From 7f9e06f7e0f2ac353612b899a430f11f9b5057a8 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Sat, 10 Apr 2021 11:26:29 -0600 Subject: [PATCH 01/11] Update GetInternalGainDeviceIndex --- src/EnergyPlus/InternalHeatGains.cc | 3 + .../unit/RoomAirflowNetwork.unit.cc | 112 ++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 7932a643724..3cc62e2307d 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -8078,6 +8078,9 @@ namespace InternalHeatGains { DeviceIndex = DeviceNum; break; } + else { + ErrorFound = true; + } } } diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 197de235a5d..8bd4b370d67 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -67,8 +67,14 @@ #include #include #include +#include +#include #include #include +#include +#include + + using namespace EnergyPlus; using namespace DataEnvironment; @@ -358,3 +364,109 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) EXPECT_NEAR(24.397538, state->dataLoopNodes->Node(2).Temp, 0.00001); EXPECT_NEAR(0.0024802305, state->dataLoopNodes->Node(2).HumRat, 0.000001); } +TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) +{ + // different names between internal gain objects and room air objects for internal gains result in fatal error from GetInternalGainDeviceIndex function. + bool ErrorsFound(false); + std::string const idf_objects = delimited_string({ + + "Zone,living_unit1;", + "ScheduleTypeLimits,Fraction,0.0,1.0,Continuous,Dimensionless;", + "Schedule:Constant,sch,,1.0;", + "People,", + " people_unit1, !- Name", + " living_unit1, !- Zone or ZoneList Name", + " sch, !- Number of People Schedule Name", + " People, !- Number of People Calculation Method", + " 3, !- Number of People", + " , !- People per Zone Floor Area {person / m2}", + " , !- Zone Floor Area per Person {m2 / person}", + " 0, !- Fraction Radiant", + " autocalculate, !- Sensible Heat Fraction", + " sch, !- Activity Level Schedule Name", + " ; !- Carbon Dioxide Generation Rate {m3 / s - W}", + + + "Lights,", + " Living Hardwired Lighting1, !- Name", + " living_unit1, !- Zone or ZoneList Name", + " sch, !- Schedule Name", + " Watts/Area, !- Design Level Calculation Method", + " , !- Lighting Level {W}", + " 28.8472799167821, !- Watts per Zone Floor Area {W / m2}", + " , !- Watts per Person {W / person}", + " 0, !- Return Air Fraction", + " 0.6, !- Fraction Radiant", + " 0.2, !- Fraction Visible", + " 0; !- Fraction Replaceable", + " ElectricEquipment,", + " Electric Equipment 1, !- Name", + " living_unit1, !- Zone or ZoneList Name", + " sch, !- Schedule Name", + " EquipmentLevel, !- Design Level Calculation Method", + " 150.0, !- Design Level {W}", + " , !- Watts per Zone Floor Area {W/m2}", + " , !- Watts per Person {W/person}", + " 0.0000, !- Fraction Latent", + " 0.5000, !- Fraction Radiant", + " 0.0000; !- Fraction Lost", + + "RoomAirModelType,", + " RoomAirWithAirflowNetwork, !- Name", + " living_unit1, !- Zone Name", + " AirflowNetwork, !- Room - Air Modeling Type", + " DIRECT; !- Air Temperature Coupling Strategy", + + "RoomAir:Node:AirflowNetwork,", + " Node1, !- Name", + " living_unit1, !- Zone Name", + " 1, !- Fraction of Zone Air Volume", + " unit1_List, !- RoomAir : Node : AirflowNetwork : AdjacentSurfaceList Name", + " Node1_Gain, !- RoomAir : Node : AirflowNetwork : InternalGains Name", + " Node1_HVAC; !- RoomAir:Node:AirflowNetwork:HVACEquipment Name", + + "RoomAir:Node:AirflowNetwork:AdjacentSurfaceList,", + " unit1_List, !- Name" + " unit1; !- Surface 1 Name" + + "RoomAir:Node:AirflowNetwork:InternalGains,", + " Node1_Gain, !- Name", + " People, !- Internal Gain Object 1 Type", + " living_unit1 People, !- Internal Gain Object 1 Name", + " 1, !- Fraction of Gains to Node 1", + " Lights, !- Internal Gain Object 2 Type", + " living_unit1 Lights, !- Internal Gain Object 2 Name", + " 1, !- Fraction of Gains to Node 2", + " ElectricEquipment, !- Internal Gain Object 3 Type", + " living_unit1 Equip, !- Internal Gain Object 3 Name", + " 1; !- Fraction of Gains to Node 3", + + " RoomAirSettings:AirflowNetwork,", + " living_unit1, !- Name", + " living_unit1, !- Zone Name", + " Node1, !- Control Point RoomAirflowNetwork : Node Name", + " Node1; !- RoomAirflowNetwork : Node Name 1", + + }); + + ASSERT_TRUE(process_idf(idf_objects)); + EXPECT_FALSE(has_err_output()); + + ErrorsFound = false; + state->dataGlobal->NumOfTimeStepInHour = 1; + state->dataGlobal->MinutesPerTimeStep = 60; + ScheduleManager::ProcessScheduleInput(*state); + + HeatBalanceManager::GetZoneData(*state, ErrorsFound); + EXPECT_FALSE(ErrorsFound); + + HeatBalanceManager::AllocateHeatBalArrays(*state); + InternalHeatGains::GetInternalHeatGainsInput(*state); + + ErrorsFound = false; + state->dataRoomAirMod->AirModel.allocate(1); + state->dataRoomAirMod->AirModel(1).AirModelType = DataRoomAirModel::RoomAirModel::AirflowNetwork; + RoomAirModelManager::GetRoomAirflowNetworkData(*state, ErrorsFound); + + EXPECT_TRUE(ErrorsFound); +} From 9d1ffab55b743e75acde440ab849b8be0dfe5c4f Mon Sep 17 00:00:00 2001 From: LipingWang Date: Tue, 13 Apr 2021 19:51:18 -0600 Subject: [PATCH 02/11] Update RoomAirflowNetwork unit --- .../unit/RoomAirflowNetwork.unit.cc | 104 ++++++++++++++---- 1 file changed, 83 insertions(+), 21 deletions(-) diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 8bd4b370d67..40ee23b8d56 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -73,6 +73,7 @@ #include #include #include +#include @@ -370,10 +371,42 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) bool ErrorsFound(false); std::string const idf_objects = delimited_string({ - "Zone,living_unit1;", - "ScheduleTypeLimits,Fraction,0.0,1.0,Continuous,Dimensionless;", - "Schedule:Constant,sch,,1.0;", - "People,", + "Zone,living_unit1;", + + "BuildingSurface:Detailed,", + " unit1, !- Name", + " Wall, !- Surface Type", + " PARTITION, !- Construction Name", + " living_unit1, !- Zone Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,3.048000, !- X,Y,Z ==> Vertex 1 {m}", + " 0,0,0, !- X,Y,Z ==> Vertex 2 {m}", + " 6.096000,0,0, !- X,Y,Z ==> Vertex 3 {m}", + " 6.096000,0,3.048000; !- X,Y,Z ==> Vertex 4 {m}", + + "Construction,", + " PARTITION, !- Name", + " GYP BOARD; !- Outside Layer", + + "Material,", + " GYP BOARD, !- Name", + " Smooth, !- Roughness", + " 1.9050000E-02, !- Thickness {m}", + " 0.7264224, !- Conductivity {W/m-K}", + " 1601.846, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.9200000, !- Solar Absorptance", + " 0.9200000; !- Visible Absorptance", + + "Schedule:Constant,sch_act,,120.0;", + "Schedule:Constant,sch,,1.0;", + "People,", " people_unit1, !- Name", " living_unit1, !- Zone or ZoneList Name", " sch, !- Number of People Schedule Name", @@ -383,23 +416,22 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " , !- Zone Floor Area per Person {m2 / person}", " 0, !- Fraction Radiant", " autocalculate, !- Sensible Heat Fraction", - " sch, !- Activity Level Schedule Name", + " sch_act, !- Activity Level Schedule Name", " ; !- Carbon Dioxide Generation Rate {m3 / s - W}", - - - "Lights,", + + "Lights,", " Living Hardwired Lighting1, !- Name", " living_unit1, !- Zone or ZoneList Name", " sch, !- Schedule Name", - " Watts/Area, !- Design Level Calculation Method", - " , !- Lighting Level {W}", - " 28.8472799167821, !- Watts per Zone Floor Area {W / m2}", + " LightingLevel, !- Design Level Calculation Method", + " 1000, !- Lighting Level {W}", + " , !- Watts per Zone Floor Area {W / m2}", " , !- Watts per Person {W / person}", " 0, !- Return Air Fraction", " 0.6, !- Fraction Radiant", " 0.2, !- Fraction Visible", " 0; !- Fraction Replaceable", - " ElectricEquipment,", + " ElectricEquipment,", " Electric Equipment 1, !- Name", " living_unit1, !- Zone or ZoneList Name", " sch, !- Schedule Name", @@ -411,13 +443,13 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " 0.5000, !- Fraction Radiant", " 0.0000; !- Fraction Lost", - "RoomAirModelType,", + "RoomAirModelType,", " RoomAirWithAirflowNetwork, !- Name", " living_unit1, !- Zone Name", " AirflowNetwork, !- Room - Air Modeling Type", " DIRECT; !- Air Temperature Coupling Strategy", - "RoomAir:Node:AirflowNetwork,", + "RoomAir:Node:AirflowNetwork,", " Node1, !- Name", " living_unit1, !- Zone Name", " 1, !- Fraction of Zone Air Volume", @@ -425,11 +457,11 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " Node1_Gain, !- RoomAir : Node : AirflowNetwork : InternalGains Name", " Node1_HVAC; !- RoomAir:Node:AirflowNetwork:HVACEquipment Name", - "RoomAir:Node:AirflowNetwork:AdjacentSurfaceList,", - " unit1_List, !- Name" - " unit1; !- Surface 1 Name" + "RoomAir:Node:AirflowNetwork:AdjacentSurfaceList,", + " unit1_List, !- Name", + " unit1; !- Surface 1 Name", - "RoomAir:Node:AirflowNetwork:InternalGains,", + "RoomAir:Node:AirflowNetwork:InternalGains,", " Node1_Gain, !- Name", " People, !- Internal Gain Object 1 Type", " living_unit1 People, !- Internal Gain Object 1 Name", @@ -441,7 +473,7 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " living_unit1 Equip, !- Internal Gain Object 3 Name", " 1; !- Fraction of Gains to Node 3", - " RoomAirSettings:AirflowNetwork,", + "RoomAirSettings:AirflowNetwork,", " living_unit1, !- Name", " living_unit1, !- Zone Name", " Node1, !- Control Point RoomAirflowNetwork : Node Name", @@ -460,6 +492,24 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) HeatBalanceManager::GetZoneData(*state, ErrorsFound); EXPECT_FALSE(ErrorsFound); + ErrorsFound = false; + HeatBalanceManager::GetMaterialData(*state, ErrorsFound); + EXPECT_FALSE(ErrorsFound); + + ErrorsFound = false; + HeatBalanceManager::GetConstructData(*state, ErrorsFound); + EXPECT_FALSE(ErrorsFound); + + ErrorsFound = false; + state->dataSurfaceGeometry->CosZoneRelNorth.allocate(1); + state->dataSurfaceGeometry->SinZoneRelNorth.allocate(1); + state->dataSurfaceGeometry->CosZoneRelNorth(1) = std::cos(-state->dataHeatBal->Zone(1).RelNorth * DataGlobalConstants::DegToRadians); + state->dataSurfaceGeometry->SinZoneRelNorth(1) = std::sin(-state->dataHeatBal->Zone(1).RelNorth * DataGlobalConstants::DegToRadians); + state->dataSurfaceGeometry->CosBldgRelNorth = 1.0; + state->dataSurfaceGeometry->SinBldgRelNorth = 0.0; + SurfaceGeometry::GetSurfaceData(*state, ErrorsFound); + EXPECT_FALSE(ErrorsFound); + HeatBalanceManager::AllocateHeatBalArrays(*state); InternalHeatGains::GetInternalHeatGainsInput(*state); @@ -467,6 +517,18 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) state->dataRoomAirMod->AirModel.allocate(1); state->dataRoomAirMod->AirModel(1).AirModelType = DataRoomAirModel::RoomAirModel::AirflowNetwork; RoomAirModelManager::GetRoomAirflowNetworkData(*state, ErrorsFound); - - EXPECT_TRUE(ErrorsFound); + EXPECT_TRUE(ErrorsFound); + + std::string const error_string = + delimited_string({" ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 PEOPLE", + " ** ~~~ ** Entered in RoomAir:Node:AirflowNetwork:InternalGains = NODE1_GAIN", + " ** ~~~ ** Internal gain did not match correctly", + " ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 LIGHTS", + " ** ~~~ ** Entered in RoomAir:Node:AirflowNetwork:InternalGains = NODE1_GAIN", + " ** ~~~ ** Internal gain did not match correctly", + " ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 EQUIP", + " ** ~~~ ** Entered in RoomAir:Node:AirflowNetwork:InternalGains = NODE1_GAIN", + " ** ~~~ ** Internal gain did not match correctly" }); + + EXPECT_TRUE(compare_err_stream(error_string, true)); } From 341bd39051dd8b4b68b595942895700b1b615175 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Wed, 14 Apr 2021 09:56:11 -0600 Subject: [PATCH 03/11] update for clang-format --- src/EnergyPlus/InternalHeatGains.cc | 14723 ++++++++-------- .../unit/RoomAirflowNetwork.unit.cc | 28 +- 2 files changed, 7468 insertions(+), 7283 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 3cc62e2307d..b734847286c 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -99,8133 +99,8318 @@ namespace EnergyPlus { -namespace InternalHeatGains { - // Module containing the routines dealing with the internal heat gains - - // MODULE INFORMATION: - // AUTHOR Rick Strand - // DATE WRITTEN August 2000 - // MODIFIED Aug 2005, PGE (Added object names and report variables) - // Feb 2006, PGE (Added end-use subcategories) - // RE-ENGINEERED na - - // PURPOSE OF THIS MODULE: - // Part of the heat balance modularization/re-engineering. Purpose of this - // module is to contain the internal heat gain routines in a single location. - - // METHODOLOGY EMPLOYED: - // Routines are called as subroutines to supply the data-only module structures - // with the proper values. - - // REFERENCES: - // Legacy BLAST code - - // OTHER NOTES: none - - // Using/Aliasing - using namespace DataEnvironment; - using namespace DataHeatBalance; - using namespace DataSurfaces; - - // Data - // MODULE PARAMETER DEFINITIONS: - int const ITEClassNone(0); - int const ITEClassA1(1); - int const ITEClassA2(2); - int const ITEClassA3(3); - int const ITEClassA4(4); - int const ITEClassB(5); - int const ITEClassC(6); - int const ITEInletAdjustedSupply(0); - int const ITEInletZoneAirNode(1); - int const ITEInletRoomAirModel(2); - - static std::string const BlankString; - - void ManageInternalHeatGains(EnergyPlusData &state, - Optional_bool_const InitOnly) // when true, just calls the get input, if appropriate and returns. - { - - // SUBROUTINE INFORMATION: + namespace InternalHeatGains { + // Module containing the routines dealing with the internal heat gains + + // MODULE INFORMATION: // AUTHOR Rick Strand - // DATE WRITTEN May 2000 - // MODIFIED Mar 2004, FCW: move call to DayltgElecLightingControl from InitSurfaceHeatBalance + // DATE WRITTEN August 2000 + // MODIFIED Aug 2005, PGE (Added object names and report variables) + // Feb 2006, PGE (Added end-use subcategories) // RE-ENGINEERED na - // PURPOSE OF THIS SUBROUTINE: - // This is the main driver subroutine for the internal heat gains. + // PURPOSE OF THIS MODULE: + // Part of the heat balance modularization/re-engineering. Purpose of this + // module is to contain the internal heat gain routines in a single location. - if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { - GetInternalHeatGainsInput(state); - state.dataInternalHeatGains->GetInternalHeatGainsInputFlag = false; - } + // METHODOLOGY EMPLOYED: + // Routines are called as subroutines to supply the data-only module structures + // with the proper values. - if (present(InitOnly)) { - if (InitOnly) return; - } + // REFERENCES: + // Legacy BLAST code - InitInternalHeatGains(state); + // OTHER NOTES: none - ReportInternalHeatGains(state); + // Using/Aliasing + using namespace DataEnvironment; + using namespace DataHeatBalance; + using namespace DataSurfaces; + + // Data + // MODULE PARAMETER DEFINITIONS: + int const ITEClassNone(0); + int const ITEClassA1(1); + int const ITEClassA2(2); + int const ITEClassA3(3); + int const ITEClassA4(4); + int const ITEClassB(5); + int const ITEClassC(6); + int const ITEInletAdjustedSupply(0); + int const ITEInletZoneAirNode(1); + int const ITEInletRoomAirModel(2); + + static std::string const BlankString; + + void ManageInternalHeatGains(EnergyPlusData &state, + Optional_bool_const InitOnly) // when true, just calls the get input, if appropriate and returns. + { + + // SUBROUTINE INFORMATION: + // AUTHOR Rick Strand + // DATE WRITTEN May 2000 + // MODIFIED Mar 2004, FCW: move call to DayltgElecLightingControl from InitSurfaceHeatBalance + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // This is the main driver subroutine for the internal heat gains. + + if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { + GetInternalHeatGainsInput(state); + state.dataInternalHeatGains->GetInternalHeatGainsInputFlag = false; + } - CheckReturnAirHeatGain(state); + if (present(InitOnly)) { + if (InitOnly) return; + } - // for the load component report, gather the load components for each timestep but not when doing pulse - if (state.dataGlobal->ZoneSizingCalc) GatherComponentLoadsIntGain(state); - } + InitInternalHeatGains(state); - void GetInternalHeatGainsInput(EnergyPlusData &state) - { + ReportInternalHeatGains(state); - // SUBROUTINE INFORMATION: - // AUTHOR Linda K. Lawrie - // DATE WRITTEN September 1997 - // MODIFIED September 1998, FW - // May 2009, BG: added calls to setup for possible EMS override - // RE-ENGINEERED August 2000, RKS + CheckReturnAirHeatGain(state); - // PURPOSE OF THIS SUBROUTINE: - // This subroutine gets the Internal Heat Gain Data for the Zones. - // Sets up the various data that will be used later with the - // schedulemanager to determine the actual values. + // for the load component report, gather the load components for each timestep but not when doing pulse + if (state.dataGlobal->ZoneSizingCalc) GatherComponentLoadsIntGain(state); + } - // METHODOLOGY EMPLOYED: - // The GetObjectItem routines are employed to retrieve the data. + void GetInternalHeatGainsInput(EnergyPlusData &state) + { - // REFERENCES: - // IDD Objects: - // People - // Lights - // ElectricEquipment - // GasEquipment - // SteamEquipment - // HotWaterEquipment - // OtherEquipment - // ElectricEquipment:ITE:AirCooled - // ZoneBaseboard:OutdoorTemperatureControlled + // SUBROUTINE INFORMATION: + // AUTHOR Linda K. Lawrie + // DATE WRITTEN September 1997 + // MODIFIED September 1998, FW + // May 2009, BG: added calls to setup for possible EMS override + // RE-ENGINEERED August 2000, RKS - // Using/Aliasing - using namespace ScheduleManager; - using General::CheckCreatedZoneItemName; - - using namespace OutputReportPredefined; - using namespace DataLoopNode; - using CurveManager::GetCurveIndex; - using NodeInputManager::GetOnlySingleNode; - - // SUBROUTINE PARAMETER DEFINITIONS: - static std::string const RoutineName("GetInternalHeatGains: "); - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Array1D_string AlphaName; - Array1D IHGNumbers; - int IOStat; - int Loop; - int NumAlpha; - int NumNumber; - int MaxAlpha; - int MaxNumber; - int OptionNum(0); // Autodesk:Init Initialization added to elim poss use uninitialized - int lastOption; - Array1D_bool RepVarSet; - // Variables for reporting nominal internal gains - Real64 LightTot; // Total Lights for calculating lights per square meter - Real64 ElecTot; // Total Electric Load for calculating electric per square meter - Real64 GasTot; // Total Gas load for calculating gas per square meter - Real64 OthTot; // Total Other load for calculating other load per square meter - Real64 HWETot; // Total Hot Water Equipment for calculating HWE per square meter - Real64 StmTot; // Total Steam for calculating Steam per square meter - std::string BBHeatInd; // Yes if BBHeat in zone, no if not. - int Loop1; - Real64 SchMin; - Real64 SchMax; - std::string liteName; - int zonePt; - Real64 mult; - int ZoneNum; - Real64 maxOccupLoad; - std::string CurrentModuleObject; - bool errFlag; - int Item; - int ZLItem; - int Item1; - - // Formats - static constexpr auto Format_720(" Zone Internal Gains Nominal, {},{:.2R},{:.1R},"); - static constexpr auto Format_722(" {} Internal Gains Nominal, {},{},{},{:.2R},{:.1R},"); - static constexpr auto Format_723("! <{} Internal Gains Nominal>,Name,Schedule Name,Zone Name,Zone Floor Area {{m2}},# Zone Occupants,{}"); - static constexpr auto Format_724(" {}, {}\n"); - - auto print_and_divide_if_greater_than_zero = [&](const Real64 numerator, const Real64 denominator) { - if (denominator > 0.0) { - print(state.files.eio, "{:.3R},", numerator / denominator); - } else { - print(state.files.eio, "N/A,"); - } - }; - - auto &ErrorsFound(state.dataInternalHeatGains->ErrorsFound); - - state.dataHeatBal->ZoneIntGain.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->ZnRpt.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->ZoneIntEEuse.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->RefrigCaseCredit.allocate(state.dataGlobal->NumOfZones); - - RepVarSet.dimension(state.dataGlobal->NumOfZones, true); - - // Determine argument length of objects gotten by this routine - MaxAlpha = -100; - MaxNumber = -100; - CurrentModuleObject = "People"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "Lights"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "ElectricEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "GasEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "HotWaterEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "SteamEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "OtherEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "ElectricEquipment:ITE:AirCooled"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - - IHGNumbers.allocate(MaxNumber); - AlphaName.allocate(MaxAlpha); - IHGNumbers = 0.0; - AlphaName = ""; - - // CurrentModuleObject='Zone' - for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { - // Overall Zone Variables - SetupOutputVariable(state, - "Zone Total Internal Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotRadiantGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotRadiantGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Visible Radiation Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotVisHeatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Visible Radiation Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotVisHeatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotConvectiveGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotConvectiveGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotLatentGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotLatentGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotTotalHeatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotTotalHeatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); - } + // PURPOSE OF THIS SUBROUTINE: + // This subroutine gets the Internal Heat Gain Data for the Zones. + // Sets up the various data that will be used later with the + // schedulemanager to determine the actual values. - // PEOPLE: Includes both information related to the heat balance and thermal comfort - // First, allocate and initialize the People derived type - CurrentModuleObject = "People"; - state.dataHeatBal->NumPeopleStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->PeopleObjects.allocate(state.dataHeatBal->NumPeopleStatements); - - state.dataHeatBal->TotPeople = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumPeopleStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->PeopleObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->PeopleObjects(Item).StartPtr = state.dataHeatBal->TotPeople + 1; - ++state.dataHeatBal->TotPeople; - state.dataHeatBal->PeopleObjects(Item).NumOfZones = 1; - state.dataHeatBal->PeopleObjects(Item).ZoneListActive = false; - state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr = Item1; - } else if (ZLItem > 0) { - state.dataHeatBal->PeopleObjects(Item).StartPtr = state.dataHeatBal->TotPeople + 1; - state.dataHeatBal->TotPeople += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->PeopleObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->PeopleObjects(Item).ZoneListActive = true; - state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr = ZLItem; - } else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + // METHODOLOGY EMPLOYED: + // The GetObjectItem routines are employed to retrieve the data. - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotPeople = 0; - } + // REFERENCES: + // IDD Objects: + // People + // Lights + // ElectricEquipment + // GasEquipment + // SteamEquipment + // HotWaterEquipment + // OtherEquipment + // ElectricEquipment:ITE:AirCooled + // ZoneBaseboard:OutdoorTemperatureControlled + + // Using/Aliasing + using namespace ScheduleManager; + using General::CheckCreatedZoneItemName; + + using namespace OutputReportPredefined; + using namespace DataLoopNode; + using CurveManager::GetCurveIndex; + using NodeInputManager::GetOnlySingleNode; + + // SUBROUTINE PARAMETER DEFINITIONS: + static std::string const RoutineName("GetInternalHeatGains: "); + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Array1D_string AlphaName; + Array1D IHGNumbers; + int IOStat; + int Loop; + int NumAlpha; + int NumNumber; + int MaxAlpha; + int MaxNumber; + int OptionNum(0); // Autodesk:Init Initialization added to elim poss use uninitialized + int lastOption; + Array1D_bool RepVarSet; + // Variables for reporting nominal internal gains + Real64 LightTot; // Total Lights for calculating lights per square meter + Real64 ElecTot; // Total Electric Load for calculating electric per square meter + Real64 GasTot; // Total Gas load for calculating gas per square meter + Real64 OthTot; // Total Other load for calculating other load per square meter + Real64 HWETot; // Total Hot Water Equipment for calculating HWE per square meter + Real64 StmTot; // Total Steam for calculating Steam per square meter + std::string BBHeatInd; // Yes if BBHeat in zone, no if not. + int Loop1; + Real64 SchMin; + Real64 SchMax; + std::string liteName; + int zonePt; + Real64 mult; + int ZoneNum; + Real64 maxOccupLoad; + std::string CurrentModuleObject; + bool errFlag; + int Item; + int ZLItem; + int Item1; + + // Formats + static constexpr auto Format_720(" Zone Internal Gains Nominal, {},{:.2R},{:.1R},"); + static constexpr auto Format_722(" {} Internal Gains Nominal, {},{},{},{:.2R},{:.1R},"); + static constexpr auto Format_723("! <{} Internal Gains Nominal>,Name,Schedule Name,Zone Name,Zone Floor Area {{m2}},# Zone Occupants,{}"); + static constexpr auto Format_724(" {}, {}\n"); + + auto print_and_divide_if_greater_than_zero = [&](const Real64 numerator, const Real64 denominator) { + if (denominator > 0.0) { + print(state.files.eio, "{:.3R},", numerator / denominator); + } + else { + print(state.files.eio, "N/A,"); + } + }; + + auto &ErrorsFound(state.dataInternalHeatGains->ErrorsFound); + + state.dataHeatBal->ZoneIntGain.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->ZnRpt.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->ZoneIntEEuse.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->RefrigCaseCredit.allocate(state.dataGlobal->NumOfZones); + + RepVarSet.dimension(state.dataGlobal->NumOfZones, true); + + // Determine argument length of objects gotten by this routine + MaxAlpha = -100; + MaxNumber = -100; + CurrentModuleObject = "People"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "Lights"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "ElectricEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "GasEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "HotWaterEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "SteamEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "OtherEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "ElectricEquipment:ITE:AirCooled"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + + IHGNumbers.allocate(MaxNumber); + AlphaName.allocate(MaxAlpha); + IHGNumbers = 0.0; + AlphaName = ""; + + // CurrentModuleObject='Zone' + for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { + // Overall Zone Variables + SetupOutputVariable(state, + "Zone Total Internal Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotRadiantGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotRadiantGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Visible Radiation Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotVisHeatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Visible Radiation Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotVisHeatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotConvectiveGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotConvectiveGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotLatentGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotLatentGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotTotalHeatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotTotalHeatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + } - state.dataHeatBal->People.allocate(state.dataHeatBal->TotPeople); + // PEOPLE: Includes both information related to the heat balance and thermal comfort + // First, allocate and initialize the People derived type + CurrentModuleObject = "People"; + state.dataHeatBal->NumPeopleStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->PeopleObjects.allocate(state.dataHeatBal->NumPeopleStatements); - if (state.dataHeatBal->TotPeople > 0) { - Loop = 0; + state.dataHeatBal->TotPeople = 0; + errFlag = false; for (Item = 1; Item <= state.dataHeatBal->NumPeopleStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->PeopleObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->PeopleObjects(Item).ZoneListActive) { - state.dataHeatBal->People(Loop).Name = AlphaName(1); - state.dataHeatBal->People(Loop).ZonePtr = state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr; - } else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) - .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->PeopleObjects(Item).Name, - state.dataHeatBal->People, - Loop - 1, - state.dataHeatBal->People(Loop).Name, - errFlag); - state.dataHeatBal->People(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->PeopleObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->PeopleObjects(Item).StartPtr = state.dataHeatBal->TotPeople + 1; + ++state.dataHeatBal->TotPeople; + state.dataHeatBal->PeopleObjects(Item).NumOfZones = 1; + state.dataHeatBal->PeopleObjects(Item).ZoneListActive = false; + state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr = Item1; + } + else if (ZLItem > 0) { + state.dataHeatBal->PeopleObjects(Item).StartPtr = state.dataHeatBal->TotPeople + 1; + state.dataHeatBal->TotPeople += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->PeopleObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->PeopleObjects(Item).ZoneListActive = true; + state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr = ZLItem; + } + else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } - state.dataHeatBal->People(Loop).NumberOfPeoplePtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->People(Loop).NumberOfPeoplePtr == 0) { - if (Item1 == 1) { // only show error on first one - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); - } else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); - } - ErrorsFound = true; + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); + state.dataHeatBal->TotPeople = 0; + } + + state.dataHeatBal->People.allocate(state.dataHeatBal->TotPeople); + + if (state.dataHeatBal->TotPeople > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumPeopleStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->PeopleObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->PeopleObjects(Item).ZoneListActive) { + state.dataHeatBal->People(Loop).Name = AlphaName(1); + state.dataHeatBal->People(Loop).ZonePtr = state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr; } - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (Item1 == 1) { - if (SchMin < 0.0) { + else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) + .Name, + state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->PeopleObjects(Item).Name, + state.dataHeatBal->People, + Loop - 1, + state.dataHeatBal->People(Loop).Name, + errFlag); + state.dataHeatBal->People(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } + + state.dataHeatBal->People(Loop).NumberOfPeoplePtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->People(Loop).NumberOfPeoplePtr == 0) { + if (Item1 == 1) { // only show error on first one + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); } - } - if (Item1 == 1) { - if (SchMax < 0.0) { + else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); } + ErrorsFound = true; } } - } - - // Number of people calculation method. - { - auto const peopleMethod(AlphaName(4)); - if (peopleMethod == "PEOPLE") { - state.dataHeatBal->People(Loop).NumberOfPeople = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 People will result."); - } - - } else if (peopleMethod == "PEOPLE/AREA") { - if (state.dataHeatBal->People(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->People(Loop).NumberOfPeople = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 People will result."); + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (Item1 == 1) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; + } + } + if (Item1 == 1) { + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } - } else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->People(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); - ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 People will result."); + } + + // Number of people calculation method. + { + auto const peopleMethod(AlphaName(4)); + if (peopleMethod == "PEOPLE") { + state.dataHeatBal->People(Loop).NumberOfPeople = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 People will result."); + } + } + else if (peopleMethod == "PEOPLE/AREA") { + if (state.dataHeatBal->People(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->People(Loop).NumberOfPeople = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 People will result."); + } + } + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->People(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 People will result."); + } - } else if (peopleMethod == "AREA/PERSON") { - if (state.dataHeatBal->People(Loop).ZonePtr != 0) { - if (IHGNumbers(3) > 0.0) { - state.dataHeatBal->People(Loop).NumberOfPeople = - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea / IHGNumbers(3); - if (state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 People will result."); + } + else if (peopleMethod == "AREA/PERSON") { + if (state.dataHeatBal->People(Loop).ZonePtr != 0) { + if (IHGNumbers(3) > 0.0) { + state.dataHeatBal->People(Loop).NumberOfPeople = + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea / IHGNumbers(3); + if (state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 People will result."); + } } - } else { + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->People(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 People will result."); + } + + } + else { + if (Item1 == 1) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->People(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"People\", \"People/Area\", \"Area/Person\"."); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 People will result."); - } + } - } else { - if (Item1 == 1) { + // Calculate nominal min/max people + state.dataHeatBal->People(Loop).NomMinNumberPeople = state.dataHeatBal->People(Loop).NumberOfPeople * SchMin; + state.dataHeatBal->People(Loop).NomMaxNumberPeople = state.dataHeatBal->People(Loop).NumberOfPeople * SchMax; + + if (state.dataHeatBal->People(Loop).ZonePtr > 0) { + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).TotOccupants += + state.dataHeatBal->People(Loop).NumberOfPeople; + } + + state.dataHeatBal->People(Loop).FractionRadiant = IHGNumbers(4); + state.dataHeatBal->People(Loop).FractionConvected = 1.0 - state.dataHeatBal->People(Loop).FractionRadiant; + if (Item1 == 1) { + if (state.dataHeatBal->People(Loop).FractionConvected < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"People\", \"People/Area\", \"Area/Person\"."); + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(4), + IHGNumbers(4))); ErrorsFound = true; } } - } - - // Calculate nominal min/max people - state.dataHeatBal->People(Loop).NomMinNumberPeople = state.dataHeatBal->People(Loop).NumberOfPeople * SchMin; - state.dataHeatBal->People(Loop).NomMaxNumberPeople = state.dataHeatBal->People(Loop).NumberOfPeople * SchMax; - if (state.dataHeatBal->People(Loop).ZonePtr > 0) { - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).TotOccupants += - state.dataHeatBal->People(Loop).NumberOfPeople; - } + if (NumNumber >= 5 && !state.dataIPShortCut->lNumericFieldBlanks(5)) { + state.dataHeatBal->People(Loop).UserSpecSensFrac = IHGNumbers(5); + } + else { + state.dataHeatBal->People(Loop).UserSpecSensFrac = DataGlobalConstants::AutoCalculate; + } - state.dataHeatBal->People(Loop).FractionRadiant = IHGNumbers(4); - state.dataHeatBal->People(Loop).FractionConvected = 1.0 - state.dataHeatBal->People(Loop).FractionRadiant; - if (Item1 == 1) { - if (state.dataHeatBal->People(Loop).FractionConvected < 0.0) { + if (NumNumber == 6 && !state.dataIPShortCut->lNumericFieldBlanks(6)) { + state.dataHeatBal->People(Loop).CO2RateFactor = IHGNumbers(6); + } + else { + state.dataHeatBal->People(Loop).CO2RateFactor = 3.82e-8; // m3/s-W + } + if (state.dataHeatBal->People(Loop).CO2RateFactor < 0.0) { ShowSevereError(state, - format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(4), - IHGNumbers(4))); + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(6), + IHGNumbers(6))); ErrorsFound = true; } - } - - if (NumNumber >= 5 && !state.dataIPShortCut->lNumericFieldBlanks(5)) { - state.dataHeatBal->People(Loop).UserSpecSensFrac = IHGNumbers(5); - } else { - state.dataHeatBal->People(Loop).UserSpecSensFrac = DataGlobalConstants::AutoCalculate; - } - - if (NumNumber == 6 && !state.dataIPShortCut->lNumericFieldBlanks(6)) { - state.dataHeatBal->People(Loop).CO2RateFactor = IHGNumbers(6); - } else { - state.dataHeatBal->People(Loop).CO2RateFactor = 3.82e-8; // m3/s-W - } - if (state.dataHeatBal->People(Loop).CO2RateFactor < 0.0) { - ShowSevereError(state, - format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(6), - IHGNumbers(6))); - ErrorsFound = true; - } - state.dataHeatBal->People(Loop).ActivityLevelPtr = GetScheduleIndex(state, AlphaName(5)); - if (state.dataHeatBal->People(Loop).ActivityLevelPtr == 0) { - if (Item1 == 1) { - if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + " is required."); - } else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(5) + " entered=" + AlphaName(5)); - } - ErrorsFound = true; - } - } else { // Check values in Schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); - if (SchMin < 0.0 || SchMax < 0.0) { + state.dataHeatBal->People(Loop).ActivityLevelPtr = GetScheduleIndex(state, AlphaName(5)); + if (state.dataHeatBal->People(Loop).ActivityLevelPtr == 0) { if (Item1 == 1) { - if (SchMin < 0.0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + " minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + " is required."); } - } - if (Item1 == 1) { - if (SchMax < 0.0) { + else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + " maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(5) + " entered=" + AlphaName(5)); } + ErrorsFound = true; } - } else if (SchMin < 70.0 || SchMax > 1000.0) { - if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + " values"); - ShowContinueError(state, "fall outside typical range [70,1000] W/person for Thermal Comfort Reporting."); - ShowContinueError(state, "Odd comfort values may result; Schedule=\"" + AlphaName(5) + "\"."); - ShowContinueError(state, format("Entered min/max range=[{:.1R},] W/person.{:.1R}", SchMin, SchMax)); + } + else { // Check values in Schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (Item1 == 1) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + " minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); + ErrorsFound = true; + } + } + if (Item1 == 1) { + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + " maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); + ErrorsFound = true; + } + } + } + else if (SchMin < 70.0 || SchMax > 1000.0) { + if (Item1 == 1) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + " values"); + ShowContinueError(state, "fall outside typical range [70,1000] W/person for Thermal Comfort Reporting."); + ShowContinueError(state, "Odd comfort values may result; Schedule=\"" + AlphaName(5) + "\"."); + ShowContinueError(state, format("Entered min/max range=[{:.1R},] W/person.{:.1R}", SchMin, SchMax)); + } } } - } - // Following is an optional parameter (ASHRAE 55 warnings - if (NumAlpha >= 6) { - if (UtilityRoutines::SameString(AlphaName(6), "Yes")) { - state.dataHeatBal->People(Loop).Show55Warning = true; - } else if (!UtilityRoutines::SameString(AlphaName(6), "No") && !state.dataIPShortCut->lAlphaFieldBlanks(6)) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(6) + " field should be Yes or No"); - ShowContinueError(state, "...Field value=\"" + AlphaName(6) + "\" is invalid."); - ErrorsFound = true; + // Following is an optional parameter (ASHRAE 55 warnings + if (NumAlpha >= 6) { + if (UtilityRoutines::SameString(AlphaName(6), "Yes")) { + state.dataHeatBal->People(Loop).Show55Warning = true; + } + else if (!UtilityRoutines::SameString(AlphaName(6), "No") && !state.dataIPShortCut->lAlphaFieldBlanks(6)) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(6) + " field should be Yes or No"); + ShowContinueError(state, "...Field value=\"" + AlphaName(6) + "\" is invalid."); + ErrorsFound = true; + } } } - } - if (NumAlpha > 6) { // Optional parameters present--thermal comfort data follows... - state.dataInternalHeatGains->UsingThermalComfort = false; - if (NumAlpha > 20) { - lastOption = 20; - } else { - lastOption = NumAlpha; - } + if (NumAlpha > 6) { // Optional parameters present--thermal comfort data follows... + state.dataInternalHeatGains->UsingThermalComfort = false; + if (NumAlpha > 20) { + lastOption = 20; + } + else { + lastOption = NumAlpha; + } - // check to see if the user has specified schedules for air velocity, clothing insulation, and/or work efficiency - // but have NOT made a selection for a thermal comfort model. If so, then the schedules are reported as unused - // which could cause confusion. The solution is for the user to either remove those schedules or pick a thermal - // comfort model. - int const NumFirstTCModel = 14; - if (NumAlpha < NumFirstTCModel) { - bool NoTCModelSelectedWithSchedules = false; - NoTCModelSelectedWithSchedules = CheckThermalComfortSchedules(state.dataIPShortCut->lAlphaFieldBlanks(9), - state.dataIPShortCut->lAlphaFieldBlanks(12), - state.dataIPShortCut->lAlphaFieldBlanks(13)); - if (NoTCModelSelectedWithSchedules) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + - "\" has comfort related schedules but no thermal comfort model selected."); - ShowContinueError(state, - "If schedules are specified for air velocity, clothing insulation, and/or work efficiency but no " - "thermal comfort"); - ShowContinueError( - state, "thermal comfort model is selected, the schedules will be listed as unused schedules in the .err file."); - ShowContinueError( - state, - "To avoid these errors, select a valid thermal comfort model or eliminate these schedules in the PEOPLE input."); + // check to see if the user has specified schedules for air velocity, clothing insulation, and/or work efficiency + // but have NOT made a selection for a thermal comfort model. If so, then the schedules are reported as unused + // which could cause confusion. The solution is for the user to either remove those schedules or pick a thermal + // comfort model. + int const NumFirstTCModel = 14; + if (NumAlpha < NumFirstTCModel) { + bool NoTCModelSelectedWithSchedules = false; + NoTCModelSelectedWithSchedules = CheckThermalComfortSchedules(state.dataIPShortCut->lAlphaFieldBlanks(9), + state.dataIPShortCut->lAlphaFieldBlanks(12), + state.dataIPShortCut->lAlphaFieldBlanks(13)); + if (NoTCModelSelectedWithSchedules) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + + "\" has comfort related schedules but no thermal comfort model selected."); + ShowContinueError(state, + "If schedules are specified for air velocity, clothing insulation, and/or work efficiency but no " + "thermal comfort"); + ShowContinueError( + state, "thermal comfort model is selected, the schedules will be listed as unused schedules in the .err file."); + ShowContinueError( + state, + "To avoid these errors, select a valid thermal comfort model or eliminate these schedules in the PEOPLE input."); + } } - } - for (OptionNum = NumFirstTCModel; OptionNum <= lastOption; ++OptionNum) { + for (OptionNum = NumFirstTCModel; OptionNum <= lastOption; ++OptionNum) { - { - auto const thermalComfortType(AlphaName(OptionNum)); + { + auto const thermalComfortType(AlphaName(OptionNum)); - if (thermalComfortType == "FANGER") { - state.dataHeatBal->People(Loop).Fanger = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + if (thermalComfortType == "FANGER") { + state.dataHeatBal->People(Loop).Fanger = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } else if (thermalComfortType == "PIERCE") { - state.dataHeatBal->People(Loop).Pierce = true; - state.dataHeatBal->AnyThermalComfortPierceModel = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } + else if (thermalComfortType == "PIERCE") { + state.dataHeatBal->People(Loop).Pierce = true; + state.dataHeatBal->AnyThermalComfortPierceModel = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } else if (thermalComfortType == "KSU") { - state.dataHeatBal->People(Loop).KSU = true; - state.dataHeatBal->AnyThermalComfortKSUModel = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } + else if (thermalComfortType == "KSU") { + state.dataHeatBal->People(Loop).KSU = true; + state.dataHeatBal->AnyThermalComfortKSUModel = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } else if (thermalComfortType == "ADAPTIVEASH55") { - state.dataHeatBal->People(Loop).AdaptiveASH55 = true; - state.dataHeatBal->AdaptiveComfortRequested_ASH55 = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } + else if (thermalComfortType == "ADAPTIVEASH55") { + state.dataHeatBal->People(Loop).AdaptiveASH55 = true; + state.dataHeatBal->AdaptiveComfortRequested_ASH55 = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } else if (thermalComfortType == "ADAPTIVECEN15251") { - state.dataHeatBal->People(Loop).AdaptiveCEN15251 = true; - state.dataHeatBal->AdaptiveComfortRequested_CEN15251 = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } + else if (thermalComfortType == "ADAPTIVECEN15251") { + state.dataHeatBal->People(Loop).AdaptiveCEN15251 = true; + state.dataHeatBal->AdaptiveComfortRequested_CEN15251 = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } else if (thermalComfortType == "COOLINGEFFECTASH55") { - state.dataHeatBal->People(Loop).CoolingEffectASH55 = true; - state.dataHeatBal->AnyThermalComfortCoolingEffectModel = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } + else if (thermalComfortType == "COOLINGEFFECTASH55") { + state.dataHeatBal->People(Loop).CoolingEffectASH55 = true; + state.dataHeatBal->AnyThermalComfortCoolingEffectModel = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } else if (thermalComfortType == "ANKLEDRAFTASH55") { - state.dataHeatBal->People(Loop).AnkleDraftASH55 = true; - state.dataHeatBal->AnyThermalComfortAnkleDraftModel = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } + else if (thermalComfortType == "ANKLEDRAFTASH55") { + state.dataHeatBal->People(Loop).AnkleDraftASH55 = true; + state.dataHeatBal->AnyThermalComfortAnkleDraftModel = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } else if (thermalComfortType == "") { // Blank input field--just ignore this + } + else if (thermalComfortType == "") { // Blank input field--just ignore this - } else { // An invalid keyword was entered--warn but ignore - if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(OptionNum) + " Option=" + AlphaName(OptionNum)); - ShowContinueError(state, - "Valid Values are \"Fanger\", \"Pierce\", \"KSU\", \"AdaptiveASH55\", " - "\"AdaptiveCEN15251\", \"CoolingEffectASH55\", \"AnkleDraftASH55\""); + } + else { // An invalid keyword was entered--warn but ignore + if (Item1 == 1) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(OptionNum) + " Option=" + AlphaName(OptionNum)); + ShowContinueError(state, + "Valid Values are \"Fanger\", \"Pierce\", \"KSU\", \"AdaptiveASH55\", " + "\"AdaptiveCEN15251\", \"CoolingEffectASH55\", \"AnkleDraftASH55\""); + } } } } - } - if (state.dataInternalHeatGains->UsingThermalComfort) { + if (state.dataInternalHeatGains->UsingThermalComfort) { - // Set the default value of MRTCalcType as 'ZoneAveraged' - state.dataHeatBal->People(Loop).MRTCalcType = ZoneAveraged; + // Set the default value of MRTCalcType as 'ZoneAveraged' + state.dataHeatBal->People(Loop).MRTCalcType = ZoneAveraged; - bool ModelWithAdditionalInputs = state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || - state.dataHeatBal->People(Loop).KSU || - state.dataHeatBal->People(Loop).CoolingEffectASH55 || - state.dataHeatBal->People(Loop).AnkleDraftASH55; + bool ModelWithAdditionalInputs = state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || + state.dataHeatBal->People(Loop).KSU || + state.dataHeatBal->People(Loop).CoolingEffectASH55 || + state.dataHeatBal->People(Loop).AnkleDraftASH55; - // MRT Calculation Type and Surface Name - { - auto const mrtType(AlphaName(7)); + // MRT Calculation Type and Surface Name + { + auto const mrtType(AlphaName(7)); - if (mrtType == "ZONEAVERAGED") { - state.dataHeatBal->People(Loop).MRTCalcType = ZoneAveraged; + if (mrtType == "ZONEAVERAGED") { + state.dataHeatBal->People(Loop).MRTCalcType = ZoneAveraged; - } else if (mrtType == "SURFACEWEIGHTED") { - state.dataHeatBal->People(Loop).MRTCalcType = SurfaceWeighted; - state.dataHeatBal->People(Loop).SurfacePtr = - UtilityRoutines::FindItemInList(AlphaName(8), state.dataSurface->Surface); - if (state.dataHeatBal->People(Loop).SurfacePtr == 0 && ModelWithAdditionalInputs) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7) + - " invalid Surface Name=" + AlphaName(8)); - ErrorsFound = true; + } + else if (mrtType == "SURFACEWEIGHTED") { + state.dataHeatBal->People(Loop).MRTCalcType = SurfaceWeighted; + state.dataHeatBal->People(Loop).SurfacePtr = + UtilityRoutines::FindItemInList(AlphaName(8), state.dataSurface->Surface); + if (state.dataHeatBal->People(Loop).SurfacePtr == 0 && ModelWithAdditionalInputs) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7) + + " invalid Surface Name=" + AlphaName(8)); + ErrorsFound = true; + } } - } else if (state.dataSurface->Surface(state.dataHeatBal->People(Loop).SurfacePtr).Zone != - state.dataHeatBal->People(Loop).ZonePtr && - ModelWithAdditionalInputs) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Surface referenced in " + - state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7) + " in different zone."); - ShowContinueError( - state, - "Surface is in Zone=" + + else if (state.dataSurface->Surface(state.dataHeatBal->People(Loop).SurfacePtr).Zone != + state.dataHeatBal->People(Loop).ZonePtr && + ModelWithAdditionalInputs) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Surface referenced in " + + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7) + " in different zone."); + ShowContinueError( + state, + "Surface is in Zone=" + state.dataHeatBal->Zone(state.dataSurface->Surface(state.dataHeatBal->People(Loop).SurfacePtr).Zone) - .Name + + .Name + " and " + CurrentModuleObject + " is in Zone=" + AlphaName(2)); - ErrorsFound = true; - } + ErrorsFound = true; + } - } else if (mrtType == "ANGLEFACTOR") { - state.dataHeatBal->People(Loop).MRTCalcType = AngleFactor; - state.dataHeatBal->People(Loop).AngleFactorListName = AlphaName(8); + } + else if (mrtType == "ANGLEFACTOR") { + state.dataHeatBal->People(Loop).MRTCalcType = AngleFactor; + state.dataHeatBal->People(Loop).AngleFactorListName = AlphaName(8); - } else if (mrtType == "") { // Blank input field--just ignore this - if (Item1 == 1 && ModelWithAdditionalInputs) - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + - state.dataIPShortCut->cAlphaFieldNames(7)); + } + else if (mrtType == "") { // Blank input field--just ignore this + if (Item1 == 1 && ModelWithAdditionalInputs) + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + + state.dataIPShortCut->cAlphaFieldNames(7)); - } else { // An invalid keyword was entered--warn but ignore - if (Item1 == 1 && ModelWithAdditionalInputs) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7)); - ShowContinueError(state, "...Valid values are \"ZoneAveraged\", \"SurfaceWeighted\", \"AngleFactor\"."); + } + else { // An invalid keyword was entered--warn but ignore + if (Item1 == 1 && ModelWithAdditionalInputs) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7)); + ShowContinueError(state, "...Valid values are \"ZoneAveraged\", \"SurfaceWeighted\", \"AngleFactor\"."); + } } } - } - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - state.dataHeatBal->People(Loop).WorkEffPtr = GetScheduleIndex(state, AlphaName(9)); - if (state.dataHeatBal->People(Loop).WorkEffPtr == 0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(9) + " entered=" + AlphaName(9)); - ErrorsFound = true; + if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { + state.dataHeatBal->People(Loop).WorkEffPtr = GetScheduleIndex(state, AlphaName(9)); + if (state.dataHeatBal->People(Loop).WorkEffPtr == 0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(9) + " entered=" + AlphaName(9)); + ErrorsFound = true; + } } - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).WorkEffPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).WorkEffPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(9) + ", minimum is < 0.0"); - ShowContinueError( - state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMin)); - ErrorsFound = true; + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).WorkEffPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).WorkEffPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(9) + ", minimum is < 0.0"); + ShowContinueError( + state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMin)); + ErrorsFound = true; + } + } + if (SchMax < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(9) + ", maximum is < 0.0"); + ShowContinueError( + state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMax)); + ErrorsFound = true; + } } } - if (SchMax < 0.0) { + if (SchMax > 1.0) { if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(9) + ", maximum is < 0.0"); - ShowContinueError( - state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMax)); - ErrorsFound = true; + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(9) + ", maximum is > 1.0"); + ShowContinueError(state, + format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Work Efficiency.", + AlphaName(9), + SchMin, + SchMax)); } } } - if (SchMax > 1.0) { - if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(9) + ", maximum is > 1.0"); - ShowContinueError(state, - format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Work Efficiency.", - AlphaName(9), - SchMin, - SchMax)); - } - } } - } else if (ModelWithAdditionalInputs) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + - state.dataIPShortCut->cAlphaFieldNames(9) + ". " + state.dataIPShortCut->cAlphaFieldNames(9) + - " is required when Thermal Comfort Model Type is one of " - "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); - ErrorsFound = true; + else if (ModelWithAdditionalInputs) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + + state.dataIPShortCut->cAlphaFieldNames(9) + ". " + state.dataIPShortCut->cAlphaFieldNames(9) + + " is required when Thermal Comfort Model Type is one of " + "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); + ErrorsFound = true; + } } - } - if (!state.dataIPShortCut->lAlphaFieldBlanks(10) || AlphaName(10) != "") { - { - auto const clothingType(AlphaName(10)); - if (clothingType == "CLOTHINGINSULATIONSCHEDULE") { - state.dataHeatBal->People(Loop).ClothingType = 1; - state.dataHeatBal->People(Loop).ClothingPtr = GetScheduleIndex(state, AlphaName(12)); - if (state.dataHeatBal->People(Loop).ClothingPtr == 0 && ModelWithAdditionalInputs) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + - "\"."); - ErrorsFound = true; + if (!state.dataIPShortCut->lAlphaFieldBlanks(10) || AlphaName(10) != "") { + { + auto const clothingType(AlphaName(10)); + if (clothingType == "CLOTHINGINSULATIONSCHEDULE") { + state.dataHeatBal->People(Loop).ClothingType = 1; + state.dataHeatBal->People(Loop).ClothingPtr = GetScheduleIndex(state, AlphaName(12)); + if (state.dataHeatBal->People(Loop).ClothingPtr == 0 && ModelWithAdditionalInputs) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + + "\"."); + ErrorsFound = true; + } } - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).ClothingPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).ClothingPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(12) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", - AlphaName(12), - SchMin)); - ErrorsFound = true; + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).ClothingPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).ClothingPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(12) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", + AlphaName(12), + SchMin)); + ErrorsFound = true; + } + } + if (SchMax < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(12) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", + AlphaName(12), + SchMax)); + ErrorsFound = true; + } } } - if (SchMax < 0.0) { + if (SchMax > 2.0) { if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(12) + ", maximum is < 0.0"); + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(12) + ", maximum is > 2.0"); ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", - AlphaName(12), - SchMax)); - ErrorsFound = true; + format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Clothing.", + AlphaName(12), + SchMin, + SchMax)); } } } - if (SchMax > 2.0) { + + } + else if (clothingType == "DYNAMICCLOTHINGMODELASHRAE55") { + state.dataHeatBal->People(Loop).ClothingType = 2; + + } + else if (clothingType == "CALCULATIONMETHODSCHEDULE") { + state.dataHeatBal->People(Loop).ClothingType = 3; + state.dataHeatBal->People(Loop).ClothingMethodPtr = GetScheduleIndex(state, AlphaName(11)); + if (state.dataHeatBal->People(Loop).ClothingMethodPtr == 0) { if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(12) + ", maximum is > 2.0"); - ShowContinueError(state, - format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Clothing.", - AlphaName(12), - SchMin, - SchMax)); + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(11) + " entered=\"" + AlphaName(11) + + "\"."); + ErrorsFound = true; + } + } + if (CheckScheduleValue(state, state.dataHeatBal->People(Loop).ClothingMethodPtr, 1)) { + state.dataHeatBal->People(Loop).ClothingPtr = GetScheduleIndex(state, AlphaName(12)); + if (state.dataHeatBal->People(Loop).ClothingPtr == 0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + + "\"."); + ErrorsFound = true; + } } } - } - } else if (clothingType == "DYNAMICCLOTHINGMODELASHRAE55") { - state.dataHeatBal->People(Loop).ClothingType = 2; + } + else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + + "\", invalid " + state.dataIPShortCut->cAlphaFieldNames(10) + + ", value =" + AlphaName(10)); + ShowContinueError(state, + "...Valid values are \"ClothingInsulationSchedule\",\"DynamicClothingModelASHRAE55a\", " + "\"CalculationMethodSchedule\"."); + ErrorsFound = true; + } + } + } - } else if (clothingType == "CALCULATIONMETHODSCHEDULE") { - state.dataHeatBal->People(Loop).ClothingType = 3; - state.dataHeatBal->People(Loop).ClothingMethodPtr = GetScheduleIndex(state, AlphaName(11)); - if (state.dataHeatBal->People(Loop).ClothingMethodPtr == 0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(11) + " entered=\"" + AlphaName(11) + - "\"."); - ErrorsFound = true; - } + if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { + state.dataHeatBal->People(Loop).AirVelocityPtr = GetScheduleIndex(state, AlphaName(13)); + if (state.dataHeatBal->People(Loop).AirVelocityPtr == 0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(13) + " entered=\"" + AlphaName(13) + "\"."); + ErrorsFound = true; } - if (CheckScheduleValue(state, state.dataHeatBal->People(Loop).ClothingMethodPtr, 1)) { - state.dataHeatBal->People(Loop).ClothingPtr = GetScheduleIndex(state, AlphaName(12)); - if (state.dataHeatBal->People(Loop).ClothingPtr == 0) { + } + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).AirVelocityPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).AirVelocityPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(13) + ", minimum is < 0.0"); + ShowContinueError( + state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMin)); + ErrorsFound = true; + } + } + if (SchMax < 0.0) { if (Item1 == 1) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + - "\"."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(13) + ", maximum is < 0.0"); + ShowContinueError( + state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMax)); ErrorsFound = true; } } } - - } else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + - "\", invalid " + state.dataIPShortCut->cAlphaFieldNames(10) + - ", value =" + AlphaName(10)); - ShowContinueError(state, - "...Valid values are \"ClothingInsulationSchedule\",\"DynamicClothingModelASHRAE55a\", " - "\"CalculationMethodSchedule\"."); - ErrorsFound = true; } } - } - - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - state.dataHeatBal->People(Loop).AirVelocityPtr = GetScheduleIndex(state, AlphaName(13)); - if (state.dataHeatBal->People(Loop).AirVelocityPtr == 0) { + else if (ModelWithAdditionalInputs) { if (Item1 == 1) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(13) + " entered=\"" + AlphaName(13) + "\"."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + + state.dataIPShortCut->cAlphaFieldNames(13) + ". " + + state.dataIPShortCut->cAlphaFieldNames(13) + + " is required when Thermal Comfort Model Type is one of " + "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); ErrorsFound = true; } - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).AirVelocityPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).AirVelocityPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(13) + ", minimum is < 0.0"); - ShowContinueError( - state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMin)); - ErrorsFound = true; - } - } - if (SchMax < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(13) + ", maximum is < 0.0"); - ShowContinueError( - state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMax)); - ErrorsFound = true; - } + } + + int indexAnkleAirVelPtr = 21; + if (!state.dataIPShortCut->lAlphaFieldBlanks(indexAnkleAirVelPtr) || AlphaName(indexAnkleAirVelPtr) != "") { + state.dataHeatBal->People(Loop).AnkleAirVelocityPtr = GetScheduleIndex(state, AlphaName(indexAnkleAirVelPtr)); + if (state.dataHeatBal->People(Loop).AnkleAirVelocityPtr == 0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + " entered=\"" + + AlphaName(indexAnkleAirVelPtr) + "\"."); + ErrorsFound = true; } } } - } else if (ModelWithAdditionalInputs) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + - state.dataIPShortCut->cAlphaFieldNames(13) + ". " + - state.dataIPShortCut->cAlphaFieldNames(13) + - " is required when Thermal Comfort Model Type is one of " - "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); - ErrorsFound = true; - } - } - - int indexAnkleAirVelPtr = 21; - if (!state.dataIPShortCut->lAlphaFieldBlanks(indexAnkleAirVelPtr) || AlphaName(indexAnkleAirVelPtr) != "") { - state.dataHeatBal->People(Loop).AnkleAirVelocityPtr = GetScheduleIndex(state, AlphaName(indexAnkleAirVelPtr)); - if (state.dataHeatBal->People(Loop).AnkleAirVelocityPtr == 0) { + else if (state.dataHeatBal->People(Loop).AnkleDraftASH55) { if (Item1 == 1) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + " entered=\"" + - AlphaName(indexAnkleAirVelPtr) + "\"."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + + state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + ". " + + state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + + " is required when Thermal Comfort Model Type is one of " + "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); ErrorsFound = true; } } - } else if (state.dataHeatBal->People(Loop).AnkleDraftASH55) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + - state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + ". " + - state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + - " is required when Thermal Comfort Model Type is one of " - "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); - ErrorsFound = true; - } - } - - } // usingthermalcomfort block - } // ...end of thermal comfort data IF-THEN block (NumAlphas > 6) + } // usingthermalcomfort block - if (state.dataHeatBal->People(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + } // ...end of thermal comfort data IF-THEN block (NumAlphas > 6) - // Object report variables - SetupOutputVariable(state, - "People Occupant Count", - OutputProcessor::Unit::None, - state.dataHeatBal->People(Loop).NumOcc, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Sensible Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).SenGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Sensible Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).SenGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Air Temperature", - OutputProcessor::Unit::C, - state.dataHeatBal->People(Loop).TemperatureInZone, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Air Relative Humidity", - OutputProcessor::Unit::Perc, - state.dataHeatBal->People(Loop).RelativeHumidityInZone, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); + if (state.dataHeatBal->People(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - // Zone total report variables - if (RepVarSet(state.dataHeatBal->People(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->People(Loop).ZonePtr) = false; + // Object report variables SetupOutputVariable(state, - "Zone People Occupant Count", - OutputProcessor::Unit::None, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleNumOcc, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Occupant Count", + OutputProcessor::Unit::None, + state.dataHeatBal->People(Loop).NumOcc, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Sensible Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleSenGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Sensible Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).SenGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Sensible Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleSenGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Sensible Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).SenGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + "People Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); SetupOutputVariable(state, - "Zone People Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - } + "People Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Air Temperature", + OutputProcessor::Unit::C, + state.dataHeatBal->People(Loop).TemperatureInZone, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Air Relative Humidity", + OutputProcessor::Unit::Perc, + state.dataHeatBal->People(Loop).RelativeHumidityInZone, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->People(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->People(Loop).ZonePtr) = false; + SetupOutputVariable(state, + "Zone People Occupant Count", + OutputProcessor::Unit::None, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleNumOcc, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Sensible Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleSenGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Sensible Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleSenGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone People Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + } - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "People", - state.dataHeatBal->People(Loop).Name, - "Number of People", - "[each]", - state.dataHeatBal->People(Loop).EMSPeopleOn, - state.dataHeatBal->People(Loop).EMSNumberOfPeople); - SetupEMSInternalVariable(state, - "People Count Design Level", - state.dataHeatBal->People(Loop).Name, - "[each]", - state.dataHeatBal->People(Loop).NumberOfPeople); - } + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "People", + state.dataHeatBal->People(Loop).Name, + "Number of People", + "[each]", + state.dataHeatBal->People(Loop).EMSPeopleOn, + state.dataHeatBal->People(Loop).EMSNumberOfPeople); + SetupEMSInternalVariable(state, + "People Count Design Level", + state.dataHeatBal->People(Loop).Name, + "[each]", + state.dataHeatBal->People(Loop).NumberOfPeople); + } - // setup internal gains - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->People(Loop).ZonePtr, - "People", - state.dataHeatBal->People(Loop).Name, - IntGainTypeOf_People, - &state.dataHeatBal->People(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->People(Loop).RadGainRate, - &state.dataHeatBal->People(Loop).LatGainRate, - nullptr, - &state.dataHeatBal->People(Loop).CO2GainRate); - - } // Item1 - number of zones - } // Item - number of people statements - } // TotPeople > 0 - - // transfer the nominal number of people in a zone to the tabular reporting - for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { - if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) { - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && - state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants < 0.1) { - ShowWarningError(state, RoutineName + "Zone=\"" + state.dataHeatBal->Zone(Loop).Name + "\" occupant density is extremely high."); - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { + // setup internal gains + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->People(Loop).ZonePtr, + "People", + state.dataHeatBal->People(Loop).Name, + IntGainTypeOf_People, + &state.dataHeatBal->People(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->People(Loop).RadGainRate, + &state.dataHeatBal->People(Loop).LatGainRate, + nullptr, + &state.dataHeatBal->People(Loop).CO2GainRate); + + } // Item1 - number of zones + } // Item - number of people statements + } // TotPeople > 0 + + // transfer the nominal number of people in a zone to the tabular reporting + for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { + if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) { + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && + state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants < 0.1) { + ShowWarningError(state, RoutineName + "Zone=\"" + state.dataHeatBal->Zone(Loop).Name + "\" occupant density is extremely high."); + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { + ShowContinueError(state, + format("Occupant Density=[{:.0R}] person/m2.", + state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea)); + } ShowContinueError(state, - format("Occupant Density=[{:.0R}] person/m2.", - state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea)); + format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", + state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants)); } - ShowContinueError(state, - format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", - state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants)); - } - maxOccupLoad = 0.0; - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotPeople; ++Loop1) { - if (state.dataHeatBal->People(Loop1).ZonePtr != Loop) continue; - if (maxOccupLoad < GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) * - state.dataHeatBal->People(Loop1).NumberOfPeople) { - maxOccupLoad = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) * - state.dataHeatBal->People(Loop1).NumberOfPeople; - MaxNumber = state.dataHeatBal->People(Loop1).NumberOfPeoplePtr; - OptionNum = Loop1; + maxOccupLoad = 0.0; + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotPeople; ++Loop1) { + if (state.dataHeatBal->People(Loop1).ZonePtr != Loop) continue; + if (maxOccupLoad < GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) * + state.dataHeatBal->People(Loop1).NumberOfPeople) { + maxOccupLoad = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) * + state.dataHeatBal->People(Loop1).NumberOfPeople; + MaxNumber = state.dataHeatBal->People(Loop1).NumberOfPeoplePtr; + OptionNum = Loop1; + } } - } - if (maxOccupLoad > state.dataHeatBal->Zone(Loop).TotOccupants) { - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad < 0.1) { - ShowWarningError(state, - RoutineName + "Zone=\"" + state.dataHeatBal->Zone(Loop).Name + - "\" occupant density at a maximum schedule value is extremely high."); - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { + if (maxOccupLoad > state.dataHeatBal->Zone(Loop).TotOccupants) { + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad < 0.1) { + ShowWarningError(state, + RoutineName + "Zone=\"" + state.dataHeatBal->Zone(Loop).Name + + "\" occupant density at a maximum schedule value is extremely high."); + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { + ShowContinueError(state, + format("Occupant Density=[{:.0R}] person/m2.", maxOccupLoad / state.dataHeatBal->Zone(Loop).FloorArea)); + } ShowContinueError(state, - format("Occupant Density=[{:.0R}] person/m2.", maxOccupLoad / state.dataHeatBal->Zone(Loop).FloorArea)); + format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", + state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad)); + ShowContinueError(state, + "Check values in People=" + state.dataHeatBal->People(OptionNum).Name + + ", Number of People Schedule=" + GetScheduleName(state, MaxNumber)); } - ShowContinueError(state, - format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", - state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad)); - ShowContinueError(state, - "Check values in People=" + state.dataHeatBal->People(OptionNum).Name + - ", Number of People Schedule=" + GetScheduleName(state, MaxNumber)); } } - } - if (state.dataHeatBal->Zone(Loop).isNominalControlled) { // conditioned zones only - if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) { - state.dataHeatBal->Zone(Loop).isNominalOccupied = true; - PreDefTableEntry(state, - state.dataOutRptPredefined->pdchOaoNomNumOcc1, - state.dataHeatBal->Zone(Loop).Name, - state.dataHeatBal->Zone(Loop).TotOccupants); - PreDefTableEntry(state, - state.dataOutRptPredefined->pdchOaoNomNumOcc2, - state.dataHeatBal->Zone(Loop).Name, - state.dataHeatBal->Zone(Loop).TotOccupants); - } + if (state.dataHeatBal->Zone(Loop).isNominalControlled) { // conditioned zones only + if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) { + state.dataHeatBal->Zone(Loop).isNominalOccupied = true; + PreDefTableEntry(state, + state.dataOutRptPredefined->pdchOaoNomNumOcc1, + state.dataHeatBal->Zone(Loop).Name, + state.dataHeatBal->Zone(Loop).TotOccupants); + PreDefTableEntry(state, + state.dataOutRptPredefined->pdchOaoNomNumOcc2, + state.dataHeatBal->Zone(Loop).Name, + state.dataHeatBal->Zone(Loop).TotOccupants); + } + } } - } - RepVarSet = true; - CurrentModuleObject = "Lights"; - state.dataHeatBal->NumLightsStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->LightsObjects.allocate(state.dataHeatBal->NumLightsStatements); - - state.dataHeatBal->TotLights = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumLightsStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->LightsObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->LightsObjects(Item).StartPtr = state.dataHeatBal->TotLights + 1; - ++state.dataHeatBal->TotLights; - state.dataHeatBal->LightsObjects(Item).NumOfZones = 1; - state.dataHeatBal->LightsObjects(Item).ZoneListActive = false; - state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr = Item1; - } else if (ZLItem > 0) { - state.dataHeatBal->LightsObjects(Item).StartPtr = state.dataHeatBal->TotLights + 1; - state.dataHeatBal->TotLights += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->LightsObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->LightsObjects(Item).ZoneListActive = true; - state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr = ZLItem; - } else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + RepVarSet = true; + CurrentModuleObject = "Lights"; + state.dataHeatBal->NumLightsStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->LightsObjects.allocate(state.dataHeatBal->NumLightsStatements); - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); state.dataHeatBal->TotLights = 0; - } - - state.dataHeatBal->Lights.allocate(state.dataHeatBal->TotLights); - - if (state.dataHeatBal->TotLights > 0) { - Loop = 0; + errFlag = false; for (Item = 1; Item <= state.dataHeatBal->NumLightsStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->LightsObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->LightsObjects(Item).ZoneListActive) { - state.dataHeatBal->Lights(Loop).Name = AlphaName(1); - state.dataHeatBal->Lights(Loop).ZonePtr = state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr; - } else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) - .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->LightsObjects(Item).Name, - state.dataHeatBal->Lights, - Loop - 1, - state.dataHeatBal->Lights(Loop).Name, - errFlag); - state.dataHeatBal->Lights(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->LightsObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->LightsObjects(Item).StartPtr = state.dataHeatBal->TotLights + 1; + ++state.dataHeatBal->TotLights; + state.dataHeatBal->LightsObjects(Item).NumOfZones = 1; + state.dataHeatBal->LightsObjects(Item).ZoneListActive = false; + state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr = Item1; + } + else if (ZLItem > 0) { + state.dataHeatBal->LightsObjects(Item).StartPtr = state.dataHeatBal->TotLights + 1; + state.dataHeatBal->TotLights += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->LightsObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->LightsObjects(Item).ZoneListActive = true; + state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr = ZLItem; + } + else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } - state.dataHeatBal->Lights(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->Lights(Loop).SchedPtr == 0) { - if (Item1 == 1) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); - } else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); - } - ErrorsFound = true; + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); + state.dataHeatBal->TotLights = 0; + } + + state.dataHeatBal->Lights.allocate(state.dataHeatBal->TotLights); + + if (state.dataHeatBal->TotLights > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumLightsStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->LightsObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->LightsObjects(Item).ZoneListActive) { + state.dataHeatBal->Lights(Loop).Name = AlphaName(1); + state.dataHeatBal->Lights(Loop).ZonePtr = state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr; } - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { + else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) + .Name, + state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->LightsObjects(Item).Name, + state.dataHeatBal->Lights, + Loop - 1, + state.dataHeatBal->Lights(Loop).Name, + errFlag); + state.dataHeatBal->Lights(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } + + state.dataHeatBal->Lights(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->Lights(Loop).SchedPtr == 0) { if (Item1 == 1) { - if (SchMin < 0.0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); } - } - if (Item1 == 1) { - if (SchMax < 0.0) { + else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); } + ErrorsFound = true; } } - } - - // Lights Design Level calculation method. - { - auto const lightingLevel(AlphaName(4)); - if (lightingLevel == "LIGHTINGLEVEL") { - state.dataHeatBal->Lights(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Lights will result."); - } - - } else if (lightingLevel == "WATTS/AREA") { - if (state.dataHeatBal->Lights(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->Lights(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Lights will result."); + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (Item1 == 1) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; + } + } + if (Item1 == 1) { + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } - } else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->Lights(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); - ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Lights will result."); + } + + // Lights Design Level calculation method. + { + auto const lightingLevel(AlphaName(4)); + if (lightingLevel == "LIGHTINGLEVEL") { + state.dataHeatBal->Lights(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Lights will result."); + } + } + else if (lightingLevel == "WATTS/AREA") { + if (state.dataHeatBal->Lights(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->Lights(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Lights will result."); + } + } + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->Lights(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Lights will result."); + } - } else if (lightingLevel == "WATTS/PERSON") { - if (state.dataHeatBal->Lights(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->Lights(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Lights will result."); + } + else if (lightingLevel == "WATTS/PERSON") { + if (state.dataHeatBal->Lights(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->Lights(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Lights will result."); + } } - } else { + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->Lights(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Lights will result."); + } + + } + else { + if (Item1 == 1) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->Lights(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"LightingLevel\", \"Watts/Area\", \"Watts/Person\"."); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Lights will result."); - } + } - } else { + // Calculate nominal min/max lighting level + state.dataHeatBal->Lights(Loop).NomMinDesignLevel = state.dataHeatBal->Lights(Loop).DesignLevel * SchMin; + state.dataHeatBal->Lights(Loop).NomMaxDesignLevel = state.dataHeatBal->Lights(Loop).DesignLevel * SchMax; + + state.dataHeatBal->Lights(Loop).FractionReturnAir = IHGNumbers(4); + state.dataHeatBal->Lights(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->Lights(Loop).FractionShortWave = IHGNumbers(6); + state.dataHeatBal->Lights(Loop).FractionReplaceable = IHGNumbers(7); + state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff1 = IHGNumbers(8); + state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff2 = IHGNumbers(9); + + state.dataHeatBal->Lights(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->Lights(Loop).FractionReturnAir + state.dataHeatBal->Lights(Loop).FractionRadiant + + state.dataHeatBal->Lights(Loop).FractionShortWave); + if (std::abs(state.dataHeatBal->Lights(Loop).FractionConvected) <= 0.001) state.dataHeatBal->Lights(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->Lights(Loop).FractionConvected < 0.0) { if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"LightingLevel\", \"Watts/Area\", \"Watts/Person\"."); + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); ErrorsFound = true; } } - } - // Calculate nominal min/max lighting level - state.dataHeatBal->Lights(Loop).NomMinDesignLevel = state.dataHeatBal->Lights(Loop).DesignLevel * SchMin; - state.dataHeatBal->Lights(Loop).NomMaxDesignLevel = state.dataHeatBal->Lights(Loop).DesignLevel * SchMax; - - state.dataHeatBal->Lights(Loop).FractionReturnAir = IHGNumbers(4); - state.dataHeatBal->Lights(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->Lights(Loop).FractionShortWave = IHGNumbers(6); - state.dataHeatBal->Lights(Loop).FractionReplaceable = IHGNumbers(7); - state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff1 = IHGNumbers(8); - state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff2 = IHGNumbers(9); - - state.dataHeatBal->Lights(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->Lights(Loop).FractionReturnAir + state.dataHeatBal->Lights(Loop).FractionRadiant + - state.dataHeatBal->Lights(Loop).FractionShortWave); - if (std::abs(state.dataHeatBal->Lights(Loop).FractionConvected) <= 0.001) state.dataHeatBal->Lights(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->Lights(Loop).FractionConvected < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; + // Note: if FractionReturnAirIsCalculated = Yes and there is a return-air plenum: + // (1) The input values of FractionReturnAir, FractionRadiant and FractionShortWave, and the + // value of FractionConvected calculated from these are used in the zone sizing calculations; + // (2) in the regular calculation, FractionReturnAir is calculated each time step in + // Subr. InitInternalHeatGains as a function of the zone's return plenum air temperature + // using FractionReturnAirPlenTempCoeff1 and FractionReturnAirPlenTempCoeff2; then + // FractionRadiant and FractionConvected are adjusted from their input values such that + // FractionReturnAir + FractionRadiant + FractionShortWave + FractionConvected = 1.0, assuming + // FractionShortWave is constant and equal to its input value. + + if (NumAlpha > 4) { + state.dataHeatBal->Lights(Loop).EndUseSubcategory = AlphaName(5); + } + else { + state.dataHeatBal->Lights(Loop).EndUseSubcategory = "General"; } - } - // Note: if FractionReturnAirIsCalculated = Yes and there is a return-air plenum: - // (1) The input values of FractionReturnAir, FractionRadiant and FractionShortWave, and the - // value of FractionConvected calculated from these are used in the zone sizing calculations; - // (2) in the regular calculation, FractionReturnAir is calculated each time step in - // Subr. InitInternalHeatGains as a function of the zone's return plenum air temperature - // using FractionReturnAirPlenTempCoeff1 and FractionReturnAirPlenTempCoeff2; then - // FractionRadiant and FractionConvected are adjusted from their input values such that - // FractionReturnAir + FractionRadiant + FractionShortWave + FractionConvected = 1.0, assuming - // FractionShortWave is constant and equal to its input value. - - if (NumAlpha > 4) { - state.dataHeatBal->Lights(Loop).EndUseSubcategory = AlphaName(5); - } else { - state.dataHeatBal->Lights(Loop).EndUseSubcategory = "General"; - } + if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { + state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = false; + } + else if (AlphaName(6) != "YES" && AlphaName(6) != "NO") { + if (Item1 == 1) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(6) + ", value =" + AlphaName(6)); + ShowContinueError(state, ".. Return Air Fraction from Plenum will NOT be calculated."); + } + state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = false; + } + else { + state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = (AlphaName(6) == "YES"); + } - if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { - state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = false; - } else if (AlphaName(6) != "YES" && AlphaName(6) != "NO") { - if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(6) + ", value =" + AlphaName(6)); - ShowContinueError(state, ".. Return Air Fraction from Plenum will NOT be calculated."); + // Set return air node number + state.dataHeatBal->Lights(Loop).ZoneReturnNum = 0; + std::string retNodeName = ""; + if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { + if (state.dataHeatBal->LightsObjects(Item).ZoneListActive) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + + "\": " + state.dataIPShortCut->cAlphaFieldNames(7) + " must be blank when using a ZoneList."); + ErrorsFound = true; + } + else { + retNodeName = AlphaName(7); + } + } + if (state.dataHeatBal->Lights(Loop).ZonePtr > 0) { + state.dataHeatBal->Lights(Loop).ZoneReturnNum = DataZoneEquipment::GetReturnNumForZone( + state, state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name, retNodeName); } - state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = false; - } else { - state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = (AlphaName(6) == "YES"); - } - // Set return air node number - state.dataHeatBal->Lights(Loop).ZoneReturnNum = 0; - std::string retNodeName = ""; - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - if (state.dataHeatBal->LightsObjects(Item).ZoneListActive) { + if ((state.dataHeatBal->Lights(Loop).ZoneReturnNum == 0) && (state.dataHeatBal->Lights(Loop).FractionReturnAir > 0.0) && + (!state.dataIPShortCut->lAlphaFieldBlanks(7))) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + - "\": " + state.dataIPShortCut->cAlphaFieldNames(7) + " must be blank when using a ZoneList."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(7) + " =" + AlphaName(7)); + ShowContinueError(state, "No matching Zone Return Air Node found."); ErrorsFound = true; - } else { - retNodeName = AlphaName(7); } - } - if (state.dataHeatBal->Lights(Loop).ZonePtr > 0) { - state.dataHeatBal->Lights(Loop).ZoneReturnNum = DataZoneEquipment::GetReturnNumForZone( - state, state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name, retNodeName); - } - - if ((state.dataHeatBal->Lights(Loop).ZoneReturnNum == 0) && (state.dataHeatBal->Lights(Loop).FractionReturnAir > 0.0) && - (!state.dataIPShortCut->lAlphaFieldBlanks(7))) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(7) + " =" + AlphaName(7)); - ShowContinueError(state, "No matching Zone Return Air Node found."); - ErrorsFound = true; - } - if (state.dataHeatBal->Lights(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - - // Object report variables - SetupOutputVariable(state, - "Lights Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); - - SetupOutputVariable(state, - "Lights Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); - SetupOutputVariable(state, - "Lights Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); - SetupOutputVariable(state, - "Lights Visible Radiation Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).VisGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); - - SetupOutputVariable(state, - "Lights Visible Radiation Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).VisGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); - SetupOutputVariable(state, - "Lights Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); - SetupOutputVariable(state, - "Lights Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); - SetupOutputVariable(state, - "Lights Return Air Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).RetAirGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); - SetupOutputVariable(state, - "Lights Return Air Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).RetAirGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); - SetupOutputVariable(state, - "Lights Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); - SetupOutputVariable(state, - "Lights Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); - SetupOutputVariable(state, - "Lights Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name, - _, - "Electricity", - "InteriorLights", - state.dataHeatBal->Lights(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).ListMultiplier); + if (state.dataHeatBal->Lights(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - // Zone total report variables - if (RepVarSet(state.dataHeatBal->Lights(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->Lights(Loop).ZonePtr) = false; + // Object report variables SetupOutputVariable(state, - "Zone Lights Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, - "Zone Lights Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsElecConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); SetupOutputVariable(state, - "Zone Lights Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); SetupOutputVariable(state, - "Zone Lights Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Visible Radiation Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).VisGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, - "Zone Lights Visible Radiation Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsVisGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Visible Radiation Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).VisGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); SetupOutputVariable(state, - "Zone Lights Visible Radiation Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsVisGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); SetupOutputVariable(state, - "Zone Lights Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); SetupOutputVariable(state, - "Zone Lights Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Return Air Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).RetAirGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); SetupOutputVariable(state, - "Zone Lights Return Air Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRetAirGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Return Air Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).RetAirGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); SetupOutputVariable(state, - "Zone Lights Return Air Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRetAirGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); SetupOutputVariable(state, - "Zone Lights Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + "Lights Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); SetupOutputVariable(state, - "Zone Lights Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - } + "Lights Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name, + _, + "Electricity", + "InteriorLights", + state.dataHeatBal->Lights(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).ListMultiplier); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->Lights(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->Lights(Loop).ZonePtr) = false; + SetupOutputVariable(state, + "Zone Lights Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsElecConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Visible Radiation Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsVisGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Visible Radiation Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsVisGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Return Air Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRetAirGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Return Air Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRetAirGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + } - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "Lights", - state.dataHeatBal->Lights(Loop).Name, - "Electricity Rate", - "[W]", - state.dataHeatBal->Lights(Loop).EMSLightsOn, - state.dataHeatBal->Lights(Loop).EMSLightingPower); - SetupEMSInternalVariable(state, - "Lighting Power Design Level", - state.dataHeatBal->Lights(Loop).Name, - "[W]", - state.dataHeatBal->Lights(Loop).DesignLevel); - } // EMS - // setup internal gains - int returnNodeNum = 0; - if ((state.dataHeatBal->Lights(Loop).ZoneReturnNum > 0) && - (state.dataHeatBal->Lights(Loop).ZoneReturnNum <= - state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->Lights(Loop).ZonePtr).NumReturnNodes)) { - returnNodeNum = state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->Lights(Loop).ZonePtr) - .ReturnNode(state.dataHeatBal->Lights(Loop).ZoneReturnNum); - } - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->Lights(Loop).ZonePtr, - "Lights", - state.dataHeatBal->Lights(Loop).Name, - IntGainTypeOf_Lights, - &state.dataHeatBal->Lights(Loop).ConGainRate, - &state.dataHeatBal->Lights(Loop).RetAirGainRate, - &state.dataHeatBal->Lights(Loop).RadGainRate, - nullptr, - nullptr, - nullptr, - nullptr, - returnNodeNum); - - if (state.dataHeatBal->Lights(Loop).FractionReturnAir > 0) - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).HasLtsRetAirGain = true; - // send values to predefined lighting summary report - liteName = state.dataHeatBal->Lights(Loop).Name; - zonePt = state.dataHeatBal->Lights(Loop).ZonePtr; - mult = state.dataHeatBal->Zone(zonePt).Multiplier * state.dataHeatBal->Zone(zonePt).ListMultiplier; - state.dataInternalHeatGains->sumArea += state.dataHeatBal->Zone(zonePt).FloorArea * mult; - state.dataInternalHeatGains->sumPower += state.dataHeatBal->Lights(Loop).DesignLevel * mult; - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtZone, liteName, state.dataHeatBal->Zone(zonePt).Name); - if (state.dataHeatBal->Zone(zonePt).FloorArea > 0.0) { - PreDefTableEntry(state, - state.dataOutRptPredefined->pdchInLtDens, - liteName, - state.dataHeatBal->Lights(Loop).DesignLevel / state.dataHeatBal->Zone(zonePt).FloorArea, - 4); - } else { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, liteName, DataPrecisionGlobals::constant_zero, 4); - } - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, liteName, state.dataHeatBal->Zone(zonePt).FloorArea * mult); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, liteName, state.dataHeatBal->Lights(Loop).DesignLevel * mult); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtEndUse, liteName, state.dataHeatBal->Lights(Loop).EndUseSubcategory); - PreDefTableEntry( - state, state.dataOutRptPredefined->pdchInLtSchd, liteName, GetScheduleName(state, state.dataHeatBal->Lights(Loop).SchedPtr)); - PreDefTableEntry( - state, state.dataOutRptPredefined->pdchInLtRetAir, liteName, state.dataHeatBal->Lights(Loop).FractionReturnAir, 4); - } // Item1 - zones - } // Item = Number of Lights Objects - } // TotLights > 0 check - // add total line to lighting summary table - if (state.dataInternalHeatGains->sumArea > 0.0) { - PreDefTableEntry(state, - state.dataOutRptPredefined->pdchInLtDens, - "Interior Lighting Total", - state.dataInternalHeatGains->sumPower / state.dataInternalHeatGains->sumArea, - 4); //** line 792 - } else { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, "Interior Lighting Total", DataPrecisionGlobals::constant_zero, 4); - } - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, "Interior Lighting Total", state.dataInternalHeatGains->sumArea); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, "Interior Lighting Total", state.dataInternalHeatGains->sumPower); - - RepVarSet = true; - CurrentModuleObject = "ElectricEquipment"; - state.dataHeatBal->NumZoneElectricStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->ZoneElectricObjects.allocate(state.dataHeatBal->NumZoneElectricStatements); - - state.dataHeatBal->TotElecEquip = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumZoneElectricStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->ZoneElectricObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->ZoneElectricObjects(Item).StartPtr = state.dataHeatBal->TotElecEquip + 1; - ++state.dataHeatBal->TotElecEquip; - state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones = 1; - state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive = false; - state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr = Item1; - } else if (ZLItem > 0) { - state.dataHeatBal->ZoneElectricObjects(Item).StartPtr = state.dataHeatBal->TotElecEquip + 1; - state.dataHeatBal->TotElecEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive = true; - state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr = ZLItem; - } else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "Lights", + state.dataHeatBal->Lights(Loop).Name, + "Electricity Rate", + "[W]", + state.dataHeatBal->Lights(Loop).EMSLightsOn, + state.dataHeatBal->Lights(Loop).EMSLightingPower); + SetupEMSInternalVariable(state, + "Lighting Power Design Level", + state.dataHeatBal->Lights(Loop).Name, + "[W]", + state.dataHeatBal->Lights(Loop).DesignLevel); + } // EMS + // setup internal gains + int returnNodeNum = 0; + if ((state.dataHeatBal->Lights(Loop).ZoneReturnNum > 0) && + (state.dataHeatBal->Lights(Loop).ZoneReturnNum <= + state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->Lights(Loop).ZonePtr).NumReturnNodes)) { + returnNodeNum = state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->Lights(Loop).ZonePtr) + .ReturnNode(state.dataHeatBal->Lights(Loop).ZoneReturnNum); + } + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->Lights(Loop).ZonePtr, + "Lights", + state.dataHeatBal->Lights(Loop).Name, + IntGainTypeOf_Lights, + &state.dataHeatBal->Lights(Loop).ConGainRate, + &state.dataHeatBal->Lights(Loop).RetAirGainRate, + &state.dataHeatBal->Lights(Loop).RadGainRate, + nullptr, + nullptr, + nullptr, + nullptr, + returnNodeNum); + + if (state.dataHeatBal->Lights(Loop).FractionReturnAir > 0) + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).HasLtsRetAirGain = true; + // send values to predefined lighting summary report + liteName = state.dataHeatBal->Lights(Loop).Name; + zonePt = state.dataHeatBal->Lights(Loop).ZonePtr; + mult = state.dataHeatBal->Zone(zonePt).Multiplier * state.dataHeatBal->Zone(zonePt).ListMultiplier; + state.dataInternalHeatGains->sumArea += state.dataHeatBal->Zone(zonePt).FloorArea * mult; + state.dataInternalHeatGains->sumPower += state.dataHeatBal->Lights(Loop).DesignLevel * mult; + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtZone, liteName, state.dataHeatBal->Zone(zonePt).Name); + if (state.dataHeatBal->Zone(zonePt).FloorArea > 0.0) { + PreDefTableEntry(state, + state.dataOutRptPredefined->pdchInLtDens, + liteName, + state.dataHeatBal->Lights(Loop).DesignLevel / state.dataHeatBal->Zone(zonePt).FloorArea, + 4); + } + else { + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, liteName, DataPrecisionGlobals::constant_zero, 4); + } + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, liteName, state.dataHeatBal->Zone(zonePt).FloorArea * mult); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, liteName, state.dataHeatBal->Lights(Loop).DesignLevel * mult); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtEndUse, liteName, state.dataHeatBal->Lights(Loop).EndUseSubcategory); + PreDefTableEntry( + state, state.dataOutRptPredefined->pdchInLtSchd, liteName, GetScheduleName(state, state.dataHeatBal->Lights(Loop).SchedPtr)); + PreDefTableEntry( + state, state.dataOutRptPredefined->pdchInLtRetAir, liteName, state.dataHeatBal->Lights(Loop).FractionReturnAir, 4); + } // Item1 - zones + } // Item = Number of Lights Objects + } // TotLights > 0 check + // add total line to lighting summary table + if (state.dataInternalHeatGains->sumArea > 0.0) { + PreDefTableEntry(state, + state.dataOutRptPredefined->pdchInLtDens, + "Interior Lighting Total", + state.dataInternalHeatGains->sumPower / state.dataInternalHeatGains->sumArea, + 4); //** line 792 } - } - - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotElecEquip = 0; - } + else { + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, "Interior Lighting Total", DataPrecisionGlobals::constant_zero, 4); + } + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, "Interior Lighting Total", state.dataInternalHeatGains->sumArea); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, "Interior Lighting Total", state.dataInternalHeatGains->sumPower); - state.dataHeatBal->ZoneElectric.allocate(state.dataHeatBal->TotElecEquip); + RepVarSet = true; + CurrentModuleObject = "ElectricEquipment"; + state.dataHeatBal->NumZoneElectricStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->ZoneElectricObjects.allocate(state.dataHeatBal->NumZoneElectricStatements); - if (state.dataHeatBal->TotElecEquip > 0) { - Loop = 0; + state.dataHeatBal->TotElecEquip = 0; + errFlag = false; for (Item = 1; Item <= state.dataHeatBal->NumZoneElectricStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneElectric(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneElectric(Loop).ZonePtr = state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr; - } else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->ZoneElectricObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->ZoneElectricObjects(Item).StartPtr = state.dataHeatBal->TotElecEquip + 1; + ++state.dataHeatBal->TotElecEquip; + state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones = 1; + state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive = false; + state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr = Item1; + } + else if (ZLItem > 0) { + state.dataHeatBal->ZoneElectricObjects(Item).StartPtr = state.dataHeatBal->TotElecEquip + 1; + state.dataHeatBal->TotElecEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive = true; + state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr = ZLItem; + } + else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); + state.dataHeatBal->TotElecEquip = 0; + } + + state.dataHeatBal->ZoneElectric.allocate(state.dataHeatBal->TotElecEquip); + + if (state.dataHeatBal->TotElecEquip > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumZoneElectricStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneElectric(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneElectric(Loop).ZonePtr = state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr; + } + else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->ZoneElectricObjects(Item).Name, - state.dataHeatBal->ZoneElectric, - Loop - 1, - state.dataHeatBal->ZoneElectric(Loop).Name, - errFlag); - state.dataHeatBal->ZoneElectric(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } - - state.dataHeatBal->ZoneElectric(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneElectric(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); - } else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->ZoneElectricObjects(Item).Name, + state.dataHeatBal->ZoneElectric, + Loop - 1, + state.dataHeatBal->ZoneElectric(Loop).Name, + errFlag); + state.dataHeatBal->ZoneElectric(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; } - ErrorsFound = true; - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { + + state.dataHeatBal->ZoneElectric(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneElectric(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); } - if (SchMax < 0.0) { + else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); } + ErrorsFound = true; } - } - - // Electric equipment design level calculation method. - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - state.dataHeatBal->ZoneElectric(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Electric Equipment will result."); - } - - } else if (equipmentLevel == "WATTS/AREA") { - if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->ZoneElectric(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Electric Equipment will result."); - } - } else { + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; + } + if (SchMax < 0.0) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Electric Equipment will result."); + } + + // Electric equipment design level calculation method. + { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + state.dataHeatBal->ZoneElectric(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Electric Equipment will result."); + } + } + else if (equipmentLevel == "WATTS/AREA") { + if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->ZoneElectric(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Electric Equipment will result."); + } + } + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Electric Equipment will result."); + } - } else if (equipmentLevel == "WATTS/PERSON") { - if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneElectric(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Electric Equipment will result."); + } + else if (equipmentLevel == "WATTS/PERSON") { + if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneElectric(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Electric Equipment will result."); + } + } + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); + ErrorsFound = true; } - } else { + } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Electric Equipment will result."); + } + + } + else { + if (Item1 == 1) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Electric Equipment will result."); - } - - } else { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); - ErrorsFound = true; - } } - } - - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneElectric(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneElectric(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * SchMax; - - state.dataHeatBal->ZoneElectric(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneElectric(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneElectric(Loop).FractionLost = IHGNumbers(6); - // FractionConvected is a calculated field - state.dataHeatBal->ZoneElectric(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneElectric(Loop).FractionLatent + state.dataHeatBal->ZoneElectric(Loop).FractionRadiant + - state.dataHeatBal->ZoneElectric(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneElectric(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneElectric(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneElectric(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; - } - - if (NumAlpha > 4) { - state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory = AlphaName(5); - } else { - state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory = "General"; - } - if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneElectric(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneElectric(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * SchMax; + + state.dataHeatBal->ZoneElectric(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneElectric(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneElectric(Loop).FractionLost = IHGNumbers(6); + // FractionConvected is a calculated field + state.dataHeatBal->ZoneElectric(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneElectric(Loop).FractionLatent + state.dataHeatBal->ZoneElectric(Loop).FractionRadiant + + state.dataHeatBal->ZoneElectric(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneElectric(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneElectric(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneElectric(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } - // Object report variables - SetupOutputVariable(state, - "Electric Equipment Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ListMultiplier); + if (NumAlpha > 4) { + state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory = AlphaName(5); + } + else { + state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory = "General"; + } - SetupOutputVariable(state, - "Electric Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); - SetupOutputVariable(state, - "Electric Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); + if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneElectric(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneElectric(Loop).ZonePtr) = false; + // Object report variables SetupOutputVariable(state, - "Zone Electric Equipment Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ListMultiplier); SetupOutputVariable(state, - "Zone Electric Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Electric Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); SetupOutputVariable(state, - "Zone Electric Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - } + "Electric Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneElectric(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneElectric(Loop).ZonePtr) = false; + SetupOutputVariable(state, + "Zone Electric Equipment Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "ElectricEquipment", - state.dataHeatBal->ZoneElectric(Loop).Name, - "Electricity Rate", - "[W]", - state.dataHeatBal->ZoneElectric(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneElectric(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Plug and Process Power Design Level", - state.dataHeatBal->ZoneElectric(Loop).Name, - "[W]", - state.dataHeatBal->ZoneElectric(Loop).DesignLevel); - } // EMS + SetupOutputVariable(state, + "Zone Electric Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Electric Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + } - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneElectric(Loop).ZonePtr, - "ElectricEquipment", - state.dataHeatBal->ZoneElectric(Loop).Name, - IntGainTypeOf_ElectricEquipment, - &state.dataHeatBal->ZoneElectric(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneElectric(Loop).RadGainRate, - &state.dataHeatBal->ZoneElectric(Loop).LatGainRate); - - } // Item1 - } // Item - Number of ZoneElectric objects - } // Check on number of ZoneElectric - - RepVarSet = true; - CurrentModuleObject = "GasEquipment"; - state.dataHeatBal->NumZoneGasStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->ZoneGasObjects.allocate(state.dataHeatBal->NumZoneGasStatements); - - state.dataHeatBal->TotGasEquip = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumZoneGasStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->ZoneGasObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->ZoneGasObjects(Item).StartPtr = state.dataHeatBal->TotGasEquip + 1; - ++state.dataHeatBal->TotGasEquip; - state.dataHeatBal->ZoneGasObjects(Item).NumOfZones = 1; - state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive = false; - state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr = Item1; - } else if (ZLItem > 0) { - state.dataHeatBal->ZoneGasObjects(Item).StartPtr = state.dataHeatBal->TotGasEquip + 1; - state.dataHeatBal->TotGasEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->ZoneGasObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive = true; - state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr = ZLItem; - } else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "ElectricEquipment", + state.dataHeatBal->ZoneElectric(Loop).Name, + "Electricity Rate", + "[W]", + state.dataHeatBal->ZoneElectric(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneElectric(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Plug and Process Power Design Level", + state.dataHeatBal->ZoneElectric(Loop).Name, + "[W]", + state.dataHeatBal->ZoneElectric(Loop).DesignLevel); + } // EMS + + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneElectric(Loop).ZonePtr, + "ElectricEquipment", + state.dataHeatBal->ZoneElectric(Loop).Name, + IntGainTypeOf_ElectricEquipment, + &state.dataHeatBal->ZoneElectric(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneElectric(Loop).RadGainRate, + &state.dataHeatBal->ZoneElectric(Loop).LatGainRate); + + } // Item1 + } // Item - Number of ZoneElectric objects + } // Check on number of ZoneElectric + + RepVarSet = true; + CurrentModuleObject = "GasEquipment"; + state.dataHeatBal->NumZoneGasStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->ZoneGasObjects.allocate(state.dataHeatBal->NumZoneGasStatements); - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); state.dataHeatBal->TotGasEquip = 0; - } - - state.dataHeatBal->ZoneGas.allocate(state.dataHeatBal->TotGasEquip); - - if (state.dataHeatBal->TotGasEquip > 0) { - Loop = 0; + errFlag = false; for (Item = 1; Item <= state.dataHeatBal->NumZoneGasStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->ZoneGasObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneGas(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneGas(Loop).ZonePtr = state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr; - } else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->ZoneGasObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->ZoneGasObjects(Item).StartPtr = state.dataHeatBal->TotGasEquip + 1; + ++state.dataHeatBal->TotGasEquip; + state.dataHeatBal->ZoneGasObjects(Item).NumOfZones = 1; + state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive = false; + state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr = Item1; + } + else if (ZLItem > 0) { + state.dataHeatBal->ZoneGasObjects(Item).StartPtr = state.dataHeatBal->TotGasEquip + 1; + state.dataHeatBal->TotGasEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->ZoneGasObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive = true; + state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr = ZLItem; + } + else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); + state.dataHeatBal->TotGasEquip = 0; + } + + state.dataHeatBal->ZoneGas.allocate(state.dataHeatBal->TotGasEquip); + + if (state.dataHeatBal->TotGasEquip > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumZoneGasStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->ZoneGasObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneGas(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneGas(Loop).ZonePtr = state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr; + } + else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->ZoneGasObjects(Item).Name, - state.dataHeatBal->ZoneGas, - Loop - 1, - state.dataHeatBal->ZoneGas(Loop).Name, - errFlag); - state.dataHeatBal->ZoneGas(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } - - state.dataHeatBal->ZoneGas(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneGas(Loop).SchedPtr == 0) { - if (Item1 == 1) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); - } else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); - } - ErrorsFound = true; + state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->ZoneGasObjects(Item).Name, + state.dataHeatBal->ZoneGas, + Loop - 1, + state.dataHeatBal->ZoneGas(Loop).Name, + errFlag); + state.dataHeatBal->ZoneGas(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; } - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { + + state.dataHeatBal->ZoneGas(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneGas(Loop).SchedPtr == 0) { if (Item1 == 1) { - if (SchMin < 0.0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); } - } - if (Item1 == 1) { - if (SchMax < 0.0) { + else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); } + ErrorsFound = true; } } - } - - // equipment design level calculation method. - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - state.dataHeatBal->ZoneGas(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Gas Equipment will result."); - } - - } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { - if (state.dataHeatBal->ZoneGas(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->ZoneGas(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Gas Equipment will result."); + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (Item1 == 1) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; + } + } + if (Item1 == 1) { + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } - } else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->ZoneGas(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); - ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Gas Equipment will result."); + } + + // equipment design level calculation method. + { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + state.dataHeatBal->ZoneGas(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Gas Equipment will result."); + } + } + else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { + if (state.dataHeatBal->ZoneGas(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->ZoneGas(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Gas Equipment will result."); + } + } + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->ZoneGas(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Gas Equipment will result."); + } - } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { - if (state.dataHeatBal->ZoneGas(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneGas(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Gas Equipment will result."); + } + else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { + if (state.dataHeatBal->ZoneGas(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneGas(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Gas Equipment will result."); + } } - } else { + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->ZoneGas(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Gas Equipment will result."); + } + + } + else { + if (Item1 == 1) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->ZoneGas(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Gas Equipment will result."); - } - - } else { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); - ErrorsFound = true; - } } - } - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneGas(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneGas(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneGas(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneGas(Loop).DesignLevel * SchMax; + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneGas(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneGas(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneGas(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneGas(Loop).DesignLevel * SchMax; - state.dataHeatBal->ZoneGas(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneGas(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneGas(Loop).FractionLost = IHGNumbers(6); + state.dataHeatBal->ZoneGas(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneGas(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneGas(Loop).FractionLost = IHGNumbers(6); - if ((NumNumber == 7) || (!state.dataIPShortCut->lNumericFieldBlanks(7))) { - state.dataHeatBal->ZoneGas(Loop).CO2RateFactor = IHGNumbers(7); - } - if (state.dataHeatBal->ZoneGas(Loop).CO2RateFactor < 0.0) { - ShowSevereError(state, - format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(7), - IHGNumbers(7))); - ErrorsFound = true; - } - if (state.dataHeatBal->ZoneGas(Loop).CO2RateFactor > 4.0e-7) { - ShowSevereError(state, - format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(7), - IHGNumbers(7))); - ErrorsFound = true; - } - // FractionConvected is a calculated field - state.dataHeatBal->ZoneGas(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneGas(Loop).FractionLatent + state.dataHeatBal->ZoneGas(Loop).FractionRadiant + - state.dataHeatBal->ZoneGas(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneGas(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneGas(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneGas(Loop).FractionConvected < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + if ((NumNumber == 7) || (!state.dataIPShortCut->lNumericFieldBlanks(7))) { + state.dataHeatBal->ZoneGas(Loop).CO2RateFactor = IHGNumbers(7); + } + if (state.dataHeatBal->ZoneGas(Loop).CO2RateFactor < 0.0) { + ShowSevereError(state, + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(7), + IHGNumbers(7))); ErrorsFound = true; } - } - - if (NumAlpha > 4) { - state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory = AlphaName(5); - } else { - state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory = "General"; - } - - if (state.dataHeatBal->ZoneGas(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - - // Object report variables - SetupOutputVariable(state, - "Gas Equipment NaturalGas Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment NaturalGas Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name, - _, - "NaturalGas", - "InteriorEquipment", - state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).ListMultiplier); + if (state.dataHeatBal->ZoneGas(Loop).CO2RateFactor > 4.0e-7) { + ShowSevereError(state, + format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(7), + IHGNumbers(7))); + ErrorsFound = true; + } + // FractionConvected is a calculated field + state.dataHeatBal->ZoneGas(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneGas(Loop).FractionLatent + state.dataHeatBal->ZoneGas(Loop).FractionRadiant + + state.dataHeatBal->ZoneGas(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneGas(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneGas(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneGas(Loop).FractionConvected < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } + } - SetupOutputVariable(state, - "Gas Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); - SetupOutputVariable(state, - "Gas Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); + if (NumAlpha > 4) { + state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory = AlphaName(5); + } + else { + state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory = "General"; + } - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneGas(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneGas(Loop).ZonePtr) = false; + if (state.dataHeatBal->ZoneGas(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + // Object report variables SetupOutputVariable(state, - "Zone Gas Equipment NaturalGas Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment NaturalGas Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment NaturalGas Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment NaturalGas Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name, + _, + "NaturalGas", + "InteriorEquipment", + state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).ListMultiplier); SetupOutputVariable(state, - "Zone Gas Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + "Gas Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); SetupOutputVariable(state, - "Zone Gas Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - } + "Gas Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "GasEquipment", - state.dataHeatBal->ZoneGas(Loop).Name, - "NaturalGas Rate", - "[W]", - state.dataHeatBal->ZoneGas(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneGas(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Gas Process Power Design Level", - state.dataHeatBal->ZoneGas(Loop).Name, - "[W]", - state.dataHeatBal->ZoneGas(Loop).DesignLevel); - } // EMS + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneGas(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneGas(Loop).ZonePtr) = false; - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneGas(Loop).ZonePtr, - "GasEquipment", - state.dataHeatBal->ZoneGas(Loop).Name, - IntGainTypeOf_GasEquipment, - &state.dataHeatBal->ZoneGas(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneGas(Loop).RadGainRate, - &state.dataHeatBal->ZoneGas(Loop).LatGainRate, - nullptr, - &state.dataHeatBal->ZoneGas(Loop).CO2GainRate); - - } // Item1 - } // Item - number of gas statements - } // check for number of gas statements - - RepVarSet = true; - CurrentModuleObject = "HotWaterEquipment"; - state.dataHeatBal->NumHotWaterEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->HotWaterEqObjects.allocate(state.dataHeatBal->NumHotWaterEqStatements); - - state.dataHeatBal->TotHWEquip = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumHotWaterEqStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->HotWaterEqObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->HotWaterEqObjects(Item).StartPtr = state.dataHeatBal->TotHWEquip + 1; - ++state.dataHeatBal->TotHWEquip; - state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones = 1; - state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive = false; - state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr = Item1; - } else if (ZLItem > 0) { - state.dataHeatBal->HotWaterEqObjects(Item).StartPtr = state.dataHeatBal->TotHWEquip + 1; - state.dataHeatBal->TotHWEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive = true; - state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr = ZLItem; - } else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + SetupOutputVariable(state, + "Zone Gas Equipment NaturalGas Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment NaturalGas Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotHWEquip = 0; - } + SetupOutputVariable(state, + "Zone Gas Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Gas Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + } - state.dataHeatBal->ZoneHWEq.allocate(state.dataHeatBal->TotHWEquip); + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "GasEquipment", + state.dataHeatBal->ZoneGas(Loop).Name, + "NaturalGas Rate", + "[W]", + state.dataHeatBal->ZoneGas(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneGas(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Gas Process Power Design Level", + state.dataHeatBal->ZoneGas(Loop).Name, + "[W]", + state.dataHeatBal->ZoneGas(Loop).DesignLevel); + } // EMS + + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneGas(Loop).ZonePtr, + "GasEquipment", + state.dataHeatBal->ZoneGas(Loop).Name, + IntGainTypeOf_GasEquipment, + &state.dataHeatBal->ZoneGas(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneGas(Loop).RadGainRate, + &state.dataHeatBal->ZoneGas(Loop).LatGainRate, + nullptr, + &state.dataHeatBal->ZoneGas(Loop).CO2GainRate); + + } // Item1 + } // Item - number of gas statements + } // check for number of gas statements + + RepVarSet = true; + CurrentModuleObject = "HotWaterEquipment"; + state.dataHeatBal->NumHotWaterEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->HotWaterEqObjects.allocate(state.dataHeatBal->NumHotWaterEqStatements); - if (state.dataHeatBal->TotHWEquip > 0) { - Loop = 0; + state.dataHeatBal->TotHWEquip = 0; + errFlag = false; for (Item = 1; Item <= state.dataHeatBal->NumHotWaterEqStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneHWEq(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneHWEq(Loop).ZonePtr = state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr; - } else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->HotWaterEqObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->HotWaterEqObjects(Item).StartPtr = state.dataHeatBal->TotHWEquip + 1; + ++state.dataHeatBal->TotHWEquip; + state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones = 1; + state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive = false; + state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr = Item1; + } + else if (ZLItem > 0) { + state.dataHeatBal->HotWaterEqObjects(Item).StartPtr = state.dataHeatBal->TotHWEquip + 1; + state.dataHeatBal->TotHWEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive = true; + state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr = ZLItem; + } + else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); + state.dataHeatBal->TotHWEquip = 0; + } + + state.dataHeatBal->ZoneHWEq.allocate(state.dataHeatBal->TotHWEquip); + + if (state.dataHeatBal->TotHWEquip > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumHotWaterEqStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneHWEq(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneHWEq(Loop).ZonePtr = state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr; + } + else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->HotWaterEqObjects(Item).Name, - state.dataHeatBal->ZoneHWEq, - Loop - 1, - state.dataHeatBal->ZoneHWEq(Loop).Name, - errFlag); - state.dataHeatBal->ZoneHWEq(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } - - state.dataHeatBal->ZoneHWEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneHWEq(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); - } else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->HotWaterEqObjects(Item).Name, + state.dataHeatBal->ZoneHWEq, + Loop - 1, + state.dataHeatBal->ZoneHWEq(Loop).Name, + errFlag); + state.dataHeatBal->ZoneHWEq(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; } - ErrorsFound = true; - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { + + state.dataHeatBal->ZoneHWEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneHWEq(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); } - if (SchMax < 0.0) { + else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); } + ErrorsFound = true; } - } - - // Hot Water equipment design level calculation method. - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - - } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { - if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); - } - } else { + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; + } + if (SchMax < 0.0) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Hot Water Equipment will result."); + } + + // Hot Water equipment design level calculation method. + { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } + } + else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { + if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); + } + } + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } - } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { - if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Hot Water Equipment will result."); + } + else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { + if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Hot Water Equipment will result."); + } + } + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); + ErrorsFound = true; } - } else { + } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } + + } + else { + if (Item1 == 1) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - - } else { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); - ErrorsFound = true; - } } - } - - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneHWEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneHWEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * SchMax; - - state.dataHeatBal->ZoneHWEq(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneHWEq(Loop).FractionLost = IHGNumbers(6); - // FractionConvected is a calculated field - state.dataHeatBal->ZoneHWEq(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneHWEq(Loop).FractionLatent + state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant + - state.dataHeatBal->ZoneHWEq(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneHWEq(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneHWEq(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneHWEq(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; - } - - if (NumAlpha > 4) { - state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory = AlphaName(5); - } else { - state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory = "General"; - } - if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneHWEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneHWEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * SchMax; + + state.dataHeatBal->ZoneHWEq(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneHWEq(Loop).FractionLost = IHGNumbers(6); + // FractionConvected is a calculated field + state.dataHeatBal->ZoneHWEq(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneHWEq(Loop).FractionLatent + state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant + + state.dataHeatBal->ZoneHWEq(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneHWEq(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneHWEq(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneHWEq(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } - // Object report variables - SetupOutputVariable(state, - "Hot Water Equipment District Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment District Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name, - _, - "DistrictHeating", - "InteriorEquipment", - state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).ListMultiplier); + if (NumAlpha > 4) { + state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory = AlphaName(5); + } + else { + state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory = "General"; + } - SetupOutputVariable(state, - "Hot Water Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); - SetupOutputVariable(state, - "Hot Water Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); + if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr) = false; + // Object report variables SetupOutputVariable(state, - "Zone Hot Water Equipment District Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment District Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment District Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment District Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name, + _, + "DistrictHeating", + "InteriorEquipment", + state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).ListMultiplier); SetupOutputVariable(state, - "Zone Hot Water Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Hot Water Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); SetupOutputVariable(state, - "Zone Hot Water Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - } - - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "HotWaterEquipment", - state.dataHeatBal->ZoneHWEq(Loop).Name, - "District Heating Power Level", - "[W]", - state.dataHeatBal->ZoneHWEq(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneHWEq(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Process District Heat Design Level", - state.dataHeatBal->ZoneHWEq(Loop).Name, - "[W]", - state.dataHeatBal->ZoneHWEq(Loop).DesignLevel); - } // EMS - - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneHWEq(Loop).ZonePtr, - "HotWaterEquipment", - state.dataHeatBal->ZoneHWEq(Loop).Name, - IntGainTypeOf_HotWaterEquipment, - &state.dataHeatBal->ZoneHWEq(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneHWEq(Loop).RadGainRate, - &state.dataHeatBal->ZoneHWEq(Loop).LatGainRate); - - } // Item1 - } // Item - number of hot water statements - } - - RepVarSet = true; - CurrentModuleObject = "SteamEquipment"; - state.dataHeatBal->NumSteamEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->SteamEqObjects.allocate(state.dataHeatBal->NumSteamEqStatements); - - state.dataHeatBal->TotStmEquip = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumSteamEqStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->SteamEqObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->SteamEqObjects(Item).StartPtr = state.dataHeatBal->TotStmEquip + 1; - ++state.dataHeatBal->TotStmEquip; - state.dataHeatBal->SteamEqObjects(Item).NumOfZones = 1; - state.dataHeatBal->SteamEqObjects(Item).ZoneListActive = false; - state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr = Item1; - } else if (ZLItem > 0) { - state.dataHeatBal->SteamEqObjects(Item).StartPtr = state.dataHeatBal->TotStmEquip + 1; - state.dataHeatBal->TotStmEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->SteamEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->SteamEqObjects(Item).ZoneListActive = true; - state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr = ZLItem; - } else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } - - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotStmEquip = 0; - } - - state.dataHeatBal->ZoneSteamEq.allocate(state.dataHeatBal->TotStmEquip); - - if (state.dataHeatBal->TotStmEquip > 0) { - Loop = 0; - for (Item = 1; Item <= state.dataHeatBal->NumSteamEqStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->SteamEqObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->SteamEqObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneSteamEq(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr = state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr; - } else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal - ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) - .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->SteamEqObjects(Item).Name, - state.dataHeatBal->ZoneSteamEq, - Loop - 1, - state.dataHeatBal->ZoneSteamEq(Loop).Name, - errFlag); - state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + "Hot Water Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr) = false; + SetupOutputVariable(state, + "Zone Hot Water Equipment District Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment District Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); - } else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); - } - ErrorsFound = true; - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { + SetupOutputVariable(state, + "Zone Hot Water Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Hot Water Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + } + + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "HotWaterEquipment", + state.dataHeatBal->ZoneHWEq(Loop).Name, + "District Heating Power Level", + "[W]", + state.dataHeatBal->ZoneHWEq(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneHWEq(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Process District Heat Design Level", + state.dataHeatBal->ZoneHWEq(Loop).Name, + "[W]", + state.dataHeatBal->ZoneHWEq(Loop).DesignLevel); + } // EMS + + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneHWEq(Loop).ZonePtr, + "HotWaterEquipment", + state.dataHeatBal->ZoneHWEq(Loop).Name, + IntGainTypeOf_HotWaterEquipment, + &state.dataHeatBal->ZoneHWEq(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneHWEq(Loop).RadGainRate, + &state.dataHeatBal->ZoneHWEq(Loop).LatGainRate); + + } // Item1 + } // Item - number of hot water statements + } + + RepVarSet = true; + CurrentModuleObject = "SteamEquipment"; + state.dataHeatBal->NumSteamEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->SteamEqObjects.allocate(state.dataHeatBal->NumSteamEqStatements); + + state.dataHeatBal->TotStmEquip = 0; + errFlag = false; + for (Item = 1; Item <= state.dataHeatBal->NumSteamEqStatements; ++Item) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->SteamEqObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->SteamEqObjects(Item).StartPtr = state.dataHeatBal->TotStmEquip + 1; + ++state.dataHeatBal->TotStmEquip; + state.dataHeatBal->SteamEqObjects(Item).NumOfZones = 1; + state.dataHeatBal->SteamEqObjects(Item).ZoneListActive = false; + state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr = Item1; + } + else if (ZLItem > 0) { + state.dataHeatBal->SteamEqObjects(Item).StartPtr = state.dataHeatBal->TotStmEquip + 1; + state.dataHeatBal->TotStmEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->SteamEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->SteamEqObjects(Item).ZoneListActive = true; + state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr = ZLItem; + } + else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); + state.dataHeatBal->TotStmEquip = 0; + } + + state.dataHeatBal->ZoneSteamEq.allocate(state.dataHeatBal->TotStmEquip); + + if (state.dataHeatBal->TotStmEquip > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumSteamEqStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->SteamEqObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->SteamEqObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneSteamEq(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr = state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr; + } + else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal + ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) + .Name, + state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->SteamEqObjects(Item).Name, + state.dataHeatBal->ZoneSteamEq, + Loop - 1, + state.dataHeatBal->ZoneSteamEq(Loop).Name, + errFlag); + state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } + + state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); } - if (SchMax < 0.0) { + else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); } + ErrorsFound = true; } - } - - // Hot Water equipment design level calculation method. - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - - } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { - if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); - } - } else { + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; + } + if (SchMax < 0.0) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Hot Water Equipment will result."); + } + + // Hot Water equipment design level calculation method. + { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } + } + else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { + if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); + } + } + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } - } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { - if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Hot Water Equipment will result."); + } + else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { + if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Hot Water Equipment will result."); + } } - } else { + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); + ErrorsFound = true; + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } + + } + else { + if (Item1 == 1) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - - } else { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); - ErrorsFound = true; - } } - } - - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneSteamEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneSteamEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * SchMax; - - state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneSteamEq(Loop).FractionLost = IHGNumbers(6); - // FractionConvected is a calculated field - state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent + state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant + - state.dataHeatBal->ZoneSteamEq(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; - } - if (NumAlpha > 4) { - state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory = AlphaName(5); - } else { - state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory = "General"; - } + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneSteamEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneSteamEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * SchMax; + + state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneSteamEq(Loop).FractionLost = IHGNumbers(6); + // FractionConvected is a calculated field + state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent + state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant + + state.dataHeatBal->ZoneSteamEq(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } - if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + if (NumAlpha > 4) { + state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory = AlphaName(5); + } + else { + state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory = "General"; + } - // Object report variables - SetupOutputVariable(state, - "Steam Equipment District Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment District Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - _, - "DistrictHeating", - "InteriorEquipment", - state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).ListMultiplier); + if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - SetupOutputVariable(state, - "Steam Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - SetupOutputVariable(state, - "Steam Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr) = false; + // Object report variables SetupOutputVariable(state, - "Zone Steam Equipment District Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment District Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment District Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment District Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + _, + "DistrictHeating", + "InteriorEquipment", + state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).ListMultiplier); SetupOutputVariable(state, - "Zone Steam Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Steam Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); SetupOutputVariable(state, - "Zone Steam Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - } - - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "SteamEquipment", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - "District Heating Power Level", - "[W]", - state.dataHeatBal->ZoneSteamEq(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneSteamEq(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Process Steam District Heat Design Level", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - "[W]", - state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel); - } // EMS + "Steam Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr) = false; + SetupOutputVariable(state, + "Zone Steam Equipment District Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment District Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr, - "SteamEquipment", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - IntGainTypeOf_SteamEquipment, - &state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate, - &state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate); - - } // Item1 - } // Item - number of hot water statements - } + SetupOutputVariable(state, + "Zone Steam Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Steam Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + } - RepVarSet = true; - CurrentModuleObject = "OtherEquipment"; - state.dataHeatBal->NumOtherEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->OtherEqObjects.allocate(state.dataHeatBal->NumOtherEqStatements); - - state.dataHeatBal->TotOthEquip = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumOtherEqStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->OtherEqObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(3), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(3), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->OtherEqObjects(Item).StartPtr = state.dataHeatBal->TotOthEquip + 1; - ++state.dataHeatBal->TotOthEquip; - state.dataHeatBal->OtherEqObjects(Item).NumOfZones = 1; - state.dataHeatBal->OtherEqObjects(Item).ZoneListActive = false; - state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr = Item1; - } else if (ZLItem > 0) { - state.dataHeatBal->OtherEqObjects(Item).StartPtr = state.dataHeatBal->TotOthEquip + 1; - state.dataHeatBal->TotOthEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->OtherEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->OtherEqObjects(Item).ZoneListActive = true; - state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr = ZLItem; - } else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(3) + "=\"" + - AlphaName(3) + "\" not found."); - ErrorsFound = true; - errFlag = true; + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "SteamEquipment", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + "District Heating Power Level", + "[W]", + state.dataHeatBal->ZoneSteamEq(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneSteamEq(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Process Steam District Heat Design Level", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + "[W]", + state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel); + } // EMS + + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr, + "SteamEquipment", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + IntGainTypeOf_SteamEquipment, + &state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate, + &state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate); + + } // Item1 + } // Item - number of hot water statements } - } - - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotOthEquip = 0; - } - state.dataHeatBal->ZoneOtherEq.allocate(state.dataHeatBal->TotOthEquip); + RepVarSet = true; + CurrentModuleObject = "OtherEquipment"; + state.dataHeatBal->NumOtherEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->OtherEqObjects.allocate(state.dataHeatBal->NumOtherEqStatements); - if (state.dataHeatBal->TotOthEquip > 0) { - Loop = 0; + state.dataHeatBal->TotOthEquip = 0; + errFlag = false; for (Item = 1; Item <= state.dataHeatBal->NumOtherEqStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->OtherEqObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->OtherEqObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneOtherEq(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr = state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr; - } else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->OtherEqObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(3), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(3), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->OtherEqObjects(Item).StartPtr = state.dataHeatBal->TotOthEquip + 1; + ++state.dataHeatBal->TotOthEquip; + state.dataHeatBal->OtherEqObjects(Item).NumOfZones = 1; + state.dataHeatBal->OtherEqObjects(Item).ZoneListActive = false; + state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr = Item1; + } + else if (ZLItem > 0) { + state.dataHeatBal->OtherEqObjects(Item).StartPtr = state.dataHeatBal->TotOthEquip + 1; + state.dataHeatBal->TotOthEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->OtherEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->OtherEqObjects(Item).ZoneListActive = true; + state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr = ZLItem; + } + else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(3) + "=\"" + + AlphaName(3) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); + state.dataHeatBal->TotOthEquip = 0; + } + + state.dataHeatBal->ZoneOtherEq.allocate(state.dataHeatBal->TotOthEquip); + + if (state.dataHeatBal->TotOthEquip > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumOtherEqStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->OtherEqObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->OtherEqObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneOtherEq(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr = state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr; + } + else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->OtherEqObjects(Item).Name, - state.dataHeatBal->ZoneOtherEq, - Loop - 1, - state.dataHeatBal->ZoneOtherEq(Loop).Name, - errFlag); - state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->OtherEqObjects(Item).Name, + state.dataHeatBal->ZoneOtherEq, + Loop - 1, + state.dataHeatBal->ZoneOtherEq(Loop).Name, + errFlag); + state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } + + std::string FuelTypeString(""); + if (AlphaName(2) == "NONE") { + state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType = ExteriorEnergyUse::ExteriorFuelUsage::Unknown; + FuelTypeString = AlphaName(2); + } + else { + ExteriorEnergyUse::ValidateFuelType(state, + state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType, + AlphaName(2), + FuelTypeString, + CurrentModuleObject, + state.dataIPShortCut->cAlphaFieldNames(2), + AlphaName(2)); + if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType == ExteriorEnergyUse::ExteriorFuelUsage::Unknown || + state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType == ExteriorEnergyUse::ExteriorFuelUsage::WaterUse) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + ": invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + + " entered=" + AlphaName(2) + " for " + state.dataIPShortCut->cAlphaFieldNames(1) + '=' + + AlphaName(1)); + ErrorsFound = true; + } + } + + state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(4)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(4)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(4) + " is required."); + } + else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + " entered=" + AlphaName(4)); + } + ErrorsFound = true; + } + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); + } - std::string FuelTypeString(""); - if (AlphaName(2) == "NONE") { - state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType = ExteriorEnergyUse::ExteriorFuelUsage::Unknown; - FuelTypeString = AlphaName(2); - } else { - ExteriorEnergyUse::ValidateFuelType(state, - state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType, - AlphaName(2), - FuelTypeString, - CurrentModuleObject, - state.dataIPShortCut->cAlphaFieldNames(2), - AlphaName(2)); - if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType == ExteriorEnergyUse::ExteriorFuelUsage::Unknown || - state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType == ExteriorEnergyUse::ExteriorFuelUsage::WaterUse) { + // equipment design level calculation method. + unsigned int DesignLevelFieldNumber; + { + auto const equipmentLevel(AlphaName(5)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + DesignLevelFieldNumber = 1; + state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = IHGNumbers(DesignLevelFieldNumber); + if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but that field is blank. 0 Other Equipment will result."); + } + + } + else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { + DesignLevelFieldNumber = 2; + if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr != 0) { + state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = + IHGNumbers(DesignLevelFieldNumber) * + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but Zone Floor Area = 0. 0 Other Equipment will result."); + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but that field is blank. 0 Other Equipment will result."); + } + + } + else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { + DesignLevelFieldNumber = 3; + if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr != 0) { + state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but Total Occupants = 0. 0 Other Equipment will result."); + } + } + if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but that field is blank. 0 Other Equipment will result."); + } + + } + else { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(5) + ", value =" + AlphaName(5)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + ErrorsFound = true; + } + } + } + + // Throw an error if the design level is negative and we have a fuel type + if (state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel < 0.0 && + state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { ShowSevereError(state, - RoutineName + CurrentModuleObject + ": invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + - " entered=" + AlphaName(2) + " for " + state.dataIPShortCut->cAlphaFieldNames(1) + '=' + - AlphaName(1)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + " is not allowed to be negative"); + ShowContinueError(state, "... when a fuel type of " + FuelTypeString + " is specified."); ErrorsFound = true; } - } - state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(4)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(4)) { + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneOtherEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneOtherEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * SchMax; + + state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneOtherEq(Loop).FractionLost = IHGNumbers(6); + + if ((NumNumber == 7) || (!state.dataIPShortCut->lNumericFieldBlanks(7))) { + state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor = IHGNumbers(7); + } + if (state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(4) + " is required."); - } else { + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(7), + IHGNumbers(7))); + ErrorsFound = true; + } + if (state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor > 4.0e-7) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + " entered=" + AlphaName(4)); + format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(7), + IHGNumbers(7))); + ErrorsFound = true; + } + + // FractionConvected is a calculated field + state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent + state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant + + state.dataHeatBal->ZoneOtherEq(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } + + if (NumAlpha > 5) { + state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory = AlphaName(6); + } + else { + state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory = "General"; + } + + if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + + // Object report variables + if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { + SetupOutputVariable(state, + "Other Equipment " + FuelTypeString + " Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment " + FuelTypeString + " Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + _, + FuelTypeString, + "InteriorEquipment", + state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).ListMultiplier); + } + + SetupOutputVariable(state, + "Other Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr) = false; + + if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { + SetupOutputVariable(state, + "Zone Other Equipment " + FuelTypeString + " Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment " + FuelTypeString + " Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + } + + SetupOutputVariable(state, + "Zone Other Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Other Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + } + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "OtherEquipment", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + "Power Level", + "[W]", + state.dataHeatBal->ZoneOtherEq(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneOtherEq(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Other Equipment Design Level", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + "[W]", + state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel); + } // EMS + + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr, + "OtherEquipment", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + IntGainTypeOf_OtherEquipment, + &state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate, + &state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate); + + } // Item1 + } // Item - number of other equipment statements + } + + RepVarSet = true; + CurrentModuleObject = "ElectricEquipment:ITE:AirCooled"; + state.dataHeatBal->NumZoneITEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + errFlag = false; + + // Note that this object type does not support ZoneList due to node names in input fields + state.dataHeatBal->ZoneITEq.allocate(state.dataHeatBal->NumZoneITEqStatements); + + if (state.dataHeatBal->NumZoneITEqStatements > 0) { + Loop = 0; + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Loop, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + state.dataHeatBal->ZoneITEq(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneITEq(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + + // IT equipment design level calculation method. + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = false; + } + else { + if (UtilityRoutines::SameString(AlphaName(3), "FlowFromSystem")) { + state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = false; + } + else if (UtilityRoutines::SameString(AlphaName(3), "FlowControlWithApproachTemperatures")) { + state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = true; + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE = true; + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).NoHeatToReturnAir = false; + } + else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\": invalid calculation method: " + AlphaName(3)); + ErrorsFound = true; } - ErrorsFound = true; - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); } - // equipment design level calculation method. - unsigned int DesignLevelFieldNumber; { - auto const equipmentLevel(AlphaName(5)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - DesignLevelFieldNumber = 1; - state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = IHGNumbers(DesignLevelFieldNumber); - if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "WATTS/UNIT") { + state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower = IHGNumbers(1) * IHGNumbers(2); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but that field is blank. 0 Other Equipment will result."); - } - - } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { - DesignLevelFieldNumber = 2; - if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr != 0) { - state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = - IHGNumbers(DesignLevelFieldNumber) * - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but Zone Floor Area = 0. 0 Other Equipment will result."); - } + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 IT Equipment will result."); } - if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but that field is blank. 0 Other Equipment will result."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 IT Equipment will result."); } - } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { - DesignLevelFieldNumber = 3; - if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr != 0) { - state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but Total Occupants = 0. 0 Other Equipment will result."); + } + else if (equipmentLevel == "WATTS/AREA") { + if (state.dataHeatBal->ZoneITEq(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but Zone Floor Area = 0. 0 IT Equipment will result."); + } + } + else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); + ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but that field is blank. 0 Other Equipment will result."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 IT Equipment will result."); } - } else { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(5) + ", value =" + AlphaName(5)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); - ErrorsFound = true; - } + } + else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"Watts/Unit\" or \"Watts/Area\"."); + ErrorsFound = true; } } - // Throw an error if the design level is negative and we have a fuel type - if (state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel < 0.0 && - state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + " is not allowed to be negative"); - ShowContinueError(state, "... when a fuel type of " + FuelTypeString + " is specified."); - ErrorsFound = true; - } - - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneOtherEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneOtherEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * SchMax; - - state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneOtherEq(Loop).FractionLost = IHGNumbers(6); - - if ((NumNumber == 7) || (!state.dataIPShortCut->lNumericFieldBlanks(7))) { - state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor = IHGNumbers(7); + if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { + state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } - if (state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor < 0.0) { - ShowSevereError(state, - format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(7), - IHGNumbers(7))); - ErrorsFound = true; + else { + state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr = GetScheduleIndex(state, AlphaName(5)); } - if (state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor > 4.0e-7) { + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr == 0) { ShowSevereError(state, - format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(7), - IHGNumbers(7))); - ErrorsFound = true; - } - - // FractionConvected is a calculated field - state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent + state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant + - state.dataHeatBal->ZoneOtherEq(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(5) + " entered=" + AlphaName(5)); ErrorsFound = true; } - - if (NumAlpha > 5) { - state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory = AlphaName(6); - } else { - state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory = "General"; + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + ", minimum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); + ErrorsFound = true; + } + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + ", maximum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); + ErrorsFound = true; + } + } } - if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - - // Object report variables - if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { - SetupOutputVariable(state, - "Other Equipment " + FuelTypeString + " Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment " + FuelTypeString + " Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - _, - FuelTypeString, - "InteriorEquipment", - state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).ListMultiplier); + if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { + state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } - - SetupOutputVariable(state, - "Other Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - SetupOutputVariable(state, - "Other Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr) = false; - - if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { - SetupOutputVariable(state, - "Zone Other Equipment " + FuelTypeString + " Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment " + FuelTypeString + " Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - } - - SetupOutputVariable(state, - "Zone Other Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + else { + state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr = GetScheduleIndex(state, AlphaName(6)); } - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "OtherEquipment", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - "Power Level", - "[W]", - state.dataHeatBal->ZoneOtherEq(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneOtherEq(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Other Equipment Design Level", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - "[W]", - state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel); - } // EMS - - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr, - "OtherEquipment", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - IntGainTypeOf_OtherEquipment, - &state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate, - &state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate); - - } // Item1 - } // Item - number of other equipment statements - } - - RepVarSet = true; - CurrentModuleObject = "ElectricEquipment:ITE:AirCooled"; - state.dataHeatBal->NumZoneITEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - errFlag = false; - - // Note that this object type does not support ZoneList due to node names in input fields - state.dataHeatBal->ZoneITEq.allocate(state.dataHeatBal->NumZoneITEqStatements); - - if (state.dataHeatBal->NumZoneITEqStatements > 0) { - Loop = 0; - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Loop, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - state.dataHeatBal->ZoneITEq(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneITEq(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - - // IT equipment design level calculation method. - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = false; - } else { - if (UtilityRoutines::SameString(AlphaName(3), "FlowFromSystem")) { - state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = false; - } else if (UtilityRoutines::SameString(AlphaName(3), "FlowControlWithApproachTemperatures")) { - state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = true; - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE = true; - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).NoHeatToReturnAir = false; - } else { + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr == 0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\": invalid calculation method: " + AlphaName(3)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(6) + " entered=" + AlphaName(6)); ErrorsFound = true; } - } - - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "WATTS/UNIT") { - state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower = IHGNumbers(1) * IHGNumbers(2); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 IT Equipment will result."); - } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 IT Equipment will result."); - } - - } else if (equipmentLevel == "WATTS/AREA") { - if (state.dataHeatBal->ZoneITEq(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but Zone Floor Area = 0. 0 IT Equipment will result."); - } - } else { + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(6) + ", minimum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMin)); + ErrorsFound = true; + } + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(6) + ", maximum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMax)); ErrorsFound = true; } } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 IT Equipment will result."); - } + } - } else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"Watts/Unit\" or \"Watts/Area\"."); + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneITEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower * SchMin; + state.dataHeatBal->ZoneITEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower * SchMax; + + state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac = IHGNumbers(4); + state.dataHeatBal->ZoneITEq(Loop).DesignFanPower = + state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; + state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower = + (1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac) * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; + state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate = IHGNumbers(5) * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; + state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn = IHGNumbers(6); + state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac = IHGNumbers(7); + state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency = IHGNumbers(8); + state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac = IHGNumbers(9); + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp = IHGNumbers(10); + state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTemp = IHGNumbers(11); + + bool hasSupplyApproachTemp = !state.dataIPShortCut->lNumericFieldBlanks(10); + bool hasReturnApproachTemp = !state.dataIPShortCut->lNumericFieldBlanks(11); + + // Performance curves + state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve = GetCurveIndex(state, AlphaName(7)); + if (state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve == 0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7)); ErrorsFound = true; } - } - if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { - state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; - } else { - state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr = GetScheduleIndex(state, AlphaName(5)); - } - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr == 0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(5) + " entered=" + AlphaName(5)); - ErrorsFound = true; - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + ", minimum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); - ErrorsFound = true; - } - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + ", maximum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); - ErrorsFound = true; - } + state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve = GetCurveIndex(state, AlphaName(8)); + if (state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve == 0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(8) + '=' + AlphaName(8)); + ErrorsFound = true; } - } - if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { - state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; - } else { - state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr = GetScheduleIndex(state, AlphaName(6)); - } - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr == 0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(6) + " entered=" + AlphaName(6)); - ErrorsFound = true; - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(6) + ", minimum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMin)); + state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve = GetCurveIndex(state, AlphaName(9)); + if (state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve == 0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(9) + '=' + AlphaName(9)); + ErrorsFound = true; + } + + if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { + // If this field isn't blank, it must point to a valid curve + state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve = GetCurveIndex(state, AlphaName(15)); + if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve == 0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(15) + '=' + AlphaName(15)); ErrorsFound = true; } - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(6) + ", maximum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMax)); + } + else { + // If this curve is left blank, then the curve is assumed to always equal 1.0. + state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve = 0; + } + + if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { + // If this field isn't blank, it must point to a valid curve + state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve = GetCurveIndex(state, AlphaName(16)); + if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve == 0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(16) + '=' + AlphaName(16)); ErrorsFound = true; } } - } - - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneITEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower * SchMin; - state.dataHeatBal->ZoneITEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower * SchMax; - - state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac = IHGNumbers(4); - state.dataHeatBal->ZoneITEq(Loop).DesignFanPower = - state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; - state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower = - (1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac) * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; - state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate = IHGNumbers(5) * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; - state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn = IHGNumbers(6); - state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac = IHGNumbers(7); - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency = IHGNumbers(8); - state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac = IHGNumbers(9); - state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp = IHGNumbers(10); - state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTemp = IHGNumbers(11); - - bool hasSupplyApproachTemp = !state.dataIPShortCut->lNumericFieldBlanks(10); - bool hasReturnApproachTemp = !state.dataIPShortCut->lNumericFieldBlanks(11); - - // Performance curves - state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve = GetCurveIndex(state, AlphaName(7)); - if (state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve == 0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7)); - ErrorsFound = true; - } - - state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve = GetCurveIndex(state, AlphaName(8)); - if (state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve == 0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(8) + '=' + AlphaName(8)); - ErrorsFound = true; - } - - state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve = GetCurveIndex(state, AlphaName(9)); - if (state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve == 0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(9) + '=' + AlphaName(9)); - ErrorsFound = true; - } - - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - // If this field isn't blank, it must point to a valid curve - state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve = GetCurveIndex(state, AlphaName(15)); - if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve == 0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(15) + '=' + AlphaName(15)); - ErrorsFound = true; + else { + // If this curve is left blank, then the curve is assumed to always equal 1.0. + state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve = 0; } - } else { - // If this curve is left blank, then the curve is assumed to always equal 1.0. - state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve = 0; - } - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - // If this field isn't blank, it must point to a valid curve - state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve = GetCurveIndex(state, AlphaName(16)); - if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve == 0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(16) + '=' + AlphaName(16)); - ErrorsFound = true; + // Environmental class + if (UtilityRoutines::SameString(AlphaName(10), "None")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassNone; } - } else { - // If this curve is left blank, then the curve is assumed to always equal 1.0. - state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve = 0; - } - - // Environmental class - if (UtilityRoutines::SameString(AlphaName(10), "None")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassNone; - } else if (UtilityRoutines::SameString(AlphaName(10), "A1")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA1; - } else if (UtilityRoutines::SameString(AlphaName(10), "A2")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA2; - } else if (UtilityRoutines::SameString(AlphaName(10), "A3")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA3; - } else if (UtilityRoutines::SameString(AlphaName(10), "A4")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA4; - } else if (UtilityRoutines::SameString(AlphaName(10), "B")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassB; - } else if (UtilityRoutines::SameString(AlphaName(10), "C")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassC; - } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(10) + '=' + AlphaName(10)); - ShowContinueError(state, "Valid entries are None, A1, A2, A3, A4, B or C."); - ErrorsFound = true; - } - - // Air and supply inlet connections - if (UtilityRoutines::SameString(AlphaName(11), "AdjustedSupply")) { - state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletAdjustedSupply; - } else if (UtilityRoutines::SameString(AlphaName(11), "ZoneAirNode")) { - state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletZoneAirNode; - } else if (UtilityRoutines::SameString(AlphaName(11), "RoomAirModel")) { - // ZoneITEq( Loop ).AirConnectionType = ITEInletRoomAirModel; - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + - "Air Inlet Connection Type = RoomAirModel is not implemented yet, using ZoneAirNode"); - state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletZoneAirNode; - } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(11) + '=' + AlphaName(11)); - ShowContinueError(state, "Valid entries are AdjustedSupply, ZoneAirNode, or RoomAirModel."); - ErrorsFound = true; - } - if (state.dataIPShortCut->lAlphaFieldBlanks(14)) { - if (state.dataHeatBal->ZoneITEq(Loop).AirConnectionType == ITEInletAdjustedSupply) { + else if (UtilityRoutines::SameString(AlphaName(10), "A1")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA1; + } + else if (UtilityRoutines::SameString(AlphaName(10), "A2")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA2; + } + else if (UtilityRoutines::SameString(AlphaName(10), "A3")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA3; + } + else if (UtilityRoutines::SameString(AlphaName(10), "A4")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA4; + } + else if (UtilityRoutines::SameString(AlphaName(10), "B")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassB; + } + else if (UtilityRoutines::SameString(AlphaName(10), "C")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassC; + } + else { ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); - ShowContinueError(state, - "For " + state.dataIPShortCut->cAlphaFieldNames(11) + "= AdjustedSupply, " + - state.dataIPShortCut->cAlphaFieldNames(14) + " is required, but this field is blank."); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(10) + '=' + AlphaName(10)); + ShowContinueError(state, "Valid entries are None, A1, A2, A3, A4, B or C."); ErrorsFound = true; - } else if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + } + + // Air and supply inlet connections + if (UtilityRoutines::SameString(AlphaName(11), "AdjustedSupply")) { + state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletAdjustedSupply; + } + else if (UtilityRoutines::SameString(AlphaName(11), "ZoneAirNode")) { + state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletZoneAirNode; + } + else if (UtilityRoutines::SameString(AlphaName(11), "RoomAirModel")) { + // ZoneITEq( Loop ).AirConnectionType = ITEInletRoomAirModel; + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + + "Air Inlet Connection Type = RoomAirModel is not implemented yet, using ZoneAirNode"); + state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletZoneAirNode; + } + else { ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); - ShowContinueError(state, - "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, " + - state.dataIPShortCut->cAlphaFieldNames(14) + " is required, but this field is blank."); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(11) + '=' + AlphaName(11)); + ShowContinueError(state, "Valid entries are AdjustedSupply, ZoneAirNode, or RoomAirModel."); ErrorsFound = true; } - } else { - state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum = GetOnlySingleNode(state, - AlphaName(14), - ErrorsFound, - CurrentModuleObject, - AlphaName(1), - DataLoopNode::NodeFluidType::Air, - DataLoopNode::NodeConnectionType::Sensor, - 1, - ObjectIsNotParent); - } - - // check supply air node for matches with zone equipment supply air node - int zoneEqIndex = - DataZoneEquipment::GetControlledZoneIndex(state, state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - auto itStart = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.begin(); - auto itEnd = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.end(); - auto key = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum; - bool supplyNodeFound = false; - if (std::find(itStart, itEnd, key) != itEnd) { - supplyNodeFound = true; - } - - if (state.dataHeatBal->ZoneITEq(Loop).AirConnectionType == ITEInletAdjustedSupply && !supplyNodeFound) { - // supply air node must match zone equipment supply air node for these conditions - ShowSevereError(state, RoutineName + ": ElectricEquipment:ITE:AirCooled " + state.dataHeatBal->ZoneITEq(Loop).Name); - ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified."); - ErrorsFound = true; - } else if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps && !supplyNodeFound) { - // supply air node must match zone equipment supply air node for these conditions - ShowSevereError(state, RoutineName + ": ElectricEquipment:ITE:AirCooled " + state.dataHeatBal->ZoneITEq(Loop).Name); - ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified."); - ErrorsFound = true; - } else if (state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum != 0 && !supplyNodeFound) { - // the given supply air node does not match any zone equipment supply air nodes - ShowWarningError(state, - CurrentModuleObject + "name: '" + AlphaName(1) + ". " + "Supply Air Node Name '" + AlphaName(14) + - "' does not match any ZoneHVAC:EquipmentConnections objects."); - } - - // End-Use subcategories - if (NumAlpha > 16) { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU = AlphaName(17); - } else { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU = "ITE-CPU"; - } - - if (NumAlpha > 17) { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan = AlphaName(18); - } else { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan = "ITE-Fans"; - } - if (state.dataHeatBal->ZoneITEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - - if (NumAlpha > 18) { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS = AlphaName(19); - } else { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS = "ITE-UPS"; - } - if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - if (!state.dataIPShortCut->lAlphaFieldBlanks(20)) { - state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch = GetScheduleIndex(state, AlphaName(20)); - if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch == 0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(20) + " entered=" + AlphaName(20)); + if (state.dataIPShortCut->lAlphaFieldBlanks(14)) { + if (state.dataHeatBal->ZoneITEq(Loop).AirConnectionType == ITEInletAdjustedSupply) { + ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); + ShowContinueError(state, + "For " + state.dataIPShortCut->cAlphaFieldNames(11) + "= AdjustedSupply, " + + state.dataIPShortCut->cAlphaFieldNames(14) + " is required, but this field is blank."); ErrorsFound = true; } - } else { - if (!hasSupplyApproachTemp) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + else if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); ShowContinueError(state, - "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, either " + - state.dataIPShortCut->cNumericFieldNames(10) + " or " + state.dataIPShortCut->cAlphaFieldNames(20) + - " is required, but both are left blank."); + "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, " + + state.dataIPShortCut->cAlphaFieldNames(14) + " is required, but this field is blank."); ErrorsFound = true; } } + else { + state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum = GetOnlySingleNode(state, + AlphaName(14), + ErrorsFound, + CurrentModuleObject, + AlphaName(1), + DataLoopNode::NodeFluidType::Air, + DataLoopNode::NodeConnectionType::Sensor, + 1, + ObjectIsNotParent); + } - if (!state.dataIPShortCut->lAlphaFieldBlanks(21)) { - state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTempSch = GetScheduleIndex(state, AlphaName(21)); - if (state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTempSch == 0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(20) + " entered=" + AlphaName(20)); - ErrorsFound = true; - } - } else { - if (!hasReturnApproachTemp) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, - "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, either " + - state.dataIPShortCut->cNumericFieldNames(11) + " or " + state.dataIPShortCut->cAlphaFieldNames(21) + - " is required, but both are left blank."); - ErrorsFound = true; - } + // check supply air node for matches with zone equipment supply air node + int zoneEqIndex = + DataZoneEquipment::GetControlledZoneIndex(state, state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + auto itStart = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.begin(); + auto itEnd = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.end(); + auto key = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum; + bool supplyNodeFound = false; + if (std::find(itStart, itEnd, key) != itEnd) { + supplyNodeFound = true; } - } - if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - Real64 TAirInSizing = 0.0; - // Set the TAirInSizing to the maximun setpoint value to do sizing based on the maximum fan and cpu power of the ite object - SetPointManager::GetSetPointManagerInputData(state, ErrorsFound); - for (int SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { - if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum == Loop) { - TAirInSizing = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp; - } + if (state.dataHeatBal->ZoneITEq(Loop).AirConnectionType == ITEInletAdjustedSupply && !supplyNodeFound) { + // supply air node must match zone equipment supply air node for these conditions + ShowSevereError(state, RoutineName + ": ElectricEquipment:ITE:AirCooled " + state.dataHeatBal->ZoneITEq(Loop).Name); + ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified."); + ErrorsFound = true; + } + else if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps && !supplyNodeFound) { + // supply air node must match zone equipment supply air node for these conditions + ShowSevereError(state, RoutineName + ": ElectricEquipment:ITE:AirCooled " + state.dataHeatBal->ZoneITEq(Loop).Name); + ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified."); + ErrorsFound = true; + } + else if (state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum != 0 && !supplyNodeFound) { + // the given supply air node does not match any zone equipment supply air nodes + ShowWarningError(state, + CurrentModuleObject + "name: '" + AlphaName(1) + ". " + "Supply Air Node Name '" + AlphaName(14) + + "' does not match any ZoneHVAC:EquipmentConnections objects."); } - state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn = max(TAirInSizing, state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn); - } + // End-Use subcategories + if (NumAlpha > 16) { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU = AlphaName(17); + } + else { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU = "ITE-CPU"; + } - // Object report variables - SetupOutputVariable(state, - "ITE CPU Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).CPUPower, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Fan Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).FanPower, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE UPS Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).UPSPower, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE CPU Electricity Rate at Design Inlet Conditions", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Fan Electricity Rate at Design Inlet Conditions", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE UPS Heat Gain to Zone Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Total Heat Gain to Zone Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + if (NumAlpha > 17) { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan = AlphaName(18); + } + else { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan = "ITE-Fans"; + } + if (state.dataHeatBal->ZoneITEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + + if (NumAlpha > 18) { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS = AlphaName(19); + } + else { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS = "ITE-UPS"; + } + if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + if (!state.dataIPShortCut->lAlphaFieldBlanks(20)) { + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch = GetScheduleIndex(state, AlphaName(20)); + if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch == 0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(20) + " entered=" + AlphaName(20)); + ErrorsFound = true; + } + } + else { + if (!hasSupplyApproachTemp) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, + "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, either " + + state.dataIPShortCut->cNumericFieldNames(10) + " or " + state.dataIPShortCut->cAlphaFieldNames(20) + + " is required, but both are left blank."); + ErrorsFound = true; + } + } - SetupOutputVariable(state, - "ITE CPU Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).CPUConsumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); - SetupOutputVariable(state, - "ITE Fan Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).FanConsumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); - SetupOutputVariable(state, - "ITE UPS Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).UPSConsumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); - SetupOutputVariable(state, - "ITE CPU Electricity Energy at Design Inlet Conditions", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Fan Electricity Energy at Design Inlet Conditions", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE UPS Heat Gain to Zone Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Total Heat Gain to Zone Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + if (!state.dataIPShortCut->lAlphaFieldBlanks(21)) { + state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTempSch = GetScheduleIndex(state, AlphaName(21)); + if (state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTempSch == 0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(20) + " entered=" + AlphaName(20)); + ErrorsFound = true; + } + } + else { + if (!hasReturnApproachTemp) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, + "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, either " + + state.dataIPShortCut->cNumericFieldNames(11) + " or " + state.dataIPShortCut->cAlphaFieldNames(21) + + " is required, but both are left blank."); + ErrorsFound = true; + } + } + } - SetupOutputVariable(state, - "ITE Standard Density Air Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Current Density Air Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Mass Flow Rate", - OutputProcessor::Unit::kg_s, - state.dataHeatBal->ZoneITEq(Loop).AirMassFlow, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature", - OutputProcessor::Unit::C, - state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature", - OutputProcessor::Unit::C, - state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity", - OutputProcessor::Unit::Perc, - state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Outlet Dry-Bulb Temperature", - OutputProcessor::Unit::C, - state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - if (state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum != 0) { - SetupOutputVariable(state, - "ITE Supply Heat Index", - OutputProcessor::Unit::None, - state.dataHeatBal->ZoneITEq(Loop).SHI, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - } - SetupOutputVariable(state, - "ITE Air Inlet Operating Range Exceeded Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature Difference Above Operating Range", - OutputProcessor::Unit::deltaC, - state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature Difference Below Operating Range", - OutputProcessor::Unit::deltaC, - state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature Difference Above Operating Range", - OutputProcessor::Unit::deltaC, - state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature Difference Below Operating Range", - OutputProcessor::Unit::deltaC, - state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity Difference Above Operating Range", - OutputProcessor::Unit::Perc, - state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity Difference Below Operating Range", - OutputProcessor::Unit::Perc, - state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + Real64 TAirInSizing = 0.0; + // Set the TAirInSizing to the maximun setpoint value to do sizing based on the maximum fan and cpu power of the ite object + SetPointManager::GetSetPointManagerInputData(state, ErrorsFound); + for (int SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { + if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum == Loop) { + TAirInSizing = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp; + } + } - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneITEq(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneITEq(Loop).ZonePtr) = false; - SetupOutputVariable(state, - "Zone ITE CPU Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn = max(TAirInSizing, state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn); + } + + // Object report variables SetupOutputVariable(state, - "Zone ITE Fan Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE CPU Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).CPUPower, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE UPS Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Fan Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).FanPower, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE CPU Electricity Rate at Design Inlet Conditions", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUPowerAtDesign, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE UPS Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).UPSPower, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Fan Electricity Rate at Design Inlet Conditions", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanPowerAtDesign, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE CPU Electricity Rate at Design Inlet Conditions", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE UPS Heat Gain to Zone Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSGainRateToZone, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Fan Electricity Rate at Design Inlet Conditions", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Total Heat Gain to Zone Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqConGainRateToZone, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE UPS Heat Gain to Zone Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Adjusted Return Air Temperature", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEAdjReturnTemp, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Total Heat Gain to Zone Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE CPU Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUConsumption, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE CPU Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).CPUConsumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); SetupOutputVariable(state, - "Zone ITE Fan Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanConsumption, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Fan Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).FanConsumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); SetupOutputVariable(state, - "Zone ITE UPS Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSConsumption, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE UPS Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).UPSConsumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); SetupOutputVariable(state, - "Zone ITE CPU Electricity Energy at Design Inlet Conditions", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUEnergyAtDesign, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE CPU Electricity Energy at Design Inlet Conditions", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Fan Electricity Energy at Design Inlet Conditions", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanEnergyAtDesign, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Fan Electricity Energy at Design Inlet Conditions", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE UPS Heat Gain to Zone Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSGainEnergyToZone, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE UPS Heat Gain to Zone Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Total Heat Gain to Zone Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqConGainEnergyToZone, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Total Heat Gain to Zone Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Standard Density Air Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqAirVolFlowStdDensity, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Standard Density Air Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Air Mass Flow Rate", - OutputProcessor::Unit::kg_s, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqAirMassFlow, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Current Density Air Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Average Supply Heat Index", - OutputProcessor::Unit::None, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqSHI, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Air Mass Flow Rate", + OutputProcessor::Unit::kg_s, + state.dataHeatBal->ZoneITEq(Loop).AirMassFlow, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Any Air Inlet Operating Range Exceeded Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeOutOfOperRange, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Air Inlet Dry-Bulb Temperature", + OutputProcessor::Unit::C, + state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Any Air Inlet Dry-Bulb Temperature Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveDryBulbT, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Air Inlet Dewpoint Temperature", + OutputProcessor::Unit::C, + state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Any Air Inlet Dry-Bulb Temperature Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowDryBulbT, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Air Inlet Relative Humidity", + OutputProcessor::Unit::Perc, + state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Any Air Inlet Dewpoint Temperature Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveDewpointT, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Air Outlet Dry-Bulb Temperature", + OutputProcessor::Unit::C, + state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + if (state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum != 0) { + SetupOutputVariable(state, + "ITE Supply Heat Index", + OutputProcessor::Unit::None, + state.dataHeatBal->ZoneITEq(Loop).SHI, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + } SetupOutputVariable(state, - "Zone ITE Any Air Inlet Dewpoint Temperature Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowDewpointT, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Air Inlet Operating Range Exceeded Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Any Air Inlet Relative Humidity Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveRH, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + "ITE Air Inlet Dry-Bulb Temperature Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); SetupOutputVariable(state, - "Zone ITE Any Air Inlet Relative Humidity Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowRH, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - } - - // MJW - EMS Not in place yet - // if ( AnyEnergyManagementSystemInModel ) { - // SetupEMSActuator( "ElectricEquipment", ZoneITEq( Loop ).Name, "Electric Power Level", "[W]", ZoneITEq( Loop - // ).EMSZoneEquipOverrideOn, ZoneITEq( Loop ).EMSEquipPower ); SetupEMSInternalVariable( "Plug and Process Power Design Level", - // ZoneITEq( Loop ).Name, "[W]", ZoneITEq( Loop ).DesignTotalPower ); } // EMS - - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneITEq(Loop).ZonePtr, - "ElectricEquipment:ITE:AirCooled", - state.dataHeatBal->ZoneITEq(Loop).Name, - IntGainTypeOf_ElectricEquipmentITEAirCooled, - &state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone); - - } // Item - Number of ZoneITEq objects - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE && - (!state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\": invalid calculation method " + AlphaName(3) + - " for Zone: " + AlphaName(2)); - ShowContinueError(state, "...Multiple flow control methods apply to one zone. "); - ErrorsFound = true; - } - } - } // Check on number of ZoneITEq + "ITE Air Inlet Dry-Bulb Temperature Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dewpoint Temperature Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dewpoint Temperature Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Relative Humidity Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Relative Humidity Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dry-Bulb Temperature Difference Above Operating Range", + OutputProcessor::Unit::deltaC, + state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dry-Bulb Temperature Difference Below Operating Range", + OutputProcessor::Unit::deltaC, + state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dewpoint Temperature Difference Above Operating Range", + OutputProcessor::Unit::deltaC, + state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dewpoint Temperature Difference Below Operating Range", + OutputProcessor::Unit::deltaC, + state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Relative Humidity Difference Above Operating Range", + OutputProcessor::Unit::Perc, + state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Relative Humidity Difference Below Operating Range", + OutputProcessor::Unit::Perc, + state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneITEq(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneITEq(Loop).ZonePtr) = false; + SetupOutputVariable(state, + "Zone ITE CPU Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Fan Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE UPS Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE CPU Electricity Rate at Design Inlet Conditions", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUPowerAtDesign, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Fan Electricity Rate at Design Inlet Conditions", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanPowerAtDesign, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE UPS Heat Gain to Zone Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSGainRateToZone, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Total Heat Gain to Zone Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqConGainRateToZone, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Adjusted Return Air Temperature", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEAdjReturnTemp, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - RepVarSet = true; - CurrentModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled"; - state.dataHeatBal->TotBBHeat = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->ZoneBBHeat.allocate(state.dataHeatBal->TotBBHeat); + SetupOutputVariable(state, + "Zone ITE CPU Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUConsumption, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Fan Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanConsumption, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE UPS Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSConsumption, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE CPU Electricity Energy at Design Inlet Conditions", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUEnergyAtDesign, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Fan Electricity Energy at Design Inlet Conditions", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanEnergyAtDesign, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE UPS Heat Gain to Zone Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSGainEnergyToZone, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Total Heat Gain to Zone Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqConGainEnergyToZone, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { - AlphaName = ""; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Loop, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->ZoneBBHeat(Loop).Name = AlphaName(1); - - state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - if (state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr == 0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(2) + " entered=" + AlphaName(2)); - ErrorsFound = true; - } + SetupOutputVariable(state, + "Zone ITE Standard Density Air Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqAirVolFlowStdDensity, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Air Mass Flow Rate", + OutputProcessor::Unit::kg_s, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqAirMassFlow, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Average Supply Heat Index", + OutputProcessor::Unit::None, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqSHI, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Any Air Inlet Operating Range Exceeded Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeOutOfOperRange, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Any Air Inlet Dry-Bulb Temperature Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveDryBulbT, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Any Air Inlet Dry-Bulb Temperature Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowDryBulbT, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Any Air Inlet Dewpoint Temperature Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveDewpointT, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Any Air Inlet Dewpoint Temperature Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowDewpointT, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Any Air Inlet Relative Humidity Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveRH, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone ITE Any Air Inlet Relative Humidity Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowRH, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + } - state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - if (state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + state.dataIPShortCut->cAlphaFieldNames(3) + - " is required."); - } else { + // MJW - EMS Not in place yet + // if ( AnyEnergyManagementSystemInModel ) { + // SetupEMSActuator( "ElectricEquipment", ZoneITEq( Loop ).Name, "Electric Power Level", "[W]", ZoneITEq( Loop + // ).EMSZoneEquipOverrideOn, ZoneITEq( Loop ).EMSEquipPower ); SetupEMSInternalVariable( "Plug and Process Power Design Level", + // ZoneITEq( Loop ).Name, "[W]", ZoneITEq( Loop ).DesignTotalPower ); } // EMS + + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneITEq(Loop).ZonePtr, + "ElectricEquipment:ITE:AirCooled", + state.dataHeatBal->ZoneITEq(Loop).Name, + IntGainTypeOf_ElectricEquipmentITEAirCooled, + &state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone); + + } // Item - Number of ZoneITEq objects + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE && + (!state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\": invalid calculation method " + AlphaName(3) + + " for Zone: " + AlphaName(2)); + ShowContinueError(state, "...Multiple flow control methods apply to one zone. "); + ErrorsFound = true; + } + } + } // Check on number of ZoneITEq + + RepVarSet = true; + CurrentModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled"; + state.dataHeatBal->TotBBHeat = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->ZoneBBHeat.allocate(state.dataHeatBal->TotBBHeat); + + for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { + AlphaName = ""; + IHGNumbers = 0.0; + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Loop, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->ZoneBBHeat(Loop).Name = AlphaName(1); + + state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + if (state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr == 0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(2) + " entered=" + AlphaName(2)); + ErrorsFound = true; } - ErrorsFound = true; - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { + + state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + if (state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + state.dataIPShortCut->cAlphaFieldNames(3) + + " is required."); } - if (SchMax < 0.0) { + else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + } + ErrorsFound = true; + } + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; + } + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; + } } } - } - - if (NumAlpha > 3) { - state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory = AlphaName(4); - } else { - state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory = "General"; - } - - state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature = IHGNumbers(1); - state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature = IHGNumbers(2); - state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature = IHGNumbers(3); - state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature = IHGNumbers(4); - state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected = 1.0 - state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant; - if (state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; - } - if (state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + if (NumAlpha > 3) { + state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory = AlphaName(4); + } + else { + state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory = "General"; + } - // Object report variables - SetupOutputVariable(state, - "Baseboard Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneBBHeat(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneBBHeat(Loop).Name); - SetupOutputVariable(state, - "Baseboard Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneBBHeat(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).ListMultiplier); + state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature = IHGNumbers(1); + state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature = IHGNumbers(2); + state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature = IHGNumbers(3); + state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature = IHGNumbers(4); + state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected = 1.0 - state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant; + if (state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } - SetupOutputVariable(state, - "Baseboard Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneBBHeat(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneBBHeat(Loop).Name); - SetupOutputVariable(state, - "Baseboard Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneBBHeat(Loop).Name); - SetupOutputVariable(state, - "Baseboard Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneBBHeat(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneBBHeat(Loop).Name); - SetupOutputVariable(state, - "Baseboard Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneBBHeat(Loop).Name); - SetupOutputVariable(state, - "Baseboard Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneBBHeat(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneBBHeat(Loop).Name); - SetupOutputVariable(state, - "Baseboard Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneBBHeat(Loop).Name); + if (state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr) = false; + // Object report variables SetupOutputVariable(state, - "Zone Baseboard Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + "Baseboard Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneBBHeat(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneBBHeat(Loop).Name); SetupOutputVariable(state, - "Zone Baseboard Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatElecCons, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + "Baseboard Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneBBHeat(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).ListMultiplier); SetupOutputVariable(state, - "Zone Baseboard Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + "Baseboard Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneBBHeat(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneBBHeat(Loop).Name); SetupOutputVariable(state, - "Zone Baseboard Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + "Baseboard Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneBBHeat(Loop).Name); SetupOutputVariable(state, - "Zone Baseboard Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + "Baseboard Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneBBHeat(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneBBHeat(Loop).Name); SetupOutputVariable(state, - "Zone Baseboard Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + "Baseboard Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneBBHeat(Loop).Name); SetupOutputVariable(state, - "Zone Baseboard Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + "Baseboard Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneBBHeat(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneBBHeat(Loop).Name); SetupOutputVariable(state, - "Zone Baseboard Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - } + "Baseboard Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneBBHeat(Loop).Name); - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "ZoneBaseboard:OutdoorTemperatureControlled", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - "Power Level", - "[W]", - state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardOverrideOn, - state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardPower); - SetupEMSInternalVariable(state, - "Simple Zone Baseboard Capacity At Low Temperature", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - "[W]", - state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature); - SetupEMSInternalVariable(state, - "Simple Zone Baseboard Capacity At High Temperature", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - "[W]", - state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature); - } // EMS - - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr, - "ZoneBaseboard:OutdoorTemperatureControlled", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - IntGainTypeOf_ZoneBaseboardOutdoorTemperatureControlled, - &state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate); - } + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr) = false; + SetupOutputVariable(state, + "Zone Baseboard Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Baseboard Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatElecCons, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - RepVarSet = true; - CurrentModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide"; - state.dataHeatBal->TotCO2Gen = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->ZoneCO2Gen.allocate(state.dataHeatBal->TotCO2Gen); + SetupOutputVariable(state, + "Zone Baseboard Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Baseboard Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Baseboard Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Baseboard Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Baseboard Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Baseboard Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); + } - for (Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) { - AlphaName = ""; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Loop, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->ZoneCO2Gen(Loop).Name = AlphaName(1); - - state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr == 0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(2) + " entered=" + AlphaName(2)); - ErrorsFound = true; + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "ZoneBaseboard:OutdoorTemperatureControlled", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + "Power Level", + "[W]", + state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardOverrideOn, + state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardPower); + SetupEMSInternalVariable(state, + "Simple Zone Baseboard Capacity At Low Temperature", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + "[W]", + state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature); + SetupEMSInternalVariable(state, + "Simple Zone Baseboard Capacity At High Temperature", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + "[W]", + state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature); + } // EMS + + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr, + "ZoneBaseboard:OutdoorTemperatureControlled", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + IntGainTypeOf_ZoneBaseboardOutdoorTemperatureControlled, + &state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate); } - state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - if (state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + state.dataIPShortCut->cAlphaFieldNames(3) + - " is required."); - } else { + RepVarSet = true; + CurrentModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide"; + state.dataHeatBal->TotCO2Gen = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->ZoneCO2Gen.allocate(state.dataHeatBal->TotCO2Gen); + + for (Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) { + AlphaName = ""; + IHGNumbers = 0.0; + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Loop, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->ZoneCO2Gen(Loop).Name = AlphaName(1); + + state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr == 0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(2) + " entered=" + AlphaName(2)); + ErrorsFound = true; } - ErrorsFound = true; - } else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { + + state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + if (state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + state.dataIPShortCut->cAlphaFieldNames(3) + + " is required."); } - if (SchMax < 0.0) { + else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + } + ErrorsFound = true; + } + else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; + } + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; + } } } - } - - state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate = IHGNumbers(1); - - if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - // Object report variables - SetupOutputVariable(state, - "Contaminant Source or Sink CO2 Gain Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneCO2Gen(Loop).Name); + state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate = IHGNumbers(1); - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr) = false; + if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + // Object report variables SetupOutputVariable(state, - "Zone Contaminant Source or Sink CO2 Gain Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).CO2Rate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).Name); - } - - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr, - "ZoneContaminantSourceAndSink:CarbonDioxide", - state.dataHeatBal->ZoneCO2Gen(Loop).Name, - IntGainTypeOf_ZoneContaminantSourceAndSinkCarbonDioxide, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - &state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate); - } + "Contaminant Source or Sink CO2 Gain Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneCO2Gen(Loop).Name); - RepVarSet.deallocate(); - IHGNumbers.deallocate(); - AlphaName.deallocate(); + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr) = false; - if (ErrorsFound) { - ShowFatalError(state, RoutineName + "Errors found in Getting Internal Gains Input, Program Stopped"); - } + SetupOutputVariable(state, + "Zone Contaminant Source or Sink CO2 Gain Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).CO2Rate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).Name); + } - static constexpr auto Format_721( - "! ,Zone Name, Floor Area {{m2}},# Occupants,Area per Occupant " - "{{m2/person}},Occupant per Area {{person/m2}},Interior Lighting {{W/m2}},Electric Load {{W/m2}},Gas Load {{W/m2}},Other " - "Load {{W/m2}},Hot Water Eq {{W/m2}},Steam Equipment {{W/m2}},Sum Loads per Area {{W/m2}},Outdoor Controlled Baseboard " - "Heat\n"); - - print(state.files.eio, Format_721); - for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { - LightTot = 0.0; - ElecTot = 0.0; - GasTot = 0.0; - OthTot = 0.0; - HWETot = 0.0; - StmTot = 0.0; - BBHeatInd = "No"; - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotLights; ++Loop1) { - if (state.dataHeatBal->Lights(Loop1).ZonePtr != Loop) continue; - LightTot += state.dataHeatBal->Lights(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotElecEquip; ++Loop1) { - if (state.dataHeatBal->ZoneElectric(Loop1).ZonePtr != Loop) continue; - ElecTot += state.dataHeatBal->ZoneElectric(Loop1).DesignLevel; + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr, + "ZoneContaminantSourceAndSink:CarbonDioxide", + state.dataHeatBal->ZoneCO2Gen(Loop).Name, + IntGainTypeOf_ZoneContaminantSourceAndSinkCarbonDioxide, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + &state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate); } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->NumZoneITEqStatements; ++Loop1) { - if (state.dataHeatBal->ZoneITEq(Loop1).ZonePtr != Loop) continue; - ElecTot += state.dataHeatBal->ZoneITEq(Loop1).DesignTotalPower; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotGasEquip; ++Loop1) { - if (state.dataHeatBal->ZoneGas(Loop1).ZonePtr != Loop) continue; - GasTot += state.dataHeatBal->ZoneGas(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotOthEquip; ++Loop1) { - if (state.dataHeatBal->ZoneOtherEq(Loop1).ZonePtr != Loop) continue; - OthTot += state.dataHeatBal->ZoneOtherEq(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotStmEquip; ++Loop1) { - if (state.dataHeatBal->ZoneSteamEq(Loop1).ZonePtr != Loop) continue; - StmTot += state.dataHeatBal->ZoneSteamEq(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotHWEquip; ++Loop1) { - if (state.dataHeatBal->ZoneHWEq(Loop1).ZonePtr != Loop) continue; - HWETot += state.dataHeatBal->ZoneHWEq(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotBBHeat; ++Loop1) { - if (state.dataHeatBal->ZoneBBHeat(Loop1).ZonePtr != Loop) continue; - BBHeatInd = "Yes"; - } - state.dataHeatBal->Zone(Loop).InternalHeatGains = LightTot + ElecTot + GasTot + OthTot + HWETot + StmTot; - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { - print(state.files.eio, - Format_720, - state.dataHeatBal->Zone(Loop).Name, - state.dataHeatBal->Zone(Loop).FloorArea, - state.dataHeatBal->Zone(Loop).TotOccupants); - print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(Loop).FloorArea, state.dataHeatBal->Zone(Loop).TotOccupants); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", LightTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", ElecTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", GasTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", OthTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", HWETot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", StmTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, - "{:.3R},{}\n", - state.dataHeatBal->Zone(Loop).InternalHeatGains / state.dataHeatBal->Zone(Loop).FloorArea, - BBHeatInd); - } else { - print(state.files.eio, - Format_720, - state.dataHeatBal->Zone(Loop).Name, - state.dataHeatBal->Zone(Loop).FloorArea, - state.dataHeatBal->Zone(Loop).TotOccupants); - print(state.files.eio, "0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,{}\n", BBHeatInd); + + RepVarSet.deallocate(); + IHGNumbers.deallocate(); + AlphaName.deallocate(); + + if (ErrorsFound) { + ShowFatalError(state, RoutineName + "Errors found in Getting Internal Gains Input, Program Stopped"); } - } - for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "People", - "Number of People {},People/Floor Area {person/m2},Floor Area per person {m2/person},Fraction Radiant,Fraction " - "Convected,Sensible Fraction Calculation,Activity level,ASHRAE 55 Warnings,Carbon Dioxide Generation Rate,Nominal Minimum " - "Number of People,Nominal Maximum Number of People"); - if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || - state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { + + static constexpr auto Format_721( + "! ,Zone Name, Floor Area {{m2}},# Occupants,Area per Occupant " + "{{m2/person}},Occupant per Area {{person/m2}},Interior Lighting {{W/m2}},Electric Load {{W/m2}},Gas Load {{W/m2}},Other " + "Load {{W/m2}},Hot Water Eq {{W/m2}},Steam Equipment {{W/m2}},Sum Loads per Area {{W/m2}},Outdoor Controlled Baseboard " + "Heat\n"); + + print(state.files.eio, Format_721); + for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { + LightTot = 0.0; + ElecTot = 0.0; + GasTot = 0.0; + OthTot = 0.0; + HWETot = 0.0; + StmTot = 0.0; + BBHeatInd = "No"; + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotLights; ++Loop1) { + if (state.dataHeatBal->Lights(Loop1).ZonePtr != Loop) continue; + LightTot += state.dataHeatBal->Lights(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotElecEquip; ++Loop1) { + if (state.dataHeatBal->ZoneElectric(Loop1).ZonePtr != Loop) continue; + ElecTot += state.dataHeatBal->ZoneElectric(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->NumZoneITEqStatements; ++Loop1) { + if (state.dataHeatBal->ZoneITEq(Loop1).ZonePtr != Loop) continue; + ElecTot += state.dataHeatBal->ZoneITEq(Loop1).DesignTotalPower; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotGasEquip; ++Loop1) { + if (state.dataHeatBal->ZoneGas(Loop1).ZonePtr != Loop) continue; + GasTot += state.dataHeatBal->ZoneGas(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotOthEquip; ++Loop1) { + if (state.dataHeatBal->ZoneOtherEq(Loop1).ZonePtr != Loop) continue; + OthTot += state.dataHeatBal->ZoneOtherEq(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotStmEquip; ++Loop1) { + if (state.dataHeatBal->ZoneSteamEq(Loop1).ZonePtr != Loop) continue; + StmTot += state.dataHeatBal->ZoneSteamEq(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotHWEquip; ++Loop1) { + if (state.dataHeatBal->ZoneHWEq(Loop1).ZonePtr != Loop) continue; + HWETot += state.dataHeatBal->ZoneHWEq(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotBBHeat; ++Loop1) { + if (state.dataHeatBal->ZoneBBHeat(Loop1).ZonePtr != Loop) continue; + BBHeatInd = "Yes"; + } + state.dataHeatBal->Zone(Loop).InternalHeatGains = LightTot + ElecTot + GasTot + OthTot + HWETot + StmTot; + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { print(state.files.eio, - ",MRT Calculation Type,Work Efficiency, Clothing Insulation Calculation Method,Clothing " - "Insulation Calculation Method Schedule,Clothing,Air Velocity,Fanger Calculation,Pierce " - "Calculation,KSU Calculation,Cooling Effect Calculation,Ankle Draft Calculation\n"); - } else { - print(state.files.eio, "\n"); + Format_720, + state.dataHeatBal->Zone(Loop).Name, + state.dataHeatBal->Zone(Loop).FloorArea, + state.dataHeatBal->Zone(Loop).TotOccupants); + print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(Loop).FloorArea, state.dataHeatBal->Zone(Loop).TotOccupants); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", LightTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", ElecTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", GasTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", OthTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", HWETot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", StmTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, + "{:.3R},{}\n", + state.dataHeatBal->Zone(Loop).InternalHeatGains / state.dataHeatBal->Zone(Loop).FloorArea, + BBHeatInd); + } + else { + print(state.files.eio, + Format_720, + state.dataHeatBal->Zone(Loop).Name, + state.dataHeatBal->Zone(Loop).FloorArea, + state.dataHeatBal->Zone(Loop).TotOccupants); + print(state.files.eio, "0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,{}\n", BBHeatInd); } } + for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "People", + "Number of People {},People/Floor Area {person/m2},Floor Area per person {m2/person},Fraction Radiant,Fraction " + "Convected,Sensible Fraction Calculation,Activity level,ASHRAE 55 Warnings,Carbon Dioxide Generation Rate,Nominal Minimum " + "Number of People,Nominal Maximum Number of People"); + if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || + state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { + print(state.files.eio, + ",MRT Calculation Type,Work Efficiency, Clothing Insulation Calculation Method,Clothing " + "Insulation Calculation Method Schedule,Clothing,Air Velocity,Fanger Calculation,Pierce " + "Calculation,KSU Calculation,Cooling Effect Calculation,Ankle Draft Calculation\n"); + } + else { + print(state.files.eio, "\n"); + } + } - ZoneNum = state.dataHeatBal->People(Loop).ZonePtr; - - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "People-Illegal Zone specified", state.dataHeatBal->People(Loop).Name); - continue; - } - - print(state.files.eio, - Format_722, - "People", - state.dataHeatBal->People(Loop).Name, - GetScheduleName(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); + ZoneNum = state.dataHeatBal->People(Loop).ZonePtr; - print(state.files.eio, "{:.1R},", state.dataHeatBal->People(Loop).NumberOfPeople); + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "People-Illegal Zone specified", state.dataHeatBal->People(Loop).Name); + continue; + } - print_and_divide_if_greater_than_zero(state.dataHeatBal->People(Loop).NumberOfPeople, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print(state.files.eio, + Format_722, + "People", + state.dataHeatBal->People(Loop).Name, + GetScheduleName(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); - if (state.dataHeatBal->People(Loop).NumberOfPeople > 0.0) { - print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(ZoneNum).FloorArea, state.dataHeatBal->People(Loop).NumberOfPeople); - } else { - print(state.files.eio, "N/A,"); - } + print(state.files.eio, "{:.1R},", state.dataHeatBal->People(Loop).NumberOfPeople); - print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionConvected); - if (state.dataHeatBal->People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate) { - print(state.files.eio, "AutoCalculate,"); - } else { - print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).UserSpecSensFrac); - } - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ActivityLevelPtr)); + print_and_divide_if_greater_than_zero(state.dataHeatBal->People(Loop).NumberOfPeople, state.dataHeatBal->Zone(ZoneNum).FloorArea); - if (state.dataHeatBal->People(Loop).Show55Warning) { - print(state.files.eio, "Yes,"); - } else { - print(state.files.eio, "No,"); - } - print(state.files.eio, "{:.4R},", state.dataHeatBal->People(Loop).CO2RateFactor); - print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMinNumberPeople); - - if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || - state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { - print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMaxNumberPeople); - - if (state.dataHeatBal->People(Loop).MRTCalcType == ZoneAveraged) { - print(state.files.eio, "Zone Averaged,"); - } else if (state.dataHeatBal->People(Loop).MRTCalcType == SurfaceWeighted) { - print(state.files.eio, "Surface Weighted,"); - } else if (state.dataHeatBal->People(Loop).MRTCalcType == AngleFactor) { - print(state.files.eio, "Angle Factor,"); - } else { - print(state.files.eio, "N/A,"); + if (state.dataHeatBal->People(Loop).NumberOfPeople > 0.0) { + print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(ZoneNum).FloorArea, state.dataHeatBal->People(Loop).NumberOfPeople); } - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).WorkEffPtr)); - - if (state.dataHeatBal->People(Loop).ClothingType == 1) { - print(state.files.eio, "Clothing Insulation Schedule,"); - } else if (state.dataHeatBal->People(Loop).ClothingType == 2) { - print(state.files.eio, "Dynamic Clothing Model ASHRAE55,"); - } else if (state.dataHeatBal->People(Loop).ClothingType == 3) { - print(state.files.eio, "Calculation Method Schedule,"); - } else { + else { print(state.files.eio, "N/A,"); } - if (state.dataHeatBal->People(Loop).ClothingType == 3) { - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingMethodPtr)); - } else { - print(state.files.eio, "N/A,"); + print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionConvected); + if (state.dataHeatBal->People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate) { + print(state.files.eio, "AutoCalculate,"); } - - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingPtr)); - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).AirVelocityPtr)); - - if (state.dataHeatBal->People(Loop).Fanger) { - print(state.files.eio, "Yes,"); - } else { - print(state.files.eio, "No,"); + else { + print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).UserSpecSensFrac); } - if (state.dataHeatBal->People(Loop).Pierce) { + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ActivityLevelPtr)); + + if (state.dataHeatBal->People(Loop).Show55Warning) { print(state.files.eio, "Yes,"); - } else { - print(state.files.eio, "No,"); } - if (state.dataHeatBal->People(Loop).KSU) { - print(state.files.eio, "Yes,"); - } else { + else { print(state.files.eio, "No,"); } - if (state.dataHeatBal->People(Loop).CoolingEffectASH55) { - print(state.files.eio, "Yes,"); - } else { - print(state.files.eio, "No,"); + print(state.files.eio, "{:.4R},", state.dataHeatBal->People(Loop).CO2RateFactor); + print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMinNumberPeople); + + if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || + state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { + print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMaxNumberPeople); + + if (state.dataHeatBal->People(Loop).MRTCalcType == ZoneAveraged) { + print(state.files.eio, "Zone Averaged,"); + } + else if (state.dataHeatBal->People(Loop).MRTCalcType == SurfaceWeighted) { + print(state.files.eio, "Surface Weighted,"); + } + else if (state.dataHeatBal->People(Loop).MRTCalcType == AngleFactor) { + print(state.files.eio, "Angle Factor,"); + } + else { + print(state.files.eio, "N/A,"); + } + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).WorkEffPtr)); + + if (state.dataHeatBal->People(Loop).ClothingType == 1) { + print(state.files.eio, "Clothing Insulation Schedule,"); + } + else if (state.dataHeatBal->People(Loop).ClothingType == 2) { + print(state.files.eio, "Dynamic Clothing Model ASHRAE55,"); + } + else if (state.dataHeatBal->People(Loop).ClothingType == 3) { + print(state.files.eio, "Calculation Method Schedule,"); + } + else { + print(state.files.eio, "N/A,"); + } + + if (state.dataHeatBal->People(Loop).ClothingType == 3) { + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingMethodPtr)); + } + else { + print(state.files.eio, "N/A,"); + } + + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingPtr)); + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).AirVelocityPtr)); + + if (state.dataHeatBal->People(Loop).Fanger) { + print(state.files.eio, "Yes,"); + } + else { + print(state.files.eio, "No,"); + } + if (state.dataHeatBal->People(Loop).Pierce) { + print(state.files.eio, "Yes,"); + } + else { + print(state.files.eio, "No,"); + } + if (state.dataHeatBal->People(Loop).KSU) { + print(state.files.eio, "Yes,"); + } + else { + print(state.files.eio, "No,"); + } + if (state.dataHeatBal->People(Loop).CoolingEffectASH55) { + print(state.files.eio, "Yes,"); + } + else { + print(state.files.eio, "No,"); + } + if (state.dataHeatBal->People(Loop).AnkleDraftASH55) { + print(state.files.eio, "Yes\n"); + } + else { + print(state.files.eio, "No\n"); + } } - if (state.dataHeatBal->People(Loop).AnkleDraftASH55) { - print(state.files.eio, "Yes\n"); - } else { - print(state.files.eio, "No\n"); + else { + print(state.files.eio, "{:.0R}\n", state.dataHeatBal->People(Loop).NomMaxNumberPeople); } - } else { - print(state.files.eio, "{:.0R}\n", state.dataHeatBal->People(Loop).NomMaxNumberPeople); - } - } - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "Lights", - "Lighting Level {W},Lights/Floor Area {W/m2},Lights per person {W/person},Fraction Return " - "Air,Fraction Radiant,Fraction Short Wave,Fraction Convected,Fraction Replaceable,End-Use " - "Category,Nominal Minimum Lighting Level {W},Nominal Maximum Lighting Level {W}\n"); } + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "Lights", + "Lighting Level {W},Lights/Floor Area {W/m2},Lights per person {W/person},Fraction Return " + "Air,Fraction Radiant,Fraction Short Wave,Fraction Convected,Fraction Replaceable,End-Use " + "Category,Nominal Minimum Lighting Level {W},Nominal Maximum Lighting Level {W}\n"); + } - ZoneNum = state.dataHeatBal->Lights(Loop).ZonePtr; + ZoneNum = state.dataHeatBal->Lights(Loop).ZonePtr; - if (ZoneNum == 0) { - print(state.files.eio, "Lights-Illegal Zone specified", state.dataHeatBal->Lights(Loop).Name); - continue; - } - print(state.files.eio, - Format_722, - "Lights", - state.dataHeatBal->Lights(Loop).Name, - GetScheduleName(state, state.dataHeatBal->Lights(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReturnAir); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionShortWave); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionConvected); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReplaceable); - print(state.files.eio, "{},", state.dataHeatBal->Lights(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->Lights(Loop).NomMaxDesignLevel); - } - for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { - if (Loop == 1) { + if (ZoneNum == 0) { + print(state.files.eio, "Lights-Illegal Zone specified", state.dataHeatBal->Lights(Loop).Name); + continue; + } print(state.files.eio, - Format_723, - "ElectricEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + Format_722, + "Lights", + state.dataHeatBal->Lights(Loop).Name, + GetScheduleName(state, state.dataHeatBal->Lights(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReturnAir); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionShortWave); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionConvected); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReplaceable); + print(state.files.eio, "{},", state.dataHeatBal->Lights(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->Lights(Loop).NomMaxDesignLevel); } + for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "ElectricEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + } - ZoneNum = state.dataHeatBal->ZoneElectric(Loop).ZonePtr; + ZoneNum = state.dataHeatBal->ZoneElectric(Loop).ZonePtr; - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Electric Equipment-Illegal Zone specified", state.dataHeatBal->ZoneElectric(Loop).Name); - continue; - } - print(state.files.eio, - Format_722, - "ElectricEquipment", - state.dataHeatBal->ZoneElectric(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionConvected); - print(state.files.eio, "{},", state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneElectric(Loop).NomMaxDesignLevel); - } - for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { - if (Loop == 1) { + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Electric Equipment-Illegal Zone specified", state.dataHeatBal->ZoneElectric(Loop).Name); + continue; + } print(state.files.eio, - Format_723, - "GasEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + Format_722, + "ElectricEquipment", + state.dataHeatBal->ZoneElectric(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionConvected); + print(state.files.eio, "{},", state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneElectric(Loop).NomMaxDesignLevel); } + for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "GasEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + } - ZoneNum = state.dataHeatBal->ZoneGas(Loop).ZonePtr; - - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Gas Equipment-Illegal Zone specified", state.dataHeatBal->ZoneGas(Loop).Name); - continue; - } + ZoneNum = state.dataHeatBal->ZoneGas(Loop).ZonePtr; - print(state.files.eio, - Format_722, - "GasEquipment", - state.dataHeatBal->ZoneGas(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionConvected); - print(state.files.eio, "{},", state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneGas(Loop).NomMaxDesignLevel); - } + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Gas Equipment-Illegal Zone specified", state.dataHeatBal->ZoneGas(Loop).Name); + continue; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { - if (Loop == 1) { print(state.files.eio, - Format_723, - "HotWaterEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + Format_722, + "GasEquipment", + state.dataHeatBal->ZoneGas(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionConvected); + print(state.files.eio, "{},", state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneGas(Loop).NomMaxDesignLevel); } - ZoneNum = state.dataHeatBal->ZoneHWEq(Loop).ZonePtr; + for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "HotWaterEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + } - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Hot Water Equipment-Illegal Zone specified", state.dataHeatBal->ZoneHWEq(Loop).Name); - continue; - } + ZoneNum = state.dataHeatBal->ZoneHWEq(Loop).ZonePtr; - print(state.files.eio, - Format_722, - "HotWaterEquipment", - state.dataHeatBal->ZoneHWEq(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionConvected); - print(state.files.eio, "{},", state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneHWEq(Loop).NomMaxDesignLevel); - } + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Hot Water Equipment-Illegal Zone specified", state.dataHeatBal->ZoneHWEq(Loop).Name); + continue; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { - if (Loop == 1) { print(state.files.eio, - Format_723, - "SteamEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + Format_722, + "HotWaterEquipment", + state.dataHeatBal->ZoneHWEq(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionConvected); + print(state.files.eio, "{},", state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneHWEq(Loop).NomMaxDesignLevel); } - ZoneNum = state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr; + for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "SteamEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + } - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Steam Equipment-Illegal Zone specified", state.dataHeatBal->ZoneSteamEq(Loop).Name); - continue; - } + ZoneNum = state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr; - print(state.files.eio, - Format_722, - "SteamEquipment", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected); - print(state.files.eio, "{},", state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneSteamEq(Loop).NomMaxDesignLevel); - } + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Steam Equipment-Illegal Zone specified", state.dataHeatBal->ZoneSteamEq(Loop).Name); + continue; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { - if (Loop == 1) { print(state.files.eio, - Format_723, - "OtherEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + Format_722, + "SteamEquipment", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected); + print(state.files.eio, "{},", state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneSteamEq(Loop).NomMaxDesignLevel); } - ZoneNum = state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr; + for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "OtherEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); + } - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Other Equipment-Illegal Zone specified", state.dataHeatBal->ZoneOtherEq(Loop).Name); - continue; - } + ZoneNum = state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr; - print(state.files.eio, - Format_722, - "OtherEquipment", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneOtherEq(Loop).NomMaxDesignLevel); - } + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Other Equipment-Illegal Zone specified", state.dataHeatBal->ZoneOtherEq(Loop).Name); + continue; + } - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - if (Loop == 1) { print(state.files.eio, - Format_723, - "ElectricEquipment:ITE:AirCooled", - "Equipment Level {W}," - "Equipment/Floor Area {W/m2},Equipment per person {W/person}," - "Fraction Convected,CPU End-Use SubCategory,Fan End-Use SubCategory,UPS End-Use SubCategory," - "Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}, Design Air Volume Flow Rate {m3/s}\n"); + Format_722, + "OtherEquipment", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneOtherEq(Loop).NomMaxDesignLevel); } - ZoneNum = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "ElectricEquipment:ITE:AirCooled", + "Equipment Level {W}," + "Equipment/Floor Area {W/m2},Equipment per person {W/person}," + "Fraction Convected,CPU End-Use SubCategory,Fan End-Use SubCategory,UPS End-Use SubCategory," + "Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}, Design Air Volume Flow Rate {m3/s}\n"); + } - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "ElectricEquipment:ITE:AirCooled-Illegal Zone specified", state.dataHeatBal->ZoneITEq(Loop).Name); - continue; - } - print(state.files.eio, - Format_722, - "ElectricEquipment:ITE:AirCooled", - state.dataHeatBal->ZoneITEq(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower, state.dataHeatBal->Zone(ZoneNum).FloorArea); - - // ElectricEquipment:ITE:AirCooled is 100% convective - print(state.files.eio, "1.0,"); - - print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU); - print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan); - print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMaxDesignLevel); - print(state.files.eio, "{:.10R}\n", state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate); - } + ZoneNum = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; - for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { - if (Loop == 1) { + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "ElectricEquipment:ITE:AirCooled-Illegal Zone specified", state.dataHeatBal->ZoneITEq(Loop).Name); + continue; + } print(state.files.eio, - Format_723, - "Outdoor Controlled Baseboard Heat", - "Capacity at Low Temperature {W},Low Temperature {C},Capacity at High Temperature " - "{W},High Temperature {C},Fraction Radiant,Fraction Convected,End-Use Subcategory\n"); + Format_722, + "ElectricEquipment:ITE:AirCooled", + state.dataHeatBal->ZoneITEq(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower, state.dataHeatBal->Zone(ZoneNum).FloorArea); + + // ElectricEquipment:ITE:AirCooled is 100% convective + print(state.files.eio, "1.0,"); + + print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU); + print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan); + print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMaxDesignLevel); + print(state.files.eio, "{:.10R}\n", state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate); } - ZoneNum = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; + for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "Outdoor Controlled Baseboard Heat", + "Capacity at Low Temperature {W},Low Temperature {C},Capacity at High Temperature " + "{W},High Temperature {C},Fraction Radiant,Fraction Convected,End-Use Subcategory\n"); + } - if (ZoneNum == 0) { + ZoneNum = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; + + if (ZoneNum == 0) { + print(state.files.eio, + Format_724, + "Outdoor Controlled Baseboard Heat-Illegal Zone specified", + state.dataHeatBal->ZoneBBHeat(Loop).Name); + continue; + } print(state.files.eio, - Format_724, - "Outdoor Controlled Baseboard Heat-Illegal Zone specified", - state.dataHeatBal->ZoneBBHeat(Loop).Name); - continue; + Format_722, + "Outdoor Controlled Baseboard Heat", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected); + print(state.files.eio, "{}\n", state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory); } - print(state.files.eio, - Format_722, - "Outdoor Controlled Baseboard Heat", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected); - print(state.files.eio, "{}\n", state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory); } - } - - void InitInternalHeatGains(EnergyPlusData &state) - { - // SUBROUTINE INFORMATION: - // AUTHOR Linda K. Lawrie - // DATE WRITTEN September 1997 - // MODIFIED November 1998, FW: add adjustment to elec lights for dayltg controls - // August 2003, FCW: add optional calculation of light-to-return fraction - // as a function of return plenum air temperature. - // RE-ENGINEERED na + void InitInternalHeatGains(EnergyPlusData &state) + { + + // SUBROUTINE INFORMATION: + // AUTHOR Linda K. Lawrie + // DATE WRITTEN September 1997 + // MODIFIED November 1998, FW: add adjustment to elec lights for dayltg controls + // August 2003, FCW: add optional calculation of light-to-return fraction + // as a function of return plenum air temperature. + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // This subroutine sets up the zone internal heat gains + // that are independent of the zone air temperature. + + // Using/Aliasing + using namespace ScheduleManager; + using DaylightingDevices::FigureTDDZoneGains; + using FuelCellElectricGenerator::FigureFuelCellZoneGains; + using MicroCHPElectricGenerator::FigureMicroCHPZoneGains; + using OutputReportTabular::AllocateLoadComponentArrays; + using Psychrometrics::PsyRhoAirFnPbTdbW; + using RefrigeratedCase::FigureRefrigerationZoneGains; + using WaterThermalTanks::CalcWaterThermalTankZoneGains; + using WaterUse::CalcWaterUseZoneGains; + + // SUBROUTINE PARAMETER DEFINITIONS: + static Array1D const C( + 9, { 6.4611027, 0.946892, 0.0000255737, 7.139322, -0.0627909, 0.0000589271, -0.198550, 0.000940018, -0.00000149532 }); + static ZoneCatEUseData const zeroZoneCatEUse; // For initialization + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 ActivityLevel_WperPerson; // Units on Activity Level (Schedule) + Real64 NumberOccupants; // Number of occupants + int Loop; + Real64 Q; // , QR + Real64 TotalPeopleGain; // Total heat gain from people (intermediate calculational variable) + Real64 SensiblePeopleGain; // Sensible heat gain from people (intermediate calculational variable) + Real64 FractionConvected; // For general lighting, fraction of heat from lights convected to zone air + Real64 FractionReturnAir; // For general lighting, fraction of heat from lights convected to zone's return air + Real64 FractionRadiant; // For general lighting, fraction of heat from lights to zone that is long wave + Real64 ReturnPlenumTemp; // Air temperature of a zone's return air plenum (C) + Real64 pulseMultipler; // use to create a pulse for the load component report computations + + // REAL(r64), ALLOCATABLE, SAVE, DIMENSION(:) :: QSA + + // IF (.NOT. ALLOCATED(QSA)) ALLOCATE(QSA(NumOfZones)) + + // Zero out time step variables + for (auto &e : state.dataHeatBal->ZoneIntGain) { + e.NOFOCC = 0.0; + e.QOCTOT = 0.0; + e.QOCSEN = 0.0; + e.QOCLAT = 0.0; + e.QOCRAD = 0.0; + e.QOCCON = 0.0; + e.QLTSW = 0.0; + e.QLTCRA = 0.0; + e.QLTRAD = 0.0; + e.QLTCON = 0.0; + e.QLTTOT = 0.0; + + e.QEELAT = 0.0; + e.QEERAD = 0.0; + e.QEECON = 0.0; + e.QEELost = 0.0; + e.QGELAT = 0.0; + e.QGERAD = 0.0; + e.QGECON = 0.0; + e.QGELost = 0.0; + e.QBBRAD = 0.0; + e.QBBCON = 0.0; + e.QOELAT = 0.0; + e.QOERAD = 0.0; + e.QOECON = 0.0; + e.QOELost = 0.0; + e.QHWLAT = 0.0; + e.QHWRAD = 0.0; + e.QHWCON = 0.0; + e.QHWLost = 0.0; + e.QSELAT = 0.0; + e.QSERAD = 0.0; + e.QSECON = 0.0; + e.QSELost = 0.0; + } - // PURPOSE OF THIS SUBROUTINE: - // This subroutine sets up the zone internal heat gains - // that are independent of the zone air temperature. + state.dataHeatBal->ZoneIntEEuse = zeroZoneCatEUse; // Set all member arrays to zeros - // Using/Aliasing - using namespace ScheduleManager; - using DaylightingDevices::FigureTDDZoneGains; - using FuelCellElectricGenerator::FigureFuelCellZoneGains; - using MicroCHPElectricGenerator::FigureMicroCHPZoneGains; - using OutputReportTabular::AllocateLoadComponentArrays; - using Psychrometrics::PsyRhoAirFnPbTdbW; - using RefrigeratedCase::FigureRefrigerationZoneGains; - using WaterThermalTanks::CalcWaterThermalTankZoneGains; - using WaterUse::CalcWaterUseZoneGains; - - // SUBROUTINE PARAMETER DEFINITIONS: - static Array1D const C( - 9, {6.4611027, 0.946892, 0.0000255737, 7.139322, -0.0627909, 0.0000589271, -0.198550, 0.000940018, -0.00000149532}); - static ZoneCatEUseData const zeroZoneCatEUse; // For initialization - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 ActivityLevel_WperPerson; // Units on Activity Level (Schedule) - Real64 NumberOccupants; // Number of occupants - int Loop; - Real64 Q; // , QR - Real64 TotalPeopleGain; // Total heat gain from people (intermediate calculational variable) - Real64 SensiblePeopleGain; // Sensible heat gain from people (intermediate calculational variable) - Real64 FractionConvected; // For general lighting, fraction of heat from lights convected to zone air - Real64 FractionReturnAir; // For general lighting, fraction of heat from lights convected to zone's return air - Real64 FractionRadiant; // For general lighting, fraction of heat from lights to zone that is long wave - Real64 ReturnPlenumTemp; // Air temperature of a zone's return air plenum (C) - Real64 pulseMultipler; // use to create a pulse for the load component report computations - - // REAL(r64), ALLOCATABLE, SAVE, DIMENSION(:) :: QSA - - // IF (.NOT. ALLOCATED(QSA)) ALLOCATE(QSA(NumOfZones)) - - // Zero out time step variables - for (auto &e : state.dataHeatBal->ZoneIntGain) { - e.NOFOCC = 0.0; - e.QOCTOT = 0.0; - e.QOCSEN = 0.0; - e.QOCLAT = 0.0; - e.QOCRAD = 0.0; - e.QOCCON = 0.0; - e.QLTSW = 0.0; - e.QLTCRA = 0.0; - e.QLTRAD = 0.0; - e.QLTCON = 0.0; - e.QLTTOT = 0.0; - - e.QEELAT = 0.0; - e.QEERAD = 0.0; - e.QEECON = 0.0; - e.QEELost = 0.0; - e.QGELAT = 0.0; - e.QGERAD = 0.0; - e.QGECON = 0.0; - e.QGELost = 0.0; - e.QBBRAD = 0.0; - e.QBBCON = 0.0; - e.QOELAT = 0.0; - e.QOERAD = 0.0; - e.QOECON = 0.0; - e.QOELost = 0.0; - e.QHWLAT = 0.0; - e.QHWRAD = 0.0; - e.QHWCON = 0.0; - e.QHWLost = 0.0; - e.QSELAT = 0.0; - e.QSERAD = 0.0; - e.QSECON = 0.0; - e.QSELost = 0.0; - } + for (auto &e : state.dataHeatBal->ZnRpt) { + e.LtsPower = 0.0; + e.ElecPower = 0.0; + e.GasPower = 0.0; + e.HWPower = 0.0; + e.SteamPower = 0.0; + e.BaseHeatPower = 0.0; + e.CO2Rate = 0.0; + } - state.dataHeatBal->ZoneIntEEuse = zeroZoneCatEUse; // Set all member arrays to zeros + for (auto &e : state.dataHeatBal->ZonePreDefRep) { + e.NumOcc = 0.0; + } - for (auto &e : state.dataHeatBal->ZnRpt) { - e.LtsPower = 0.0; - e.ElecPower = 0.0; - e.GasPower = 0.0; - e.HWPower = 0.0; - e.SteamPower = 0.0; - e.BaseHeatPower = 0.0; - e.CO2Rate = 0.0; - } + // QSA = 0.0 + + // Process Internal Heat Gains, People done below + // Occupant Stuff + // METHOD: + // The function is based on a curve fit to data presented in + // Table 48 'Heat Gain From People' of Chapter 1 of the 'Carrier + // Handbook of Air Conditioning System Design', 1965. Values of + // Sensible gain were obtained from the table at average adjusted + // metabolic rates 350, 400, 450, 500, 750, 850, 1000, and + // 1450 Btu/hr each at temperatures 82, 80, 78, 75, and 70F. + // Sensible gains of 0.0 at 96F and equal to the metabolic rate + // at 30F were assumed in order to give reasonable values beyond + // The reported temperature range. + for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { + int NZ = state.dataHeatBal->People(Loop).ZonePtr; + NumberOccupants = + state.dataHeatBal->People(Loop).NumberOfPeople * GetCurrentScheduleValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); + if (state.dataHeatBal->People(Loop).EMSPeopleOn) NumberOccupants = state.dataHeatBal->People(Loop).EMSNumberOfPeople; + + TotalPeopleGain = 0.0; + SensiblePeopleGain = 0.0; + + if (NumberOccupants > 0.0) { + ActivityLevel_WperPerson = GetCurrentScheduleValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); + TotalPeopleGain = NumberOccupants * ActivityLevel_WperPerson; + // if the user did not specify a sensible fraction, calculate the sensible heat gain + if (state.dataHeatBal->People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate) { + if (!(state.dataRoomAirMod->IsZoneDV(NZ) || state.dataRoomAirMod->IsZoneUI(NZ))) { + SensiblePeopleGain = + NumberOccupants * + (C(1) + ActivityLevel_WperPerson * (C(2) + ActivityLevel_WperPerson * C(3)) + + state.dataHeatBalFanSys->MAT(NZ) * + ((C(4) + ActivityLevel_WperPerson * (C(5) + ActivityLevel_WperPerson * C(6))) + + state.dataHeatBalFanSys->MAT(NZ) * (C(7) + ActivityLevel_WperPerson * (C(8) + ActivityLevel_WperPerson * C(9))))); + } + else { // UCSD - DV or UI + SensiblePeopleGain = + NumberOccupants * + (C(1) + ActivityLevel_WperPerson * (C(2) + ActivityLevel_WperPerson * C(3)) + + state.dataRoomAirMod->TCMF(NZ) * + ((C(4) + ActivityLevel_WperPerson * (C(5) + ActivityLevel_WperPerson * C(6))) + + state.dataRoomAirMod->TCMF(NZ) * (C(7) + ActivityLevel_WperPerson * (C(8) + ActivityLevel_WperPerson * C(9))))); + } + } + else { // if the user did specify a sensible fraction, use it + SensiblePeopleGain = TotalPeopleGain * state.dataHeatBal->People(Loop).UserSpecSensFrac; + } - for (auto &e : state.dataHeatBal->ZonePreDefRep) { - e.NumOcc = 0.0; - } + if (SensiblePeopleGain > TotalPeopleGain) SensiblePeopleGain = TotalPeopleGain; + if (SensiblePeopleGain < 0.0) SensiblePeopleGain = 0.0; - // QSA = 0.0 - - // Process Internal Heat Gains, People done below - // Occupant Stuff - // METHOD: - // The function is based on a curve fit to data presented in - // Table 48 'Heat Gain From People' of Chapter 1 of the 'Carrier - // Handbook of Air Conditioning System Design', 1965. Values of - // Sensible gain were obtained from the table at average adjusted - // metabolic rates 350, 400, 450, 500, 750, 850, 1000, and - // 1450 Btu/hr each at temperatures 82, 80, 78, 75, and 70F. - // Sensible gains of 0.0 at 96F and equal to the metabolic rate - // at 30F were assumed in order to give reasonable values beyond - // The reported temperature range. - for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { - int NZ = state.dataHeatBal->People(Loop).ZonePtr; - NumberOccupants = - state.dataHeatBal->People(Loop).NumberOfPeople * GetCurrentScheduleValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); - if (state.dataHeatBal->People(Loop).EMSPeopleOn) NumberOccupants = state.dataHeatBal->People(Loop).EMSNumberOfPeople; - - TotalPeopleGain = 0.0; - SensiblePeopleGain = 0.0; - - if (NumberOccupants > 0.0) { - ActivityLevel_WperPerson = GetCurrentScheduleValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); - TotalPeopleGain = NumberOccupants * ActivityLevel_WperPerson; - // if the user did not specify a sensible fraction, calculate the sensible heat gain - if (state.dataHeatBal->People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate) { - if (!(state.dataRoomAirMod->IsZoneDV(NZ) || state.dataRoomAirMod->IsZoneUI(NZ))) { - SensiblePeopleGain = - NumberOccupants * - (C(1) + ActivityLevel_WperPerson * (C(2) + ActivityLevel_WperPerson * C(3)) + - state.dataHeatBalFanSys->MAT(NZ) * - ((C(4) + ActivityLevel_WperPerson * (C(5) + ActivityLevel_WperPerson * C(6))) + - state.dataHeatBalFanSys->MAT(NZ) * (C(7) + ActivityLevel_WperPerson * (C(8) + ActivityLevel_WperPerson * C(9))))); - } else { // UCSD - DV or UI - SensiblePeopleGain = - NumberOccupants * - (C(1) + ActivityLevel_WperPerson * (C(2) + ActivityLevel_WperPerson * C(3)) + - state.dataRoomAirMod->TCMF(NZ) * - ((C(4) + ActivityLevel_WperPerson * (C(5) + ActivityLevel_WperPerson * C(6))) + - state.dataRoomAirMod->TCMF(NZ) * (C(7) + ActivityLevel_WperPerson * (C(8) + ActivityLevel_WperPerson * C(9))))); - } - } else { // if the user did specify a sensible fraction, use it - SensiblePeopleGain = TotalPeopleGain * state.dataHeatBal->People(Loop).UserSpecSensFrac; + // For predefined tabular reports related to outside air ventilation + state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = true; // set flag to occupied to be used in tabular reporting for ventilation + state.dataHeatBal->ZonePreDefRep(NZ).NumOcc += NumberOccupants; + state.dataHeatBal->ZonePreDefRep(NZ).NumOccAccum += NumberOccupants * state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZonePreDefRep(NZ).NumOccAccumTime += state.dataGlobal->TimeStepZone; + } + else { + state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = false; // set flag to occupied to be used in tabular reporting for ventilation } - if (SensiblePeopleGain > TotalPeopleGain) SensiblePeopleGain = TotalPeopleGain; - if (SensiblePeopleGain < 0.0) SensiblePeopleGain = 0.0; - - // For predefined tabular reports related to outside air ventilation - state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = true; // set flag to occupied to be used in tabular reporting for ventilation - state.dataHeatBal->ZonePreDefRep(NZ).NumOcc += NumberOccupants; - state.dataHeatBal->ZonePreDefRep(NZ).NumOccAccum += NumberOccupants * state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZonePreDefRep(NZ).NumOccAccumTime += state.dataGlobal->TimeStepZone; - } else { - state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = false; // set flag to occupied to be used in tabular reporting for ventilation + state.dataHeatBal->People(Loop).NumOcc = NumberOccupants; + state.dataHeatBal->People(Loop).RadGainRate = SensiblePeopleGain * state.dataHeatBal->People(Loop).FractionRadiant; + state.dataHeatBal->People(Loop).ConGainRate = SensiblePeopleGain * state.dataHeatBal->People(Loop).FractionConvected; + state.dataHeatBal->People(Loop).SenGainRate = SensiblePeopleGain; + state.dataHeatBal->People(Loop).LatGainRate = TotalPeopleGain - SensiblePeopleGain; + state.dataHeatBal->People(Loop).TotGainRate = TotalPeopleGain; + state.dataHeatBal->People(Loop).CO2GainRate = TotalPeopleGain * state.dataHeatBal->People(Loop).CO2RateFactor; + + state.dataHeatBal->ZoneIntGain(NZ).NOFOCC += state.dataHeatBal->People(Loop).NumOcc; + state.dataHeatBal->ZoneIntGain(NZ).QOCRAD += state.dataHeatBal->People(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOCCON += state.dataHeatBal->People(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOCSEN += state.dataHeatBal->People(Loop).SenGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOCLAT += state.dataHeatBal->People(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOCTOT += state.dataHeatBal->People(Loop).TotGainRate; } - state.dataHeatBal->People(Loop).NumOcc = NumberOccupants; - state.dataHeatBal->People(Loop).RadGainRate = SensiblePeopleGain * state.dataHeatBal->People(Loop).FractionRadiant; - state.dataHeatBal->People(Loop).ConGainRate = SensiblePeopleGain * state.dataHeatBal->People(Loop).FractionConvected; - state.dataHeatBal->People(Loop).SenGainRate = SensiblePeopleGain; - state.dataHeatBal->People(Loop).LatGainRate = TotalPeopleGain - SensiblePeopleGain; - state.dataHeatBal->People(Loop).TotGainRate = TotalPeopleGain; - state.dataHeatBal->People(Loop).CO2GainRate = TotalPeopleGain * state.dataHeatBal->People(Loop).CO2RateFactor; - - state.dataHeatBal->ZoneIntGain(NZ).NOFOCC += state.dataHeatBal->People(Loop).NumOcc; - state.dataHeatBal->ZoneIntGain(NZ).QOCRAD += state.dataHeatBal->People(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOCCON += state.dataHeatBal->People(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOCSEN += state.dataHeatBal->People(Loop).SenGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOCLAT += state.dataHeatBal->People(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOCTOT += state.dataHeatBal->People(Loop).TotGainRate; - } - - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - int NZ = state.dataHeatBal->Lights(Loop).ZonePtr; - Q = state.dataHeatBal->Lights(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + int NZ = state.dataHeatBal->Lights(Loop).ZonePtr; + Q = state.dataHeatBal->Lights(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); - if (state.dataDaylightingData->ZoneDaylight(NZ).DaylightMethod == DataDaylighting::iDaylightingMethod::SplitFluxDaylighting || - state.dataDaylightingData->ZoneDaylight(NZ).DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) { + if (state.dataDaylightingData->ZoneDaylight(NZ).DaylightMethod == DataDaylighting::iDaylightingMethod::SplitFluxDaylighting || + state.dataDaylightingData->ZoneDaylight(NZ).DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) { - if (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0) { // FractionReplaceable can only be 0 or 1 for these models - Q *= state.dataDaylightingData->ZoneDaylight(NZ).ZonePowerReductionFactor; + if (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0) { // FractionReplaceable can only be 0 or 1 for these models + Q *= state.dataDaylightingData->ZoneDaylight(NZ).ZonePowerReductionFactor; + } } - } - // Reduce lighting power due to demand limiting - if (state.dataHeatBal->Lights(Loop).ManageDemand && (Q > state.dataHeatBal->Lights(Loop).DemandLimit)) - Q = state.dataHeatBal->Lights(Loop).DemandLimit; - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->Lights(Loop).EMSLightsOn) Q = state.dataHeatBal->Lights(Loop).EMSLightingPower; - - FractionConvected = state.dataHeatBal->Lights(Loop).FractionConvected; - FractionReturnAir = state.dataHeatBal->Lights(Loop).FractionReturnAir; - FractionRadiant = state.dataHeatBal->Lights(Loop).FractionRadiant; - if (state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated && !state.dataGlobal->ZoneSizingCalc && - state.dataGlobal->SimTimeSteps > 1) { - // Calculate FractionReturnAir based on conditions in the zone's return air plenum, if there is one. - if (state.dataHeatBal->Zone(NZ).IsControlled) { - int retNum = state.dataHeatBal->Lights(Loop).ZoneReturnNum; - int ReturnZonePlenumCondNum = state.dataZoneEquip->ZoneEquipConfig(NZ).ReturnNodePlenumNum(retNum); - if (ReturnZonePlenumCondNum > 0) { - ReturnPlenumTemp = state.dataZonePlenum->ZoneRetPlenCond(ReturnZonePlenumCondNum).ZoneTemp; - FractionReturnAir = state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff1 - - state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff2 * ReturnPlenumTemp; - FractionReturnAir = max(0.0, min(1.0, FractionReturnAir)); - if (FractionReturnAir >= (1.0 - state.dataHeatBal->Lights(Loop).FractionShortWave)) { - FractionReturnAir = 1.0 - state.dataHeatBal->Lights(Loop).FractionShortWave; - FractionRadiant = 0.0; - FractionConvected = 0.0; - } else { - FractionRadiant = - ((1.0 - FractionReturnAir - state.dataHeatBal->Lights(Loop).FractionShortWave) / - (state.dataHeatBal->Lights(Loop).FractionRadiant + state.dataHeatBal->Lights(Loop).FractionConvected)) * - state.dataHeatBal->Lights(Loop).FractionRadiant; - FractionConvected = 1.0 - (FractionReturnAir + FractionRadiant + state.dataHeatBal->Lights(Loop).FractionShortWave); + // Reduce lighting power due to demand limiting + if (state.dataHeatBal->Lights(Loop).ManageDemand && (Q > state.dataHeatBal->Lights(Loop).DemandLimit)) + Q = state.dataHeatBal->Lights(Loop).DemandLimit; + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->Lights(Loop).EMSLightsOn) Q = state.dataHeatBal->Lights(Loop).EMSLightingPower; + + FractionConvected = state.dataHeatBal->Lights(Loop).FractionConvected; + FractionReturnAir = state.dataHeatBal->Lights(Loop).FractionReturnAir; + FractionRadiant = state.dataHeatBal->Lights(Loop).FractionRadiant; + if (state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated && !state.dataGlobal->ZoneSizingCalc && + state.dataGlobal->SimTimeSteps > 1) { + // Calculate FractionReturnAir based on conditions in the zone's return air plenum, if there is one. + if (state.dataHeatBal->Zone(NZ).IsControlled) { + int retNum = state.dataHeatBal->Lights(Loop).ZoneReturnNum; + int ReturnZonePlenumCondNum = state.dataZoneEquip->ZoneEquipConfig(NZ).ReturnNodePlenumNum(retNum); + if (ReturnZonePlenumCondNum > 0) { + ReturnPlenumTemp = state.dataZonePlenum->ZoneRetPlenCond(ReturnZonePlenumCondNum).ZoneTemp; + FractionReturnAir = state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff1 - + state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff2 * ReturnPlenumTemp; + FractionReturnAir = max(0.0, min(1.0, FractionReturnAir)); + if (FractionReturnAir >= (1.0 - state.dataHeatBal->Lights(Loop).FractionShortWave)) { + FractionReturnAir = 1.0 - state.dataHeatBal->Lights(Loop).FractionShortWave; + FractionRadiant = 0.0; + FractionConvected = 0.0; + } + else { + FractionRadiant = + ((1.0 - FractionReturnAir - state.dataHeatBal->Lights(Loop).FractionShortWave) / + (state.dataHeatBal->Lights(Loop).FractionRadiant + state.dataHeatBal->Lights(Loop).FractionConvected)) * + state.dataHeatBal->Lights(Loop).FractionRadiant; + FractionConvected = 1.0 - (FractionReturnAir + FractionRadiant + state.dataHeatBal->Lights(Loop).FractionShortWave); + } } } } - } - state.dataHeatBal->Lights(Loop).Power = Q; - state.dataHeatBal->Lights(Loop).RadGainRate = Q * FractionRadiant; - state.dataHeatBal->Lights(Loop).VisGainRate = Q * state.dataHeatBal->Lights(Loop).FractionShortWave; - state.dataHeatBal->Lights(Loop).ConGainRate = Q * FractionConvected; - state.dataHeatBal->Lights(Loop).RetAirGainRate = Q * FractionReturnAir; - state.dataHeatBal->Lights(Loop).TotGainRate = Q; - - state.dataHeatBal->ZnRpt(NZ).LtsPower += state.dataHeatBal->Lights(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QLTRAD += state.dataHeatBal->Lights(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QLTSW += state.dataHeatBal->Lights(Loop).VisGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QLTCON += state.dataHeatBal->Lights(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QLTCRA += state.dataHeatBal->Lights(Loop).RetAirGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QLTTOT += state.dataHeatBal->Lights(Loop).TotGainRate; - } + state.dataHeatBal->Lights(Loop).Power = Q; + state.dataHeatBal->Lights(Loop).RadGainRate = Q * FractionRadiant; + state.dataHeatBal->Lights(Loop).VisGainRate = Q * state.dataHeatBal->Lights(Loop).FractionShortWave; + state.dataHeatBal->Lights(Loop).ConGainRate = Q * FractionConvected; + state.dataHeatBal->Lights(Loop).RetAirGainRate = Q * FractionReturnAir; + state.dataHeatBal->Lights(Loop).TotGainRate = Q; + + state.dataHeatBal->ZnRpt(NZ).LtsPower += state.dataHeatBal->Lights(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QLTRAD += state.dataHeatBal->Lights(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QLTSW += state.dataHeatBal->Lights(Loop).VisGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QLTCON += state.dataHeatBal->Lights(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QLTCRA += state.dataHeatBal->Lights(Loop).RetAirGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QLTTOT += state.dataHeatBal->Lights(Loop).TotGainRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { - Q = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); - - // Reduce equipment power due to demand limiting - if (state.dataHeatBal->ZoneElectric(Loop).ManageDemand && (Q > state.dataHeatBal->ZoneElectric(Loop).DemandLimit)) - Q = state.dataHeatBal->ZoneElectric(Loop).DemandLimit; - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneElectric(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneElectric(Loop).EMSEquipPower; - - state.dataHeatBal->ZoneElectric(Loop).Power = Q; - state.dataHeatBal->ZoneElectric(Loop).RadGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionRadiant; - state.dataHeatBal->ZoneElectric(Loop).ConGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionConvected; - state.dataHeatBal->ZoneElectric(Loop).LatGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionLatent; - state.dataHeatBal->ZoneElectric(Loop).LostRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionLost; - state.dataHeatBal->ZoneElectric(Loop).TotGainRate = Q - state.dataHeatBal->ZoneElectric(Loop).LostRate; - - int NZ = state.dataHeatBal->ZoneElectric(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).ElecPower += state.dataHeatBal->ZoneElectric(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QEERAD += state.dataHeatBal->ZoneElectric(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QEECON += state.dataHeatBal->ZoneElectric(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QEELAT += state.dataHeatBal->ZoneElectric(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QEELost += state.dataHeatBal->ZoneElectric(Loop).LostRate; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { + Q = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); + + // Reduce equipment power due to demand limiting + if (state.dataHeatBal->ZoneElectric(Loop).ManageDemand && (Q > state.dataHeatBal->ZoneElectric(Loop).DemandLimit)) + Q = state.dataHeatBal->ZoneElectric(Loop).DemandLimit; + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneElectric(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneElectric(Loop).EMSEquipPower; + + state.dataHeatBal->ZoneElectric(Loop).Power = Q; + state.dataHeatBal->ZoneElectric(Loop).RadGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionRadiant; + state.dataHeatBal->ZoneElectric(Loop).ConGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionConvected; + state.dataHeatBal->ZoneElectric(Loop).LatGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionLatent; + state.dataHeatBal->ZoneElectric(Loop).LostRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionLost; + state.dataHeatBal->ZoneElectric(Loop).TotGainRate = Q - state.dataHeatBal->ZoneElectric(Loop).LostRate; + + int NZ = state.dataHeatBal->ZoneElectric(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).ElecPower += state.dataHeatBal->ZoneElectric(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QEERAD += state.dataHeatBal->ZoneElectric(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QEECON += state.dataHeatBal->ZoneElectric(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QEELAT += state.dataHeatBal->ZoneElectric(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QEELost += state.dataHeatBal->ZoneElectric(Loop).LostRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { - Q = state.dataHeatBal->ZoneGas(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneGas(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneGas(Loop).EMSEquipPower; - - state.dataHeatBal->ZoneGas(Loop).Power = Q; - state.dataHeatBal->ZoneGas(Loop).RadGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionRadiant; - state.dataHeatBal->ZoneGas(Loop).ConGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionConvected; - state.dataHeatBal->ZoneGas(Loop).LatGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionLatent; - state.dataHeatBal->ZoneGas(Loop).LostRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionLost; - state.dataHeatBal->ZoneGas(Loop).TotGainRate = Q - state.dataHeatBal->ZoneGas(Loop).LostRate; - state.dataHeatBal->ZoneGas(Loop).CO2GainRate = Q * state.dataHeatBal->ZoneGas(Loop).CO2RateFactor; - - int NZ = state.dataHeatBal->ZoneGas(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).GasPower += state.dataHeatBal->ZoneGas(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QGERAD += state.dataHeatBal->ZoneGas(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QGECON += state.dataHeatBal->ZoneGas(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QGELAT += state.dataHeatBal->ZoneGas(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QGELost += state.dataHeatBal->ZoneGas(Loop).LostRate; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { + Q = state.dataHeatBal->ZoneGas(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneGas(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneGas(Loop).EMSEquipPower; + + state.dataHeatBal->ZoneGas(Loop).Power = Q; + state.dataHeatBal->ZoneGas(Loop).RadGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionRadiant; + state.dataHeatBal->ZoneGas(Loop).ConGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionConvected; + state.dataHeatBal->ZoneGas(Loop).LatGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionLatent; + state.dataHeatBal->ZoneGas(Loop).LostRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionLost; + state.dataHeatBal->ZoneGas(Loop).TotGainRate = Q - state.dataHeatBal->ZoneGas(Loop).LostRate; + state.dataHeatBal->ZoneGas(Loop).CO2GainRate = Q * state.dataHeatBal->ZoneGas(Loop).CO2RateFactor; + + int NZ = state.dataHeatBal->ZoneGas(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).GasPower += state.dataHeatBal->ZoneGas(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QGERAD += state.dataHeatBal->ZoneGas(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QGECON += state.dataHeatBal->ZoneGas(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QGELAT += state.dataHeatBal->ZoneGas(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QGELost += state.dataHeatBal->ZoneGas(Loop).LostRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { - Q = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); + for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { + Q = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneOtherEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneOtherEq(Loop).EMSEquipPower; + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneOtherEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneOtherEq(Loop).EMSEquipPower; - state.dataHeatBal->ZoneOtherEq(Loop).Power = Q; - state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant; - state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected; - state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent; - state.dataHeatBal->ZoneOtherEq(Loop).LostRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionLost; - state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneOtherEq(Loop).LostRate; + state.dataHeatBal->ZoneOtherEq(Loop).Power = Q; + state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant; + state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected; + state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent; + state.dataHeatBal->ZoneOtherEq(Loop).LostRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionLost; + state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneOtherEq(Loop).LostRate; - int NZ = state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr; - state.dataHeatBal->ZoneIntGain(NZ).QOERAD += state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOECON += state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOELAT += state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOELost += state.dataHeatBal->ZoneOtherEq(Loop).LostRate; - } + int NZ = state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr; + state.dataHeatBal->ZoneIntGain(NZ).QOERAD += state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOECON += state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOELAT += state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOELost += state.dataHeatBal->ZoneOtherEq(Loop).LostRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { - Q = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneHWEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneHWEq(Loop).EMSEquipPower; - - state.dataHeatBal->ZoneHWEq(Loop).Power = Q; - state.dataHeatBal->ZoneHWEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant; - state.dataHeatBal->ZoneHWEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionConvected; - state.dataHeatBal->ZoneHWEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionLatent; - state.dataHeatBal->ZoneHWEq(Loop).LostRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionLost; - state.dataHeatBal->ZoneHWEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneHWEq(Loop).LostRate; - - int NZ = state.dataHeatBal->ZoneHWEq(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).HWPower += state.dataHeatBal->ZoneHWEq(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QHWRAD += state.dataHeatBal->ZoneHWEq(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QHWCON += state.dataHeatBal->ZoneHWEq(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QHWLAT += state.dataHeatBal->ZoneHWEq(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QHWLost += state.dataHeatBal->ZoneHWEq(Loop).LostRate; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { + Q = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneHWEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneHWEq(Loop).EMSEquipPower; + + state.dataHeatBal->ZoneHWEq(Loop).Power = Q; + state.dataHeatBal->ZoneHWEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant; + state.dataHeatBal->ZoneHWEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionConvected; + state.dataHeatBal->ZoneHWEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionLatent; + state.dataHeatBal->ZoneHWEq(Loop).LostRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionLost; + state.dataHeatBal->ZoneHWEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneHWEq(Loop).LostRate; + + int NZ = state.dataHeatBal->ZoneHWEq(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).HWPower += state.dataHeatBal->ZoneHWEq(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QHWRAD += state.dataHeatBal->ZoneHWEq(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QHWCON += state.dataHeatBal->ZoneHWEq(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QHWLAT += state.dataHeatBal->ZoneHWEq(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QHWLost += state.dataHeatBal->ZoneHWEq(Loop).LostRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { - Q = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneSteamEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneSteamEq(Loop).EMSEquipPower; - - state.dataHeatBal->ZoneSteamEq(Loop).Power = Q; - state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant; - state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected; - state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent; - state.dataHeatBal->ZoneSteamEq(Loop).LostRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionLost; - state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneSteamEq(Loop).LostRate; - - int NZ = state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).SteamPower += state.dataHeatBal->ZoneSteamEq(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QSERAD += state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QSECON += state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QSELAT += state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QSELost += state.dataHeatBal->ZoneSteamEq(Loop).LostRate; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { + Q = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneSteamEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneSteamEq(Loop).EMSEquipPower; + + state.dataHeatBal->ZoneSteamEq(Loop).Power = Q; + state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant; + state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected; + state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent; + state.dataHeatBal->ZoneSteamEq(Loop).LostRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionLost; + state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneSteamEq(Loop).LostRate; + + int NZ = state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).SteamPower += state.dataHeatBal->ZoneSteamEq(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QSERAD += state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QSECON += state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QSELAT += state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QSELost += state.dataHeatBal->ZoneSteamEq(Loop).LostRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { - int NZ = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; - if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp >= state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature) { - Q = 0.0; - } else if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp > state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) { - Q = (state.dataHeatBal->Zone(NZ).OutDryBulbTemp - state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) * + for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { + int NZ = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; + if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp >= state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature) { + Q = 0.0; + } + else if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp > state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) { + Q = (state.dataHeatBal->Zone(NZ).OutDryBulbTemp - state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) * (state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature - state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature) / (state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature - state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) + - state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature; - } else { - Q = state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature; - } - Q *= GetCurrentScheduleValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); + state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature; + } + else { + Q = state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature; + } + Q *= GetCurrentScheduleValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); - // set with EMS value if being called for. - if (state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardOverrideOn) Q = state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardPower; + // set with EMS value if being called for. + if (state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardOverrideOn) Q = state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardPower; - state.dataHeatBal->ZoneBBHeat(Loop).Power = Q; - state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate = Q * state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant; - state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate = Q * state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected; - state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate = Q; + state.dataHeatBal->ZoneBBHeat(Loop).Power = Q; + state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate = Q * state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant; + state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate = Q * state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected; + state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate = Q; - NZ = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).BaseHeatPower += state.dataHeatBal->ZoneBBHeat(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QBBRAD += state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QBBCON += state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate; - } + NZ = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).BaseHeatPower += state.dataHeatBal->ZoneBBHeat(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QBBRAD += state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QBBCON += state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) { - int NZ = state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr; - state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate = - state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); - state.dataHeatBal->ZnRpt(NZ).CO2Rate += state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) { + int NZ = state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr; + state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate = + state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); + state.dataHeatBal->ZnRpt(NZ).CO2Rate += state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate; + } - if (state.dataHeatBal->NumZoneITEqStatements > 0) CalcZoneITEq(state); + if (state.dataHeatBal->NumZoneITEqStatements > 0) CalcZoneITEq(state); - CalcWaterThermalTankZoneGains(state); - PipeHeatTransfer::PipeHTData::CalcZonePipesHeatGain(state); - CalcWaterUseZoneGains(state); - FigureFuelCellZoneGains(state); - FigureMicroCHPZoneGains(state); - initializeElectricPowerServiceZoneGains(state); - FigureTDDZoneGains(state); - FigureRefrigerationZoneGains(state); + CalcWaterThermalTankZoneGains(state); + PipeHeatTransfer::PipeHTData::CalcZonePipesHeatGain(state); + CalcWaterUseZoneGains(state); + FigureFuelCellZoneGains(state); + FigureMicroCHPZoneGains(state); + initializeElectricPowerServiceZoneGains(state); + FigureTDDZoneGains(state); + FigureRefrigerationZoneGains(state); - // store pointer values to hold generic internal gain values constant for entire timestep - UpdateInternalGainValues(state); + // store pointer values to hold generic internal gain values constant for entire timestep + UpdateInternalGainValues(state); - for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { + for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { - SumAllInternalLatentGains(state, NZ, state.dataHeatBalFanSys->ZoneLatentGain(NZ)); - // Added for hybrid model - if (state.dataHybridModel->FlagHybridModel_PC) { - SumAllInternalLatentGainsExceptPeople(state, NZ, state.dataHeatBalFanSys->ZoneLatentGainExceptPeople(NZ)); + SumAllInternalLatentGains(state, NZ, state.dataHeatBalFanSys->ZoneLatentGain(NZ)); + // Added for hybrid model + if (state.dataHybridModel->FlagHybridModel_PC) { + SumAllInternalLatentGainsExceptPeople(state, NZ, state.dataHeatBalFanSys->ZoneLatentGainExceptPeople(NZ)); + } } - } - // QL is per radiant enclosure (one or more zones if grouped by air boundaries) - for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++enclosureNum) { - auto &thisEnclosure(state.dataViewFactor->ZoneRadiantInfo(enclosureNum)); - state.dataHeatBal->QL(enclosureNum) = 0.0; - for (int const zoneNum : thisEnclosure.ZoneNums) { - Real64 zoneQL; - SumAllInternalRadiationGains(state, zoneNum, zoneQL); - state.dataHeatBal->QL(enclosureNum) += zoneQL; + // QL is per radiant enclosure (one or more zones if grouped by air boundaries) + for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++enclosureNum) { + auto &thisEnclosure(state.dataViewFactor->ZoneRadiantInfo(enclosureNum)); + state.dataHeatBal->QL(enclosureNum) = 0.0; + for (int const zoneNum : thisEnclosure.ZoneNums) { + Real64 zoneQL; + SumAllInternalRadiationGains(state, zoneNum, zoneQL); + state.dataHeatBal->QL(enclosureNum) += zoneQL; + } } - } - state.dataHeatBalFanSys->SumConvHTRadSys = 0.0; + state.dataHeatBalFanSys->SumConvHTRadSys = 0.0; - pulseMultipler = 0.01; // the W/sqft pulse for the zone - if (state.dataGlobal->CompLoadReportIsReq) { - AllocateLoadComponentArrays(state); - } - for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { // Loop through all surfaces... - int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; - int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; - if (firstSurf <= 0) continue; - for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { - int const radEnclosureNum = state.dataHeatBal->Zone(zoneNum).RadiantEnclosureNum; - if (!state.dataGlobal->doLoadComponentPulseNow) { - state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = - state.dataHeatBal->QL(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); - } else { - state.dataInternalHeatGains->curQL = state.dataHeatBal->QL(radEnclosureNum); - // for the loads component report during the special sizing run increase the radiant portion - // a small amount to create a "pulse" of heat that is used for the delayed loads - state.dataInternalHeatGains->adjQL = - state.dataInternalHeatGains->curQL + state.dataViewFactor->ZoneRadiantInfo(radEnclosureNum).FloorArea * pulseMultipler; - // ITABSF is the Inside Thermal Absorptance - // TMULT is a multiplier for each zone - // QRadThermInAbs is the thermal radiation absorbed on inside surfaces - state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = - state.dataInternalHeatGains->adjQL * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); - // store the magnitude and time of the pulse - state.dataOutRptTab->radiantPulseTimestep(state.dataSize->CurOverallSimDay, zoneNum) = - (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - state.dataOutRptTab->radiantPulseReceived(state.dataSize->CurOverallSimDay, SurfNum) = - (state.dataInternalHeatGains->adjQL - state.dataInternalHeatGains->curQL) * state.dataHeatBal->TMULT(radEnclosureNum) * - state.dataHeatBal->ITABSF(SurfNum) * state.dataSurface->Surface(SurfNum).Area; + pulseMultipler = 0.01; // the W/sqft pulse for the zone + if (state.dataGlobal->CompLoadReportIsReq) { + AllocateLoadComponentArrays(state); + } + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { // Loop through all surfaces... + int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; + int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; + if (firstSurf <= 0) continue; + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + int const radEnclosureNum = state.dataHeatBal->Zone(zoneNum).RadiantEnclosureNum; + if (!state.dataGlobal->doLoadComponentPulseNow) { + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = + state.dataHeatBal->QL(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); + } + else { + state.dataInternalHeatGains->curQL = state.dataHeatBal->QL(radEnclosureNum); + // for the loads component report during the special sizing run increase the radiant portion + // a small amount to create a "pulse" of heat that is used for the delayed loads + state.dataInternalHeatGains->adjQL = + state.dataInternalHeatGains->curQL + state.dataViewFactor->ZoneRadiantInfo(radEnclosureNum).FloorArea * pulseMultipler; + // ITABSF is the Inside Thermal Absorptance + // TMULT is a multiplier for each zone + // QRadThermInAbs is the thermal radiation absorbed on inside surfaces + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = + state.dataInternalHeatGains->adjQL * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); + // store the magnitude and time of the pulse + state.dataOutRptTab->radiantPulseTimestep(state.dataSize->CurOverallSimDay, zoneNum) = + (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; + state.dataOutRptTab->radiantPulseReceived(state.dataSize->CurOverallSimDay, SurfNum) = + (state.dataInternalHeatGains->adjQL - state.dataInternalHeatGains->curQL) * state.dataHeatBal->TMULT(radEnclosureNum) * + state.dataHeatBal->ITABSF(SurfNum) * state.dataSurface->Surface(SurfNum).Area; + } } } } - } - void CheckReturnAirHeatGain(EnergyPlusData &state) - { - // SUBROUTINE INFORMATION: - // AUTHOR Xuan Luo - // DATE WRITTEN Jan 2018 + void CheckReturnAirHeatGain(EnergyPlusData &state) + { + // SUBROUTINE INFORMATION: + // AUTHOR Xuan Luo + // DATE WRITTEN Jan 2018 - // PURPOSE OF THIS SUBROUTINE: - // This subroutine currently creates the values for standard "zone loads" reporting - // from the heat balance module. + // PURPOSE OF THIS SUBROUTINE: + // This subroutine currently creates the values for standard "zone loads" reporting + // from the heat balance module. - // Using/Aliasing + // Using/Aliasing - for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasLtsRetAirGain) { - ShowFatalError(state, - "Return air heat gains from lights are not allowed when Air Flow Calculation Method = " - "FlowControlWithApproachTemperatures in zones with ITE objects."); - } - if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasAirFlowWindowReturn) { - ShowFatalError(state, - "Return air heat gains from windows are not allowed when Air Flow Calculation Method = " - "FlowControlWithApproachTemperatures in zones with ITE objects."); + for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { + if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasLtsRetAirGain) { + ShowFatalError(state, + "Return air heat gains from lights are not allowed when Air Flow Calculation Method = " + "FlowControlWithApproachTemperatures in zones with ITE objects."); + } + if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasAirFlowWindowReturn) { + ShowFatalError(state, + "Return air heat gains from windows are not allowed when Air Flow Calculation Method = " + "FlowControlWithApproachTemperatures in zones with ITE objects."); + } } } - } - - void CalcZoneITEq(EnergyPlusData &state) - { - - // SUBROUTINE INFORMATION: - // AUTHOR M.J. Witte - // DATE WRITTEN October 2014 - - // PURPOSE OF THIS SUBROUTINE: - // This subroutine calculates the gains and other results for ElectricEquipment:ITE:AirCooled. - // This broken into a separate subroutine, because the calculations are more detailed than the other - // types of internal gains. - - using ScheduleManager::GetCurrentScheduleValue; - using namespace Psychrometrics; - using CurveManager::CurveValue; - using DataHVACGlobals::SmallAirVolFlow; - using DataHVACGlobals::SmallTempDiff; - - // Operating Limits for environmental class: None, A1, A2, A3, A4, B, C - // From ASHRAE 2011 Thermal Guidelines environmental classes for Air-Cooled ITE - static Array1D const DBMin(7, {-99.0, 15.0, 10.0, 5.0, 5.0, 5.0, 5.0}); // Minimum dry-bulb temperature [C] - static Array1D const DBMax(7, {99.0, 32.0, 35.0, 40.0, 45.0, 35.0, 40.0}); // Maximum dry-bulb temperature [C] - static Array1D const DPMax(7, {99.0, 17.0, 21.0, 24.0, 24.0, 28.0, 28.0}); // Maximum dewpoint temperature [C] - static Array1D const DPMin(7, {-99.0, -99.0, -99.0, -12.0, -12.0, -99.0, -99.0}); // Minimum dewpoint temperature [C] - static Array1D const RHMin(7, {0.0, 20.0, 20.0, 8.0, 8.0, 8.0, 8.0}); // Minimum relative humidity [%] - static Array1D const RHMax(7, {99.0, 80.0, 80.0, 85.0, 90.0, 80.0, 80.0}); // Maximum relative humidity [%] - - static std::string const RoutineName("CalcZoneITEq"); - int Loop; - int NZ; - int SupplyNodeNum; // Supply air node number (if zero, then not specified) - Real64 OperSchedFrac; // Operating schedule fraction - Real64 CPULoadSchedFrac; // CPU loading schedule fraction - Real64 AirConnection; // Air connection type - Real64 TSupply(0.0); // Supply air temperature [C] - Real64 WSupply; // Supply air humidity ratio [kgWater/kgDryAir] - Real64 RecircFrac; // Recirulation fraction - current - Real64 TRecirc; // Recirulation air temperature [C] - Real64 WRecirc; // Recirulation air humidity ratio [kgWater/kgDryAir] - Real64 TAirIn; // Entering air dry-bulb temperature [C] - Real64 TAirInDesign; // Design entering air dry-bulb temperature [C] - Real64 WAirIn; // Entering air humidity ratio [kgWater/kgDryAir] - Real64 TDPAirIn; // Entering air dewpoint temperature [C] - Real64 RHAirIn; // Entering air relative humidity [%] - Real64 SupplyHeatIndex; // Supply heat index - Real64 TAirOut; // Leaving air temperature [C] - Real64 AirVolFlowFrac; // Air volume flow fraction - Real64 AirVolFlowFracDesignT; // Air volume flow fraction at design entering air temperature - Real64 AirVolFlowRate; // Air volume flow rate at current density [m3/s] - Real64 AirMassFlowRate; // Air mass flow rate [kg/s] - Real64 CPUPower; // CPU power input [W] - Real64 FanPower; // Fan power input [W] - Real64 UPSPower; // UPS new power input (losses) [W] - Real64 UPSPartLoadRatio; // UPS part load ratio (current total power input / design total power input) - Real64 UPSHeatGain; // UPS convective heat gain to zone [W] - int EnvClass; // Index for environmental class (None=0, A1=1, A2=2, A3=3, A4=4, B=5, C=6) - - std::map> ZoneITEMap; - - // Zero out time step variables - // Object report variables - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - state.dataHeatBal->ZoneITEq(Loop).CPUPower = 0.0; - state.dataHeatBal->ZoneITEq(Loop).FanPower = 0.0; - state.dataHeatBal->ZoneITEq(Loop).UPSPower = 0.0; - state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign = 0.0; - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign = 0.0; - state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone = 0.0; - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = 0.0; - - state.dataHeatBal->ZoneITEq(Loop).CPUConsumption = 0.0; - state.dataHeatBal->ZoneITEq(Loop).FanConsumption = 0.0; - state.dataHeatBal->ZoneITEq(Loop).UPSConsumption = 0.0; - state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign = 0.0; - state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign = 0.0; - state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone = 0.0; - state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone = 0.0; - - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).SHI = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = 0.0; - state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = 0.0; - state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = 0.0; - } // ZoneITEq init loop - - // Zone total report variables - for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { - state.dataHeatBal->ZnRpt(Loop).ITEqCPUPower = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqFanPower = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqUPSPower = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqCPUPowerAtDesign = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqFanPowerAtDesign = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqUPSGainRateToZone = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqConGainRateToZone = 0.0; - - state.dataHeatBal->ZnRpt(Loop).ITEAdjReturnTemp = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqCPUConsumption = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqFanConsumption = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqUPSConsumption = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqCPUEnergyAtDesign = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqFanEnergyAtDesign = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqUPSGainEnergyToZone = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqConGainEnergyToZone = 0.0; - - state.dataHeatBal->ZnRpt(Loop).ITEqAirVolFlowStdDensity = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqAirMassFlow = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqSHI = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeOutOfOperRange = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveDryBulbT = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowDryBulbT = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveDewpointT = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowDewpointT = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveRH = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowRH = 0.0; - - state.dataHeatBal->ZnRpt(Loop).SumTinMinusTSup = 0.0; - state.dataHeatBal->ZnRpt(Loop).SumToutMinusTSup = 0.0; - } // Zone init loop - - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - // Get schedules - NZ = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; - OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); - CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); - - // Determine inlet air temperature and humidity - AirConnection = state.dataHeatBal->ZoneITEq(Loop).AirConnectionType; - RecircFrac = 0.0; - SupplyNodeNum = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum; - if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp; - WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; - if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) { - TAirIn = TSupply + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch); - } else { - TAirIn = TSupply + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp; - } - WAirIn = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; - } else { - if (AirConnection == ITEInletAdjustedSupply) { + + void CalcZoneITEq(EnergyPlusData &state) + { + + // SUBROUTINE INFORMATION: + // AUTHOR M.J. Witte + // DATE WRITTEN October 2014 + + // PURPOSE OF THIS SUBROUTINE: + // This subroutine calculates the gains and other results for ElectricEquipment:ITE:AirCooled. + // This broken into a separate subroutine, because the calculations are more detailed than the other + // types of internal gains. + + using ScheduleManager::GetCurrentScheduleValue; + using namespace Psychrometrics; + using CurveManager::CurveValue; + using DataHVACGlobals::SmallAirVolFlow; + using DataHVACGlobals::SmallTempDiff; + + // Operating Limits for environmental class: None, A1, A2, A3, A4, B, C + // From ASHRAE 2011 Thermal Guidelines environmental classes for Air-Cooled ITE + static Array1D const DBMin(7, { -99.0, 15.0, 10.0, 5.0, 5.0, 5.0, 5.0 }); // Minimum dry-bulb temperature [C] + static Array1D const DBMax(7, { 99.0, 32.0, 35.0, 40.0, 45.0, 35.0, 40.0 }); // Maximum dry-bulb temperature [C] + static Array1D const DPMax(7, { 99.0, 17.0, 21.0, 24.0, 24.0, 28.0, 28.0 }); // Maximum dewpoint temperature [C] + static Array1D const DPMin(7, { -99.0, -99.0, -99.0, -12.0, -12.0, -99.0, -99.0 }); // Minimum dewpoint temperature [C] + static Array1D const RHMin(7, { 0.0, 20.0, 20.0, 8.0, 8.0, 8.0, 8.0 }); // Minimum relative humidity [%] + static Array1D const RHMax(7, { 99.0, 80.0, 80.0, 85.0, 90.0, 80.0, 80.0 }); // Maximum relative humidity [%] + + static std::string const RoutineName("CalcZoneITEq"); + int Loop; + int NZ; + int SupplyNodeNum; // Supply air node number (if zero, then not specified) + Real64 OperSchedFrac; // Operating schedule fraction + Real64 CPULoadSchedFrac; // CPU loading schedule fraction + Real64 AirConnection; // Air connection type + Real64 TSupply(0.0); // Supply air temperature [C] + Real64 WSupply; // Supply air humidity ratio [kgWater/kgDryAir] + Real64 RecircFrac; // Recirulation fraction - current + Real64 TRecirc; // Recirulation air temperature [C] + Real64 WRecirc; // Recirulation air humidity ratio [kgWater/kgDryAir] + Real64 TAirIn; // Entering air dry-bulb temperature [C] + Real64 TAirInDesign; // Design entering air dry-bulb temperature [C] + Real64 WAirIn; // Entering air humidity ratio [kgWater/kgDryAir] + Real64 TDPAirIn; // Entering air dewpoint temperature [C] + Real64 RHAirIn; // Entering air relative humidity [%] + Real64 SupplyHeatIndex; // Supply heat index + Real64 TAirOut; // Leaving air temperature [C] + Real64 AirVolFlowFrac; // Air volume flow fraction + Real64 AirVolFlowFracDesignT; // Air volume flow fraction at design entering air temperature + Real64 AirVolFlowRate; // Air volume flow rate at current density [m3/s] + Real64 AirMassFlowRate; // Air mass flow rate [kg/s] + Real64 CPUPower; // CPU power input [W] + Real64 FanPower; // Fan power input [W] + Real64 UPSPower; // UPS new power input (losses) [W] + Real64 UPSPartLoadRatio; // UPS part load ratio (current total power input / design total power input) + Real64 UPSHeatGain; // UPS convective heat gain to zone [W] + int EnvClass; // Index for environmental class (None=0, A1=1, A2=2, A3=3, A4=4, B=5, C=6) + + std::map> ZoneITEMap; + + // Zero out time step variables + // Object report variables + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + state.dataHeatBal->ZoneITEq(Loop).CPUPower = 0.0; + state.dataHeatBal->ZoneITEq(Loop).FanPower = 0.0; + state.dataHeatBal->ZoneITEq(Loop).UPSPower = 0.0; + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign = 0.0; + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign = 0.0; + state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone = 0.0; + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = 0.0; + + state.dataHeatBal->ZoneITEq(Loop).CPUConsumption = 0.0; + state.dataHeatBal->ZoneITEq(Loop).FanConsumption = 0.0; + state.dataHeatBal->ZoneITEq(Loop).UPSConsumption = 0.0; + state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign = 0.0; + state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign = 0.0; + state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone = 0.0; + state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone = 0.0; + + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).SHI = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = 0.0; + state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = 0.0; + state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = 0.0; + } // ZoneITEq init loop + + // Zone total report variables + for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { + state.dataHeatBal->ZnRpt(Loop).ITEqCPUPower = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqFanPower = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqUPSPower = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqCPUPowerAtDesign = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqFanPowerAtDesign = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqUPSGainRateToZone = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqConGainRateToZone = 0.0; + + state.dataHeatBal->ZnRpt(Loop).ITEAdjReturnTemp = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqCPUConsumption = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqFanConsumption = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqUPSConsumption = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqCPUEnergyAtDesign = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqFanEnergyAtDesign = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqUPSGainEnergyToZone = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqConGainEnergyToZone = 0.0; + + state.dataHeatBal->ZnRpt(Loop).ITEqAirVolFlowStdDensity = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqAirMassFlow = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqSHI = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeOutOfOperRange = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveDryBulbT = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowDryBulbT = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveDewpointT = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowDewpointT = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveRH = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowRH = 0.0; + + state.dataHeatBal->ZnRpt(Loop).SumTinMinusTSup = 0.0; + state.dataHeatBal->ZnRpt(Loop).SumToutMinusTSup = 0.0; + } // Zone init loop + + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + // Get schedules + NZ = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; + OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); + CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); + + // Determine inlet air temperature and humidity + AirConnection = state.dataHeatBal->ZoneITEq(Loop).AirConnectionType; + RecircFrac = 0.0; + SupplyNodeNum = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum; + if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp; WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; - if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve != 0) { - RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve, CPULoadSchedFrac, TSupply); - } else { - RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac; + if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) { + TAirIn = TSupply + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch); + } + else { + TAirIn = TSupply + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp; + } + WAirIn = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; + } + else { + if (AirConnection == ITEInletAdjustedSupply) { + TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp; + WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; + if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve != 0) { + RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve, CPULoadSchedFrac, TSupply); + } + else { + RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac; + } + TRecirc = state.dataHeatBalFanSys->MAT(NZ); + WRecirc = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); + TAirIn = TRecirc * RecircFrac + TSupply * (1.0 - RecircFrac); + WAirIn = WRecirc * RecircFrac + WSupply * (1.0 - RecircFrac); + } + else if (AirConnection == ITEInletRoomAirModel) { + // Room air model option: TAirIn=TAirZone, according to EngineeringRef 17.1.4 + TAirIn = state.dataHeatBalFanSys->MAT(NZ); + TSupply = TAirIn; + WAirIn = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); + } + else { + // TAirIn = TRoomAirNodeIn, according to EngineeringRef 17.1.4 + int ZoneAirInletNode = state.dataZoneEquip->ZoneEquipConfig(NZ).InletNode(1); + TSupply = state.dataLoopNodes->Node(ZoneAirInletNode).Temp; + TAirIn = state.dataHeatBalFanSys->MAT(NZ); + WAirIn = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); } - TRecirc = state.dataHeatBalFanSys->MAT(NZ); - WRecirc = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); - TAirIn = TRecirc * RecircFrac + TSupply * (1.0 - RecircFrac); - WAirIn = WRecirc * RecircFrac + WSupply * (1.0 - RecircFrac); - } else if (AirConnection == ITEInletRoomAirModel) { - // Room air model option: TAirIn=TAirZone, according to EngineeringRef 17.1.4 - TAirIn = state.dataHeatBalFanSys->MAT(NZ); - TSupply = TAirIn; - WAirIn = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); - } else { - // TAirIn = TRoomAirNodeIn, according to EngineeringRef 17.1.4 - int ZoneAirInletNode = state.dataZoneEquip->ZoneEquipConfig(NZ).InletNode(1); - TSupply = state.dataLoopNodes->Node(ZoneAirInletNode).Temp; - TAirIn = state.dataHeatBalFanSys->MAT(NZ); - WAirIn = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); } - } - TDPAirIn = PsyTdpFnWPb(state, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); - RHAirIn = 100.0 * PsyRhFnTdbWPb(state, TAirIn, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); // RHAirIn is % + TDPAirIn = PsyTdpFnWPb(state, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); + RHAirIn = 100.0 * PsyRhFnTdbWPb(state, TAirIn, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); // RHAirIn is % - // Calculate power input and airflow - TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn; + // Calculate power input and airflow + TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn; - if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn; - if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) { - TAirInDesign = TAirInDesign + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch); - } else { - TAirInDesign = TAirInDesign + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp; + TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn; + if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) { + TAirInDesign = TAirInDesign + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch); + } + else { + TAirInDesign = TAirInDesign + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp; + } + OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); + CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); } - OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); - CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); - } - CPUPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirIn), - 0.0); - state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign = - max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirInDesign), + CPUPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirIn), 0.0); + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign = + max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirInDesign), + 0.0); - AirVolFlowFrac = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirIn), 0.0); - AirVolFlowRate = state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate * OperSchedFrac * AirVolFlowFrac; - if (AirVolFlowRate < SmallAirVolFlow) { - AirVolFlowRate = 0.0; - } - AirVolFlowFracDesignT = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirInDesign), 0.0); + AirVolFlowFrac = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirIn), 0.0); + AirVolFlowRate = state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate * OperSchedFrac * AirVolFlowFrac; + if (AirVolFlowRate < SmallAirVolFlow) { + AirVolFlowRate = 0.0; + } + AirVolFlowFracDesignT = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirInDesign), 0.0); - FanPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFrac), - 0.0); - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign = - max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFracDesignT), + FanPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFrac), 0.0); + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign = + max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFracDesignT), + 0.0); - // Calculate UPS net power input (power in less power to ITEquip) and UPS heat gain to zone - if (state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower > 0.0) { - UPSPartLoadRatio = (CPUPower + FanPower) / state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; - } else { - UPSPartLoadRatio = 0.0; - } - if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve != 0) { - UPSPower = - (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve, UPSPartLoadRatio)), - 0.0); - } else { - UPSPower = (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency), 0.0); - } - UPSHeatGain = UPSPower * state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac; + // Calculate UPS net power input (power in less power to ITEquip) and UPS heat gain to zone + if (state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower > 0.0) { + UPSPartLoadRatio = (CPUPower + FanPower) / state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; + } + else { + UPSPartLoadRatio = 0.0; + } + if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve != 0) { + UPSPower = + (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve, UPSPartLoadRatio)), + 0.0); + } + else { + UPSPower = (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency), 0.0); + } + UPSHeatGain = UPSPower * state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac; - // Calculate air outlet conditions and convective heat gain to zone + // Calculate air outlet conditions and convective heat gain to zone - AirMassFlowRate = AirVolFlowRate * PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, TAirIn, WAirIn, RoutineName); - if (AirMassFlowRate > 0.0) { - TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnW(WAirIn); - } else { - TAirOut = TAirIn; - } + AirMassFlowRate = AirVolFlowRate * PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, TAirIn, WAirIn, RoutineName); + if (AirMassFlowRate > 0.0) { + TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnW(WAirIn); + } + else { + TAirOut = TAirIn; + } - if (std::abs(TAirOut - TSupply) < SmallTempDiff) { - TAirOut = TSupply; - } + if (std::abs(TAirOut - TSupply) < SmallTempDiff) { + TAirOut = TSupply; + } - if ((SupplyNodeNum != 0) && (TAirOut != TSupply)) { - SupplyHeatIndex = (TAirIn - TSupply) / (TAirOut - TSupply); - } else { - SupplyHeatIndex = 0.0; - } + if ((SupplyNodeNum != 0) && (TAirOut != TSupply)) { + SupplyHeatIndex = (TAirIn - TSupply) / (TAirOut - TSupply); + } + else { + SupplyHeatIndex = 0.0; + } - if (AirConnection == ITEInletAdjustedSupply || AirConnection == ITEInletZoneAirNode) { - // If not a room air model, then all ITEquip power input is a convective heat gain to the zone heat balance, plus UPS heat gain - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = CPUPower + FanPower + UPSHeatGain; - } else if (AirConnection == ITEInletRoomAirModel) { - // Room air model option not implemented yet - set room air model outlet node conditions here - // If a room air model, then the only convective heat gain to the zone heat balance is the UPS heat gain - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = UPSHeatGain; - } - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE) { - ZoneITEMap[state.dataHeatBal->ZoneITEq(Loop).ZonePtr].push_back(Loop); - } - if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - if (state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign > - state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower) { - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign; + if (AirConnection == ITEInletAdjustedSupply || AirConnection == ITEInletZoneAirNode) { + // If not a room air model, then all ITEquip power input is a convective heat gain to the zone heat balance, plus UPS heat gain + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = CPUPower + FanPower + UPSHeatGain; } - } - // Object report variables - state.dataHeatBal->ZoneITEq(Loop).CPUPower = CPUPower; - state.dataHeatBal->ZoneITEq(Loop).FanPower = FanPower; - state.dataHeatBal->ZoneITEq(Loop).UPSPower = UPSPower; - // ZoneITEq( Loop ).CPUPowerAtDesign = set above - // ZoneITEq( Loop ).FanPowerAtDesign = set above - state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone = UPSHeatGain; - // ZoneITEq( Loop ).ConGainRateToZone = set above - - state.dataHeatBal->ZnRpt(NZ).ITEqCPUPower += state.dataHeatBal->ZoneITEq(Loop).CPUPower; - state.dataHeatBal->ZnRpt(NZ).ITEqFanPower += state.dataHeatBal->ZoneITEq(Loop).FanPower; - state.dataHeatBal->ZnRpt(NZ).ITEqUPSPower += state.dataHeatBal->ZoneITEq(Loop).UPSPower; - state.dataHeatBal->ZnRpt(NZ).ITEqCPUPowerAtDesign += state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign; - state.dataHeatBal->ZnRpt(NZ).ITEqFanPowerAtDesign += state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign; - state.dataHeatBal->ZnRpt(NZ).ITEqUPSGainRateToZone += state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone; - state.dataHeatBal->ZnRpt(NZ).ITEqConGainRateToZone += state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone; - - state.dataHeatBal->ZoneITEq(Loop).CPUConsumption = CPUPower * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).FanConsumption = FanPower * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).UPSConsumption = UPSPower * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign = - state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign = - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone = UPSHeatGain * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone = - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone * state.dataGlobal->TimeStepZoneSec; - - state.dataHeatBal->ZnRpt(NZ).ITEqCPUConsumption += state.dataHeatBal->ZoneITEq(Loop).CPUConsumption; - state.dataHeatBal->ZnRpt(NZ).ITEqFanConsumption += state.dataHeatBal->ZoneITEq(Loop).FanConsumption; - state.dataHeatBal->ZnRpt(NZ).ITEqUPSConsumption += state.dataHeatBal->ZoneITEq(Loop).UPSConsumption; - state.dataHeatBal->ZnRpt(NZ).ITEqCPUEnergyAtDesign += state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign; - state.dataHeatBal->ZnRpt(NZ).ITEqFanEnergyAtDesign += state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign; - state.dataHeatBal->ZnRpt(NZ).ITEqUPSGainEnergyToZone += state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone; - state.dataHeatBal->ZnRpt(NZ).ITEqConGainEnergyToZone += state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone; - - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = AirMassFlowRate * state.dataEnvrn->StdRhoAir; - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = AirVolFlowRate; - state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = AirMassFlowRate; - state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = TAirIn; - state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = TDPAirIn; - state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = RHAirIn; - state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = TAirOut; - state.dataHeatBal->ZoneITEq(Loop).SHI = SupplyHeatIndex; - - state.dataHeatBal->ZnRpt(NZ).ITEqAirVolFlowStdDensity += state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity; - state.dataHeatBal->ZnRpt(NZ).ITEqAirMassFlow += state.dataHeatBal->ZoneITEq(Loop).AirMassFlow; - state.dataHeatBal->ZnRpt(NZ).SumTinMinusTSup += (TAirIn - TSupply) * AirVolFlowRate; - state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup += (TAirOut - TSupply) * AirVolFlowRate; - - // Check environmental class operating range limits (defined as parameters in this subroutine) - EnvClass = state.dataHeatBal->ZoneITEq(Loop).Class; - if (EnvClass > 0) { - if (TAirIn > DBMax(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = TAirIn - DBMax(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveDryBulbT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (TAirIn < DBMin(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = TAirIn - DBMin(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowDryBulbT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (TDPAirIn > DPMax(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = TDPAirIn - DPMax(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveDewpointT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (TDPAirIn < DPMin(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = TDPAirIn - DPMin(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowDewpointT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (RHAirIn > RHMax(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = RHAirIn - RHMax(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveRH = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (RHAirIn < RHMin(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = RHAirIn - RHMin(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowRH = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + else if (AirConnection == ITEInletRoomAirModel) { + // Room air model option not implemented yet - set room air model outlet node conditions here + // If a room air model, then the only convective heat gain to the zone heat balance is the UPS heat gain + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = UPSHeatGain; + } + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE) { + ZoneITEMap[state.dataHeatBal->ZoneITEq(Loop).ZonePtr].push_back(Loop); + } + if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + if (state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign > + state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower) { + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign; + } + } + // Object report variables + state.dataHeatBal->ZoneITEq(Loop).CPUPower = CPUPower; + state.dataHeatBal->ZoneITEq(Loop).FanPower = FanPower; + state.dataHeatBal->ZoneITEq(Loop).UPSPower = UPSPower; + // ZoneITEq( Loop ).CPUPowerAtDesign = set above + // ZoneITEq( Loop ).FanPowerAtDesign = set above + state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone = UPSHeatGain; + // ZoneITEq( Loop ).ConGainRateToZone = set above + + state.dataHeatBal->ZnRpt(NZ).ITEqCPUPower += state.dataHeatBal->ZoneITEq(Loop).CPUPower; + state.dataHeatBal->ZnRpt(NZ).ITEqFanPower += state.dataHeatBal->ZoneITEq(Loop).FanPower; + state.dataHeatBal->ZnRpt(NZ).ITEqUPSPower += state.dataHeatBal->ZoneITEq(Loop).UPSPower; + state.dataHeatBal->ZnRpt(NZ).ITEqCPUPowerAtDesign += state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign; + state.dataHeatBal->ZnRpt(NZ).ITEqFanPowerAtDesign += state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign; + state.dataHeatBal->ZnRpt(NZ).ITEqUPSGainRateToZone += state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone; + state.dataHeatBal->ZnRpt(NZ).ITEqConGainRateToZone += state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone; + + state.dataHeatBal->ZoneITEq(Loop).CPUConsumption = CPUPower * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).FanConsumption = FanPower * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).UPSConsumption = UPSPower * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign = + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign = + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone = UPSHeatGain * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone = + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone * state.dataGlobal->TimeStepZoneSec; + + state.dataHeatBal->ZnRpt(NZ).ITEqCPUConsumption += state.dataHeatBal->ZoneITEq(Loop).CPUConsumption; + state.dataHeatBal->ZnRpt(NZ).ITEqFanConsumption += state.dataHeatBal->ZoneITEq(Loop).FanConsumption; + state.dataHeatBal->ZnRpt(NZ).ITEqUPSConsumption += state.dataHeatBal->ZoneITEq(Loop).UPSConsumption; + state.dataHeatBal->ZnRpt(NZ).ITEqCPUEnergyAtDesign += state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign; + state.dataHeatBal->ZnRpt(NZ).ITEqFanEnergyAtDesign += state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign; + state.dataHeatBal->ZnRpt(NZ).ITEqUPSGainEnergyToZone += state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone; + state.dataHeatBal->ZnRpt(NZ).ITEqConGainEnergyToZone += state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone; + + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = AirMassFlowRate * state.dataEnvrn->StdRhoAir; + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = AirVolFlowRate; + state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = AirMassFlowRate; + state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = TAirIn; + state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = TDPAirIn; + state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = RHAirIn; + state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = TAirOut; + state.dataHeatBal->ZoneITEq(Loop).SHI = SupplyHeatIndex; + + state.dataHeatBal->ZnRpt(NZ).ITEqAirVolFlowStdDensity += state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity; + state.dataHeatBal->ZnRpt(NZ).ITEqAirMassFlow += state.dataHeatBal->ZoneITEq(Loop).AirMassFlow; + state.dataHeatBal->ZnRpt(NZ).SumTinMinusTSup += (TAirIn - TSupply) * AirVolFlowRate; + state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup += (TAirOut - TSupply) * AirVolFlowRate; + + // Check environmental class operating range limits (defined as parameters in this subroutine) + EnvClass = state.dataHeatBal->ZoneITEq(Loop).Class; + if (EnvClass > 0) { + if (TAirIn > DBMax(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = TAirIn - DBMax(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveDryBulbT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (TAirIn < DBMin(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = TAirIn - DBMin(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowDryBulbT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (TDPAirIn > DPMax(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = TDPAirIn - DPMax(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveDewpointT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (TDPAirIn < DPMin(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = TDPAirIn - DPMin(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowDewpointT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (RHAirIn > RHMax(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = RHAirIn - RHMax(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveRH = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (RHAirIn < RHMin(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = RHAirIn - RHMin(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowRH = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } } - } - } // ZoneITEq calc loop + } // ZoneITEq calc loop - // Zone-level sensible heat index - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - int ZN = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; - if (state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup != 0.0) { - state.dataHeatBal->ZnRpt(ZN).ITEqSHI = state.dataHeatBal->ZnRpt(NZ).SumTinMinusTSup / state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup; + // Zone-level sensible heat index + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + int ZN = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; + if (state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup != 0.0) { + state.dataHeatBal->ZnRpt(ZN).ITEqSHI = state.dataHeatBal->ZnRpt(NZ).SumTinMinusTSup / state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup; + } } - } - std::map>::iterator it = ZoneITEMap.begin(); - Real64 totalGain; - Real64 totalRate; - Real64 TAirReturn; - while (it != ZoneITEMap.end()) { - if (state.dataHeatBal->Zone(it->first).HasAdjustedReturnTempByITE) { - totalGain = 0; - totalRate = 0; - for (int i : it->second) { - if (state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch != 0) { - TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + - GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch); - } else { - TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + state.dataHeatBal->ZoneITEq(i).ReturnApproachTemp; + std::map>::iterator it = ZoneITEMap.begin(); + Real64 totalGain; + Real64 totalRate; + Real64 TAirReturn; + while (it != ZoneITEMap.end()) { + if (state.dataHeatBal->Zone(it->first).HasAdjustedReturnTempByITE) { + totalGain = 0; + totalRate = 0; + for (int i : it->second) { + if (state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch != 0) { + TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch); + } + else { + TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + state.dataHeatBal->ZoneITEq(i).ReturnApproachTemp; + } + totalRate += state.dataHeatBal->ZoneITEq(i).AirMassFlow; + totalGain += state.dataHeatBal->ZoneITEq(i).AirMassFlow * TAirReturn; + } + if (totalRate != 0) { + state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE = totalGain / totalRate; + state.dataHeatBal->ZnRpt(it->first).ITEAdjReturnTemp = state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE; } - totalRate += state.dataHeatBal->ZoneITEq(i).AirMassFlow; - totalGain += state.dataHeatBal->ZoneITEq(i).AirMassFlow * TAirReturn; - } - if (totalRate != 0) { - state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE = totalGain / totalRate; - state.dataHeatBal->ZnRpt(it->first).ITEAdjReturnTemp = state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE; } + it++; } - it++; - } - - } // End CalcZoneITEq - - void ReportInternalHeatGains(EnergyPlusData &state) - { - - // SUBROUTINE INFORMATION: - // AUTHOR Richard Liesen - // DATE WRITTEN June 1997 - // MODIFIED July 1997 RKS - // RE-ENGINEERED December 1998 LKL - - // PURPOSE OF THIS SUBROUTINE: - // This subroutine currently creates the values for standard "zone loads" reporting - // from the heat balance module. - // METHODOLOGY EMPLOYED: - // The reporting methodology is described in the OutputDataStructure.doc - // as the "modified modular" format. - - // REFERENCES: - // OutputDataStructure.doc (EnergyPlus documentation) - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Loop; - int ZoneLoop; // Counter for the # of zones (nz) - static const Array1D_int TradIntGainTypes(8, - {IntGainTypeOf_People, - IntGainTypeOf_Lights, - IntGainTypeOf_ElectricEquipment, - IntGainTypeOf_ElectricEquipmentITEAirCooled, - IntGainTypeOf_GasEquipment, - IntGainTypeOf_HotWaterEquipment, - IntGainTypeOf_SteamEquipment, - IntGainTypeOf_OtherEquipment}); - - for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { - state.dataHeatBal->People(Loop).RadGainEnergy = state.dataHeatBal->People(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->People(Loop).ConGainEnergy = state.dataHeatBal->People(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->People(Loop).SenGainEnergy = state.dataHeatBal->People(Loop).SenGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->People(Loop).LatGainEnergy = state.dataHeatBal->People(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->People(Loop).TotGainEnergy = state.dataHeatBal->People(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + } // End CalcZoneITEq + + void ReportInternalHeatGains(EnergyPlusData &state) + { + + // SUBROUTINE INFORMATION: + // AUTHOR Richard Liesen + // DATE WRITTEN June 1997 + // MODIFIED July 1997 RKS + // RE-ENGINEERED December 1998 LKL + + // PURPOSE OF THIS SUBROUTINE: + // This subroutine currently creates the values for standard "zone loads" reporting + // from the heat balance module. + + // METHODOLOGY EMPLOYED: + // The reporting methodology is described in the OutputDataStructure.doc + // as the "modified modular" format. + + // REFERENCES: + // OutputDataStructure.doc (EnergyPlus documentation) + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int Loop; + int ZoneLoop; // Counter for the # of zones (nz) + static const Array1D_int TradIntGainTypes(8, + { IntGainTypeOf_People, + IntGainTypeOf_Lights, + IntGainTypeOf_ElectricEquipment, + IntGainTypeOf_ElectricEquipmentITEAirCooled, + IntGainTypeOf_GasEquipment, + IntGainTypeOf_HotWaterEquipment, + IntGainTypeOf_SteamEquipment, + IntGainTypeOf_OtherEquipment }); + + for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { + state.dataHeatBal->People(Loop).RadGainEnergy = state.dataHeatBal->People(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->People(Loop).ConGainEnergy = state.dataHeatBal->People(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->People(Loop).SenGainEnergy = state.dataHeatBal->People(Loop).SenGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->People(Loop).LatGainEnergy = state.dataHeatBal->People(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->People(Loop).TotGainEnergy = state.dataHeatBal->People(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - state.dataHeatBal->Lights(Loop).Consumption = state.dataHeatBal->Lights(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).RadGainEnergy = state.dataHeatBal->Lights(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).VisGainEnergy = state.dataHeatBal->Lights(Loop).VisGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).ConGainEnergy = state.dataHeatBal->Lights(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).RetAirGainEnergy = state.dataHeatBal->Lights(Loop).RetAirGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).TotGainEnergy = state.dataHeatBal->Lights(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - if (!state.dataGlobal->WarmupFlag) { - if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && - (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // for weather simulations only - // for tabular report, accumulate the total electricity used for each Light object - state.dataHeatBal->Lights(Loop).SumConsumption += state.dataHeatBal->Lights(Loop).Consumption; - // for tabular report, accumulate the time when each Light has consumption (using a very small threshold instead of zero) - if (state.dataHeatBal->Lights(Loop).Power > 0.01 * state.dataHeatBal->Lights(Loop).DesignLevel) { - state.dataHeatBal->Lights(Loop).SumTimeNotZeroCons += state.dataGlobal->TimeStepZone; + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + state.dataHeatBal->Lights(Loop).Consumption = state.dataHeatBal->Lights(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).RadGainEnergy = state.dataHeatBal->Lights(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).VisGainEnergy = state.dataHeatBal->Lights(Loop).VisGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).ConGainEnergy = state.dataHeatBal->Lights(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).RetAirGainEnergy = state.dataHeatBal->Lights(Loop).RetAirGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).TotGainEnergy = state.dataHeatBal->Lights(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + if (!state.dataGlobal->WarmupFlag) { + if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && + (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // for weather simulations only + // for tabular report, accumulate the total electricity used for each Light object + state.dataHeatBal->Lights(Loop).SumConsumption += state.dataHeatBal->Lights(Loop).Consumption; + // for tabular report, accumulate the time when each Light has consumption (using a very small threshold instead of zero) + if (state.dataHeatBal->Lights(Loop).Power > 0.01 * state.dataHeatBal->Lights(Loop).DesignLevel) { + state.dataHeatBal->Lights(Loop).SumTimeNotZeroCons += state.dataGlobal->TimeStepZone; + } } } } - } - for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { - state.dataHeatBal->ZoneElectric(Loop).Consumption = state.dataHeatBal->ZoneElectric(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).RadGainEnergy = - state.dataHeatBal->ZoneElectric(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).ConGainEnergy = - state.dataHeatBal->ZoneElectric(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).LatGainEnergy = - state.dataHeatBal->ZoneElectric(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).LostEnergy = state.dataHeatBal->ZoneElectric(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).TotGainEnergy = - state.dataHeatBal->ZoneElectric(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { + state.dataHeatBal->ZoneElectric(Loop).Consumption = state.dataHeatBal->ZoneElectric(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).RadGainEnergy = + state.dataHeatBal->ZoneElectric(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).ConGainEnergy = + state.dataHeatBal->ZoneElectric(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).LatGainEnergy = + state.dataHeatBal->ZoneElectric(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).LostEnergy = state.dataHeatBal->ZoneElectric(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).TotGainEnergy = + state.dataHeatBal->ZoneElectric(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { - state.dataHeatBal->ZoneGas(Loop).Consumption = state.dataHeatBal->ZoneGas(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).RadGainEnergy = state.dataHeatBal->ZoneGas(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).ConGainEnergy = state.dataHeatBal->ZoneGas(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).LatGainEnergy = state.dataHeatBal->ZoneGas(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).LostEnergy = state.dataHeatBal->ZoneGas(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).TotGainEnergy = state.dataHeatBal->ZoneGas(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { + state.dataHeatBal->ZoneGas(Loop).Consumption = state.dataHeatBal->ZoneGas(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).RadGainEnergy = state.dataHeatBal->ZoneGas(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).ConGainEnergy = state.dataHeatBal->ZoneGas(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).LatGainEnergy = state.dataHeatBal->ZoneGas(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).LostEnergy = state.dataHeatBal->ZoneGas(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).TotGainEnergy = state.dataHeatBal->ZoneGas(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { - state.dataHeatBal->ZoneOtherEq(Loop).Consumption = state.dataHeatBal->ZoneOtherEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).LostEnergy = state.dataHeatBal->ZoneOtherEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { + state.dataHeatBal->ZoneOtherEq(Loop).Consumption = state.dataHeatBal->ZoneOtherEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).LostEnergy = state.dataHeatBal->ZoneOtherEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { - state.dataHeatBal->ZoneHWEq(Loop).Consumption = state.dataHeatBal->ZoneHWEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).LostEnergy = state.dataHeatBal->ZoneHWEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { + state.dataHeatBal->ZoneHWEq(Loop).Consumption = state.dataHeatBal->ZoneHWEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).LostEnergy = state.dataHeatBal->ZoneHWEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { - state.dataHeatBal->ZoneSteamEq(Loop).Consumption = state.dataHeatBal->ZoneSteamEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).LostEnergy = state.dataHeatBal->ZoneSteamEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { + state.dataHeatBal->ZoneSteamEq(Loop).Consumption = state.dataHeatBal->ZoneSteamEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).LostEnergy = state.dataHeatBal->ZoneSteamEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { - state.dataHeatBal->ZoneBBHeat(Loop).Consumption = state.dataHeatBal->ZoneBBHeat(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneBBHeat(Loop).RadGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneBBHeat(Loop).ConGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneBBHeat(Loop).TotGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { + state.dataHeatBal->ZoneBBHeat(Loop).Consumption = state.dataHeatBal->ZoneBBHeat(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneBBHeat(Loop).RadGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneBBHeat(Loop).ConGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneBBHeat(Loop).TotGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (ZoneLoop = 1; ZoneLoop <= state.dataGlobal->NumOfZones; ++ZoneLoop) { - // People - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleNumOcc = state.dataHeatBal->ZoneIntGain(ZoneLoop).NOFOCC; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCRAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCCON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleSenGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCSEN * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCLAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleTotGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCTOT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCRAD; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCCON; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleSenGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCSEN; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCLAT; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleTotGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCTOT; - - // General Lights - state.dataHeatBal->ZnRpt(ZoneLoop).LtsRetAirGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCRA * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTRAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTTOT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTSW * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsRetAirGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCRA; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTRAD; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTTOT; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCON; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTSW; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsElecConsump = state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGain; - - // Electric Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEECON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEERAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEECON; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEERAD; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELAT; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELost; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecConsump = - state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLost; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGainRate; - - // Gas Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGECON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGERAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).GasLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).GasConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGECON; - state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGERAD; - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELAT; - state.dataHeatBal->ZnRpt(ZoneLoop).GasLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELost; - state.dataHeatBal->ZnRpt(ZoneLoop).GasConsump = - state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).GasLost; - state.dataHeatBal->ZnRpt(ZoneLoop).GasTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).GasTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).GasConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGainRate; - - // Hot Water Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWCON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWRAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).HWLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).HWConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWCON; - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWRAD; - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLAT; - state.dataHeatBal->ZnRpt(ZoneLoop).HWLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLost; - state.dataHeatBal->ZnRpt(ZoneLoop).HWConsump = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).HWLost; - state.dataHeatBal->ZnRpt(ZoneLoop).HWTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).HWTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGainRate; - - // Steam Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSECON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSERAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSECON; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSERAD; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELAT; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELost; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamConsump = - state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLost; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGainRate; - - // Other Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOECON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOERAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOECON; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOERAD; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELAT; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELost; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherConsump = - state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLost; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGainRate; - - // Baseboard Heat - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBCON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBRAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBCON; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBRAD; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGain = - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGain + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGain; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGainRate = - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGainRate; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatElecCons = state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGain; - - // Overall Zone Variables - - // these overalls include component gains from devices like water heater, water use, and generators - // working vars QFCConv QGenConv QFCRad QGenRad WaterUseLatentGain WaterThermalTankGain WaterUseSensibleGain - - state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGain = state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGain; - state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGainRate; - - SumInternalRadiationGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate); - state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGain = - state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate * state.dataGlobal->TimeStepZoneSec; - - SumInternalConvectionGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate); - state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGain = - state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate * state.dataGlobal->TimeStepZoneSec; - - SumInternalLatentGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate); - state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGain = - state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate * state.dataGlobal->TimeStepZoneSec; - - state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGainRate = - state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGainRate; - state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGain = - state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGainRate * state.dataGlobal->TimeStepZoneSec; + for (ZoneLoop = 1; ZoneLoop <= state.dataGlobal->NumOfZones; ++ZoneLoop) { + // People + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleNumOcc = state.dataHeatBal->ZoneIntGain(ZoneLoop).NOFOCC; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCRAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCCON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleSenGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCSEN * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCLAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleTotGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCTOT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCRAD; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCCON; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleSenGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCSEN; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCLAT; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleTotGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCTOT; + + // General Lights + state.dataHeatBal->ZnRpt(ZoneLoop).LtsRetAirGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCRA * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTRAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTTOT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTSW * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsRetAirGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCRA; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTRAD; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTTOT; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCON; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTSW; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsElecConsump = state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGain; + + // Electric Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEECON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEERAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEECON; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEERAD; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELAT; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELost; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecConsump = + state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLost; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGainRate; + + // Gas Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGECON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGERAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).GasLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).GasConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGECON; + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGERAD; + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELAT; + state.dataHeatBal->ZnRpt(ZoneLoop).GasLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELost; + state.dataHeatBal->ZnRpt(ZoneLoop).GasConsump = + state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).GasLost; + state.dataHeatBal->ZnRpt(ZoneLoop).GasTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).GasTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).GasConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGainRate; + + // Hot Water Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWCON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWRAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).HWLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).HWConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWCON; + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWRAD; + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLAT; + state.dataHeatBal->ZnRpt(ZoneLoop).HWLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLost; + state.dataHeatBal->ZnRpt(ZoneLoop).HWConsump = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).HWLost; + state.dataHeatBal->ZnRpt(ZoneLoop).HWTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).HWTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGainRate; + + // Steam Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSECON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSERAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSECON; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSERAD; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELAT; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELost; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamConsump = + state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLost; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGainRate; + + // Other Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOECON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOERAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOECON; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOERAD; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELAT; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELost; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherConsump = + state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLost; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGainRate; + + // Baseboard Heat + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBCON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBRAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBCON; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBRAD; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGain = + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGain + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGain; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGainRate = + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGainRate; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatElecCons = state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGain; + + // Overall Zone Variables + + // these overalls include component gains from devices like water heater, water use, and generators + // working vars QFCConv QGenConv QFCRad QGenRad WaterUseLatentGain WaterThermalTankGain WaterUseSensibleGain + + state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGain = state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGain; + state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGainRate; + + SumInternalRadiationGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate); + state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGain = + state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate * state.dataGlobal->TimeStepZoneSec; + + SumInternalConvectionGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate); + state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGain = + state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate * state.dataGlobal->TimeStepZoneSec; + + SumInternalLatentGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate); + state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGain = + state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate * state.dataGlobal->TimeStepZoneSec; + + state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGainRate = + state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGainRate; + state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGain = + state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGainRate * state.dataGlobal->TimeStepZoneSec; + } } - } - - Real64 GetDesignLightingLevelForZone(EnergyPlusData &state, int const WhichZone) // name of zone - { - - // FUNCTION INFORMATION: - // AUTHOR Linda Lawrie - // DATE WRITTEN April 2007; January 2008 - moved to InternalGains - // MODIFIED na - // RE-ENGINEERED na - // PURPOSE OF THIS FUNCTION: - // This routine sums the Lighting Level for a zone. - // Will issue a severe error for illegal zone. - // Must be called after InternalHeatGains get input. + Real64 GetDesignLightingLevelForZone(EnergyPlusData &state, int const WhichZone) // name of zone + { - // Using/Aliasing - using namespace DataHeatBalance; - // Return value - Real64 DesignLightingLevelSum; // Sum of design lighting level for this zone + // FUNCTION INFORMATION: + // AUTHOR Linda Lawrie + // DATE WRITTEN April 2007; January 2008 - moved to InternalGains + // MODIFIED na + // RE-ENGINEERED na - // FUNCTION LOCAL VARIABLE DECLARATIONS: - int Loop; + // PURPOSE OF THIS FUNCTION: + // This routine sums the Lighting Level for a zone. + // Will issue a severe error for illegal zone. + // Must be called after InternalHeatGains get input. - if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { - ShowFatalError(state, "GetDesignLightingLevelForZone: Function called prior to Getting Lights Input."); - } + // Using/Aliasing + using namespace DataHeatBalance; + // Return value + Real64 DesignLightingLevelSum; // Sum of design lighting level for this zone - DesignLightingLevelSum = 0.0; + // FUNCTION LOCAL VARIABLE DECLARATIONS: + int Loop; - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - if (state.dataHeatBal->Lights(Loop).ZonePtr == WhichZone) { - DesignLightingLevelSum += state.dataHeatBal->Lights(Loop).DesignLevel; + if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { + ShowFatalError(state, "GetDesignLightingLevelForZone: Function called prior to Getting Lights Input."); } - } - return DesignLightingLevelSum; - } + DesignLightingLevelSum = 0.0; - bool CheckThermalComfortSchedules(bool const WorkEffSch, // Blank work efficiency schedule = true - bool const CloInsSch, // Blank clothing insulation schedule = true - bool const AirVeloSch) // Blank air velocity schedule = true - { - bool TCSchedsPresent = false; + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + if (state.dataHeatBal->Lights(Loop).ZonePtr == WhichZone) { + DesignLightingLevelSum += state.dataHeatBal->Lights(Loop).DesignLevel; + } + } - if (!WorkEffSch || !CloInsSch || !AirVeloSch) { - TCSchedsPresent = true; + return DesignLightingLevelSum; } - return TCSchedsPresent; - } - - void CheckLightsReplaceableMinMaxForZone(EnergyPlusData &state, int const WhichZone) // Zone Number - { - - // SUBROUTINE INFORMATION: - // AUTHOR Linda Lawrie - // DATE WRITTEN April 2007 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // Daylighting is not available unless Lights (replaceable) is 0.0 or 1.0. No dimming will be done - // unless the lights replaceable fraction is 1.0. This is documented in the InputOutputReference but - // not warned about. Also, this will sum the Zone Design Lighting level, in case the calling routine - // would like to have an error if the lights is zero and daylighting is requested. + bool CheckThermalComfortSchedules(bool const WorkEffSch, // Blank work efficiency schedule = true + bool const CloInsSch, // Blank clothing insulation schedule = true + bool const AirVeloSch) // Blank air velocity schedule = true + { + bool TCSchedsPresent = false; - // METHODOLOGY EMPLOYED: - // Traverse the LIGHTS structure and get fraction replaceable - min/max as well as lighting - // level for a zone. + if (!WorkEffSch || !CloInsSch || !AirVeloSch) { + TCSchedsPresent = true; + } - // Using/Aliasing - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Loop; - Real64 LightsRepMin; // Minimum Lighting replacement fraction for any lights statement for this zone - Real64 LightsRepMax; // Maximum Lighting replacement fraction for any lights statement for this zone - int NumLights; // Number of Lights statement for that zone. - - if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { - ShowFatalError(state, "CheckLightsReplaceableMinMaxForZone: Function called prior to Getting Lights Input."); + return TCSchedsPresent; } - LightsRepMin = 99999.0; - LightsRepMax = -99999.0; - NumLights = 0; - - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - if (state.dataHeatBal->Lights(Loop).ZonePtr != WhichZone) continue; - LightsRepMin = min(LightsRepMin, state.dataHeatBal->Lights(Loop).FractionReplaceable); - LightsRepMax = max(LightsRepMax, state.dataHeatBal->Lights(Loop).FractionReplaceable); - ++NumLights; - if ((state.dataDaylightingData->ZoneDaylight(state.dataHeatBal->Lights(Loop).ZonePtr).DaylightMethod == - DataDaylighting::iDaylightingMethod::SplitFluxDaylighting || - state.dataDaylightingData->ZoneDaylight(state.dataHeatBal->Lights(Loop).ZonePtr).DaylightMethod == - DataDaylighting::iDaylightingMethod::DElightDaylighting) && - (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0 && state.dataHeatBal->Lights(Loop).FractionReplaceable < 1.0)) { - ShowWarningError(state, "CheckLightsReplaceableMinMaxForZone: Fraction Replaceable must be 0.0 or 1.0 if used with daylighting."); - ShowContinueError(state, - "..Lights=\"" + state.dataHeatBal->Lights(Loop).Name + - "\", Fraction Replaceable will be reset to 1.0 to allow dimming controls"); - ShowContinueError(state, "..in Zone=" + state.dataHeatBal->Zone(WhichZone).Name); - state.dataHeatBal->Lights(Loop).FractionReplaceable = 1.0; + void CheckLightsReplaceableMinMaxForZone(EnergyPlusData &state, int const WhichZone) // Zone Number + { + + // SUBROUTINE INFORMATION: + // AUTHOR Linda Lawrie + // DATE WRITTEN April 2007 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // Daylighting is not available unless Lights (replaceable) is 0.0 or 1.0. No dimming will be done + // unless the lights replaceable fraction is 1.0. This is documented in the InputOutputReference but + // not warned about. Also, this will sum the Zone Design Lighting level, in case the calling routine + // would like to have an error if the lights is zero and daylighting is requested. + + // METHODOLOGY EMPLOYED: + // Traverse the LIGHTS structure and get fraction replaceable - min/max as well as lighting + // level for a zone. + + // Using/Aliasing + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int Loop; + Real64 LightsRepMin; // Minimum Lighting replacement fraction for any lights statement for this zone + Real64 LightsRepMax; // Maximum Lighting replacement fraction for any lights statement for this zone + int NumLights; // Number of Lights statement for that zone. + + if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { + ShowFatalError(state, "CheckLightsReplaceableMinMaxForZone: Function called prior to Getting Lights Input."); } - } - if (state.dataDaylightingData->ZoneDaylight(WhichZone).DaylightMethod == DataDaylighting::iDaylightingMethod::SplitFluxDaylighting) { - if (LightsRepMax == 0.0) { - ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); - ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable."); - ShowContinueError(state, "The daylighting controls will have no effect."); - } - if (NumLights == 0) { - ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); - ShowContinueError(state, "but there are no LIGHTS objects in that zone."); - ShowContinueError(state, "The daylighting controls will have no effect."); + LightsRepMin = 99999.0; + LightsRepMax = -99999.0; + NumLights = 0; + + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + if (state.dataHeatBal->Lights(Loop).ZonePtr != WhichZone) continue; + LightsRepMin = min(LightsRepMin, state.dataHeatBal->Lights(Loop).FractionReplaceable); + LightsRepMax = max(LightsRepMax, state.dataHeatBal->Lights(Loop).FractionReplaceable); + ++NumLights; + if ((state.dataDaylightingData->ZoneDaylight(state.dataHeatBal->Lights(Loop).ZonePtr).DaylightMethod == + DataDaylighting::iDaylightingMethod::SplitFluxDaylighting || + state.dataDaylightingData->ZoneDaylight(state.dataHeatBal->Lights(Loop).ZonePtr).DaylightMethod == + DataDaylighting::iDaylightingMethod::DElightDaylighting) && + (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0 && state.dataHeatBal->Lights(Loop).FractionReplaceable < 1.0)) { + ShowWarningError(state, "CheckLightsReplaceableMinMaxForZone: Fraction Replaceable must be 0.0 or 1.0 if used with daylighting."); + ShowContinueError(state, + "..Lights=\"" + state.dataHeatBal->Lights(Loop).Name + + "\", Fraction Replaceable will be reset to 1.0 to allow dimming controls"); + ShowContinueError(state, "..in Zone=" + state.dataHeatBal->Zone(WhichZone).Name); + state.dataHeatBal->Lights(Loop).FractionReplaceable = 1.0; + } } - } else if (state.dataDaylightingData->ZoneDaylight(WhichZone).DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) { - if (LightsRepMax == 0.0) { - ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); - ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable."); - ShowContinueError(state, "The daylighting controls will have no effect."); + + if (state.dataDaylightingData->ZoneDaylight(WhichZone).DaylightMethod == DataDaylighting::iDaylightingMethod::SplitFluxDaylighting) { + if (LightsRepMax == 0.0) { + ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); + ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable."); + ShowContinueError(state, "The daylighting controls will have no effect."); + } + if (NumLights == 0) { + ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); + ShowContinueError(state, "but there are no LIGHTS objects in that zone."); + ShowContinueError(state, "The daylighting controls will have no effect."); + } } - if (NumLights == 0) { - ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); - ShowContinueError(state, "but there are no LIGHTS objects in that zone."); - ShowContinueError(state, "The daylighting controls will have no effect."); + else if (state.dataDaylightingData->ZoneDaylight(WhichZone).DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) { + if (LightsRepMax == 0.0) { + ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); + ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable."); + ShowContinueError(state, "The daylighting controls will have no effect."); + } + if (NumLights == 0) { + ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); + ShowContinueError(state, "but there are no LIGHTS objects in that zone."); + ShowContinueError(state, "The daylighting controls will have no effect."); + } } } - } - void UpdateInternalGainValues(EnergyPlusData &state, Optional_bool_const SuppressRadiationUpdate, Optional_bool_const SumLatentGains) - { + void UpdateInternalGainValues(EnergyPlusData &state, Optional_bool_const SuppressRadiationUpdate, Optional_bool_const SumLatentGains) + { - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na - // Using/Aliasing + // Using/Aliasing - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Loop; - int NZ; - bool DoRadiationUpdate; - bool ReSumLatentGains; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int Loop; + int NZ; + bool DoRadiationUpdate; + bool ReSumLatentGains; - DoRadiationUpdate = true; - ReSumLatentGains = false; + DoRadiationUpdate = true; + ReSumLatentGains = false; - if (present(SuppressRadiationUpdate)) { - if (SuppressRadiationUpdate) DoRadiationUpdate = false; - } + if (present(SuppressRadiationUpdate)) { + if (SuppressRadiationUpdate) DoRadiationUpdate = false; + } - if (present(SumLatentGains)) { - if (SumLatentGains) ReSumLatentGains = true; - } + if (present(SumLatentGains)) { + if (SumLatentGains) ReSumLatentGains = true; + } - // store pointer values to hold generic internal gain values constant for entire timestep - for (NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { - for (Loop = 1; Loop <= state.dataHeatBal->ZoneIntGain(NZ).NumberOfDevices; ++Loop) { - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ConvectGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrConvectGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ReturnAirConvGainRate = - *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrReturnAirConvGainRate; - if (DoRadiationUpdate) - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).RadiantGainRate = + // store pointer values to hold generic internal gain values constant for entire timestep + for (NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { + for (Loop = 1; Loop <= state.dataHeatBal->ZoneIntGain(NZ).NumberOfDevices; ++Loop) { + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ConvectGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrConvectGainRate; + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ReturnAirConvGainRate = + *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrReturnAirConvGainRate; + if (DoRadiationUpdate) + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).RadiantGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrRadiantGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).LatentGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrLatentGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ReturnAirLatentGainRate = - *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrReturnAirLatentGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).CarbonDioxideGainRate = - *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrCarbonDioxideGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).GenericContamGainRate = - *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrGenericContamGainRate; - } - if (ReSumLatentGains) { - SumAllInternalLatentGains(state, NZ, state.dataHeatBalFanSys->ZoneLatentGain(NZ)); - // Added for the hybrid model - if (state.dataHybridModel->FlagHybridModel_PC) { - SumAllInternalLatentGainsExceptPeople(state, NZ, state.dataHeatBalFanSys->ZoneLatentGainExceptPeople(NZ)); + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).LatentGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrLatentGainRate; + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ReturnAirLatentGainRate = + *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrReturnAirLatentGainRate; + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).CarbonDioxideGainRate = + *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrCarbonDioxideGainRate; + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).GenericContamGainRate = + *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrGenericContamGainRate; + } + if (ReSumLatentGains) { + SumAllInternalLatentGains(state, NZ, state.dataHeatBalFanSys->ZoneLatentGain(NZ)); + // Added for the hybrid model + if (state.dataHybridModel->FlagHybridModel_PC) { + SumAllInternalLatentGainsExceptPeople(state, NZ, state.dataHeatBalFanSys->ZoneLatentGainExceptPeople(NZ)); + } } } - } - if (state.dataContaminantBalance->Contaminant.GenericContamSimulation && allocated(state.dataContaminantBalance->ZoneGCGain)) { - for (NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { - SumAllInternalGenericContamGains(state, NZ, state.dataContaminantBalance->ZoneGCGain(NZ)); - state.dataHeatBal->ZnRpt(NZ).GCRate = state.dataContaminantBalance->ZoneGCGain(NZ); + if (state.dataContaminantBalance->Contaminant.GenericContamSimulation && allocated(state.dataContaminantBalance->ZoneGCGain)) { + for (NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { + SumAllInternalGenericContamGains(state, NZ, state.dataContaminantBalance->ZoneGCGain(NZ)); + state.dataHeatBal->ZnRpt(NZ).GCRate = state.dataContaminantBalance->ZoneGCGain(NZ); + } } } - } - - void SumAllInternalConvectionGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumConvGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumConvGainRate; - int DeviceNum; - - tmpSumConvGainRate = 0.0; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumConvGainRate = 0.0; - return; - } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; - } + void SumAllInternalConvectionGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumConvGainRate) + { - SumConvGainRate = tmpSumConvGainRate; - } + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na - // For HybridModel - void SumAllInternalConvectionGainsExceptPeople(EnergyPlusData &state, int const ZoneNum, Real64 &SumConvGainRateExceptPeople) - { - Real64 tmpSumConvGainRateExceptPeople; - int DeviceNum; - std::string str_people = "PEOPLE"; - tmpSumConvGainRateExceptPeople = 0.0; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumConvGainRateExceptPeople = 0.0; - return; - } + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumConvGainRate; + int DeviceNum; - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectType != str_people) { - tmpSumConvGainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; + tmpSumConvGainRate = 0.0; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumConvGainRate = 0.0; + return; } - } - SumConvGainRateExceptPeople = tmpSumConvGainRateExceptPeople; - } - - void SumInternalConvectionGainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumConvGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011cl - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumConvGainRate; - int DeviceNum; - int TypeNum; - - NumberOfTypes = size(GainTypeARR); - tmpSumConvGainRate = 0.0; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumConvGainRate = 0.0; - return; + SumConvGainRate = tmpSumConvGainRate; } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + // For HybridModel + void SumAllInternalConvectionGainsExceptPeople(EnergyPlusData &state, int const ZoneNum, Real64 &SumConvGainRateExceptPeople) + { + Real64 tmpSumConvGainRateExceptPeople; + int DeviceNum; + std::string str_people = "PEOPLE"; + tmpSumConvGainRateExceptPeople = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumConvGainRateExceptPeople = 0.0; + return; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectType != str_people) { + tmpSumConvGainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; } } - } - - SumConvGainRate = tmpSumConvGainRate; - } - - void SumAllReturnAirConvectionGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumReturnAirGainRate, - int const ReturnNodeNum // return air node number - ) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types - - Real64 tmpSumRetAirGainRate; - int DeviceNum; - - tmpSumRetAirGainRate = 0.0; - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumReturnAirGainRate = 0.0; - return; + SumConvGainRateExceptPeople = tmpSumConvGainRateExceptPeople; } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum - if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirNodeNum)) { - tmpSumRetAirGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate; + void SumInternalConvectionGainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumConvGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011cl + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumConvGainRate; + int DeviceNum; + int TypeNum; + + NumberOfTypes = size(GainTypeARR); + tmpSumConvGainRate = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumConvGainRate = 0.0; + return; } - } - SumReturnAirGainRate = tmpSumRetAirGainRate; - } + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { - void SumReturnAirConvectionGainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumReturnAirGainRate) - { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; + } + } + } - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na + SumConvGainRate = tmpSumConvGainRate; + } - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types + void SumAllReturnAirConvectionGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumReturnAirGainRate, + int const ReturnNodeNum // return air node number + ) + { - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumRetAirConvGainRate; - int DeviceNum; - int TypeNum; + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 - NumberOfTypes = size(GainTypeARR); - tmpSumRetAirConvGainRate = 0.0; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumReturnAirGainRate = 0.0; - return; - } + Real64 tmpSumRetAirGainRate; + int DeviceNum; - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + tmpSumRetAirGainRate = 0.0; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumRetAirConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate; - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumReturnAirGainRate = 0.0; + return; } - } - SumReturnAirGainRate = tmpSumRetAirConvGainRate; - } - - void SumAllInternalRadiationGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumRadGainRate) - { + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum + if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirNodeNum)) { + tmpSumRetAirGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate; + } + } - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na + SumReturnAirGainRate = tmpSumRetAirGainRate; + } - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + void SumReturnAirConvectionGainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumReturnAirGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumRetAirConvGainRate; + int DeviceNum; + int TypeNum; + + NumberOfTypes = size(GainTypeARR); + tmpSumRetAirConvGainRate = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumReturnAirGainRate = 0.0; + return; + } - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumRadGainRate; - int DeviceNum; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { - tmpSumRadGainRate = 0.0; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumRetAirConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate; + } + } + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumRadGainRate = 0.0; - return; + SumReturnAirGainRate = tmpSumRetAirConvGainRate; } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumRadGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).RadiantGainRate; - } + void SumAllInternalRadiationGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumRadGainRate) + { - SumRadGainRate = tmpSumRadGainRate; - } + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na - void SumInternalRadiationGainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumRadiationGainRate) - { + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumRadGainRate; + int DeviceNum; - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types + tmpSumRadGainRate = 0.0; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumRadiationGainRate; - int DeviceNum; - int TypeNum; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumRadGainRate = 0.0; + return; + } - NumberOfTypes = size(GainTypeARR); - tmpSumRadiationGainRate = 0.0; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumRadGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).RadiantGainRate; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumRadiationGainRate = 0.0; - return; + SumRadGainRate = tmpSumRadGainRate; } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + void SumInternalRadiationGainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumRadiationGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumRadiationGainRate; + int DeviceNum; + int TypeNum; + + NumberOfTypes = size(GainTypeARR); + tmpSumRadiationGainRate = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumRadiationGainRate = 0.0; + return; + } + + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumRadiationGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).RadiantGainRate; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumRadiationGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).RadiantGainRate; + } } } + + SumRadiationGainRate = tmpSumRadiationGainRate; } - SumRadiationGainRate = tmpSumRadiationGainRate; - } + void SumAllInternalLatentGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumLatentGainRate) + { - void SumAllInternalLatentGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumLatentGainRate) - { + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumLatentGainRate; + int DeviceNum; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumLatentGainRate; - int DeviceNum; + tmpSumLatentGainRate = 0.0; - tmpSumLatentGainRate = 0.0; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumLatentGainRate = 0.0; + return; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumLatentGainRate = 0.0; - return; - } + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; + } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; + SumLatentGainRate = tmpSumLatentGainRate; } - SumLatentGainRate = tmpSumLatentGainRate; - } - - // Added for hybrid model -- calculate the latent gain from all sources except for people - void SumAllInternalLatentGainsExceptPeople(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumLatentGainRateExceptPeople) - { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumLatentGainRateExceptPeople = 0.0; - return; - } - for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOf_People) { - SumLatentGainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; + // Added for hybrid model -- calculate the latent gain from all sources except for people + void SumAllInternalLatentGainsExceptPeople(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumLatentGainRateExceptPeople) + { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumLatentGainRateExceptPeople = 0.0; + return; + } + for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOf_People) { + SumLatentGainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; + } } } - } - - void SumInternalLatentGainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumLatentGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumLatentGainRate; - int DeviceNum; - int TypeNum; - - NumberOfTypes = size(GainTypeARR); - tmpSumLatentGainRate = 0.0; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumLatentGainRate = 0.0; - return; - } + void SumInternalLatentGainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumLatentGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumLatentGainRate; + int DeviceNum; + int TypeNum; + + NumberOfTypes = size(GainTypeARR); + tmpSumLatentGainRate = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumLatentGainRate = 0.0; + return; + } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; + } } } - } - SumLatentGainRate = tmpSumLatentGainRate; - } + SumLatentGainRate = tmpSumLatentGainRate; + } - void SumAllReturnAirLatentGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumRetAirLatentGainRate, - int const ReturnNodeNum // return air node number - ) - { + void SumAllReturnAirLatentGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumRetAirLatentGainRate, + int const ReturnNodeNum // return air node number + ) + { - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumLatentGainRate; - int DeviceNum; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumLatentGainRate; + int DeviceNum; - tmpSumLatentGainRate = 0.0; + tmpSumLatentGainRate = 0.0; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumRetAirLatentGainRate = 0.0; - return; - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumRetAirLatentGainRate = 0.0; + return; + } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum - if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirNodeNum)) { - tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirLatentGainRate; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum + if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirNodeNum)) { + tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirLatentGainRate; + } } + + SumRetAirLatentGainRate = tmpSumLatentGainRate; } - SumRetAirLatentGainRate = tmpSumLatentGainRate; - } + void SumAllInternalCO2Gains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumCO2GainRate) + { - void SumAllInternalCO2Gains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumCO2GainRate) - { + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumCO2GainRate; + int DeviceNum; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumCO2GainRate; - int DeviceNum; + tmpSumCO2GainRate = 0.0; - tmpSumCO2GainRate = 0.0; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumCO2GainRate = 0.0; + return; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumCO2GainRate = 0.0; - return; - } + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumCO2GainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; + } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumCO2GainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; + SumCO2GainRate = tmpSumCO2GainRate; } - SumCO2GainRate = tmpSumCO2GainRate; - } - - // Added for hybrid model -- function for calculating CO2 gains except people - void SumAllInternalCO2GainsExceptPeople(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumCO2GainRateExceptPeople) - { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumCO2GainRateExceptPeople = 0.0; - return; - } + // Added for hybrid model -- function for calculating CO2 gains except people + void SumAllInternalCO2GainsExceptPeople(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumCO2GainRateExceptPeople) + { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumCO2GainRateExceptPeople = 0.0; + return; + } - for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOf_People) { - SumCO2GainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; + for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOf_People) { + SumCO2GainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; + } } } - } - - void SumInternalCO2GainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumCO2GainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumCO2GainRate; - int DeviceNum; - int TypeNum; - NumberOfTypes = size(GainTypeARR); - tmpSumCO2GainRate = 0.0; - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumCO2GainRate = 0.0; - return; - } + void SumInternalCO2GainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumCO2GainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumCO2GainRate; + int DeviceNum; + int TypeNum; + + NumberOfTypes = size(GainTypeARR); + tmpSumCO2GainRate = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumCO2GainRate = 0.0; + return; + } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumCO2GainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumCO2GainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; + } } } + + SumCO2GainRate = tmpSumCO2GainRate; } - SumCO2GainRate = tmpSumCO2GainRate; - } + void SumAllInternalGenericContamGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumGCGainRate) + { - void SumAllInternalGenericContamGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumGCGainRate) - { + // SUBROUTINE INFORMATION: + // AUTHOR L. Gu + // DATE WRITTEN Feb. 2012 + // MODIFIED na + // RE-ENGINEERED na - // SUBROUTINE INFORMATION: - // AUTHOR L. Gu - // DATE WRITTEN Feb. 2012 - // MODIFIED na - // RE-ENGINEERED na + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types based on the existing subrotine SumAllInternalCO2Gains - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types based on the existing subrotine SumAllInternalCO2Gains + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumGCGainRate; + int DeviceNum; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumGCGainRate; - int DeviceNum; + tmpSumGCGainRate = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumGCGainRate = 0.0; + return; + } - tmpSumGCGainRate = 0.0; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumGCGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).GenericContamGainRate; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumGCGainRate = 0.0; - return; + SumGCGainRate = tmpSumGCGainRate; } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumGCGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).GenericContamGainRate; + void GatherComponentLoadsIntGain(EnergyPlusData &state) + { + // SUBROUTINE INFORMATION: + // AUTHOR Jason Glazer + // DATE WRITTEN September 2012 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // Gather values during sizing used for loads component report. + + // METHODOLOGY EMPLOYED: + // Save sequence of values for report during sizing. + + // Using/Aliasing + using namespace DataHeatBalance; + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + static const Array1D_int IntGainTypesPeople(1, { IntGainTypeOf_People }); + static const Array1D_int IntGainTypesLight(1, { IntGainTypeOf_Lights }); + static const Array1D_int IntGainTypesEquip(6, + { IntGainTypeOf_ElectricEquipment, + IntGainTypeOf_ElectricEquipmentITEAirCooled, + IntGainTypeOf_GasEquipment, + IntGainTypeOf_HotWaterEquipment, + IntGainTypeOf_SteamEquipment, + IntGainTypeOf_OtherEquipment }); + static const Array1D_int IntGainTypesRefrig(10, + { IntGainTypeOf_RefrigerationCase, + IntGainTypeOf_RefrigerationCompressorRack, + IntGainTypeOf_RefrigerationSystemAirCooledCondenser, + IntGainTypeOf_RefrigerationSystemSuctionPipe, + IntGainTypeOf_RefrigerationSecondaryReceiver, + IntGainTypeOf_RefrigerationSecondaryPipe, + IntGainTypeOf_RefrigerationWalkIn, + IntGainTypeOf_RefrigerationTransSysAirCooledGasCooler, + IntGainTypeOf_RefrigerationTransSysSuctionPipeMT, + IntGainTypeOf_RefrigerationTransSysSuctionPipeLT }); + static const Array1D_int IntGainTypesWaterUse( + 3, { IntGainTypeOf_WaterUseEquipment, IntGainTypeOf_WaterHeaterMixed, IntGainTypeOf_WaterHeaterStratified }); + static const Array1D_int IntGainTypesHvacLoss(20, + { IntGainTypeOf_ZoneBaseboardOutdoorTemperatureControlled, + IntGainTypeOf_ThermalStorageChilledWaterMixed, + IntGainTypeOf_ThermalStorageChilledWaterStratified, + IntGainTypeOf_PipeIndoor, + IntGainTypeOf_Pump_VarSpeed, + IntGainTypeOf_Pump_ConSpeed, + IntGainTypeOf_Pump_Cond, + IntGainTypeOf_PumpBank_VarSpeed, + IntGainTypeOf_PumpBank_ConSpeed, + IntGainTypeOf_PlantComponentUserDefined, + IntGainTypeOf_CoilUserDefined, + IntGainTypeOf_ZoneHVACForcedAirUserDefined, + IntGainTypeOf_AirTerminalUserDefined, + IntGainTypeOf_PackagedTESCoilTank, + IntGainTypeOf_FanSystemModel, + IntGainTypeOf_SecCoolingDXCoilSingleSpeed, + IntGainTypeOf_SecHeatingDXCoilSingleSpeed, + IntGainTypeOf_SecCoolingDXCoilTwoSpeed, + IntGainTypeOf_SecCoolingDXCoilMultiSpeed, + IntGainTypeOf_SecHeatingDXCoilMultiSpeed }); + static const Array1D_int IntGainTypesPowerGen(10, + { IntGainTypeOf_GeneratorFuelCell, + IntGainTypeOf_GeneratorMicroCHP, + IntGainTypeOf_ElectricLoadCenterTransformer, + IntGainTypeOf_ElectricLoadCenterInverterSimple, + IntGainTypeOf_ElectricLoadCenterInverterFunctionOfPower, + IntGainTypeOf_ElectricLoadCenterInverterLookUpTable, + IntGainTypeOf_ElectricLoadCenterStorageLiIonNmcBattery, + IntGainTypeOf_ElectricLoadCenterStorageBattery, + IntGainTypeOf_ElectricLoadCenterStorageSimple, + IntGainTypeOf_ElectricLoadCenterConverter }); + + if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { + int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + SumInternalConvectionGainsByTypes( + state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes( + state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes( + state, iZone, IntGainTypesLight, state.dataOutRptTab->lightInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumReturnAirConvectionGainsByTypes( + state, iZone, IntGainTypesLight, state.dataOutRptTab->lightRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesLight, state.dataOutRptTab->lightLWRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes( + state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes( + state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes( + state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumReturnAirConvectionGainsByTypes( + state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes( + state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes(state, + iZone, + IntGainTypesWaterUse, + state.dataOutRptTab->waterUseInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes(state, + iZone, + IntGainTypesWaterUse, + state.dataOutRptTab->waterUseLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes(state, + iZone, + IntGainTypesHvacLoss, + state.dataOutRptTab->hvacLossInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesHvacLoss, state.dataOutRptTab->hvacLossRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes(state, + iZone, + IntGainTypesPowerGen, + state.dataOutRptTab->powerGenInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesPowerGen, state.dataOutRptTab->powerGenRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + } + } } - SumGCGainRate = tmpSumGCGainRate; - } + void GetInternalGainDeviceIndex(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number + std::string const &IntGainName, // Internal gain name + int &DeviceIndex, // Device index + bool &ErrorFound) + { - void GatherComponentLoadsIntGain(EnergyPlusData &state) - { - // SUBROUTINE INFORMATION: - // AUTHOR Jason Glazer - // DATE WRITTEN September 2012 - // MODIFIED na - // RE-ENGINEERED na + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN June 2012 + // MODIFIED na + // RE-ENGINEERED na - // PURPOSE OF THIS SUBROUTINE: - // Gather values during sizing used for loads component report. + // PURPOSE OF THIS SUBROUTINE: + // utility to retrieve index pointer to a specific internal gain - // METHODOLOGY EMPLOYED: - // Save sequence of values for report during sizing. + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + bool Found; + int DeviceNum; - // Using/Aliasing - using namespace DataHeatBalance; + Found = false; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static const Array1D_int IntGainTypesPeople(1, {IntGainTypeOf_People}); - static const Array1D_int IntGainTypesLight(1, {IntGainTypeOf_Lights}); - static const Array1D_int IntGainTypesEquip(6, - {IntGainTypeOf_ElectricEquipment, - IntGainTypeOf_ElectricEquipmentITEAirCooled, - IntGainTypeOf_GasEquipment, - IntGainTypeOf_HotWaterEquipment, - IntGainTypeOf_SteamEquipment, - IntGainTypeOf_OtherEquipment}); - static const Array1D_int IntGainTypesRefrig(10, - {IntGainTypeOf_RefrigerationCase, - IntGainTypeOf_RefrigerationCompressorRack, - IntGainTypeOf_RefrigerationSystemAirCooledCondenser, - IntGainTypeOf_RefrigerationSystemSuctionPipe, - IntGainTypeOf_RefrigerationSecondaryReceiver, - IntGainTypeOf_RefrigerationSecondaryPipe, - IntGainTypeOf_RefrigerationWalkIn, - IntGainTypeOf_RefrigerationTransSysAirCooledGasCooler, - IntGainTypeOf_RefrigerationTransSysSuctionPipeMT, - IntGainTypeOf_RefrigerationTransSysSuctionPipeLT}); - static const Array1D_int IntGainTypesWaterUse( - 3, {IntGainTypeOf_WaterUseEquipment, IntGainTypeOf_WaterHeaterMixed, IntGainTypeOf_WaterHeaterStratified}); - static const Array1D_int IntGainTypesHvacLoss(20, - {IntGainTypeOf_ZoneBaseboardOutdoorTemperatureControlled, - IntGainTypeOf_ThermalStorageChilledWaterMixed, - IntGainTypeOf_ThermalStorageChilledWaterStratified, - IntGainTypeOf_PipeIndoor, - IntGainTypeOf_Pump_VarSpeed, - IntGainTypeOf_Pump_ConSpeed, - IntGainTypeOf_Pump_Cond, - IntGainTypeOf_PumpBank_VarSpeed, - IntGainTypeOf_PumpBank_ConSpeed, - IntGainTypeOf_PlantComponentUserDefined, - IntGainTypeOf_CoilUserDefined, - IntGainTypeOf_ZoneHVACForcedAirUserDefined, - IntGainTypeOf_AirTerminalUserDefined, - IntGainTypeOf_PackagedTESCoilTank, - IntGainTypeOf_FanSystemModel, - IntGainTypeOf_SecCoolingDXCoilSingleSpeed, - IntGainTypeOf_SecHeatingDXCoilSingleSpeed, - IntGainTypeOf_SecCoolingDXCoilTwoSpeed, - IntGainTypeOf_SecCoolingDXCoilMultiSpeed, - IntGainTypeOf_SecHeatingDXCoilMultiSpeed}); - static const Array1D_int IntGainTypesPowerGen(10, - {IntGainTypeOf_GeneratorFuelCell, - IntGainTypeOf_GeneratorMicroCHP, - IntGainTypeOf_ElectricLoadCenterTransformer, - IntGainTypeOf_ElectricLoadCenterInverterSimple, - IntGainTypeOf_ElectricLoadCenterInverterFunctionOfPower, - IntGainTypeOf_ElectricLoadCenterInverterLookUpTable, - IntGainTypeOf_ElectricLoadCenterStorageLiIonNmcBattery, - IntGainTypeOf_ElectricLoadCenterStorageBattery, - IntGainTypeOf_ElectricLoadCenterStorageSimple, - IntGainTypeOf_ElectricLoadCenterConverter}); - - if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { - int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - SumInternalConvectionGainsByTypes( - state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes( - state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes( - state, iZone, IntGainTypesLight, state.dataOutRptTab->lightInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumReturnAirConvectionGainsByTypes( - state, iZone, IntGainTypesLight, state.dataOutRptTab->lightRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesLight, state.dataOutRptTab->lightLWRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes( - state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes( - state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes( - state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumReturnAirConvectionGainsByTypes( - state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes( - state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes(state, - iZone, - IntGainTypesWaterUse, - state.dataOutRptTab->waterUseInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes(state, - iZone, - IntGainTypesWaterUse, - state.dataOutRptTab->waterUseLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes(state, - iZone, - IntGainTypesHvacLoss, - state.dataOutRptTab->hvacLossInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesHvacLoss, state.dataOutRptTab->hvacLossRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes(state, - iZone, - IntGainTypesPowerGen, - state.dataOutRptTab->powerGenInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesPowerGen, state.dataOutRptTab->powerGenRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + DeviceIndex = -1; + ErrorFound = true; + return; } - } - } - - void GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number - std::string const &IntGainName, // Internal gain name - int &DeviceIndex, // Device index - bool &ErrorFound) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN June 2012 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // utility to retrieve index pointer to a specific internal gain - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - bool Found; - int DeviceNum; - Found = false; - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - DeviceIndex = -1; - ErrorFound = true; - return; - } - - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (UtilityRoutines::SameString(state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName, IntGainName)) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOfNum) { + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + if (UtilityRoutines::SameString(state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName, IntGainName)) { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOfNum) { + ErrorFound = true; + } + else { + ErrorFound = false; + } + Found = true; + DeviceIndex = DeviceNum; + break; + } + else { ErrorFound = true; - } else { - ErrorFound = false; } - Found = true; - DeviceIndex = DeviceNum; - break; - } - else { - ErrorFound = true; } } - } - - void SumInternalConvectionGainsByIndices( - EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation - const Array1D &FractionARR, // array of fractional multipliers to apply to devices - Real64 &SumConvGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN June 2012 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gains by index - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfIndices; - int NumberOfFractions; - Real64 tmpSumConvGainRate; - int loop; - int DeviceNum; - Real64 DeviceFraction; - NumberOfIndices = isize(DeviceIndexARR); - NumberOfFractions = isize(FractionARR); - tmpSumConvGainRate = 0.0; - - // remove this next safety check after testing code - if (NumberOfIndices != NumberOfFractions) { // throw error - ShowSevereError(state, "SumInternalConvectionGainsByIndices: bad arguments, sizes do not match"); - } + void SumInternalConvectionGainsByIndices( + EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation + const Array1D &FractionARR, // array of fractional multipliers to apply to devices + Real64 &SumConvGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN June 2012 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gains by index + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfIndices; + int NumberOfFractions; + Real64 tmpSumConvGainRate; + int loop; + int DeviceNum; + Real64 DeviceFraction; + + NumberOfIndices = isize(DeviceIndexARR); + NumberOfFractions = isize(FractionARR); + tmpSumConvGainRate = 0.0; + + // remove this next safety check after testing code + if (NumberOfIndices != NumberOfFractions) { // throw error + ShowSevereError(state, "SumInternalConvectionGainsByIndices: bad arguments, sizes do not match"); + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumConvGainRate = 0.0; - return; - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumConvGainRate = 0.0; + return; + } - for (loop = 1; loop <= NumberOfIndices; ++loop) { - DeviceNum = DeviceIndexARR(loop); - DeviceFraction = FractionARR(loop); - tmpSumConvGainRate = tmpSumConvGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate * DeviceFraction; + for (loop = 1; loop <= NumberOfIndices; ++loop) { + DeviceNum = DeviceIndexARR(loop); + DeviceFraction = FractionARR(loop); + tmpSumConvGainRate = tmpSumConvGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate * DeviceFraction; + } + SumConvGainRate = tmpSumConvGainRate; } - SumConvGainRate = tmpSumConvGainRate; - } - - void SumInternalLatentGainsByIndices( - EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation - const Array1D &FractionARR, // array of fractional multipliers to apply to devices - Real64 &SumLatentGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN June 2012 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gains by index - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfIndices; - int NumberOfFractions; - Real64 tmpSumLatentGainRate; - int loop; - int DeviceNum; - Real64 DeviceFraction; - - NumberOfIndices = isize(DeviceIndexARR); - NumberOfFractions = isize(FractionARR); - tmpSumLatentGainRate = 0.0; - - // remove this next safety check after testing code - if (NumberOfIndices != NumberOfFractions) { // throw error - ShowSevereError(state, "SumInternalLatentGainsByIndices: bad arguments, sizes do not match"); - } + void SumInternalLatentGainsByIndices( + EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation + const Array1D &FractionARR, // array of fractional multipliers to apply to devices + Real64 &SumLatentGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN June 2012 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gains by index + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfIndices; + int NumberOfFractions; + Real64 tmpSumLatentGainRate; + int loop; + int DeviceNum; + Real64 DeviceFraction; + + NumberOfIndices = isize(DeviceIndexARR); + NumberOfFractions = isize(FractionARR); + tmpSumLatentGainRate = 0.0; + + // remove this next safety check after testing code + if (NumberOfIndices != NumberOfFractions) { // throw error + ShowSevereError(state, "SumInternalLatentGainsByIndices: bad arguments, sizes do not match"); + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumLatentGainRate = 0.0; - return; - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumLatentGainRate = 0.0; + return; + } - for (loop = 1; loop <= NumberOfIndices; ++loop) { - DeviceNum = DeviceIndexARR(loop); - DeviceFraction = FractionARR(loop); - tmpSumLatentGainRate = tmpSumLatentGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate * DeviceFraction; + for (loop = 1; loop <= NumberOfIndices; ++loop) { + DeviceNum = DeviceIndexARR(loop); + DeviceFraction = FractionARR(loop); + tmpSumLatentGainRate = tmpSumLatentGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate * DeviceFraction; + } + SumLatentGainRate = tmpSumLatentGainRate; } - SumLatentGainRate = tmpSumLatentGainRate; - } - - void SumReturnAirConvectionGainsByIndices( - EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation - const Array1D &FractionARR, // array of fractional multipliers to apply to devices - Real64 &SumReturnAirGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN June 2012 - // MODIFIED na - // RE-ENGINEERED na - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gains by index - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfIndices; - int NumberOfFractions; - Real64 tmpSumReturnAirGainRate; - int loop; - int DeviceNum; - Real64 DeviceFraction; - - NumberOfIndices = isize(DeviceIndexARR); - NumberOfFractions = isize(FractionARR); - tmpSumReturnAirGainRate = 0.0; - - // remove this next safety check after testing code - if (NumberOfIndices != NumberOfFractions) { // throw error - ShowSevereError(state, "SumReturnAirConvectionGainsByIndice: bad arguments, sizes do not match"); - } + void SumReturnAirConvectionGainsByIndices( + EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation + const Array1D &FractionARR, // array of fractional multipliers to apply to devices + Real64 &SumReturnAirGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN June 2012 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gains by index + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfIndices; + int NumberOfFractions; + Real64 tmpSumReturnAirGainRate; + int loop; + int DeviceNum; + Real64 DeviceFraction; + + NumberOfIndices = isize(DeviceIndexARR); + NumberOfFractions = isize(FractionARR); + tmpSumReturnAirGainRate = 0.0; + + // remove this next safety check after testing code + if (NumberOfIndices != NumberOfFractions) { // throw error + ShowSevereError(state, "SumReturnAirConvectionGainsByIndice: bad arguments, sizes do not match"); + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumReturnAirGainRate = 0.0; - return; - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumReturnAirGainRate = 0.0; + return; + } - for (loop = 1; loop <= NumberOfIndices; ++loop) { - DeviceNum = DeviceIndexARR(loop); - DeviceFraction = FractionARR(loop); - tmpSumReturnAirGainRate = - tmpSumReturnAirGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate * DeviceFraction; + for (loop = 1; loop <= NumberOfIndices; ++loop) { + DeviceNum = DeviceIndexARR(loop); + DeviceFraction = FractionARR(loop); + tmpSumReturnAirGainRate = + tmpSumReturnAirGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate * DeviceFraction; + } + SumReturnAirGainRate = tmpSumReturnAirGainRate; } - SumReturnAirGainRate = tmpSumReturnAirGainRate; - } -} // namespace InternalHeatGains + } // namespace InternalHeatGains } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 40ee23b8d56..f14f1bc7f89 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -295,15 +295,15 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataMstBal->HMassConvInFD(1) = state->dataHeatBal->HConvIn(1) / ((PsyRhoAirFnPbTdbW( - *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + - state->dataMstBal->RhoVaporAirIn(1)) * - PsyCpAirFnW(state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum))); + *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + + state->dataMstBal->RhoVaporAirIn(1)) * + PsyCpAirFnW(state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum))); state->dataMstBal->HMassConvInFD(2) = state->dataHeatBal->HConvIn(2) / ((PsyRhoAirFnPbTdbW( - *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + - state->dataMstBal->RhoVaporAirIn(2)) * - PsyCpAirFnW(state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum))); + *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + + state->dataMstBal->RhoVaporAirIn(2)) * + PsyCpAirFnW(state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum))); RoomAirNode = 1; auto &thisRAFN(state->dataRoomAirflowNetModel->RAFN(ZoneNum)); @@ -418,7 +418,7 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " autocalculate, !- Sensible Heat Fraction", " sch_act, !- Activity Level Schedule Name", " ; !- Carbon Dioxide Generation Rate {m3 / s - W}", - + "Lights,", " Living Hardwired Lighting1, !- Name", " living_unit1, !- Zone or ZoneList Name", @@ -478,15 +478,15 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " living_unit1, !- Zone Name", " Node1, !- Control Point RoomAirflowNetwork : Node Name", " Node1; !- RoomAirflowNetwork : Node Name 1", - + }); ASSERT_TRUE(process_idf(idf_objects)); EXPECT_FALSE(has_err_output()); - + ErrorsFound = false; - state->dataGlobal->NumOfTimeStepInHour = 1; - state->dataGlobal->MinutesPerTimeStep = 60; + state->dataGlobal->NumOfTimeStepInHour = 1; + state->dataGlobal->MinutesPerTimeStep = 60; ScheduleManager::ProcessScheduleInput(*state); HeatBalanceManager::GetZoneData(*state, ErrorsFound); @@ -513,14 +513,14 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) HeatBalanceManager::AllocateHeatBalArrays(*state); InternalHeatGains::GetInternalHeatGainsInput(*state); - ErrorsFound = false; + ErrorsFound = false; state->dataRoomAirMod->AirModel.allocate(1); state->dataRoomAirMod->AirModel(1).AirModelType = DataRoomAirModel::RoomAirModel::AirflowNetwork; RoomAirModelManager::GetRoomAirflowNetworkData(*state, ErrorsFound); EXPECT_TRUE(ErrorsFound); std::string const error_string = - delimited_string({" ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 PEOPLE", + delimited_string({ " ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 PEOPLE", " ** ~~~ ** Entered in RoomAir:Node:AirflowNetwork:InternalGains = NODE1_GAIN", " ** ~~~ ** Internal gain did not match correctly", " ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 LIGHTS", @@ -529,6 +529,6 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 EQUIP", " ** ~~~ ** Entered in RoomAir:Node:AirflowNetwork:InternalGains = NODE1_GAIN", " ** ~~~ ** Internal gain did not match correctly" }); - + EXPECT_TRUE(compare_err_stream(error_string, true)); } From e26d4fd8e121d7b8ab425fcb21bfbccf3426e0c5 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Wed, 14 Apr 2021 10:15:19 -0600 Subject: [PATCH 04/11] Update clang format --- src/EnergyPlus/InternalHeatGains.cc | 14682 +++++++++++++------------- 1 file changed, 7248 insertions(+), 7434 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index b734847286c..818de6ebb2e 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -99,8318 +99,8132 @@ namespace EnergyPlus { - namespace InternalHeatGains { - // Module containing the routines dealing with the internal heat gains - - // MODULE INFORMATION: +namespace InternalHeatGains { + // Module containing the routines dealing with the internal heat gains + + // MODULE INFORMATION: + // AUTHOR Rick Strand + // DATE WRITTEN August 2000 + // MODIFIED Aug 2005, PGE (Added object names and report variables) + // Feb 2006, PGE (Added end-use subcategories) + // RE-ENGINEERED na + + // PURPOSE OF THIS MODULE: + // Part of the heat balance modularization/re-engineering. Purpose of this + // module is to contain the internal heat gain routines in a single location. + + // METHODOLOGY EMPLOYED: + // Routines are called as subroutines to supply the data-only module structures + // with the proper values. + + // REFERENCES: + // Legacy BLAST code + + // OTHER NOTES: none + + // Using/Aliasing + using namespace DataEnvironment; + using namespace DataHeatBalance; + using namespace DataSurfaces; + + // Data + // MODULE PARAMETER DEFINITIONS: + int const ITEClassNone(0); + int const ITEClassA1(1); + int const ITEClassA2(2); + int const ITEClassA3(3); + int const ITEClassA4(4); + int const ITEClassB(5); + int const ITEClassC(6); + int const ITEInletAdjustedSupply(0); + int const ITEInletZoneAirNode(1); + int const ITEInletRoomAirModel(2); + + static std::string const BlankString; + + void ManageInternalHeatGains(EnergyPlusData &state, + Optional_bool_const InitOnly) // when true, just calls the get input, if appropriate and returns. + { + + // SUBROUTINE INFORMATION: // AUTHOR Rick Strand - // DATE WRITTEN August 2000 - // MODIFIED Aug 2005, PGE (Added object names and report variables) - // Feb 2006, PGE (Added end-use subcategories) + // DATE WRITTEN May 2000 + // MODIFIED Mar 2004, FCW: move call to DayltgElecLightingControl from InitSurfaceHeatBalance // RE-ENGINEERED na - // PURPOSE OF THIS MODULE: - // Part of the heat balance modularization/re-engineering. Purpose of this - // module is to contain the internal heat gain routines in a single location. - - // METHODOLOGY EMPLOYED: - // Routines are called as subroutines to supply the data-only module structures - // with the proper values. - - // REFERENCES: - // Legacy BLAST code - - // OTHER NOTES: none + // PURPOSE OF THIS SUBROUTINE: + // This is the main driver subroutine for the internal heat gains. - // Using/Aliasing - using namespace DataEnvironment; - using namespace DataHeatBalance; - using namespace DataSurfaces; - - // Data - // MODULE PARAMETER DEFINITIONS: - int const ITEClassNone(0); - int const ITEClassA1(1); - int const ITEClassA2(2); - int const ITEClassA3(3); - int const ITEClassA4(4); - int const ITEClassB(5); - int const ITEClassC(6); - int const ITEInletAdjustedSupply(0); - int const ITEInletZoneAirNode(1); - int const ITEInletRoomAirModel(2); - - static std::string const BlankString; - - void ManageInternalHeatGains(EnergyPlusData &state, - Optional_bool_const InitOnly) // when true, just calls the get input, if appropriate and returns. - { - - // SUBROUTINE INFORMATION: - // AUTHOR Rick Strand - // DATE WRITTEN May 2000 - // MODIFIED Mar 2004, FCW: move call to DayltgElecLightingControl from InitSurfaceHeatBalance - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // This is the main driver subroutine for the internal heat gains. - - if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { - GetInternalHeatGainsInput(state); - state.dataInternalHeatGains->GetInternalHeatGainsInputFlag = false; - } + if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { + GetInternalHeatGainsInput(state); + state.dataInternalHeatGains->GetInternalHeatGainsInputFlag = false; + } - if (present(InitOnly)) { - if (InitOnly) return; - } + if (present(InitOnly)) { + if (InitOnly) return; + } - InitInternalHeatGains(state); + InitInternalHeatGains(state); - ReportInternalHeatGains(state); + ReportInternalHeatGains(state); - CheckReturnAirHeatGain(state); + CheckReturnAirHeatGain(state); - // for the load component report, gather the load components for each timestep but not when doing pulse - if (state.dataGlobal->ZoneSizingCalc) GatherComponentLoadsIntGain(state); - } + // for the load component report, gather the load components for each timestep but not when doing pulse + if (state.dataGlobal->ZoneSizingCalc) GatherComponentLoadsIntGain(state); + } - void GetInternalHeatGainsInput(EnergyPlusData &state) - { + void GetInternalHeatGainsInput(EnergyPlusData &state) + { - // SUBROUTINE INFORMATION: - // AUTHOR Linda K. Lawrie - // DATE WRITTEN September 1997 - // MODIFIED September 1998, FW - // May 2009, BG: added calls to setup for possible EMS override - // RE-ENGINEERED August 2000, RKS + // SUBROUTINE INFORMATION: + // AUTHOR Linda K. Lawrie + // DATE WRITTEN September 1997 + // MODIFIED September 1998, FW + // May 2009, BG: added calls to setup for possible EMS override + // RE-ENGINEERED August 2000, RKS - // PURPOSE OF THIS SUBROUTINE: - // This subroutine gets the Internal Heat Gain Data for the Zones. - // Sets up the various data that will be used later with the - // schedulemanager to determine the actual values. + // PURPOSE OF THIS SUBROUTINE: + // This subroutine gets the Internal Heat Gain Data for the Zones. + // Sets up the various data that will be used later with the + // schedulemanager to determine the actual values. - // METHODOLOGY EMPLOYED: - // The GetObjectItem routines are employed to retrieve the data. + // METHODOLOGY EMPLOYED: + // The GetObjectItem routines are employed to retrieve the data. - // REFERENCES: - // IDD Objects: - // People - // Lights - // ElectricEquipment - // GasEquipment - // SteamEquipment - // HotWaterEquipment - // OtherEquipment - // ElectricEquipment:ITE:AirCooled - // ZoneBaseboard:OutdoorTemperatureControlled - - // Using/Aliasing - using namespace ScheduleManager; - using General::CheckCreatedZoneItemName; - - using namespace OutputReportPredefined; - using namespace DataLoopNode; - using CurveManager::GetCurveIndex; - using NodeInputManager::GetOnlySingleNode; - - // SUBROUTINE PARAMETER DEFINITIONS: - static std::string const RoutineName("GetInternalHeatGains: "); - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Array1D_string AlphaName; - Array1D IHGNumbers; - int IOStat; - int Loop; - int NumAlpha; - int NumNumber; - int MaxAlpha; - int MaxNumber; - int OptionNum(0); // Autodesk:Init Initialization added to elim poss use uninitialized - int lastOption; - Array1D_bool RepVarSet; - // Variables for reporting nominal internal gains - Real64 LightTot; // Total Lights for calculating lights per square meter - Real64 ElecTot; // Total Electric Load for calculating electric per square meter - Real64 GasTot; // Total Gas load for calculating gas per square meter - Real64 OthTot; // Total Other load for calculating other load per square meter - Real64 HWETot; // Total Hot Water Equipment for calculating HWE per square meter - Real64 StmTot; // Total Steam for calculating Steam per square meter - std::string BBHeatInd; // Yes if BBHeat in zone, no if not. - int Loop1; - Real64 SchMin; - Real64 SchMax; - std::string liteName; - int zonePt; - Real64 mult; - int ZoneNum; - Real64 maxOccupLoad; - std::string CurrentModuleObject; - bool errFlag; - int Item; - int ZLItem; - int Item1; - - // Formats - static constexpr auto Format_720(" Zone Internal Gains Nominal, {},{:.2R},{:.1R},"); - static constexpr auto Format_722(" {} Internal Gains Nominal, {},{},{},{:.2R},{:.1R},"); - static constexpr auto Format_723("! <{} Internal Gains Nominal>,Name,Schedule Name,Zone Name,Zone Floor Area {{m2}},# Zone Occupants,{}"); - static constexpr auto Format_724(" {}, {}\n"); - - auto print_and_divide_if_greater_than_zero = [&](const Real64 numerator, const Real64 denominator) { - if (denominator > 0.0) { - print(state.files.eio, "{:.3R},", numerator / denominator); - } - else { - print(state.files.eio, "N/A,"); - } - }; - - auto &ErrorsFound(state.dataInternalHeatGains->ErrorsFound); - - state.dataHeatBal->ZoneIntGain.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->ZnRpt.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->ZoneIntEEuse.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->RefrigCaseCredit.allocate(state.dataGlobal->NumOfZones); - - RepVarSet.dimension(state.dataGlobal->NumOfZones, true); - - // Determine argument length of objects gotten by this routine - MaxAlpha = -100; - MaxNumber = -100; - CurrentModuleObject = "People"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "Lights"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "ElectricEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "GasEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "HotWaterEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "SteamEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "OtherEquipment"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "ElectricEquipment:ITE:AirCooled"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - CurrentModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide"; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); - MaxAlpha = max(MaxAlpha, NumAlpha); - MaxNumber = max(MaxNumber, NumNumber); - - IHGNumbers.allocate(MaxNumber); - AlphaName.allocate(MaxAlpha); - IHGNumbers = 0.0; - AlphaName = ""; + // REFERENCES: + // IDD Objects: + // People + // Lights + // ElectricEquipment + // GasEquipment + // SteamEquipment + // HotWaterEquipment + // OtherEquipment + // ElectricEquipment:ITE:AirCooled + // ZoneBaseboard:OutdoorTemperatureControlled - // CurrentModuleObject='Zone' - for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { - // Overall Zone Variables - SetupOutputVariable(state, - "Zone Total Internal Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotRadiantGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotRadiantGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Visible Radiation Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotVisHeatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Visible Radiation Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotVisHeatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotConvectiveGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotConvectiveGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotLatentGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotLatentGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(Loop).TotTotalHeatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(Loop).Name); - SetupOutputVariable(state, - "Zone Total Internal Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(Loop).TotTotalHeatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(Loop).Name); + // Using/Aliasing + using namespace ScheduleManager; + using General::CheckCreatedZoneItemName; + + using namespace OutputReportPredefined; + using namespace DataLoopNode; + using CurveManager::GetCurveIndex; + using NodeInputManager::GetOnlySingleNode; + + // SUBROUTINE PARAMETER DEFINITIONS: + static std::string const RoutineName("GetInternalHeatGains: "); + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Array1D_string AlphaName; + Array1D IHGNumbers; + int IOStat; + int Loop; + int NumAlpha; + int NumNumber; + int MaxAlpha; + int MaxNumber; + int OptionNum(0); // Autodesk:Init Initialization added to elim poss use uninitialized + int lastOption; + Array1D_bool RepVarSet; + // Variables for reporting nominal internal gains + Real64 LightTot; // Total Lights for calculating lights per square meter + Real64 ElecTot; // Total Electric Load for calculating electric per square meter + Real64 GasTot; // Total Gas load for calculating gas per square meter + Real64 OthTot; // Total Other load for calculating other load per square meter + Real64 HWETot; // Total Hot Water Equipment for calculating HWE per square meter + Real64 StmTot; // Total Steam for calculating Steam per square meter + std::string BBHeatInd; // Yes if BBHeat in zone, no if not. + int Loop1; + Real64 SchMin; + Real64 SchMax; + std::string liteName; + int zonePt; + Real64 mult; + int ZoneNum; + Real64 maxOccupLoad; + std::string CurrentModuleObject; + bool errFlag; + int Item; + int ZLItem; + int Item1; + + // Formats + static constexpr auto Format_720(" Zone Internal Gains Nominal, {},{:.2R},{:.1R},"); + static constexpr auto Format_722(" {} Internal Gains Nominal, {},{},{},{:.2R},{:.1R},"); + static constexpr auto Format_723("! <{} Internal Gains Nominal>,Name,Schedule Name,Zone Name,Zone Floor Area {{m2}},# Zone Occupants,{}"); + static constexpr auto Format_724(" {}, {}\n"); + + auto print_and_divide_if_greater_than_zero = [&](const Real64 numerator, const Real64 denominator) { + if (denominator > 0.0) { + print(state.files.eio, "{:.3R},", numerator / denominator); + } else { + print(state.files.eio, "N/A,"); } + }; + + auto &ErrorsFound(state.dataInternalHeatGains->ErrorsFound); + + state.dataHeatBal->ZoneIntGain.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->ZnRpt.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->ZoneIntEEuse.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->RefrigCaseCredit.allocate(state.dataGlobal->NumOfZones); + + RepVarSet.dimension(state.dataGlobal->NumOfZones, true); + + // Determine argument length of objects gotten by this routine + MaxAlpha = -100; + MaxNumber = -100; + CurrentModuleObject = "People"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "Lights"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "ElectricEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "GasEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "HotWaterEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "SteamEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "OtherEquipment"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "ElectricEquipment:ITE:AirCooled"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + CurrentModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide"; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Loop, NumAlpha, NumNumber); + MaxAlpha = max(MaxAlpha, NumAlpha); + MaxNumber = max(MaxNumber, NumNumber); + + IHGNumbers.allocate(MaxNumber); + AlphaName.allocate(MaxAlpha); + IHGNumbers = 0.0; + AlphaName = ""; + + // CurrentModuleObject='Zone' + for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { + // Overall Zone Variables + SetupOutputVariable(state, + "Zone Total Internal Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotRadiantGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotRadiantGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Visible Radiation Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotVisHeatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Visible Radiation Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotVisHeatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotConvectiveGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotConvectiveGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotLatentGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotLatentGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(Loop).TotTotalHeatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(Loop).Name); + SetupOutputVariable(state, + "Zone Total Internal Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(Loop).TotTotalHeatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(Loop).Name); + } - // PEOPLE: Includes both information related to the heat balance and thermal comfort - // First, allocate and initialize the People derived type - CurrentModuleObject = "People"; - state.dataHeatBal->NumPeopleStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->PeopleObjects.allocate(state.dataHeatBal->NumPeopleStatements); + // PEOPLE: Includes both information related to the heat balance and thermal comfort + // First, allocate and initialize the People derived type + CurrentModuleObject = "People"; + state.dataHeatBal->NumPeopleStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->PeopleObjects.allocate(state.dataHeatBal->NumPeopleStatements); + + state.dataHeatBal->TotPeople = 0; + errFlag = false; + for (Item = 1; Item <= state.dataHeatBal->NumPeopleStatements; ++Item) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->PeopleObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->PeopleObjects(Item).StartPtr = state.dataHeatBal->TotPeople + 1; + ++state.dataHeatBal->TotPeople; + state.dataHeatBal->PeopleObjects(Item).NumOfZones = 1; + state.dataHeatBal->PeopleObjects(Item).ZoneListActive = false; + state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr = Item1; + } else if (ZLItem > 0) { + state.dataHeatBal->PeopleObjects(Item).StartPtr = state.dataHeatBal->TotPeople + 1; + state.dataHeatBal->TotPeople += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->PeopleObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->PeopleObjects(Item).ZoneListActive = true; + state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr = ZLItem; + } else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); state.dataHeatBal->TotPeople = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumPeopleStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->PeopleObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->PeopleObjects(Item).StartPtr = state.dataHeatBal->TotPeople + 1; - ++state.dataHeatBal->TotPeople; - state.dataHeatBal->PeopleObjects(Item).NumOfZones = 1; - state.dataHeatBal->PeopleObjects(Item).ZoneListActive = false; - state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr = Item1; - } - else if (ZLItem > 0) { - state.dataHeatBal->PeopleObjects(Item).StartPtr = state.dataHeatBal->TotPeople + 1; - state.dataHeatBal->TotPeople += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->PeopleObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->PeopleObjects(Item).ZoneListActive = true; - state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr = ZLItem; - } - else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + } - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotPeople = 0; - } + state.dataHeatBal->People.allocate(state.dataHeatBal->TotPeople); - state.dataHeatBal->People.allocate(state.dataHeatBal->TotPeople); - - if (state.dataHeatBal->TotPeople > 0) { - Loop = 0; - for (Item = 1; Item <= state.dataHeatBal->NumPeopleStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->PeopleObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->PeopleObjects(Item).ZoneListActive) { - state.dataHeatBal->People(Loop).Name = AlphaName(1); - state.dataHeatBal->People(Loop).ZonePtr = state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr; - } - else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) + if (state.dataHeatBal->TotPeople > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumPeopleStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->PeopleObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->PeopleObjects(Item).ZoneListActive) { + state.dataHeatBal->People(Loop).Name = AlphaName(1); + state.dataHeatBal->People(Loop).ZonePtr = state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr; + } else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->PeopleObjects(Item).Name, - state.dataHeatBal->People, - Loop - 1, - state.dataHeatBal->People(Loop).Name, - errFlag); - state.dataHeatBal->People(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->PeopleObjects(Item).Name, + state.dataHeatBal->People, + Loop - 1, + state.dataHeatBal->People(Loop).Name, + errFlag); + state.dataHeatBal->People(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->PeopleObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } - state.dataHeatBal->People(Loop).NumberOfPeoplePtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->People(Loop).NumberOfPeoplePtr == 0) { - if (Item1 == 1) { // only show error on first one - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); - } - else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); - } - ErrorsFound = true; + state.dataHeatBal->People(Loop).NumberOfPeoplePtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->People(Loop).NumberOfPeoplePtr == 0) { + if (Item1 == 1) { // only show error on first one + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); } + ErrorsFound = true; } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (Item1 == 1) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; - } + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (Item1 == 1) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; } - if (Item1 == 1) { - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; - } + } + if (Item1 == 1) { + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } } } + } - // Number of people calculation method. - { - auto const peopleMethod(AlphaName(4)); - if (peopleMethod == "PEOPLE") { - state.dataHeatBal->People(Loop).NumberOfPeople = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 People will result."); - } - + // Number of people calculation method. + { + auto const peopleMethod(AlphaName(4)); + if (peopleMethod == "PEOPLE") { + state.dataHeatBal->People(Loop).NumberOfPeople = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 People will result."); } - else if (peopleMethod == "PEOPLE/AREA") { - if (state.dataHeatBal->People(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->People(Loop).NumberOfPeople = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 People will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->People(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); - ErrorsFound = true; - } - } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 People will result."); - } - } - else if (peopleMethod == "AREA/PERSON") { - if (state.dataHeatBal->People(Loop).ZonePtr != 0) { - if (IHGNumbers(3) > 0.0) { - state.dataHeatBal->People(Loop).NumberOfPeople = - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea / IHGNumbers(3); - if (state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 People will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->People(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); - ErrorsFound = true; + } else if (peopleMethod == "PEOPLE/AREA") { + if (state.dataHeatBal->People(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->People(Loop).NumberOfPeople = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 People will result."); } + } else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->People(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); + ErrorsFound = true; } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 People will result."); - } - } - else { - if (Item1 == 1) { + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 People will result."); + } + + } else if (peopleMethod == "AREA/PERSON") { + if (state.dataHeatBal->People(Loop).ZonePtr != 0) { + if (IHGNumbers(3) > 0.0) { + state.dataHeatBal->People(Loop).NumberOfPeople = + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea / IHGNumbers(3); + if (state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 People will result."); + } + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"People\", \"People/Area\", \"Area/Person\"."); + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->People(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } - } - - // Calculate nominal min/max people - state.dataHeatBal->People(Loop).NomMinNumberPeople = state.dataHeatBal->People(Loop).NumberOfPeople * SchMin; - state.dataHeatBal->People(Loop).NomMaxNumberPeople = state.dataHeatBal->People(Loop).NumberOfPeople * SchMax; - - if (state.dataHeatBal->People(Loop).ZonePtr > 0) { - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).TotOccupants += - state.dataHeatBal->People(Loop).NumberOfPeople; - } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 People will result."); + } - state.dataHeatBal->People(Loop).FractionRadiant = IHGNumbers(4); - state.dataHeatBal->People(Loop).FractionConvected = 1.0 - state.dataHeatBal->People(Loop).FractionRadiant; - if (Item1 == 1) { - if (state.dataHeatBal->People(Loop).FractionConvected < 0.0) { + } else { + if (Item1 == 1) { ShowSevereError(state, - format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(4), - IHGNumbers(4))); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"People\", \"People/Area\", \"Area/Person\"."); ErrorsFound = true; } } + } - if (NumNumber >= 5 && !state.dataIPShortCut->lNumericFieldBlanks(5)) { - state.dataHeatBal->People(Loop).UserSpecSensFrac = IHGNumbers(5); - } - else { - state.dataHeatBal->People(Loop).UserSpecSensFrac = DataGlobalConstants::AutoCalculate; - } + // Calculate nominal min/max people + state.dataHeatBal->People(Loop).NomMinNumberPeople = state.dataHeatBal->People(Loop).NumberOfPeople * SchMin; + state.dataHeatBal->People(Loop).NomMaxNumberPeople = state.dataHeatBal->People(Loop).NumberOfPeople * SchMax; - if (NumNumber == 6 && !state.dataIPShortCut->lNumericFieldBlanks(6)) { - state.dataHeatBal->People(Loop).CO2RateFactor = IHGNumbers(6); - } - else { - state.dataHeatBal->People(Loop).CO2RateFactor = 3.82e-8; // m3/s-W - } - if (state.dataHeatBal->People(Loop).CO2RateFactor < 0.0) { + if (state.dataHeatBal->People(Loop).ZonePtr > 0) { + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).TotOccupants += + state.dataHeatBal->People(Loop).NumberOfPeople; + } + + state.dataHeatBal->People(Loop).FractionRadiant = IHGNumbers(4); + state.dataHeatBal->People(Loop).FractionConvected = 1.0 - state.dataHeatBal->People(Loop).FractionRadiant; + if (Item1 == 1) { + if (state.dataHeatBal->People(Loop).FractionConvected < 0.0) { ShowSevereError(state, - format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(6), - IHGNumbers(6))); + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(4), + IHGNumbers(4))); ErrorsFound = true; } + } + + if (NumNumber >= 5 && !state.dataIPShortCut->lNumericFieldBlanks(5)) { + state.dataHeatBal->People(Loop).UserSpecSensFrac = IHGNumbers(5); + } else { + state.dataHeatBal->People(Loop).UserSpecSensFrac = DataGlobalConstants::AutoCalculate; + } + + if (NumNumber == 6 && !state.dataIPShortCut->lNumericFieldBlanks(6)) { + state.dataHeatBal->People(Loop).CO2RateFactor = IHGNumbers(6); + } else { + state.dataHeatBal->People(Loop).CO2RateFactor = 3.82e-8; // m3/s-W + } + if (state.dataHeatBal->People(Loop).CO2RateFactor < 0.0) { + ShowSevereError(state, + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(6), + IHGNumbers(6))); + ErrorsFound = true; + } - state.dataHeatBal->People(Loop).ActivityLevelPtr = GetScheduleIndex(state, AlphaName(5)); - if (state.dataHeatBal->People(Loop).ActivityLevelPtr == 0) { + state.dataHeatBal->People(Loop).ActivityLevelPtr = GetScheduleIndex(state, AlphaName(5)); + if (state.dataHeatBal->People(Loop).ActivityLevelPtr == 0) { + if (Item1 == 1) { + if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(5) + " entered=" + AlphaName(5)); + } + ErrorsFound = true; + } + } else { // Check values in Schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); + if (SchMin < 0.0 || SchMax < 0.0) { if (Item1 == 1) { - if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + " is required."); - } - else { + if (SchMin < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(5) + " entered=" + AlphaName(5)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + " minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); + ErrorsFound = true; } - ErrorsFound = true; } - } - else { // Check values in Schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (Item1 == 1) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + " minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); - ErrorsFound = true; - } - } - if (Item1 == 1) { - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + " maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); - ErrorsFound = true; - } + if (Item1 == 1) { + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + " maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); + ErrorsFound = true; } } - else if (SchMin < 70.0 || SchMax > 1000.0) { - if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + " values"); - ShowContinueError(state, "fall outside typical range [70,1000] W/person for Thermal Comfort Reporting."); - ShowContinueError(state, "Odd comfort values may result; Schedule=\"" + AlphaName(5) + "\"."); - ShowContinueError(state, format("Entered min/max range=[{:.1R},] W/person.{:.1R}", SchMin, SchMax)); - } + } else if (SchMin < 70.0 || SchMax > 1000.0) { + if (Item1 == 1) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + " values"); + ShowContinueError(state, "fall outside typical range [70,1000] W/person for Thermal Comfort Reporting."); + ShowContinueError(state, "Odd comfort values may result; Schedule=\"" + AlphaName(5) + "\"."); + ShowContinueError(state, format("Entered min/max range=[{:.1R},] W/person.{:.1R}", SchMin, SchMax)); } } + } - // Following is an optional parameter (ASHRAE 55 warnings - if (NumAlpha >= 6) { - if (UtilityRoutines::SameString(AlphaName(6), "Yes")) { - state.dataHeatBal->People(Loop).Show55Warning = true; - } - else if (!UtilityRoutines::SameString(AlphaName(6), "No") && !state.dataIPShortCut->lAlphaFieldBlanks(6)) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(6) + " field should be Yes or No"); - ShowContinueError(state, "...Field value=\"" + AlphaName(6) + "\" is invalid."); - ErrorsFound = true; - } + // Following is an optional parameter (ASHRAE 55 warnings + if (NumAlpha >= 6) { + if (UtilityRoutines::SameString(AlphaName(6), "Yes")) { + state.dataHeatBal->People(Loop).Show55Warning = true; + } else if (!UtilityRoutines::SameString(AlphaName(6), "No") && !state.dataIPShortCut->lAlphaFieldBlanks(6)) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(6) + " field should be Yes or No"); + ShowContinueError(state, "...Field value=\"" + AlphaName(6) + "\" is invalid."); + ErrorsFound = true; } } + } - if (NumAlpha > 6) { // Optional parameters present--thermal comfort data follows... - state.dataInternalHeatGains->UsingThermalComfort = false; - if (NumAlpha > 20) { - lastOption = 20; - } - else { - lastOption = NumAlpha; - } + if (NumAlpha > 6) { // Optional parameters present--thermal comfort data follows... + state.dataInternalHeatGains->UsingThermalComfort = false; + if (NumAlpha > 20) { + lastOption = 20; + } else { + lastOption = NumAlpha; + } - // check to see if the user has specified schedules for air velocity, clothing insulation, and/or work efficiency - // but have NOT made a selection for a thermal comfort model. If so, then the schedules are reported as unused - // which could cause confusion. The solution is for the user to either remove those schedules or pick a thermal - // comfort model. - int const NumFirstTCModel = 14; - if (NumAlpha < NumFirstTCModel) { - bool NoTCModelSelectedWithSchedules = false; - NoTCModelSelectedWithSchedules = CheckThermalComfortSchedules(state.dataIPShortCut->lAlphaFieldBlanks(9), - state.dataIPShortCut->lAlphaFieldBlanks(12), - state.dataIPShortCut->lAlphaFieldBlanks(13)); - if (NoTCModelSelectedWithSchedules) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + - "\" has comfort related schedules but no thermal comfort model selected."); - ShowContinueError(state, - "If schedules are specified for air velocity, clothing insulation, and/or work efficiency but no " - "thermal comfort"); - ShowContinueError( - state, "thermal comfort model is selected, the schedules will be listed as unused schedules in the .err file."); - ShowContinueError( - state, - "To avoid these errors, select a valid thermal comfort model or eliminate these schedules in the PEOPLE input."); - } + // check to see if the user has specified schedules for air velocity, clothing insulation, and/or work efficiency + // but have NOT made a selection for a thermal comfort model. If so, then the schedules are reported as unused + // which could cause confusion. The solution is for the user to either remove those schedules or pick a thermal + // comfort model. + int const NumFirstTCModel = 14; + if (NumAlpha < NumFirstTCModel) { + bool NoTCModelSelectedWithSchedules = false; + NoTCModelSelectedWithSchedules = CheckThermalComfortSchedules(state.dataIPShortCut->lAlphaFieldBlanks(9), + state.dataIPShortCut->lAlphaFieldBlanks(12), + state.dataIPShortCut->lAlphaFieldBlanks(13)); + if (NoTCModelSelectedWithSchedules) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + + "\" has comfort related schedules but no thermal comfort model selected."); + ShowContinueError(state, + "If schedules are specified for air velocity, clothing insulation, and/or work efficiency but no " + "thermal comfort"); + ShowContinueError( + state, "thermal comfort model is selected, the schedules will be listed as unused schedules in the .err file."); + ShowContinueError( + state, + "To avoid these errors, select a valid thermal comfort model or eliminate these schedules in the PEOPLE input."); } + } - for (OptionNum = NumFirstTCModel; OptionNum <= lastOption; ++OptionNum) { + for (OptionNum = NumFirstTCModel; OptionNum <= lastOption; ++OptionNum) { - { - auto const thermalComfortType(AlphaName(OptionNum)); + { + auto const thermalComfortType(AlphaName(OptionNum)); - if (thermalComfortType == "FANGER") { - state.dataHeatBal->People(Loop).Fanger = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + if (thermalComfortType == "FANGER") { + state.dataHeatBal->People(Loop).Fanger = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } - else if (thermalComfortType == "PIERCE") { - state.dataHeatBal->People(Loop).Pierce = true; - state.dataHeatBal->AnyThermalComfortPierceModel = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } else if (thermalComfortType == "PIERCE") { + state.dataHeatBal->People(Loop).Pierce = true; + state.dataHeatBal->AnyThermalComfortPierceModel = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } - else if (thermalComfortType == "KSU") { - state.dataHeatBal->People(Loop).KSU = true; - state.dataHeatBal->AnyThermalComfortKSUModel = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } else if (thermalComfortType == "KSU") { + state.dataHeatBal->People(Loop).KSU = true; + state.dataHeatBal->AnyThermalComfortKSUModel = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } - else if (thermalComfortType == "ADAPTIVEASH55") { - state.dataHeatBal->People(Loop).AdaptiveASH55 = true; - state.dataHeatBal->AdaptiveComfortRequested_ASH55 = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } else if (thermalComfortType == "ADAPTIVEASH55") { + state.dataHeatBal->People(Loop).AdaptiveASH55 = true; + state.dataHeatBal->AdaptiveComfortRequested_ASH55 = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } - else if (thermalComfortType == "ADAPTIVECEN15251") { - state.dataHeatBal->People(Loop).AdaptiveCEN15251 = true; - state.dataHeatBal->AdaptiveComfortRequested_CEN15251 = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } else if (thermalComfortType == "ADAPTIVECEN15251") { + state.dataHeatBal->People(Loop).AdaptiveCEN15251 = true; + state.dataHeatBal->AdaptiveComfortRequested_CEN15251 = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } - else if (thermalComfortType == "COOLINGEFFECTASH55") { - state.dataHeatBal->People(Loop).CoolingEffectASH55 = true; - state.dataHeatBal->AnyThermalComfortCoolingEffectModel = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } else if (thermalComfortType == "COOLINGEFFECTASH55") { + state.dataHeatBal->People(Loop).CoolingEffectASH55 = true; + state.dataHeatBal->AnyThermalComfortCoolingEffectModel = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } - else if (thermalComfortType == "ANKLEDRAFTASH55") { - state.dataHeatBal->People(Loop).AnkleDraftASH55 = true; - state.dataHeatBal->AnyThermalComfortAnkleDraftModel = true; - state.dataInternalHeatGains->UsingThermalComfort = true; + } else if (thermalComfortType == "ANKLEDRAFTASH55") { + state.dataHeatBal->People(Loop).AnkleDraftASH55 = true; + state.dataHeatBal->AnyThermalComfortAnkleDraftModel = true; + state.dataInternalHeatGains->UsingThermalComfort = true; - } - else if (thermalComfortType == "") { // Blank input field--just ignore this + } else if (thermalComfortType == "") { // Blank input field--just ignore this - } - else { // An invalid keyword was entered--warn but ignore - if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(OptionNum) + " Option=" + AlphaName(OptionNum)); - ShowContinueError(state, - "Valid Values are \"Fanger\", \"Pierce\", \"KSU\", \"AdaptiveASH55\", " - "\"AdaptiveCEN15251\", \"CoolingEffectASH55\", \"AnkleDraftASH55\""); - } + } else { // An invalid keyword was entered--warn but ignore + if (Item1 == 1) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(OptionNum) + " Option=" + AlphaName(OptionNum)); + ShowContinueError(state, + "Valid Values are \"Fanger\", \"Pierce\", \"KSU\", \"AdaptiveASH55\", " + "\"AdaptiveCEN15251\", \"CoolingEffectASH55\", \"AnkleDraftASH55\""); } } } + } - if (state.dataInternalHeatGains->UsingThermalComfort) { + if (state.dataInternalHeatGains->UsingThermalComfort) { - // Set the default value of MRTCalcType as 'ZoneAveraged' - state.dataHeatBal->People(Loop).MRTCalcType = ZoneAveraged; + // Set the default value of MRTCalcType as 'ZoneAveraged' + state.dataHeatBal->People(Loop).MRTCalcType = ZoneAveraged; - bool ModelWithAdditionalInputs = state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || - state.dataHeatBal->People(Loop).KSU || - state.dataHeatBal->People(Loop).CoolingEffectASH55 || - state.dataHeatBal->People(Loop).AnkleDraftASH55; + bool ModelWithAdditionalInputs = state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || + state.dataHeatBal->People(Loop).KSU || + state.dataHeatBal->People(Loop).CoolingEffectASH55 || + state.dataHeatBal->People(Loop).AnkleDraftASH55; - // MRT Calculation Type and Surface Name - { - auto const mrtType(AlphaName(7)); + // MRT Calculation Type and Surface Name + { + auto const mrtType(AlphaName(7)); - if (mrtType == "ZONEAVERAGED") { - state.dataHeatBal->People(Loop).MRTCalcType = ZoneAveraged; + if (mrtType == "ZONEAVERAGED") { + state.dataHeatBal->People(Loop).MRTCalcType = ZoneAveraged; - } - else if (mrtType == "SURFACEWEIGHTED") { - state.dataHeatBal->People(Loop).MRTCalcType = SurfaceWeighted; - state.dataHeatBal->People(Loop).SurfacePtr = - UtilityRoutines::FindItemInList(AlphaName(8), state.dataSurface->Surface); - if (state.dataHeatBal->People(Loop).SurfacePtr == 0 && ModelWithAdditionalInputs) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7) + - " invalid Surface Name=" + AlphaName(8)); - ErrorsFound = true; - } - } - else if (state.dataSurface->Surface(state.dataHeatBal->People(Loop).SurfacePtr).Zone != - state.dataHeatBal->People(Loop).ZonePtr && - ModelWithAdditionalInputs) { + } else if (mrtType == "SURFACEWEIGHTED") { + state.dataHeatBal->People(Loop).MRTCalcType = SurfaceWeighted; + state.dataHeatBal->People(Loop).SurfacePtr = + UtilityRoutines::FindItemInList(AlphaName(8), state.dataSurface->Surface); + if (state.dataHeatBal->People(Loop).SurfacePtr == 0 && ModelWithAdditionalInputs) { + if (Item1 == 1) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Surface referenced in " + - state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7) + " in different zone."); - ShowContinueError( - state, - "Surface is in Zone=" + - state.dataHeatBal->Zone(state.dataSurface->Surface(state.dataHeatBal->People(Loop).SurfacePtr).Zone) - .Name + - " and " + CurrentModuleObject + " is in Zone=" + AlphaName(2)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7) + + " invalid Surface Name=" + AlphaName(8)); ErrorsFound = true; } - + } else if (state.dataSurface->Surface(state.dataHeatBal->People(Loop).SurfacePtr).Zone != + state.dataHeatBal->People(Loop).ZonePtr && + ModelWithAdditionalInputs) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Surface referenced in " + + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7) + " in different zone."); + ShowContinueError( + state, + "Surface is in Zone=" + + state.dataHeatBal->Zone(state.dataSurface->Surface(state.dataHeatBal->People(Loop).SurfacePtr).Zone) + .Name + + " and " + CurrentModuleObject + " is in Zone=" + AlphaName(2)); + ErrorsFound = true; } - else if (mrtType == "ANGLEFACTOR") { - state.dataHeatBal->People(Loop).MRTCalcType = AngleFactor; - state.dataHeatBal->People(Loop).AngleFactorListName = AlphaName(8); - } - else if (mrtType == "") { // Blank input field--just ignore this - if (Item1 == 1 && ModelWithAdditionalInputs) - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + - state.dataIPShortCut->cAlphaFieldNames(7)); + } else if (mrtType == "ANGLEFACTOR") { + state.dataHeatBal->People(Loop).MRTCalcType = AngleFactor; + state.dataHeatBal->People(Loop).AngleFactorListName = AlphaName(8); - } - else { // An invalid keyword was entered--warn but ignore - if (Item1 == 1 && ModelWithAdditionalInputs) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7)); - ShowContinueError(state, "...Valid values are \"ZoneAveraged\", \"SurfaceWeighted\", \"AngleFactor\"."); - } + } else if (mrtType == "") { // Blank input field--just ignore this + if (Item1 == 1 && ModelWithAdditionalInputs) + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + + state.dataIPShortCut->cAlphaFieldNames(7)); + + } else { // An invalid keyword was entered--warn but ignore + if (Item1 == 1 && ModelWithAdditionalInputs) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7)); + ShowContinueError(state, "...Valid values are \"ZoneAveraged\", \"SurfaceWeighted\", \"AngleFactor\"."); } } + } - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - state.dataHeatBal->People(Loop).WorkEffPtr = GetScheduleIndex(state, AlphaName(9)); - if (state.dataHeatBal->People(Loop).WorkEffPtr == 0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(9) + " entered=" + AlphaName(9)); - ErrorsFound = true; - } + if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { + state.dataHeatBal->People(Loop).WorkEffPtr = GetScheduleIndex(state, AlphaName(9)); + if (state.dataHeatBal->People(Loop).WorkEffPtr == 0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(9) + " entered=" + AlphaName(9)); + ErrorsFound = true; } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).WorkEffPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).WorkEffPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(9) + ", minimum is < 0.0"); - ShowContinueError( - state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMin)); - ErrorsFound = true; - } - } - if (SchMax < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(9) + ", maximum is < 0.0"); - ShowContinueError( - state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMax)); - ErrorsFound = true; - } + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).WorkEffPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).WorkEffPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(9) + ", minimum is < 0.0"); + ShowContinueError( + state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMin)); + ErrorsFound = true; } } - if (SchMax > 1.0) { + if (SchMax < 0.0) { if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(9) + ", maximum is > 1.0"); - ShowContinueError(state, - format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Work Efficiency.", - AlphaName(9), - SchMin, - SchMax)); + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(9) + ", maximum is < 0.0"); + ShowContinueError( + state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMax)); + ErrorsFound = true; } } } - } - else if (ModelWithAdditionalInputs) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + - state.dataIPShortCut->cAlphaFieldNames(9) + ". " + state.dataIPShortCut->cAlphaFieldNames(9) + - " is required when Thermal Comfort Model Type is one of " - "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); - ErrorsFound = true; + if (SchMax > 1.0) { + if (Item1 == 1) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(9) + ", maximum is > 1.0"); + ShowContinueError(state, + format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Work Efficiency.", + AlphaName(9), + SchMin, + SchMax)); + } } } + } else if (ModelWithAdditionalInputs) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + + state.dataIPShortCut->cAlphaFieldNames(9) + ". " + state.dataIPShortCut->cAlphaFieldNames(9) + + " is required when Thermal Comfort Model Type is one of " + "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); + ErrorsFound = true; + } + } - if (!state.dataIPShortCut->lAlphaFieldBlanks(10) || AlphaName(10) != "") { - { - auto const clothingType(AlphaName(10)); - if (clothingType == "CLOTHINGINSULATIONSCHEDULE") { - state.dataHeatBal->People(Loop).ClothingType = 1; - state.dataHeatBal->People(Loop).ClothingPtr = GetScheduleIndex(state, AlphaName(12)); - if (state.dataHeatBal->People(Loop).ClothingPtr == 0 && ModelWithAdditionalInputs) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + - "\"."); - ErrorsFound = true; - } + if (!state.dataIPShortCut->lAlphaFieldBlanks(10) || AlphaName(10) != "") { + { + auto const clothingType(AlphaName(10)); + if (clothingType == "CLOTHINGINSULATIONSCHEDULE") { + state.dataHeatBal->People(Loop).ClothingType = 1; + state.dataHeatBal->People(Loop).ClothingPtr = GetScheduleIndex(state, AlphaName(12)); + if (state.dataHeatBal->People(Loop).ClothingPtr == 0 && ModelWithAdditionalInputs) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + + "\"."); + ErrorsFound = true; } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).ClothingPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).ClothingPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(12) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", - AlphaName(12), - SchMin)); - ErrorsFound = true; - } - } - if (SchMax < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(12) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", - AlphaName(12), - SchMax)); - ErrorsFound = true; - } - } - } - if (SchMax > 2.0) { + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).ClothingPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).ClothingPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(12) + ", maximum is > 2.0"); + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(12) + ", minimum is < 0.0"); ShowContinueError(state, - format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Clothing.", - AlphaName(12), - SchMin, - SchMax)); + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", + AlphaName(12), + SchMin)); + ErrorsFound = true; } } - } - - } - else if (clothingType == "DYNAMICCLOTHINGMODELASHRAE55") { - state.dataHeatBal->People(Loop).ClothingType = 2; - - } - else if (clothingType == "CALCULATIONMETHODSCHEDULE") { - state.dataHeatBal->People(Loop).ClothingType = 3; - state.dataHeatBal->People(Loop).ClothingMethodPtr = GetScheduleIndex(state, AlphaName(11)); - if (state.dataHeatBal->People(Loop).ClothingMethodPtr == 0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(11) + " entered=\"" + AlphaName(11) + - "\"."); - ErrorsFound = true; - } - } - if (CheckScheduleValue(state, state.dataHeatBal->People(Loop).ClothingMethodPtr, 1)) { - state.dataHeatBal->People(Loop).ClothingPtr = GetScheduleIndex(state, AlphaName(12)); - if (state.dataHeatBal->People(Loop).ClothingPtr == 0) { + if (SchMax < 0.0) { if (Item1 == 1) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + - "\"."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(12) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", + AlphaName(12), + SchMax)); ErrorsFound = true; } } } - - } - else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + - "\", invalid " + state.dataIPShortCut->cAlphaFieldNames(10) + - ", value =" + AlphaName(10)); - ShowContinueError(state, - "...Valid values are \"ClothingInsulationSchedule\",\"DynamicClothingModelASHRAE55a\", " - "\"CalculationMethodSchedule\"."); - ErrorsFound = true; - } - } - } - - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - state.dataHeatBal->People(Loop).AirVelocityPtr = GetScheduleIndex(state, AlphaName(13)); - if (state.dataHeatBal->People(Loop).AirVelocityPtr == 0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(13) + " entered=\"" + AlphaName(13) + "\"."); - ErrorsFound = true; - } - } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).AirVelocityPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).AirVelocityPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { + if (SchMax > 2.0) { if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(13) + ", minimum is < 0.0"); - ShowContinueError( - state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMin)); - ErrorsFound = true; + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(12) + ", maximum is > 2.0"); + ShowContinueError(state, + format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Clothing.", + AlphaName(12), + SchMin, + SchMax)); } } - if (SchMax < 0.0) { + } + + } else if (clothingType == "DYNAMICCLOTHINGMODELASHRAE55") { + state.dataHeatBal->People(Loop).ClothingType = 2; + + } else if (clothingType == "CALCULATIONMETHODSCHEDULE") { + state.dataHeatBal->People(Loop).ClothingType = 3; + state.dataHeatBal->People(Loop).ClothingMethodPtr = GetScheduleIndex(state, AlphaName(11)); + if (state.dataHeatBal->People(Loop).ClothingMethodPtr == 0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(11) + " entered=\"" + AlphaName(11) + + "\"."); + ErrorsFound = true; + } + } + if (CheckScheduleValue(state, state.dataHeatBal->People(Loop).ClothingMethodPtr, 1)) { + state.dataHeatBal->People(Loop).ClothingPtr = GetScheduleIndex(state, AlphaName(12)); + if (state.dataHeatBal->People(Loop).ClothingPtr == 0) { if (Item1 == 1) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(13) + ", maximum is < 0.0"); - ShowContinueError( - state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMax)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + + "\"."); ErrorsFound = true; } } } + + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->People(Loop).Name + + "\", invalid " + state.dataIPShortCut->cAlphaFieldNames(10) + + ", value =" + AlphaName(10)); + ShowContinueError(state, + "...Valid values are \"ClothingInsulationSchedule\",\"DynamicClothingModelASHRAE55a\", " + "\"CalculationMethodSchedule\"."); + ErrorsFound = true; } } - else if (ModelWithAdditionalInputs) { + } + + if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { + state.dataHeatBal->People(Loop).AirVelocityPtr = GetScheduleIndex(state, AlphaName(13)); + if (state.dataHeatBal->People(Loop).AirVelocityPtr == 0) { if (Item1 == 1) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + - state.dataIPShortCut->cAlphaFieldNames(13) + ". " + - state.dataIPShortCut->cAlphaFieldNames(13) + - " is required when Thermal Comfort Model Type is one of " - "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(13) + " entered=\"" + AlphaName(13) + "\"."); ErrorsFound = true; } - } - - int indexAnkleAirVelPtr = 21; - if (!state.dataIPShortCut->lAlphaFieldBlanks(indexAnkleAirVelPtr) || AlphaName(indexAnkleAirVelPtr) != "") { - state.dataHeatBal->People(Loop).AnkleAirVelocityPtr = GetScheduleIndex(state, AlphaName(indexAnkleAirVelPtr)); - if (state.dataHeatBal->People(Loop).AnkleAirVelocityPtr == 0) { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + " entered=\"" + - AlphaName(indexAnkleAirVelPtr) + "\"."); - ErrorsFound = true; + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->People(Loop).AirVelocityPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop).AirVelocityPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(13) + ", minimum is < 0.0"); + ShowContinueError( + state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMin)); + ErrorsFound = true; + } + } + if (SchMax < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(13) + ", maximum is < 0.0"); + ShowContinueError( + state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMax)); + ErrorsFound = true; + } } } } - else if (state.dataHeatBal->People(Loop).AnkleDraftASH55) { + } else if (ModelWithAdditionalInputs) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + + state.dataIPShortCut->cAlphaFieldNames(13) + ". " + + state.dataIPShortCut->cAlphaFieldNames(13) + + " is required when Thermal Comfort Model Type is one of " + "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); + ErrorsFound = true; + } + } + + int indexAnkleAirVelPtr = 21; + if (!state.dataIPShortCut->lAlphaFieldBlanks(indexAnkleAirVelPtr) || AlphaName(indexAnkleAirVelPtr) != "") { + state.dataHeatBal->People(Loop).AnkleAirVelocityPtr = GetScheduleIndex(state, AlphaName(indexAnkleAirVelPtr)); + if (state.dataHeatBal->People(Loop).AnkleAirVelocityPtr == 0) { if (Item1 == 1) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + - state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + ". " + - state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + - " is required when Thermal Comfort Model Type is one of " - "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + " entered=\"" + + AlphaName(indexAnkleAirVelPtr) + "\"."); ErrorsFound = true; } } + } else if (state.dataHeatBal->People(Loop).AnkleDraftASH55) { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + + state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + ". " + + state.dataIPShortCut->cAlphaFieldNames(indexAnkleAirVelPtr) + + " is required when Thermal Comfort Model Type is one of " + "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\""); + ErrorsFound = true; + } + } - } // usingthermalcomfort block + } // usingthermalcomfort block - } // ...end of thermal comfort data IF-THEN block (NumAlphas > 6) + } // ...end of thermal comfort data IF-THEN block (NumAlphas > 6) - if (state.dataHeatBal->People(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + if (state.dataHeatBal->People(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - // Object report variables - SetupOutputVariable(state, - "People Occupant Count", - OutputProcessor::Unit::None, - state.dataHeatBal->People(Loop).NumOcc, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); - SetupOutputVariable(state, - "People Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); + // Object report variables + SetupOutputVariable(state, + "People Occupant Count", + OutputProcessor::Unit::None, + state.dataHeatBal->People(Loop).NumOcc, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Sensible Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).SenGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Sensible Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).SenGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->People(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->People(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Air Temperature", + OutputProcessor::Unit::C, + state.dataHeatBal->People(Loop).TemperatureInZone, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + SetupOutputVariable(state, + "People Air Relative Humidity", + OutputProcessor::Unit::Perc, + state.dataHeatBal->People(Loop).RelativeHumidityInZone, + "Zone", + "Average", + state.dataHeatBal->People(Loop).Name); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->People(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->People(Loop).ZonePtr) = false; SetupOutputVariable(state, - "People Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); + "Zone People Occupant Count", + OutputProcessor::Unit::None, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleNumOcc, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); + "Zone People Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); + "Zone People Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Sensible Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).SenGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); + "Zone People Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Sensible Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).SenGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); + "Zone People Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); + "Zone People Sensible Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleSenGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); + "Zone People Sensible Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleSenGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->People(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->People(Loop).Name); + "Zone People Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->People(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); + "Zone People Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Air Temperature", - OutputProcessor::Unit::C, - state.dataHeatBal->People(Loop).TemperatureInZone, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); + "Zone People Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); SetupOutputVariable(state, - "People Air Relative Humidity", - OutputProcessor::Unit::Perc, - state.dataHeatBal->People(Loop).RelativeHumidityInZone, - "Zone", - "Average", - state.dataHeatBal->People(Loop).Name); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->People(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->People(Loop).ZonePtr) = false; - SetupOutputVariable(state, - "Zone People Occupant Count", - OutputProcessor::Unit::None, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleNumOcc, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Sensible Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleSenGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Sensible Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleSenGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone People Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); - } + "Zone People Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->People(Loop).ZonePtr).PeopleTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->People(Loop).ZonePtr).Name); + } - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "People", - state.dataHeatBal->People(Loop).Name, - "Number of People", - "[each]", - state.dataHeatBal->People(Loop).EMSPeopleOn, - state.dataHeatBal->People(Loop).EMSNumberOfPeople); - SetupEMSInternalVariable(state, - "People Count Design Level", - state.dataHeatBal->People(Loop).Name, - "[each]", - state.dataHeatBal->People(Loop).NumberOfPeople); - } + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "People", + state.dataHeatBal->People(Loop).Name, + "Number of People", + "[each]", + state.dataHeatBal->People(Loop).EMSPeopleOn, + state.dataHeatBal->People(Loop).EMSNumberOfPeople); + SetupEMSInternalVariable(state, + "People Count Design Level", + state.dataHeatBal->People(Loop).Name, + "[each]", + state.dataHeatBal->People(Loop).NumberOfPeople); + } - // setup internal gains - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->People(Loop).ZonePtr, - "People", - state.dataHeatBal->People(Loop).Name, - IntGainTypeOf_People, - &state.dataHeatBal->People(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->People(Loop).RadGainRate, - &state.dataHeatBal->People(Loop).LatGainRate, - nullptr, - &state.dataHeatBal->People(Loop).CO2GainRate); - - } // Item1 - number of zones - } // Item - number of people statements - } // TotPeople > 0 - - // transfer the nominal number of people in a zone to the tabular reporting - for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { - if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) { - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && - state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants < 0.1) { - ShowWarningError(state, RoutineName + "Zone=\"" + state.dataHeatBal->Zone(Loop).Name + "\" occupant density is extremely high."); - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { - ShowContinueError(state, - format("Occupant Density=[{:.0R}] person/m2.", - state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea)); - } + // setup internal gains + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->People(Loop).ZonePtr, + "People", + state.dataHeatBal->People(Loop).Name, + IntGainTypeOf_People, + &state.dataHeatBal->People(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->People(Loop).RadGainRate, + &state.dataHeatBal->People(Loop).LatGainRate, + nullptr, + &state.dataHeatBal->People(Loop).CO2GainRate); + + } // Item1 - number of zones + } // Item - number of people statements + } // TotPeople > 0 + + // transfer the nominal number of people in a zone to the tabular reporting + for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { + if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) { + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && + state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants < 0.1) { + ShowWarningError(state, RoutineName + "Zone=\"" + state.dataHeatBal->Zone(Loop).Name + "\" occupant density is extremely high."); + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { ShowContinueError(state, - format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", - state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants)); + format("Occupant Density=[{:.0R}] person/m2.", + state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea)); } - maxOccupLoad = 0.0; - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotPeople; ++Loop1) { - if (state.dataHeatBal->People(Loop1).ZonePtr != Loop) continue; - if (maxOccupLoad < GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) * - state.dataHeatBal->People(Loop1).NumberOfPeople) { - maxOccupLoad = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) * - state.dataHeatBal->People(Loop1).NumberOfPeople; - MaxNumber = state.dataHeatBal->People(Loop1).NumberOfPeoplePtr; - OptionNum = Loop1; - } + ShowContinueError(state, + format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", + state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants)); + } + maxOccupLoad = 0.0; + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotPeople; ++Loop1) { + if (state.dataHeatBal->People(Loop1).ZonePtr != Loop) continue; + if (maxOccupLoad < GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) * + state.dataHeatBal->People(Loop1).NumberOfPeople) { + maxOccupLoad = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) * + state.dataHeatBal->People(Loop1).NumberOfPeople; + MaxNumber = state.dataHeatBal->People(Loop1).NumberOfPeoplePtr; + OptionNum = Loop1; } - if (maxOccupLoad > state.dataHeatBal->Zone(Loop).TotOccupants) { - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad < 0.1) { - ShowWarningError(state, - RoutineName + "Zone=\"" + state.dataHeatBal->Zone(Loop).Name + - "\" occupant density at a maximum schedule value is extremely high."); - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { - ShowContinueError(state, - format("Occupant Density=[{:.0R}] person/m2.", maxOccupLoad / state.dataHeatBal->Zone(Loop).FloorArea)); - } - ShowContinueError(state, - format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", - state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad)); + } + if (maxOccupLoad > state.dataHeatBal->Zone(Loop).TotOccupants) { + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad < 0.1) { + ShowWarningError(state, + RoutineName + "Zone=\"" + state.dataHeatBal->Zone(Loop).Name + + "\" occupant density at a maximum schedule value is extremely high."); + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { ShowContinueError(state, - "Check values in People=" + state.dataHeatBal->People(OptionNum).Name + - ", Number of People Schedule=" + GetScheduleName(state, MaxNumber)); + format("Occupant Density=[{:.0R}] person/m2.", maxOccupLoad / state.dataHeatBal->Zone(Loop).FloorArea)); } + ShowContinueError(state, + format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", + state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad)); + ShowContinueError(state, + "Check values in People=" + state.dataHeatBal->People(OptionNum).Name + + ", Number of People Schedule=" + GetScheduleName(state, MaxNumber)); } } + } - if (state.dataHeatBal->Zone(Loop).isNominalControlled) { // conditioned zones only - if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) { - state.dataHeatBal->Zone(Loop).isNominalOccupied = true; - PreDefTableEntry(state, - state.dataOutRptPredefined->pdchOaoNomNumOcc1, - state.dataHeatBal->Zone(Loop).Name, - state.dataHeatBal->Zone(Loop).TotOccupants); - PreDefTableEntry(state, - state.dataOutRptPredefined->pdchOaoNomNumOcc2, - state.dataHeatBal->Zone(Loop).Name, - state.dataHeatBal->Zone(Loop).TotOccupants); - } + if (state.dataHeatBal->Zone(Loop).isNominalControlled) { // conditioned zones only + if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) { + state.dataHeatBal->Zone(Loop).isNominalOccupied = true; + PreDefTableEntry(state, + state.dataOutRptPredefined->pdchOaoNomNumOcc1, + state.dataHeatBal->Zone(Loop).Name, + state.dataHeatBal->Zone(Loop).TotOccupants); + PreDefTableEntry(state, + state.dataOutRptPredefined->pdchOaoNomNumOcc2, + state.dataHeatBal->Zone(Loop).Name, + state.dataHeatBal->Zone(Loop).TotOccupants); } } + } - RepVarSet = true; - CurrentModuleObject = "Lights"; - state.dataHeatBal->NumLightsStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->LightsObjects.allocate(state.dataHeatBal->NumLightsStatements); + RepVarSet = true; + CurrentModuleObject = "Lights"; + state.dataHeatBal->NumLightsStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->LightsObjects.allocate(state.dataHeatBal->NumLightsStatements); + + state.dataHeatBal->TotLights = 0; + errFlag = false; + for (Item = 1; Item <= state.dataHeatBal->NumLightsStatements; ++Item) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->LightsObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->LightsObjects(Item).StartPtr = state.dataHeatBal->TotLights + 1; + ++state.dataHeatBal->TotLights; + state.dataHeatBal->LightsObjects(Item).NumOfZones = 1; + state.dataHeatBal->LightsObjects(Item).ZoneListActive = false; + state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr = Item1; + } else if (ZLItem > 0) { + state.dataHeatBal->LightsObjects(Item).StartPtr = state.dataHeatBal->TotLights + 1; + state.dataHeatBal->TotLights += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->LightsObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->LightsObjects(Item).ZoneListActive = true; + state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr = ZLItem; + } else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); state.dataHeatBal->TotLights = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumLightsStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->LightsObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->LightsObjects(Item).StartPtr = state.dataHeatBal->TotLights + 1; - ++state.dataHeatBal->TotLights; - state.dataHeatBal->LightsObjects(Item).NumOfZones = 1; - state.dataHeatBal->LightsObjects(Item).ZoneListActive = false; - state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr = Item1; - } - else if (ZLItem > 0) { - state.dataHeatBal->LightsObjects(Item).StartPtr = state.dataHeatBal->TotLights + 1; - state.dataHeatBal->TotLights += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->LightsObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->LightsObjects(Item).ZoneListActive = true; - state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr = ZLItem; - } - else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + } - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotLights = 0; - } + state.dataHeatBal->Lights.allocate(state.dataHeatBal->TotLights); - state.dataHeatBal->Lights.allocate(state.dataHeatBal->TotLights); - - if (state.dataHeatBal->TotLights > 0) { - Loop = 0; - for (Item = 1; Item <= state.dataHeatBal->NumLightsStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->LightsObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->LightsObjects(Item).ZoneListActive) { - state.dataHeatBal->Lights(Loop).Name = AlphaName(1); - state.dataHeatBal->Lights(Loop).ZonePtr = state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr; - } - else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) + if (state.dataHeatBal->TotLights > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumLightsStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->LightsObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->LightsObjects(Item).ZoneListActive) { + state.dataHeatBal->Lights(Loop).Name = AlphaName(1); + state.dataHeatBal->Lights(Loop).ZonePtr = state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr; + } else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->LightsObjects(Item).Name, - state.dataHeatBal->Lights, - Loop - 1, - state.dataHeatBal->Lights(Loop).Name, - errFlag); - state.dataHeatBal->Lights(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->LightsObjects(Item).Name, + state.dataHeatBal->Lights, + Loop - 1, + state.dataHeatBal->Lights(Loop).Name, + errFlag); + state.dataHeatBal->Lights(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->LightsObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } - state.dataHeatBal->Lights(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->Lights(Loop).SchedPtr == 0) { + state.dataHeatBal->Lights(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->Lights(Loop).SchedPtr == 0) { + if (Item1 == 1) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + } + ErrorsFound = true; + } + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { if (Item1 == 1) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); - } - else { + if (SchMin < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; } - ErrorsFound = true; } - } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (Item1 == 1) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; - } - } - if (Item1 == 1) { - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; - } + if (Item1 == 1) { + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } } } + } - // Lights Design Level calculation method. - { - auto const lightingLevel(AlphaName(4)); - if (lightingLevel == "LIGHTINGLEVEL") { - state.dataHeatBal->Lights(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Lights will result."); - } - + // Lights Design Level calculation method. + { + auto const lightingLevel(AlphaName(4)); + if (lightingLevel == "LIGHTINGLEVEL") { + state.dataHeatBal->Lights(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Lights will result."); } - else if (lightingLevel == "WATTS/AREA") { - if (state.dataHeatBal->Lights(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->Lights(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Lights will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->Lights(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); - ErrorsFound = true; - } - } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Lights will result."); - } - } - else if (lightingLevel == "WATTS/PERSON") { - if (state.dataHeatBal->Lights(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->Lights(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Lights will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->Lights(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); - ErrorsFound = true; + } else if (lightingLevel == "WATTS/AREA") { + if (state.dataHeatBal->Lights(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->Lights(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Lights will result."); } + } else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->Lights(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); + ErrorsFound = true; } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Lights will result."); - } - } - else { - if (Item1 == 1) { + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Lights will result."); + } + + } else if (lightingLevel == "WATTS/PERSON") { + if (state.dataHeatBal->Lights(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->Lights(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Lights will result."); + } + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"LightingLevel\", \"Watts/Area\", \"Watts/Person\"."); + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->Lights(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } - } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Lights will result."); + } - // Calculate nominal min/max lighting level - state.dataHeatBal->Lights(Loop).NomMinDesignLevel = state.dataHeatBal->Lights(Loop).DesignLevel * SchMin; - state.dataHeatBal->Lights(Loop).NomMaxDesignLevel = state.dataHeatBal->Lights(Loop).DesignLevel * SchMax; - - state.dataHeatBal->Lights(Loop).FractionReturnAir = IHGNumbers(4); - state.dataHeatBal->Lights(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->Lights(Loop).FractionShortWave = IHGNumbers(6); - state.dataHeatBal->Lights(Loop).FractionReplaceable = IHGNumbers(7); - state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff1 = IHGNumbers(8); - state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff2 = IHGNumbers(9); - - state.dataHeatBal->Lights(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->Lights(Loop).FractionReturnAir + state.dataHeatBal->Lights(Loop).FractionRadiant + - state.dataHeatBal->Lights(Loop).FractionShortWave); - if (std::abs(state.dataHeatBal->Lights(Loop).FractionConvected) <= 0.001) state.dataHeatBal->Lights(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->Lights(Loop).FractionConvected < 0.0) { + } else { if (Item1 == 1) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"LightingLevel\", \"Watts/Area\", \"Watts/Person\"."); ErrorsFound = true; } } + } - // Note: if FractionReturnAirIsCalculated = Yes and there is a return-air plenum: - // (1) The input values of FractionReturnAir, FractionRadiant and FractionShortWave, and the - // value of FractionConvected calculated from these are used in the zone sizing calculations; - // (2) in the regular calculation, FractionReturnAir is calculated each time step in - // Subr. InitInternalHeatGains as a function of the zone's return plenum air temperature - // using FractionReturnAirPlenTempCoeff1 and FractionReturnAirPlenTempCoeff2; then - // FractionRadiant and FractionConvected are adjusted from their input values such that - // FractionReturnAir + FractionRadiant + FractionShortWave + FractionConvected = 1.0, assuming - // FractionShortWave is constant and equal to its input value. - - if (NumAlpha > 4) { - state.dataHeatBal->Lights(Loop).EndUseSubcategory = AlphaName(5); - } - else { - state.dataHeatBal->Lights(Loop).EndUseSubcategory = "General"; + // Calculate nominal min/max lighting level + state.dataHeatBal->Lights(Loop).NomMinDesignLevel = state.dataHeatBal->Lights(Loop).DesignLevel * SchMin; + state.dataHeatBal->Lights(Loop).NomMaxDesignLevel = state.dataHeatBal->Lights(Loop).DesignLevel * SchMax; + + state.dataHeatBal->Lights(Loop).FractionReturnAir = IHGNumbers(4); + state.dataHeatBal->Lights(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->Lights(Loop).FractionShortWave = IHGNumbers(6); + state.dataHeatBal->Lights(Loop).FractionReplaceable = IHGNumbers(7); + state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff1 = IHGNumbers(8); + state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff2 = IHGNumbers(9); + + state.dataHeatBal->Lights(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->Lights(Loop).FractionReturnAir + state.dataHeatBal->Lights(Loop).FractionRadiant + + state.dataHeatBal->Lights(Loop).FractionShortWave); + if (std::abs(state.dataHeatBal->Lights(Loop).FractionConvected) <= 0.001) state.dataHeatBal->Lights(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->Lights(Loop).FractionConvected < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; } + } - if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { - state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = false; - } - else if (AlphaName(6) != "YES" && AlphaName(6) != "NO") { - if (Item1 == 1) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(6) + ", value =" + AlphaName(6)); - ShowContinueError(state, ".. Return Air Fraction from Plenum will NOT be calculated."); - } - state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = false; - } - else { - state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = (AlphaName(6) == "YES"); - } + // Note: if FractionReturnAirIsCalculated = Yes and there is a return-air plenum: + // (1) The input values of FractionReturnAir, FractionRadiant and FractionShortWave, and the + // value of FractionConvected calculated from these are used in the zone sizing calculations; + // (2) in the regular calculation, FractionReturnAir is calculated each time step in + // Subr. InitInternalHeatGains as a function of the zone's return plenum air temperature + // using FractionReturnAirPlenTempCoeff1 and FractionReturnAirPlenTempCoeff2; then + // FractionRadiant and FractionConvected are adjusted from their input values such that + // FractionReturnAir + FractionRadiant + FractionShortWave + FractionConvected = 1.0, assuming + // FractionShortWave is constant and equal to its input value. + + if (NumAlpha > 4) { + state.dataHeatBal->Lights(Loop).EndUseSubcategory = AlphaName(5); + } else { + state.dataHeatBal->Lights(Loop).EndUseSubcategory = "General"; + } - // Set return air node number - state.dataHeatBal->Lights(Loop).ZoneReturnNum = 0; - std::string retNodeName = ""; - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - if (state.dataHeatBal->LightsObjects(Item).ZoneListActive) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + - "\": " + state.dataIPShortCut->cAlphaFieldNames(7) + " must be blank when using a ZoneList."); - ErrorsFound = true; - } - else { - retNodeName = AlphaName(7); - } - } - if (state.dataHeatBal->Lights(Loop).ZonePtr > 0) { - state.dataHeatBal->Lights(Loop).ZoneReturnNum = DataZoneEquipment::GetReturnNumForZone( - state, state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name, retNodeName); + if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { + state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = false; + } else if (AlphaName(6) != "YES" && AlphaName(6) != "NO") { + if (Item1 == 1) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(6) + ", value =" + AlphaName(6)); + ShowContinueError(state, ".. Return Air Fraction from Plenum will NOT be calculated."); } + state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = false; + } else { + state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated = (AlphaName(6) == "YES"); + } - if ((state.dataHeatBal->Lights(Loop).ZoneReturnNum == 0) && (state.dataHeatBal->Lights(Loop).FractionReturnAir > 0.0) && - (!state.dataIPShortCut->lAlphaFieldBlanks(7))) { + // Set return air node number + state.dataHeatBal->Lights(Loop).ZoneReturnNum = 0; + std::string retNodeName = ""; + if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { + if (state.dataHeatBal->LightsObjects(Item).ZoneListActive) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(7) + " =" + AlphaName(7)); - ShowContinueError(state, "No matching Zone Return Air Node found."); + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->Lights(Loop).Name + + "\": " + state.dataIPShortCut->cAlphaFieldNames(7) + " must be blank when using a ZoneList."); ErrorsFound = true; + } else { + retNodeName = AlphaName(7); } - if (state.dataHeatBal->Lights(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + } + if (state.dataHeatBal->Lights(Loop).ZonePtr > 0) { + state.dataHeatBal->Lights(Loop).ZoneReturnNum = DataZoneEquipment::GetReturnNumForZone( + state, state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name, retNodeName); + } - // Object report variables - SetupOutputVariable(state, - "Lights Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); + if ((state.dataHeatBal->Lights(Loop).ZoneReturnNum == 0) && (state.dataHeatBal->Lights(Loop).FractionReturnAir > 0.0) && + (!state.dataIPShortCut->lAlphaFieldBlanks(7))) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(7) + " =" + AlphaName(7)); + ShowContinueError(state, "No matching Zone Return Air Node found."); + ErrorsFound = true; + } + if (state.dataHeatBal->Lights(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + + // Object report variables + SetupOutputVariable(state, + "Lights Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Visible Radiation Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).VisGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); + + SetupOutputVariable(state, + "Lights Visible Radiation Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).VisGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Return Air Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).RetAirGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Return Air Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).RetAirGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->Lights(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->Lights(Loop).Name); + SetupOutputVariable(state, + "Lights Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->Lights(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->Lights(Loop).Name, + _, + "Electricity", + "InteriorLights", + state.dataHeatBal->Lights(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).ListMultiplier); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->Lights(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->Lights(Loop).ZonePtr) = false; SetupOutputVariable(state, - "Lights Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); + "Zone Lights Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); + "Zone Lights Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsElecConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Visible Radiation Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).VisGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); - + "Zone Lights Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Visible Radiation Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).VisGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); + "Zone Lights Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); + "Zone Lights Visible Radiation Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsVisGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); + "Zone Lights Visible Radiation Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsVisGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Return Air Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).RetAirGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); + "Zone Lights Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Return Air Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).RetAirGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); + "Zone Lights Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name); + "Zone Lights Return Air Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRetAirGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->Lights(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->Lights(Loop).Name); + "Zone Lights Return Air Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRetAirGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Lights Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->Lights(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->Lights(Loop).Name, - _, - "Electricity", - "InteriorLights", - state.dataHeatBal->Lights(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).ListMultiplier); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->Lights(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->Lights(Loop).ZonePtr) = false; - SetupOutputVariable(state, - "Zone Lights Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsElecConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Visible Radiation Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsVisGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Visible Radiation Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsVisGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Return Air Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRetAirGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Return Air Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsRetAirGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Lights Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); - } + "Zone Lights Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + SetupOutputVariable(state, + "Zone Lights Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->Lights(Loop).ZonePtr).LtsTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).Name); + } - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "Lights", - state.dataHeatBal->Lights(Loop).Name, - "Electricity Rate", - "[W]", - state.dataHeatBal->Lights(Loop).EMSLightsOn, - state.dataHeatBal->Lights(Loop).EMSLightingPower); - SetupEMSInternalVariable(state, - "Lighting Power Design Level", - state.dataHeatBal->Lights(Loop).Name, - "[W]", - state.dataHeatBal->Lights(Loop).DesignLevel); - } // EMS - // setup internal gains - int returnNodeNum = 0; - if ((state.dataHeatBal->Lights(Loop).ZoneReturnNum > 0) && - (state.dataHeatBal->Lights(Loop).ZoneReturnNum <= - state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->Lights(Loop).ZonePtr).NumReturnNodes)) { - returnNodeNum = state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->Lights(Loop).ZonePtr) - .ReturnNode(state.dataHeatBal->Lights(Loop).ZoneReturnNum); - } - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->Lights(Loop).ZonePtr, - "Lights", - state.dataHeatBal->Lights(Loop).Name, - IntGainTypeOf_Lights, - &state.dataHeatBal->Lights(Loop).ConGainRate, - &state.dataHeatBal->Lights(Loop).RetAirGainRate, - &state.dataHeatBal->Lights(Loop).RadGainRate, - nullptr, - nullptr, - nullptr, - nullptr, - returnNodeNum); - - if (state.dataHeatBal->Lights(Loop).FractionReturnAir > 0) - state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).HasLtsRetAirGain = true; - // send values to predefined lighting summary report - liteName = state.dataHeatBal->Lights(Loop).Name; - zonePt = state.dataHeatBal->Lights(Loop).ZonePtr; - mult = state.dataHeatBal->Zone(zonePt).Multiplier * state.dataHeatBal->Zone(zonePt).ListMultiplier; - state.dataInternalHeatGains->sumArea += state.dataHeatBal->Zone(zonePt).FloorArea * mult; - state.dataInternalHeatGains->sumPower += state.dataHeatBal->Lights(Loop).DesignLevel * mult; - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtZone, liteName, state.dataHeatBal->Zone(zonePt).Name); - if (state.dataHeatBal->Zone(zonePt).FloorArea > 0.0) { - PreDefTableEntry(state, - state.dataOutRptPredefined->pdchInLtDens, - liteName, - state.dataHeatBal->Lights(Loop).DesignLevel / state.dataHeatBal->Zone(zonePt).FloorArea, - 4); - } - else { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, liteName, DataPrecisionGlobals::constant_zero, 4); - } - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, liteName, state.dataHeatBal->Zone(zonePt).FloorArea * mult); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, liteName, state.dataHeatBal->Lights(Loop).DesignLevel * mult); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtEndUse, liteName, state.dataHeatBal->Lights(Loop).EndUseSubcategory); - PreDefTableEntry( - state, state.dataOutRptPredefined->pdchInLtSchd, liteName, GetScheduleName(state, state.dataHeatBal->Lights(Loop).SchedPtr)); - PreDefTableEntry( - state, state.dataOutRptPredefined->pdchInLtRetAir, liteName, state.dataHeatBal->Lights(Loop).FractionReturnAir, 4); - } // Item1 - zones - } // Item = Number of Lights Objects - } // TotLights > 0 check - // add total line to lighting summary table - if (state.dataInternalHeatGains->sumArea > 0.0) { - PreDefTableEntry(state, - state.dataOutRptPredefined->pdchInLtDens, - "Interior Lighting Total", - state.dataInternalHeatGains->sumPower / state.dataInternalHeatGains->sumArea, - 4); //** line 792 - } - else { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, "Interior Lighting Total", DataPrecisionGlobals::constant_zero, 4); + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "Lights", + state.dataHeatBal->Lights(Loop).Name, + "Electricity Rate", + "[W]", + state.dataHeatBal->Lights(Loop).EMSLightsOn, + state.dataHeatBal->Lights(Loop).EMSLightingPower); + SetupEMSInternalVariable(state, + "Lighting Power Design Level", + state.dataHeatBal->Lights(Loop).Name, + "[W]", + state.dataHeatBal->Lights(Loop).DesignLevel); + } // EMS + // setup internal gains + int returnNodeNum = 0; + if ((state.dataHeatBal->Lights(Loop).ZoneReturnNum > 0) && + (state.dataHeatBal->Lights(Loop).ZoneReturnNum <= + state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->Lights(Loop).ZonePtr).NumReturnNodes)) { + returnNodeNum = state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->Lights(Loop).ZonePtr) + .ReturnNode(state.dataHeatBal->Lights(Loop).ZoneReturnNum); + } + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->Lights(Loop).ZonePtr, + "Lights", + state.dataHeatBal->Lights(Loop).Name, + IntGainTypeOf_Lights, + &state.dataHeatBal->Lights(Loop).ConGainRate, + &state.dataHeatBal->Lights(Loop).RetAirGainRate, + &state.dataHeatBal->Lights(Loop).RadGainRate, + nullptr, + nullptr, + nullptr, + nullptr, + returnNodeNum); + + if (state.dataHeatBal->Lights(Loop).FractionReturnAir > 0) + state.dataHeatBal->Zone(state.dataHeatBal->Lights(Loop).ZonePtr).HasLtsRetAirGain = true; + // send values to predefined lighting summary report + liteName = state.dataHeatBal->Lights(Loop).Name; + zonePt = state.dataHeatBal->Lights(Loop).ZonePtr; + mult = state.dataHeatBal->Zone(zonePt).Multiplier * state.dataHeatBal->Zone(zonePt).ListMultiplier; + state.dataInternalHeatGains->sumArea += state.dataHeatBal->Zone(zonePt).FloorArea * mult; + state.dataInternalHeatGains->sumPower += state.dataHeatBal->Lights(Loop).DesignLevel * mult; + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtZone, liteName, state.dataHeatBal->Zone(zonePt).Name); + if (state.dataHeatBal->Zone(zonePt).FloorArea > 0.0) { + PreDefTableEntry(state, + state.dataOutRptPredefined->pdchInLtDens, + liteName, + state.dataHeatBal->Lights(Loop).DesignLevel / state.dataHeatBal->Zone(zonePt).FloorArea, + 4); + } else { + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, liteName, DataPrecisionGlobals::constant_zero, 4); + } + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, liteName, state.dataHeatBal->Zone(zonePt).FloorArea * mult); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, liteName, state.dataHeatBal->Lights(Loop).DesignLevel * mult); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtEndUse, liteName, state.dataHeatBal->Lights(Loop).EndUseSubcategory); + PreDefTableEntry( + state, state.dataOutRptPredefined->pdchInLtSchd, liteName, GetScheduleName(state, state.dataHeatBal->Lights(Loop).SchedPtr)); + PreDefTableEntry( + state, state.dataOutRptPredefined->pdchInLtRetAir, liteName, state.dataHeatBal->Lights(Loop).FractionReturnAir, 4); + } // Item1 - zones + } // Item = Number of Lights Objects + } // TotLights > 0 check + // add total line to lighting summary table + if (state.dataInternalHeatGains->sumArea > 0.0) { + PreDefTableEntry(state, + state.dataOutRptPredefined->pdchInLtDens, + "Interior Lighting Total", + state.dataInternalHeatGains->sumPower / state.dataInternalHeatGains->sumArea, + 4); //** line 792 + } else { + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, "Interior Lighting Total", DataPrecisionGlobals::constant_zero, 4); + } + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, "Interior Lighting Total", state.dataInternalHeatGains->sumArea); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, "Interior Lighting Total", state.dataInternalHeatGains->sumPower); + + RepVarSet = true; + CurrentModuleObject = "ElectricEquipment"; + state.dataHeatBal->NumZoneElectricStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->ZoneElectricObjects.allocate(state.dataHeatBal->NumZoneElectricStatements); + + state.dataHeatBal->TotElecEquip = 0; + errFlag = false; + for (Item = 1; Item <= state.dataHeatBal->NumZoneElectricStatements; ++Item) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->ZoneElectricObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->ZoneElectricObjects(Item).StartPtr = state.dataHeatBal->TotElecEquip + 1; + ++state.dataHeatBal->TotElecEquip; + state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones = 1; + state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive = false; + state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr = Item1; + } else if (ZLItem > 0) { + state.dataHeatBal->ZoneElectricObjects(Item).StartPtr = state.dataHeatBal->TotElecEquip + 1; + state.dataHeatBal->TotElecEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive = true; + state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr = ZLItem; + } else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; } - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, "Interior Lighting Total", state.dataInternalHeatGains->sumArea); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, "Interior Lighting Total", state.dataInternalHeatGains->sumPower); - - RepVarSet = true; - CurrentModuleObject = "ElectricEquipment"; - state.dataHeatBal->NumZoneElectricStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->ZoneElectricObjects.allocate(state.dataHeatBal->NumZoneElectricStatements); + } + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); state.dataHeatBal->TotElecEquip = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumZoneElectricStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->ZoneElectricObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->ZoneElectricObjects(Item).StartPtr = state.dataHeatBal->TotElecEquip + 1; - ++state.dataHeatBal->TotElecEquip; - state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones = 1; - state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive = false; - state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr = Item1; - } - else if (ZLItem > 0) { - state.dataHeatBal->ZoneElectricObjects(Item).StartPtr = state.dataHeatBal->TotElecEquip + 1; - state.dataHeatBal->TotElecEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive = true; - state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr = ZLItem; - } - else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + } - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotElecEquip = 0; - } + state.dataHeatBal->ZoneElectric.allocate(state.dataHeatBal->TotElecEquip); - state.dataHeatBal->ZoneElectric.allocate(state.dataHeatBal->TotElecEquip); - - if (state.dataHeatBal->TotElecEquip > 0) { - Loop = 0; - for (Item = 1; Item <= state.dataHeatBal->NumZoneElectricStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneElectric(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneElectric(Loop).ZonePtr = state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr; - } - else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal + if (state.dataHeatBal->TotElecEquip > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumZoneElectricStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->ZoneElectricObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->ZoneElectricObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneElectric(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneElectric(Loop).ZonePtr = state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr; + } else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->ZoneElectricObjects(Item).Name, - state.dataHeatBal->ZoneElectric, - Loop - 1, - state.dataHeatBal->ZoneElectric(Loop).Name, - errFlag); - state.dataHeatBal->ZoneElectric(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->ZoneElectricObjects(Item).Name, + state.dataHeatBal->ZoneElectric, + Loop - 1, + state.dataHeatBal->ZoneElectric(Loop).Name, + errFlag); + state.dataHeatBal->ZoneElectric(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneElectricObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } - state.dataHeatBal->ZoneElectric(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneElectric(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + state.dataHeatBal->ZoneElectric(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneElectric(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + } + ErrorsFound = true; + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; } - else { + if (SchMax < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } - ErrorsFound = true; } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; - } - if (SchMax < 0.0) { + } + + // Electric equipment design level calculation method. + { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + state.dataHeatBal->ZoneElectric(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Electric Equipment will result."); + } + + } else if (equipmentLevel == "WATTS/AREA") { + if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->ZoneElectric(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Electric Equipment will result."); + } + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); ErrorsFound = true; } } - } - - // Electric equipment design level calculation method. - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - state.dataHeatBal->ZoneElectric(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Electric Equipment will result."); - } - + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Electric Equipment will result."); } - else if (equipmentLevel == "WATTS/AREA") { - if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->ZoneElectric(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Electric Equipment will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); - ErrorsFound = true; - } - } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Electric Equipment will result."); - } - } - else if (equipmentLevel == "WATTS/PERSON") { - if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneElectric(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Electric Equipment will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); - ErrorsFound = true; + } else if (equipmentLevel == "WATTS/PERSON") { + if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneElectric(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Electric Equipment will result."); } - } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Electric Equipment will result."); - } - - } - else { - if (Item1 == 1) { + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } - } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Electric Equipment will result."); + } - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneElectric(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneElectric(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * SchMax; - - state.dataHeatBal->ZoneElectric(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneElectric(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneElectric(Loop).FractionLost = IHGNumbers(6); - // FractionConvected is a calculated field - state.dataHeatBal->ZoneElectric(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneElectric(Loop).FractionLatent + state.dataHeatBal->ZoneElectric(Loop).FractionRadiant + - state.dataHeatBal->ZoneElectric(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneElectric(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneElectric(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneElectric(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; + } else { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + ErrorsFound = true; + } } + } - if (NumAlpha > 4) { - state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory = AlphaName(5); - } - else { - state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory = "General"; - } + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneElectric(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneElectric(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * SchMax; + + state.dataHeatBal->ZoneElectric(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneElectric(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneElectric(Loop).FractionLost = IHGNumbers(6); + // FractionConvected is a calculated field + state.dataHeatBal->ZoneElectric(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneElectric(Loop).FractionLatent + state.dataHeatBal->ZoneElectric(Loop).FractionRadiant + + state.dataHeatBal->ZoneElectric(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneElectric(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneElectric(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneElectric(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } + + if (NumAlpha > 4) { + state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory = AlphaName(5); + } else { + state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory = "General"; + } - if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + if (state.dataHeatBal->ZoneElectric(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + + // Object report variables + SetupOutputVariable(state, + "Electric Equipment Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ListMultiplier); + + SetupOutputVariable(state, + "Electric Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneElectric(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneElectric(Loop).Name); + SetupOutputVariable(state, + "Electric Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneElectric(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneElectric(Loop).Name); - // Object report variables + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneElectric(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneElectric(Loop).ZonePtr) = false; SetupOutputVariable(state, - "Electric Equipment Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ListMultiplier); + "Zone Electric Equipment Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneElectric(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneElectric(Loop).Name); + "Zone Electric Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Electric Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneElectric(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneElectric(Loop).Name); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneElectric(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneElectric(Loop).ZonePtr) = false; - SetupOutputVariable(state, - "Zone Electric Equipment Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + "Zone Electric Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); + } - SetupOutputVariable(state, - "Zone Electric Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Electric Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).ElecTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(Loop).ZonePtr).Name); - } + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "ElectricEquipment", + state.dataHeatBal->ZoneElectric(Loop).Name, + "Electricity Rate", + "[W]", + state.dataHeatBal->ZoneElectric(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneElectric(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Plug and Process Power Design Level", + state.dataHeatBal->ZoneElectric(Loop).Name, + "[W]", + state.dataHeatBal->ZoneElectric(Loop).DesignLevel); + } // EMS - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "ElectricEquipment", - state.dataHeatBal->ZoneElectric(Loop).Name, - "Electricity Rate", - "[W]", - state.dataHeatBal->ZoneElectric(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneElectric(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Plug and Process Power Design Level", - state.dataHeatBal->ZoneElectric(Loop).Name, - "[W]", - state.dataHeatBal->ZoneElectric(Loop).DesignLevel); - } // EMS - - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneElectric(Loop).ZonePtr, - "ElectricEquipment", - state.dataHeatBal->ZoneElectric(Loop).Name, - IntGainTypeOf_ElectricEquipment, - &state.dataHeatBal->ZoneElectric(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneElectric(Loop).RadGainRate, - &state.dataHeatBal->ZoneElectric(Loop).LatGainRate); - - } // Item1 - } // Item - Number of ZoneElectric objects - } // Check on number of ZoneElectric - - RepVarSet = true; - CurrentModuleObject = "GasEquipment"; - state.dataHeatBal->NumZoneGasStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->ZoneGasObjects.allocate(state.dataHeatBal->NumZoneGasStatements); + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneElectric(Loop).ZonePtr, + "ElectricEquipment", + state.dataHeatBal->ZoneElectric(Loop).Name, + IntGainTypeOf_ElectricEquipment, + &state.dataHeatBal->ZoneElectric(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneElectric(Loop).RadGainRate, + &state.dataHeatBal->ZoneElectric(Loop).LatGainRate); + + } // Item1 + } // Item - Number of ZoneElectric objects + } // Check on number of ZoneElectric + + RepVarSet = true; + CurrentModuleObject = "GasEquipment"; + state.dataHeatBal->NumZoneGasStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->ZoneGasObjects.allocate(state.dataHeatBal->NumZoneGasStatements); + + state.dataHeatBal->TotGasEquip = 0; + errFlag = false; + for (Item = 1; Item <= state.dataHeatBal->NumZoneGasStatements; ++Item) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->ZoneGasObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->ZoneGasObjects(Item).StartPtr = state.dataHeatBal->TotGasEquip + 1; + ++state.dataHeatBal->TotGasEquip; + state.dataHeatBal->ZoneGasObjects(Item).NumOfZones = 1; + state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive = false; + state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr = Item1; + } else if (ZLItem > 0) { + state.dataHeatBal->ZoneGasObjects(Item).StartPtr = state.dataHeatBal->TotGasEquip + 1; + state.dataHeatBal->TotGasEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->ZoneGasObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive = true; + state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr = ZLItem; + } else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); state.dataHeatBal->TotGasEquip = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumZoneGasStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->ZoneGasObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->ZoneGasObjects(Item).StartPtr = state.dataHeatBal->TotGasEquip + 1; - ++state.dataHeatBal->TotGasEquip; - state.dataHeatBal->ZoneGasObjects(Item).NumOfZones = 1; - state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive = false; - state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr = Item1; - } - else if (ZLItem > 0) { - state.dataHeatBal->ZoneGasObjects(Item).StartPtr = state.dataHeatBal->TotGasEquip + 1; - state.dataHeatBal->TotGasEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->ZoneGasObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive = true; - state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr = ZLItem; - } - else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + } - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotGasEquip = 0; - } + state.dataHeatBal->ZoneGas.allocate(state.dataHeatBal->TotGasEquip); - state.dataHeatBal->ZoneGas.allocate(state.dataHeatBal->TotGasEquip); - - if (state.dataHeatBal->TotGasEquip > 0) { - Loop = 0; - for (Item = 1; Item <= state.dataHeatBal->NumZoneGasStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->ZoneGasObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneGas(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneGas(Loop).ZonePtr = state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr; - } - else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal + if (state.dataHeatBal->TotGasEquip > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumZoneGasStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->ZoneGasObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->ZoneGasObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneGas(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneGas(Loop).ZonePtr = state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr; + } else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->ZoneGasObjects(Item).Name, - state.dataHeatBal->ZoneGas, - Loop - 1, - state.dataHeatBal->ZoneGas(Loop).Name, - errFlag); - state.dataHeatBal->ZoneGas(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->ZoneGasObjects(Item).Name, + state.dataHeatBal->ZoneGas, + Loop - 1, + state.dataHeatBal->ZoneGas(Loop).Name, + errFlag); + state.dataHeatBal->ZoneGas(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->ZoneGasObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } - state.dataHeatBal->ZoneGas(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneGas(Loop).SchedPtr == 0) { + state.dataHeatBal->ZoneGas(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneGas(Loop).SchedPtr == 0) { + if (Item1 == 1) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + } + ErrorsFound = true; + } + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { if (Item1 == 1) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); - } - else { + if (SchMin < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; } - ErrorsFound = true; } - } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (Item1 == 1) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; - } - } - if (Item1 == 1) { - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; - } + if (Item1 == 1) { + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } } } + } - // equipment design level calculation method. - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - state.dataHeatBal->ZoneGas(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Gas Equipment will result."); - } - + // equipment design level calculation method. + { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + state.dataHeatBal->ZoneGas(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Gas Equipment will result."); } - else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { - if (state.dataHeatBal->ZoneGas(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->ZoneGas(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Gas Equipment will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->ZoneGas(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); - ErrorsFound = true; - } - } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Gas Equipment will result."); - } - } - else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { - if (state.dataHeatBal->ZoneGas(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneGas(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Gas Equipment will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - state.dataHeatBal->ZoneGas(Loop).Name, - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); - ErrorsFound = true; + } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { + if (state.dataHeatBal->ZoneGas(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->ZoneGas(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Gas Equipment will result."); } + } else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->ZoneGas(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); + ErrorsFound = true; } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + - "\", specifies " + state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Gas Equipment will result."); - } - } - else { - if (Item1 == 1) { + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Gas Equipment will result."); + } + + } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { + if (state.dataHeatBal->ZoneGas(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneGas(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Gas Equipment will result."); + } + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + state.dataHeatBal->ZoneGas(Loop).Name, + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataHeatBal->ZoneGas(Loop).Name + + "\", specifies " + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Gas Equipment will result."); + } + + } else { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + ErrorsFound = true; + } } + } - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneGas(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneGas(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneGas(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneGas(Loop).DesignLevel * SchMax; + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneGas(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneGas(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneGas(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneGas(Loop).DesignLevel * SchMax; - state.dataHeatBal->ZoneGas(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneGas(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneGas(Loop).FractionLost = IHGNumbers(6); + state.dataHeatBal->ZoneGas(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneGas(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneGas(Loop).FractionLost = IHGNumbers(6); - if ((NumNumber == 7) || (!state.dataIPShortCut->lNumericFieldBlanks(7))) { - state.dataHeatBal->ZoneGas(Loop).CO2RateFactor = IHGNumbers(7); - } - if (state.dataHeatBal->ZoneGas(Loop).CO2RateFactor < 0.0) { - ShowSevereError(state, - format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(7), - IHGNumbers(7))); - ErrorsFound = true; - } - if (state.dataHeatBal->ZoneGas(Loop).CO2RateFactor > 4.0e-7) { - ShowSevereError(state, - format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(7), - IHGNumbers(7))); + if ((NumNumber == 7) || (!state.dataIPShortCut->lNumericFieldBlanks(7))) { + state.dataHeatBal->ZoneGas(Loop).CO2RateFactor = IHGNumbers(7); + } + if (state.dataHeatBal->ZoneGas(Loop).CO2RateFactor < 0.0) { + ShowSevereError(state, + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(7), + IHGNumbers(7))); + ErrorsFound = true; + } + if (state.dataHeatBal->ZoneGas(Loop).CO2RateFactor > 4.0e-7) { + ShowSevereError(state, + format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(7), + IHGNumbers(7))); + ErrorsFound = true; + } + // FractionConvected is a calculated field + state.dataHeatBal->ZoneGas(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneGas(Loop).FractionLatent + state.dataHeatBal->ZoneGas(Loop).FractionRadiant + + state.dataHeatBal->ZoneGas(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneGas(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneGas(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneGas(Loop).FractionConvected < 0.0) { + if (Item1 == 1) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); ErrorsFound = true; } - // FractionConvected is a calculated field - state.dataHeatBal->ZoneGas(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneGas(Loop).FractionLatent + state.dataHeatBal->ZoneGas(Loop).FractionRadiant + - state.dataHeatBal->ZoneGas(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneGas(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneGas(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneGas(Loop).FractionConvected < 0.0) { - if (Item1 == 1) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; - } - } + } - if (NumAlpha > 4) { - state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory = AlphaName(5); - } - else { - state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory = "General"; - } + if (NumAlpha > 4) { + state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory = AlphaName(5); + } else { + state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory = "General"; + } + + if (state.dataHeatBal->ZoneGas(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + + // Object report variables + SetupOutputVariable(state, + "Gas Equipment NaturalGas Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment NaturalGas Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name, + _, + "NaturalGas", + "InteriorEquipment", + state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).ListMultiplier); + + SetupOutputVariable(state, + "Gas Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneGas(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); + SetupOutputVariable(state, + "Gas Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneGas(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneGas(Loop).Name); - if (state.dataHeatBal->ZoneGas(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneGas(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneGas(Loop).ZonePtr) = false; - // Object report variables SetupOutputVariable(state, - "Gas Equipment NaturalGas Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment NaturalGas Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment NaturalGas Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name, - _, - "NaturalGas", - "InteriorEquipment", - state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).ListMultiplier); + "Zone Gas Equipment NaturalGas Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneGas(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Gas Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneGas(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneGas(Loop).Name); + "Zone Gas Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + } - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneGas(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneGas(Loop).ZonePtr) = false; + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "GasEquipment", + state.dataHeatBal->ZoneGas(Loop).Name, + "NaturalGas Rate", + "[W]", + state.dataHeatBal->ZoneGas(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneGas(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Gas Process Power Design Level", + state.dataHeatBal->ZoneGas(Loop).Name, + "[W]", + state.dataHeatBal->ZoneGas(Loop).DesignLevel); + } // EMS - SetupOutputVariable(state, - "Zone Gas Equipment NaturalGas Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment NaturalGas Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneGas(Loop).ZonePtr, + "GasEquipment", + state.dataHeatBal->ZoneGas(Loop).Name, + IntGainTypeOf_GasEquipment, + &state.dataHeatBal->ZoneGas(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneGas(Loop).RadGainRate, + &state.dataHeatBal->ZoneGas(Loop).LatGainRate, + nullptr, + &state.dataHeatBal->ZoneGas(Loop).CO2GainRate); + + } // Item1 + } // Item - number of gas statements + } // check for number of gas statements + + RepVarSet = true; + CurrentModuleObject = "HotWaterEquipment"; + state.dataHeatBal->NumHotWaterEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->HotWaterEqObjects.allocate(state.dataHeatBal->NumHotWaterEqStatements); + + state.dataHeatBal->TotHWEquip = 0; + errFlag = false; + for (Item = 1; Item <= state.dataHeatBal->NumHotWaterEqStatements; ++Item) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->HotWaterEqObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->HotWaterEqObjects(Item).StartPtr = state.dataHeatBal->TotHWEquip + 1; + ++state.dataHeatBal->TotHWEquip; + state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones = 1; + state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive = false; + state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr = Item1; + } else if (ZLItem > 0) { + state.dataHeatBal->HotWaterEqObjects(Item).StartPtr = state.dataHeatBal->TotHWEquip + 1; + state.dataHeatBal->TotHWEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive = true; + state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr = ZLItem; + } else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } - SetupOutputVariable(state, - "Zone Gas Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Gas Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneGas(Loop).ZonePtr).GasTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(Loop).ZonePtr).Name); - } + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); + state.dataHeatBal->TotHWEquip = 0; + } - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "GasEquipment", - state.dataHeatBal->ZoneGas(Loop).Name, - "NaturalGas Rate", - "[W]", - state.dataHeatBal->ZoneGas(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneGas(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Gas Process Power Design Level", - state.dataHeatBal->ZoneGas(Loop).Name, - "[W]", - state.dataHeatBal->ZoneGas(Loop).DesignLevel); - } // EMS - - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneGas(Loop).ZonePtr, - "GasEquipment", - state.dataHeatBal->ZoneGas(Loop).Name, - IntGainTypeOf_GasEquipment, - &state.dataHeatBal->ZoneGas(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneGas(Loop).RadGainRate, - &state.dataHeatBal->ZoneGas(Loop).LatGainRate, - nullptr, - &state.dataHeatBal->ZoneGas(Loop).CO2GainRate); - - } // Item1 - } // Item - number of gas statements - } // check for number of gas statements - - RepVarSet = true; - CurrentModuleObject = "HotWaterEquipment"; - state.dataHeatBal->NumHotWaterEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->HotWaterEqObjects.allocate(state.dataHeatBal->NumHotWaterEqStatements); + state.dataHeatBal->ZoneHWEq.allocate(state.dataHeatBal->TotHWEquip); - state.dataHeatBal->TotHWEquip = 0; - errFlag = false; + if (state.dataHeatBal->TotHWEquip > 0) { + Loop = 0; for (Item = 1; Item <= state.dataHeatBal->NumHotWaterEqStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->HotWaterEqObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->HotWaterEqObjects(Item).StartPtr = state.dataHeatBal->TotHWEquip + 1; - ++state.dataHeatBal->TotHWEquip; - state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones = 1; - state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive = false; - state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr = Item1; - } - else if (ZLItem > 0) { - state.dataHeatBal->HotWaterEqObjects(Item).StartPtr = state.dataHeatBal->TotHWEquip + 1; - state.dataHeatBal->TotHWEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive = true; - state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr = ZLItem; - } - else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } - - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotHWEquip = 0; - } + AlphaName = BlankString; + IHGNumbers = 0.0; - state.dataHeatBal->ZoneHWEq.allocate(state.dataHeatBal->TotHWEquip); - - if (state.dataHeatBal->TotHWEquip > 0) { - Loop = 0; - for (Item = 1; Item <= state.dataHeatBal->NumHotWaterEqStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneHWEq(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneHWEq(Loop).ZonePtr = state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr; - } - else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->HotWaterEqObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->HotWaterEqObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneHWEq(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneHWEq(Loop).ZonePtr = state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr; + } else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->HotWaterEqObjects(Item).Name, - state.dataHeatBal->ZoneHWEq, - Loop - 1, - state.dataHeatBal->ZoneHWEq(Loop).Name, - errFlag); - state.dataHeatBal->ZoneHWEq(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->HotWaterEqObjects(Item).Name, + state.dataHeatBal->ZoneHWEq, + Loop - 1, + state.dataHeatBal->ZoneHWEq(Loop).Name, + errFlag); + state.dataHeatBal->ZoneHWEq(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->HotWaterEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } - state.dataHeatBal->ZoneHWEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneHWEq(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + state.dataHeatBal->ZoneHWEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneHWEq(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + } + ErrorsFound = true; + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; } - else { + if (SchMax < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } - ErrorsFound = true; } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; - } - if (SchMax < 0.0) { + } + + // Hot Water equipment design level calculation method. + { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } + + } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { + if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); + } + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); ErrorsFound = true; } } - } - - // Hot Water equipment design level calculation method. - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Hot Water Equipment will result."); } - else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { - if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); - ErrorsFound = true; - } - } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - } - else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { - if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Hot Water Equipment will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); - ErrorsFound = true; + } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { + if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneHWEq(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Hot Water Equipment will result."); } - } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - - } - else { - if (Item1 == 1) { + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } - } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneHWEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneHWEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * SchMax; - - state.dataHeatBal->ZoneHWEq(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneHWEq(Loop).FractionLost = IHGNumbers(6); - // FractionConvected is a calculated field - state.dataHeatBal->ZoneHWEq(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneHWEq(Loop).FractionLatent + state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant + - state.dataHeatBal->ZoneHWEq(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneHWEq(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneHWEq(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneHWEq(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; + } else { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + ErrorsFound = true; + } } + } - if (NumAlpha > 4) { - state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory = AlphaName(5); - } - else { - state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory = "General"; - } + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneHWEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneHWEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * SchMax; + + state.dataHeatBal->ZoneHWEq(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneHWEq(Loop).FractionLost = IHGNumbers(6); + // FractionConvected is a calculated field + state.dataHeatBal->ZoneHWEq(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneHWEq(Loop).FractionLatent + state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant + + state.dataHeatBal->ZoneHWEq(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneHWEq(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneHWEq(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneHWEq(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } + + if (NumAlpha > 4) { + state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory = AlphaName(5); + } else { + state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory = "General"; + } + + if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + + // Object report variables + SetupOutputVariable(state, + "Hot Water Equipment District Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment District Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name, + _, + "DistrictHeating", + "InteriorEquipment", + state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).ListMultiplier); - if (state.dataHeatBal->ZoneHWEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + SetupOutputVariable(state, + "Hot Water Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneHWEq(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneHWEq(Loop).Name); + SetupOutputVariable(state, + "Hot Water Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneHWEq(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneHWEq(Loop).Name); - // Object report variables + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr) = false; SetupOutputVariable(state, - "Hot Water Equipment District Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment District Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment District Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name, - _, - "DistrictHeating", - "InteriorEquipment", - state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).ListMultiplier); + "Zone Hot Water Equipment District Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneHWEq(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneHWEq(Loop).Name); + "Zone Hot Water Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Hot Water Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneHWEq(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneHWEq(Loop).Name); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr) = false; - SetupOutputVariable(state, - "Zone Hot Water Equipment District Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment District Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + "Zone Hot Water Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); + } - SetupOutputVariable(state, - "Zone Hot Water Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Hot Water Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).HWTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(Loop).ZonePtr).Name); - } + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "HotWaterEquipment", + state.dataHeatBal->ZoneHWEq(Loop).Name, + "District Heating Power Level", + "[W]", + state.dataHeatBal->ZoneHWEq(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneHWEq(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Process District Heat Design Level", + state.dataHeatBal->ZoneHWEq(Loop).Name, + "[W]", + state.dataHeatBal->ZoneHWEq(Loop).DesignLevel); + } // EMS - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "HotWaterEquipment", - state.dataHeatBal->ZoneHWEq(Loop).Name, - "District Heating Power Level", - "[W]", - state.dataHeatBal->ZoneHWEq(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneHWEq(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Process District Heat Design Level", - state.dataHeatBal->ZoneHWEq(Loop).Name, - "[W]", - state.dataHeatBal->ZoneHWEq(Loop).DesignLevel); - } // EMS - - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneHWEq(Loop).ZonePtr, - "HotWaterEquipment", - state.dataHeatBal->ZoneHWEq(Loop).Name, - IntGainTypeOf_HotWaterEquipment, - &state.dataHeatBal->ZoneHWEq(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneHWEq(Loop).RadGainRate, - &state.dataHeatBal->ZoneHWEq(Loop).LatGainRate); - - } // Item1 - } // Item - number of hot water statements - } + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneHWEq(Loop).ZonePtr, + "HotWaterEquipment", + state.dataHeatBal->ZoneHWEq(Loop).Name, + IntGainTypeOf_HotWaterEquipment, + &state.dataHeatBal->ZoneHWEq(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneHWEq(Loop).RadGainRate, + &state.dataHeatBal->ZoneHWEq(Loop).LatGainRate); + + } // Item1 + } // Item - number of hot water statements + } - RepVarSet = true; - CurrentModuleObject = "SteamEquipment"; - state.dataHeatBal->NumSteamEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->SteamEqObjects.allocate(state.dataHeatBal->NumSteamEqStatements); + RepVarSet = true; + CurrentModuleObject = "SteamEquipment"; + state.dataHeatBal->NumSteamEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->SteamEqObjects.allocate(state.dataHeatBal->NumSteamEqStatements); + + state.dataHeatBal->TotStmEquip = 0; + errFlag = false; + for (Item = 1; Item <= state.dataHeatBal->NumSteamEqStatements; ++Item) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->SteamEqObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->SteamEqObjects(Item).StartPtr = state.dataHeatBal->TotStmEquip + 1; + ++state.dataHeatBal->TotStmEquip; + state.dataHeatBal->SteamEqObjects(Item).NumOfZones = 1; + state.dataHeatBal->SteamEqObjects(Item).ZoneListActive = false; + state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr = Item1; + } else if (ZLItem > 0) { + state.dataHeatBal->SteamEqObjects(Item).StartPtr = state.dataHeatBal->TotStmEquip + 1; + state.dataHeatBal->TotStmEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->SteamEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->SteamEqObjects(Item).ZoneListActive = true; + state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr = ZLItem; + } else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + + AlphaName(2) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); state.dataHeatBal->TotStmEquip = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumSteamEqStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->SteamEqObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->SteamEqObjects(Item).StartPtr = state.dataHeatBal->TotStmEquip + 1; - ++state.dataHeatBal->TotStmEquip; - state.dataHeatBal->SteamEqObjects(Item).NumOfZones = 1; - state.dataHeatBal->SteamEqObjects(Item).ZoneListActive = false; - state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr = Item1; - } - else if (ZLItem > 0) { - state.dataHeatBal->SteamEqObjects(Item).StartPtr = state.dataHeatBal->TotStmEquip + 1; - state.dataHeatBal->TotStmEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->SteamEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->SteamEqObjects(Item).ZoneListActive = true; - state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr = ZLItem; - } - else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + - AlphaName(2) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + } - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotStmEquip = 0; - } + state.dataHeatBal->ZoneSteamEq.allocate(state.dataHeatBal->TotStmEquip); - state.dataHeatBal->ZoneSteamEq.allocate(state.dataHeatBal->TotStmEquip); - - if (state.dataHeatBal->TotStmEquip > 0) { - Loop = 0; - for (Item = 1; Item <= state.dataHeatBal->NumSteamEqStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->SteamEqObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->SteamEqObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneSteamEq(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr = state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr; - } - else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal + if (state.dataHeatBal->TotStmEquip > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumSteamEqStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->SteamEqObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->SteamEqObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneSteamEq(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr = state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr; + } else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->SteamEqObjects(Item).Name, - state.dataHeatBal->ZoneSteamEq, - Loop - 1, - state.dataHeatBal->ZoneSteamEq(Loop).Name, - errFlag); - state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->SteamEqObjects(Item).Name, + state.dataHeatBal->ZoneSteamEq, + Loop - 1, + state.dataHeatBal->ZoneSteamEq(Loop).Name, + errFlag); + state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->SteamEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } - state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + } + ErrorsFound = true; + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + " is required."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; } - else { + if (SchMax < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } - ErrorsFound = true; } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; - } - if (SchMax < 0.0) { + } + + // Hot Water equipment design level calculation method. + { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = IHGNumbers(1); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } + + } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { + if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr != 0) { + if (IHGNumbers(2) >= 0.0) { + state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = + IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); + } + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, - format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(2), + IHGNumbers(2))); ErrorsFound = true; } } - } - - // Hot Water equipment design level calculation method. - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = IHGNumbers(1); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 Hot Water Equipment will result."); } - else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { - if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr != 0) { - if (IHGNumbers(2) >= 0.0) { - state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = - IHGNumbers(2) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(2), - IHGNumbers(2))); - ErrorsFound = true; - } - } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - } - else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { - if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but Total Occupants = 0. 0 Hot Water Equipment will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); - ErrorsFound = true; + } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { + if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).TotOccupants <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but Total Occupants = 0. 0 Hot Water Equipment will result."); } - } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 Hot Water Equipment will result."); - } - - } - else { - if (Item1 == 1) { + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } - } + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 Hot Water Equipment will result."); + } - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneSteamEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneSteamEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * SchMax; - - state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneSteamEq(Loop).FractionLost = IHGNumbers(6); - // FractionConvected is a calculated field - state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent + state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant + - state.dataHeatBal->ZoneSteamEq(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; + } else { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + ErrorsFound = true; + } } + } - if (NumAlpha > 4) { - state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory = AlphaName(5); - } - else { - state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory = "General"; - } + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneSteamEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneSteamEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * SchMax; + + state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneSteamEq(Loop).FractionLost = IHGNumbers(6); + // FractionConvected is a calculated field + state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent + state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant + + state.dataHeatBal->ZoneSteamEq(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } + + if (NumAlpha > 4) { + state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory = AlphaName(5); + } else { + state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory = "General"; + } + + if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - if (state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + // Object report variables + SetupOutputVariable(state, + "Steam Equipment District Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment District Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + _, + "DistrictHeating", + "InteriorEquipment", + state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).ListMultiplier); + + SetupOutputVariable(state, + "Steam Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneSteamEq(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneSteamEq(Loop).Name); + SetupOutputVariable(state, + "Steam Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneSteamEq(Loop).Name); - // Object report variables + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr) = false; SetupOutputVariable(state, - "Steam Equipment District Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment District Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment District Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - _, - "DistrictHeating", - "InteriorEquipment", - state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).ListMultiplier); + "Zone Steam Equipment District Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneSteamEq(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneSteamEq(Loop).Name); + "Zone Steam Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Steam Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneSteamEq(Loop).Name); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr) = false; - SetupOutputVariable(state, - "Zone Steam Equipment District Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment District Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + "Zone Steam Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); + } - SetupOutputVariable(state, - "Zone Steam Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Steam Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).SteamTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr).Name); - } + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "SteamEquipment", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + "District Heating Power Level", + "[W]", + state.dataHeatBal->ZoneSteamEq(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneSteamEq(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Process Steam District Heat Design Level", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + "[W]", + state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel); + } // EMS - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "SteamEquipment", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - "District Heating Power Level", - "[W]", - state.dataHeatBal->ZoneSteamEq(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneSteamEq(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Process Steam District Heat Design Level", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - "[W]", - state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel); - } // EMS - - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr, - "SteamEquipment", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - IntGainTypeOf_SteamEquipment, - &state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate, - &state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate); - - } // Item1 - } // Item - number of hot water statements - } + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr, + "SteamEquipment", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + IntGainTypeOf_SteamEquipment, + &state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate, + &state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate); + + } // Item1 + } // Item - number of hot water statements + } - RepVarSet = true; - CurrentModuleObject = "OtherEquipment"; - state.dataHeatBal->NumOtherEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->OtherEqObjects.allocate(state.dataHeatBal->NumOtherEqStatements); + RepVarSet = true; + CurrentModuleObject = "OtherEquipment"; + state.dataHeatBal->NumOtherEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->OtherEqObjects.allocate(state.dataHeatBal->NumOtherEqStatements); + + state.dataHeatBal->TotOthEquip = 0; + errFlag = false; + for (Item = 1; Item <= state.dataHeatBal->NumOtherEqStatements; ++Item) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->OtherEqObjects(Item).Name = AlphaName(1); + + Item1 = UtilityRoutines::FindItemInList(AlphaName(3), state.dataHeatBal->Zone); + ZLItem = 0; + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) + ZLItem = UtilityRoutines::FindItemInList(AlphaName(3), state.dataHeatBal->ZoneList); + if (Item1 > 0) { + state.dataHeatBal->OtherEqObjects(Item).StartPtr = state.dataHeatBal->TotOthEquip + 1; + ++state.dataHeatBal->TotOthEquip; + state.dataHeatBal->OtherEqObjects(Item).NumOfZones = 1; + state.dataHeatBal->OtherEqObjects(Item).ZoneListActive = false; + state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr = Item1; + } else if (ZLItem > 0) { + state.dataHeatBal->OtherEqObjects(Item).StartPtr = state.dataHeatBal->TotOthEquip + 1; + state.dataHeatBal->TotOthEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->OtherEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; + state.dataHeatBal->OtherEqObjects(Item).ZoneListActive = true; + state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr = ZLItem; + } else { + ShowSevereError(state, + CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(3) + "=\"" + + AlphaName(3) + "\" not found."); + ErrorsFound = true; + errFlag = true; + } + } + if (errFlag) { + ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); + ShowContinueError(state, "...These will not be read in. Other errors may occur."); state.dataHeatBal->TotOthEquip = 0; - errFlag = false; - for (Item = 1; Item <= state.dataHeatBal->NumOtherEqStatements; ++Item) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - errFlag = UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->OtherEqObjects(Item).Name = AlphaName(1); - - Item1 = UtilityRoutines::FindItemInList(AlphaName(3), state.dataHeatBal->Zone); - ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(AlphaName(3), state.dataHeatBal->ZoneList); - if (Item1 > 0) { - state.dataHeatBal->OtherEqObjects(Item).StartPtr = state.dataHeatBal->TotOthEquip + 1; - ++state.dataHeatBal->TotOthEquip; - state.dataHeatBal->OtherEqObjects(Item).NumOfZones = 1; - state.dataHeatBal->OtherEqObjects(Item).ZoneListActive = false; - state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr = Item1; - } - else if (ZLItem > 0) { - state.dataHeatBal->OtherEqObjects(Item).StartPtr = state.dataHeatBal->TotOthEquip + 1; - state.dataHeatBal->TotOthEquip += state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->OtherEqObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; - state.dataHeatBal->OtherEqObjects(Item).ZoneListActive = true; - state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr = ZLItem; - } - else { - ShowSevereError(state, - CurrentModuleObject + "=\"" + AlphaName(1) + "\" invalid " + state.dataIPShortCut->cAlphaFieldNames(3) + "=\"" + - AlphaName(3) + "\" not found."); - ErrorsFound = true; - errFlag = true; - } - } + } - if (errFlag) { - ShowSevereError(state, RoutineName + "Errors with invalid names in " + CurrentModuleObject + " objects."); - ShowContinueError(state, "...These will not be read in. Other errors may occur."); - state.dataHeatBal->TotOthEquip = 0; - } + state.dataHeatBal->ZoneOtherEq.allocate(state.dataHeatBal->TotOthEquip); - state.dataHeatBal->ZoneOtherEq.allocate(state.dataHeatBal->TotOthEquip); - - if (state.dataHeatBal->TotOthEquip > 0) { - Loop = 0; - for (Item = 1; Item <= state.dataHeatBal->NumOtherEqStatements; ++Item) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Item, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - for (Item1 = 1; Item1 <= state.dataHeatBal->OtherEqObjects(Item).NumOfZones; ++Item1) { - ++Loop; - if (!state.dataHeatBal->OtherEqObjects(Item).ZoneListActive) { - state.dataHeatBal->ZoneOtherEq(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr = state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr; - } - else { - CheckCreatedZoneItemName( - state, - RoutineName, - CurrentModuleObject, - state.dataHeatBal + if (state.dataHeatBal->TotOthEquip > 0) { + Loop = 0; + for (Item = 1; Item <= state.dataHeatBal->NumOtherEqStatements; ++Item) { + AlphaName = BlankString; + IHGNumbers = 0.0; + + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Item, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + for (Item1 = 1; Item1 <= state.dataHeatBal->OtherEqObjects(Item).NumOfZones; ++Item1) { + ++Loop; + if (!state.dataHeatBal->OtherEqObjects(Item).ZoneListActive) { + state.dataHeatBal->ZoneOtherEq(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr = state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr; + } else { + CheckCreatedZoneItemName( + state, + RoutineName, + CurrentModuleObject, + state.dataHeatBal ->Zone(state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1)) .Name, - state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, - state.dataHeatBal->OtherEqObjects(Item).Name, - state.dataHeatBal->ZoneOtherEq, - Loop - 1, - state.dataHeatBal->ZoneOtherEq(Loop).Name, - errFlag); - state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr = - state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); - if (errFlag) ErrorsFound = true; - } + state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).MaxZoneNameLength, + state.dataHeatBal->OtherEqObjects(Item).Name, + state.dataHeatBal->ZoneOtherEq, + Loop - 1, + state.dataHeatBal->ZoneOtherEq(Loop).Name, + errFlag); + state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr = + state.dataHeatBal->ZoneList(state.dataHeatBal->OtherEqObjects(Item).ZoneOrZoneListPtr).Zone(Item1); + if (errFlag) ErrorsFound = true; + } - std::string FuelTypeString(""); - if (AlphaName(2) == "NONE") { - state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType = ExteriorEnergyUse::ExteriorFuelUsage::Unknown; - FuelTypeString = AlphaName(2); + std::string FuelTypeString(""); + if (AlphaName(2) == "NONE") { + state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType = ExteriorEnergyUse::ExteriorFuelUsage::Unknown; + FuelTypeString = AlphaName(2); + } else { + ExteriorEnergyUse::ValidateFuelType(state, + state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType, + AlphaName(2), + FuelTypeString, + CurrentModuleObject, + state.dataIPShortCut->cAlphaFieldNames(2), + AlphaName(2)); + if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType == ExteriorEnergyUse::ExteriorFuelUsage::Unknown || + state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType == ExteriorEnergyUse::ExteriorFuelUsage::WaterUse) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + ": invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + + " entered=" + AlphaName(2) + " for " + state.dataIPShortCut->cAlphaFieldNames(1) + '=' + + AlphaName(1)); + ErrorsFound = true; } - else { - ExteriorEnergyUse::ValidateFuelType(state, - state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType, - AlphaName(2), - FuelTypeString, - CurrentModuleObject, - state.dataIPShortCut->cAlphaFieldNames(2), - AlphaName(2)); - if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType == ExteriorEnergyUse::ExteriorFuelUsage::Unknown || - state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType == ExteriorEnergyUse::ExteriorFuelUsage::WaterUse) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + ": invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + - " entered=" + AlphaName(2) + " for " + state.dataIPShortCut->cAlphaFieldNames(1) + '=' + - AlphaName(1)); - ErrorsFound = true; - } + } + + state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(4)); + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(4)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(4) + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + " entered=" + AlphaName(4)); } + ErrorsFound = true; + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); + } - state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(4)); - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(4)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(4) + " is required."); - } - else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + " entered=" + AlphaName(4)); + // equipment design level calculation method. + unsigned int DesignLevelFieldNumber; + { + auto const equipmentLevel(AlphaName(5)); + if (equipmentLevel == "EQUIPMENTLEVEL") { + DesignLevelFieldNumber = 1; + state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = IHGNumbers(DesignLevelFieldNumber); + if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but that field is blank. 0 Other Equipment will result."); } - ErrorsFound = true; - } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); - } - // equipment design level calculation method. - unsigned int DesignLevelFieldNumber; - { - auto const equipmentLevel(AlphaName(5)); - if (equipmentLevel == "EQUIPMENTLEVEL") { - DesignLevelFieldNumber = 1; - state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = IHGNumbers(DesignLevelFieldNumber); - if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { + DesignLevelFieldNumber = 2; + if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr != 0) { + state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = + IHGNumbers(DesignLevelFieldNumber) * + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).FloorArea <= 0.0) { ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but that field is blank. 0 Other Equipment will result."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but Zone Floor Area = 0. 0 Other Equipment will result."); } - } - else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") { - DesignLevelFieldNumber = 2; - if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr != 0) { - state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = - IHGNumbers(DesignLevelFieldNumber) * - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but Zone Floor Area = 0. 0 Other Equipment will result."); - } - } - if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but that field is blank. 0 Other Equipment will result."); - } - + if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but that field is blank. 0 Other Equipment will result."); } - else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { - DesignLevelFieldNumber = 3; - if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr != 0) { - state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).TotOccupants; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).TotOccupants <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but Total Occupants = 0. 0 Other Equipment will result."); - } - } - if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + + } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") { + DesignLevelFieldNumber = 3; + if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr != 0) { + state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).TotOccupants; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).TotOccupants <= 0.0) { ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + - ", but that field is blank. 0 Other Equipment will result."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but Total Occupants = 0. 0 Other Equipment will result."); } - } - else { - if (Item1 == 1) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(5) + ", value =" + AlphaName(5)); - ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); - ErrorsFound = true; - } + if (state.dataIPShortCut->lNumericFieldBlanks(DesignLevelFieldNumber)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + + ", but that field is blank. 0 Other Equipment will result."); } - } - // Throw an error if the design level is negative and we have a fuel type - if (state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel < 0.0 && - state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + " is not allowed to be negative"); - ShowContinueError(state, "... when a fuel type of " + FuelTypeString + " is specified."); - ErrorsFound = true; - } + } else { + if (Item1 == 1) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(5) + ", value =" + AlphaName(5)); + ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\"."); + ErrorsFound = true; + } + } + } - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneOtherEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * SchMin; - state.dataHeatBal->ZoneOtherEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * SchMax; + // Throw an error if the design level is negative and we have a fuel type + if (state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel < 0.0 && + state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cNumericFieldNames(DesignLevelFieldNumber) + " is not allowed to be negative"); + ShowContinueError(state, "... when a fuel type of " + FuelTypeString + " is specified."); + ErrorsFound = true; + } - state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent = IHGNumbers(4); - state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneOtherEq(Loop).FractionLost = IHGNumbers(6); + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneOtherEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * SchMin; + state.dataHeatBal->ZoneOtherEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * SchMax; - if ((NumNumber == 7) || (!state.dataIPShortCut->lNumericFieldBlanks(7))) { - state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor = IHGNumbers(7); - } - if (state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor < 0.0) { - ShowSevereError(state, - format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(7), - IHGNumbers(7))); - ErrorsFound = true; - } - if (state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor > 4.0e-7) { - ShowSevereError(state, - format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(7), - IHGNumbers(7))); - ErrorsFound = true; - } + state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent = IHGNumbers(4); + state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneOtherEq(Loop).FractionLost = IHGNumbers(6); - // FractionConvected is a calculated field - state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected = - 1.0 - (state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent + state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant + - state.dataHeatBal->ZoneOtherEq(Loop).FractionLost); - if (std::abs(state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected) <= 0.001) - state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected = 0.0; - if (state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; - } + if ((NumNumber == 7) || (!state.dataIPShortCut->lNumericFieldBlanks(7))) { + state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor = IHGNumbers(7); + } + if (state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor < 0.0) { + ShowSevereError(state, + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(7), + IHGNumbers(7))); + ErrorsFound = true; + } + if (state.dataHeatBal->ZoneOtherEq(Loop).CO2RateFactor > 4.0e-7) { + ShowSevereError(state, + format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(7), + IHGNumbers(7))); + ErrorsFound = true; + } - if (NumAlpha > 5) { - state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory = AlphaName(6); - } - else { - state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory = "General"; - } + // FractionConvected is a calculated field + state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected = + 1.0 - (state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent + state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant + + state.dataHeatBal->ZoneOtherEq(Loop).FractionLost); + if (std::abs(state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected) <= 0.001) + state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected = 0.0; + if (state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } + + if (NumAlpha > 5) { + state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory = AlphaName(6); + } else { + state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory = "General"; + } + + if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + + // Object report variables + if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { + SetupOutputVariable(state, + "Other Equipment " + FuelTypeString + " Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment " + FuelTypeString + " Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + _, + FuelTypeString, + "InteriorEquipment", + state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).ListMultiplier); + } + + SetupOutputVariable(state, + "Other Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).LatGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).LostEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).LostRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneOtherEq(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneOtherEq(Loop).Name); + SetupOutputVariable(state, + "Other Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneOtherEq(Loop).Name); - if (state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr) = false; - // Object report variables if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { SetupOutputVariable(state, - "Other Equipment " + FuelTypeString + " Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment " + FuelTypeString + " Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment " + FuelTypeString + " Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - _, - FuelTypeString, - "InteriorEquipment", - state.dataHeatBal->ZoneOtherEq(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).ListMultiplier); + "Zone Other Equipment " + FuelTypeString + " Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConsump, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); } SetupOutputVariable(state, - "Other Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).LatGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment Latent Gain Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLatGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment Latent Gain Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLatGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).LostEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment Lost Heat Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLost, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).LostRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment Lost Heat Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLostRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneOtherEq(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneOtherEq(Loop).Name); + "Zone Other Equipment Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Other Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneOtherEq(Loop).Name); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr) = false; - - if (state.dataHeatBal->ZoneOtherEq(Loop).OtherEquipFuelType != ExteriorEnergyUse::ExteriorFuelUsage::Unknown) { - SetupOutputVariable(state, - "Zone Other Equipment " + FuelTypeString + " Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment " + FuelTypeString + " Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConsump, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - } + "Zone Other Equipment Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); + } + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "OtherEquipment", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + "Power Level", + "[W]", + state.dataHeatBal->ZoneOtherEq(Loop).EMSZoneEquipOverrideOn, + state.dataHeatBal->ZoneOtherEq(Loop).EMSEquipPower); + SetupEMSInternalVariable(state, + "Other Equipment Design Level", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + "[W]", + state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel); + } // EMS - SetupOutputVariable(state, - "Zone Other Equipment Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Latent Gain Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLatGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Latent Gain Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLatGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Lost Heat Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLost, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Lost Heat Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherLostRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Other Equipment Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).OtherTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr).Name); - } - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "OtherEquipment", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - "Power Level", - "[W]", - state.dataHeatBal->ZoneOtherEq(Loop).EMSZoneEquipOverrideOn, - state.dataHeatBal->ZoneOtherEq(Loop).EMSEquipPower); - SetupEMSInternalVariable(state, - "Other Equipment Design Level", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - "[W]", - state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel); - } // EMS - - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr, - "OtherEquipment", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - IntGainTypeOf_OtherEquipment, - &state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate, - &state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate); - - } // Item1 - } // Item - number of other equipment statements - } + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr, + "OtherEquipment", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + IntGainTypeOf_OtherEquipment, + &state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate, + &state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate); + + } // Item1 + } // Item - number of other equipment statements + } + + RepVarSet = true; + CurrentModuleObject = "ElectricEquipment:ITE:AirCooled"; + state.dataHeatBal->NumZoneITEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + errFlag = false; + + // Note that this object type does not support ZoneList due to node names in input fields + state.dataHeatBal->ZoneITEq.allocate(state.dataHeatBal->NumZoneITEqStatements); + + if (state.dataHeatBal->NumZoneITEqStatements > 0) { + Loop = 0; + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + AlphaName = BlankString; + IHGNumbers = 0.0; - RepVarSet = true; - CurrentModuleObject = "ElectricEquipment:ITE:AirCooled"; - state.dataHeatBal->NumZoneITEqStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - errFlag = false; - - // Note that this object type does not support ZoneList due to node names in input fields - state.dataHeatBal->ZoneITEq.allocate(state.dataHeatBal->NumZoneITEqStatements); - - if (state.dataHeatBal->NumZoneITEqStatements > 0) { - Loop = 0; - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - AlphaName = BlankString; - IHGNumbers = 0.0; - - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Loop, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - state.dataHeatBal->ZoneITEq(Loop).Name = AlphaName(1); - state.dataHeatBal->ZoneITEq(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - - // IT equipment design level calculation method. - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Loop, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + + state.dataHeatBal->ZoneITEq(Loop).Name = AlphaName(1); + state.dataHeatBal->ZoneITEq(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + + // IT equipment design level calculation method. + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = false; + } else { + if (UtilityRoutines::SameString(AlphaName(3), "FlowFromSystem")) { state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = false; + } else if (UtilityRoutines::SameString(AlphaName(3), "FlowControlWithApproachTemperatures")) { + state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = true; + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE = true; + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).NoHeatToReturnAir = false; + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\": invalid calculation method: " + AlphaName(3)); + ErrorsFound = true; } - else { - if (UtilityRoutines::SameString(AlphaName(3), "FlowFromSystem")) { - state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = false; - } - else if (UtilityRoutines::SameString(AlphaName(3), "FlowControlWithApproachTemperatures")) { - state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps = true; - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE = true; - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).NoHeatToReturnAir = false; + } + + { + auto const equipmentLevel(AlphaName(4)); + if (equipmentLevel == "WATTS/UNIT") { + state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower = IHGNumbers(1) * IHGNumbers(2); + if (state.dataIPShortCut->lNumericFieldBlanks(1)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(1) + + ", but that field is blank. 0 IT Equipment will result."); } - else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\": invalid calculation method: " + AlphaName(3)); - ErrorsFound = true; + if (state.dataIPShortCut->lNumericFieldBlanks(2)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(2) + + ", but that field is blank. 0 IT Equipment will result."); } - } - - { - auto const equipmentLevel(AlphaName(4)); - if (equipmentLevel == "WATTS/UNIT") { - state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower = IHGNumbers(1) * IHGNumbers(2); - if (state.dataIPShortCut->lNumericFieldBlanks(1)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(1) + - ", but that field is blank. 0 IT Equipment will result."); - } - if (state.dataIPShortCut->lNumericFieldBlanks(2)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(2) + - ", but that field is blank. 0 IT Equipment will result."); - } - } - else if (equipmentLevel == "WATTS/AREA") { - if (state.dataHeatBal->ZoneITEq(Loop).ZonePtr != 0) { - if (IHGNumbers(3) >= 0.0) { - state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower = - IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).FloorArea; - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).FloorArea <= 0.0) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but Zone Floor Area = 0. 0 IT Equipment will result."); - } - } - else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", - RoutineName, - CurrentModuleObject, - AlphaName(1), - state.dataIPShortCut->cNumericFieldNames(3), - IHGNumbers(3))); - ErrorsFound = true; + } else if (equipmentLevel == "WATTS/AREA") { + if (state.dataHeatBal->ZoneITEq(Loop).ZonePtr != 0) { + if (IHGNumbers(3) >= 0.0) { + state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower = + IHGNumbers(3) * state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).FloorArea; + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).FloorArea <= 0.0) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but Zone Floor Area = 0. 0 IT Equipment will result."); } + } else { + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + state.dataIPShortCut->cNumericFieldNames(3), + IHGNumbers(3))); + ErrorsFound = true; } - if (state.dataIPShortCut->lNumericFieldBlanks(3)) { - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + - state.dataIPShortCut->cNumericFieldNames(3) + - ", but that field is blank. 0 IT Equipment will result."); - } - } - else { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); - ShowContinueError(state, "...Valid values are \"Watts/Unit\" or \"Watts/Area\"."); - ErrorsFound = true; + if (state.dataIPShortCut->lNumericFieldBlanks(3)) { + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", specifies " + + state.dataIPShortCut->cNumericFieldNames(3) + + ", but that field is blank. 0 IT Equipment will result."); } - } - if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { - state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; - } - else { - state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr = GetScheduleIndex(state, AlphaName(5)); - } - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr == 0) { + } else { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(5) + " entered=" + AlphaName(5)); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(4) + ", value =" + AlphaName(4)); + ShowContinueError(state, "...Valid values are \"Watts/Unit\" or \"Watts/Area\"."); ErrorsFound = true; } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + ", minimum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); - ErrorsFound = true; - } - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(5) + ", maximum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); - ErrorsFound = true; - } + } + + if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { + state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + } else { + state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr = GetScheduleIndex(state, AlphaName(5)); + } + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr == 0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(5) + " entered=" + AlphaName(5)); + ErrorsFound = true; + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + ", minimum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); + ErrorsFound = true; + } + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(5) + ", maximum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); + ErrorsFound = true; } } + } - if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { - state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; - } - else { - state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr = GetScheduleIndex(state, AlphaName(6)); - } - SchMin = 0.0; - SchMax = 0.0; - if (state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr == 0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(6) + " entered=" + AlphaName(6)); - ErrorsFound = true; - } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(6) + ", minimum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMin)); - ErrorsFound = true; - } - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(6) + ", maximum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMax)); - ErrorsFound = true; - } + if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { + state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + } else { + state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr = GetScheduleIndex(state, AlphaName(6)); + } + SchMin = 0.0; + SchMax = 0.0; + if (state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr == 0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(6) + " entered=" + AlphaName(6)); + ErrorsFound = true; + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(6) + ", minimum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMin)); + ErrorsFound = true; + } + if (SchMax < 0.0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(6) + ", maximum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMax)); + ErrorsFound = true; } } + } - // Calculate nominal min/max equipment level - state.dataHeatBal->ZoneITEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower * SchMin; - state.dataHeatBal->ZoneITEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower * SchMax; - - state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac = IHGNumbers(4); - state.dataHeatBal->ZoneITEq(Loop).DesignFanPower = - state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; - state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower = - (1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac) * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; - state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate = IHGNumbers(5) * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; - state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn = IHGNumbers(6); - state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac = IHGNumbers(7); - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency = IHGNumbers(8); - state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac = IHGNumbers(9); - state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp = IHGNumbers(10); - state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTemp = IHGNumbers(11); - - bool hasSupplyApproachTemp = !state.dataIPShortCut->lNumericFieldBlanks(10); - bool hasReturnApproachTemp = !state.dataIPShortCut->lNumericFieldBlanks(11); - - // Performance curves - state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve = GetCurveIndex(state, AlphaName(7)); - if (state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve == 0) { + // Calculate nominal min/max equipment level + state.dataHeatBal->ZoneITEq(Loop).NomMinDesignLevel = state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower * SchMin; + state.dataHeatBal->ZoneITEq(Loop).NomMaxDesignLevel = state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower * SchMax; + + state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac = IHGNumbers(4); + state.dataHeatBal->ZoneITEq(Loop).DesignFanPower = + state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; + state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower = + (1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignFanPowerFrac) * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; + state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate = IHGNumbers(5) * state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; + state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn = IHGNumbers(6); + state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac = IHGNumbers(7); + state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency = IHGNumbers(8); + state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac = IHGNumbers(9); + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp = IHGNumbers(10); + state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTemp = IHGNumbers(11); + + bool hasSupplyApproachTemp = !state.dataIPShortCut->lNumericFieldBlanks(10); + bool hasReturnApproachTemp = !state.dataIPShortCut->lNumericFieldBlanks(11); + + // Performance curves + state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve = GetCurveIndex(state, AlphaName(7)); + if (state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve == 0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7)); + ErrorsFound = true; + } + + state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve = GetCurveIndex(state, AlphaName(8)); + if (state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve == 0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(8) + '=' + AlphaName(8)); + ErrorsFound = true; + } + + state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve = GetCurveIndex(state, AlphaName(9)); + if (state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve == 0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(9) + '=' + AlphaName(9)); + ErrorsFound = true; + } + + if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { + // If this field isn't blank, it must point to a valid curve + state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve = GetCurveIndex(state, AlphaName(15)); + if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve == 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(7) + '=' + AlphaName(7)); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(15) + '=' + AlphaName(15)); ErrorsFound = true; } + } else { + // If this curve is left blank, then the curve is assumed to always equal 1.0. + state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve = 0; + } - state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve = GetCurveIndex(state, AlphaName(8)); - if (state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve == 0) { + if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { + // If this field isn't blank, it must point to a valid curve + state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve = GetCurveIndex(state, AlphaName(16)); + if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve == 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(8) + '=' + AlphaName(8)); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(16) + '=' + AlphaName(16)); ErrorsFound = true; } + } else { + // If this curve is left blank, then the curve is assumed to always equal 1.0. + state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve = 0; + } + + // Environmental class + if (UtilityRoutines::SameString(AlphaName(10), "None")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassNone; + } else if (UtilityRoutines::SameString(AlphaName(10), "A1")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA1; + } else if (UtilityRoutines::SameString(AlphaName(10), "A2")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA2; + } else if (UtilityRoutines::SameString(AlphaName(10), "A3")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA3; + } else if (UtilityRoutines::SameString(AlphaName(10), "A4")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA4; + } else if (UtilityRoutines::SameString(AlphaName(10), "B")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassB; + } else if (UtilityRoutines::SameString(AlphaName(10), "C")) { + state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassC; + } else { + ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(10) + '=' + AlphaName(10)); + ShowContinueError(state, "Valid entries are None, A1, A2, A3, A4, B or C."); + ErrorsFound = true; + } - state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve = GetCurveIndex(state, AlphaName(9)); - if (state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve == 0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(9) + '=' + AlphaName(9)); + // Air and supply inlet connections + if (UtilityRoutines::SameString(AlphaName(11), "AdjustedSupply")) { + state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletAdjustedSupply; + } else if (UtilityRoutines::SameString(AlphaName(11), "ZoneAirNode")) { + state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletZoneAirNode; + } else if (UtilityRoutines::SameString(AlphaName(11), "RoomAirModel")) { + // ZoneITEq( Loop ).AirConnectionType = ITEInletRoomAirModel; + ShowWarningError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + + "Air Inlet Connection Type = RoomAirModel is not implemented yet, using ZoneAirNode"); + state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletZoneAirNode; + } else { + ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); + ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(11) + '=' + AlphaName(11)); + ShowContinueError(state, "Valid entries are AdjustedSupply, ZoneAirNode, or RoomAirModel."); + ErrorsFound = true; + } + if (state.dataIPShortCut->lAlphaFieldBlanks(14)) { + if (state.dataHeatBal->ZoneITEq(Loop).AirConnectionType == ITEInletAdjustedSupply) { + ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); + ShowContinueError(state, + "For " + state.dataIPShortCut->cAlphaFieldNames(11) + "= AdjustedSupply, " + + state.dataIPShortCut->cAlphaFieldNames(14) + " is required, but this field is blank."); + ErrorsFound = true; + } else if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); + ShowContinueError(state, + "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, " + + state.dataIPShortCut->cAlphaFieldNames(14) + " is required, but this field is blank."); ErrorsFound = true; } + } else { + state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum = GetOnlySingleNode(state, + AlphaName(14), + ErrorsFound, + CurrentModuleObject, + AlphaName(1), + DataLoopNode::NodeFluidType::Air, + DataLoopNode::NodeConnectionType::Sensor, + 1, + ObjectIsNotParent); + } + + // check supply air node for matches with zone equipment supply air node + int zoneEqIndex = + DataZoneEquipment::GetControlledZoneIndex(state, state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + auto itStart = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.begin(); + auto itEnd = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.end(); + auto key = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum; + bool supplyNodeFound = false; + if (std::find(itStart, itEnd, key) != itEnd) { + supplyNodeFound = true; + } + + if (state.dataHeatBal->ZoneITEq(Loop).AirConnectionType == ITEInletAdjustedSupply && !supplyNodeFound) { + // supply air node must match zone equipment supply air node for these conditions + ShowSevereError(state, RoutineName + ": ElectricEquipment:ITE:AirCooled " + state.dataHeatBal->ZoneITEq(Loop).Name); + ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified."); + ErrorsFound = true; + } else if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps && !supplyNodeFound) { + // supply air node must match zone equipment supply air node for these conditions + ShowSevereError(state, RoutineName + ": ElectricEquipment:ITE:AirCooled " + state.dataHeatBal->ZoneITEq(Loop).Name); + ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified."); + ErrorsFound = true; + } else if (state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum != 0 && !supplyNodeFound) { + // the given supply air node does not match any zone equipment supply air nodes + ShowWarningError(state, + CurrentModuleObject + "name: '" + AlphaName(1) + ". " + "Supply Air Node Name '" + AlphaName(14) + + "' does not match any ZoneHVAC:EquipmentConnections objects."); + } - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - // If this field isn't blank, it must point to a valid curve - state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve = GetCurveIndex(state, AlphaName(15)); - if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve == 0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(15) + '=' + AlphaName(15)); + // End-Use subcategories + if (NumAlpha > 16) { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU = AlphaName(17); + } else { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU = "ITE-CPU"; + } + + if (NumAlpha > 17) { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan = AlphaName(18); + } else { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan = "ITE-Fans"; + } + if (state.dataHeatBal->ZoneITEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + + if (NumAlpha > 18) { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS = AlphaName(19); + } else { + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS = "ITE-UPS"; + } + if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + if (!state.dataIPShortCut->lAlphaFieldBlanks(20)) { + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch = GetScheduleIndex(state, AlphaName(20)); + if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch == 0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(20) + " entered=" + AlphaName(20)); ErrorsFound = true; } - } - else { - // If this curve is left blank, then the curve is assumed to always equal 1.0. - state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve = 0; - } - - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - // If this field isn't blank, it must point to a valid curve - state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve = GetCurveIndex(state, AlphaName(16)); - if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve == 0) { + } else { + if (!hasSupplyApproachTemp) { ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(16) + '=' + AlphaName(16)); + ShowContinueError(state, + "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, either " + + state.dataIPShortCut->cNumericFieldNames(10) + " or " + state.dataIPShortCut->cAlphaFieldNames(20) + + " is required, but both are left blank."); ErrorsFound = true; } } - else { - // If this curve is left blank, then the curve is assumed to always equal 1.0. - state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve = 0; - } - - // Environmental class - if (UtilityRoutines::SameString(AlphaName(10), "None")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassNone; - } - else if (UtilityRoutines::SameString(AlphaName(10), "A1")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA1; - } - else if (UtilityRoutines::SameString(AlphaName(10), "A2")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA2; - } - else if (UtilityRoutines::SameString(AlphaName(10), "A3")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA3; - } - else if (UtilityRoutines::SameString(AlphaName(10), "A4")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassA4; - } - else if (UtilityRoutines::SameString(AlphaName(10), "B")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassB; - } - else if (UtilityRoutines::SameString(AlphaName(10), "C")) { - state.dataHeatBal->ZoneITEq(Loop).Class = ITEClassC; - } - else { - ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(10) + '=' + AlphaName(10)); - ShowContinueError(state, "Valid entries are None, A1, A2, A3, A4, B or C."); - ErrorsFound = true; - } - // Air and supply inlet connections - if (UtilityRoutines::SameString(AlphaName(11), "AdjustedSupply")) { - state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletAdjustedSupply; - } - else if (UtilityRoutines::SameString(AlphaName(11), "ZoneAirNode")) { - state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletZoneAirNode; - } - else if (UtilityRoutines::SameString(AlphaName(11), "RoomAirModel")) { - // ZoneITEq( Loop ).AirConnectionType = ITEInletRoomAirModel; - ShowWarningError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + - "Air Inlet Connection Type = RoomAirModel is not implemented yet, using ZoneAirNode"); - state.dataHeatBal->ZoneITEq(Loop).AirConnectionType = ITEInletZoneAirNode; - } - else { - ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); - ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(11) + '=' + AlphaName(11)); - ShowContinueError(state, "Valid entries are AdjustedSupply, ZoneAirNode, or RoomAirModel."); - ErrorsFound = true; - } - if (state.dataIPShortCut->lAlphaFieldBlanks(14)) { - if (state.dataHeatBal->ZoneITEq(Loop).AirConnectionType == ITEInletAdjustedSupply) { - ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); - ShowContinueError(state, - "For " + state.dataIPShortCut->cAlphaFieldNames(11) + "= AdjustedSupply, " + - state.dataIPShortCut->cAlphaFieldNames(14) + " is required, but this field is blank."); + if (!state.dataIPShortCut->lAlphaFieldBlanks(21)) { + state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTempSch = GetScheduleIndex(state, AlphaName(21)); + if (state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTempSch == 0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(20) + " entered=" + AlphaName(20)); ErrorsFound = true; } - else if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + AlphaName(1)); + } else { + if (!hasReturnApproachTemp) { + ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); ShowContinueError(state, - "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, " + - state.dataIPShortCut->cAlphaFieldNames(14) + " is required, but this field is blank."); + "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, either " + + state.dataIPShortCut->cNumericFieldNames(11) + " or " + state.dataIPShortCut->cAlphaFieldNames(21) + + " is required, but both are left blank."); ErrorsFound = true; } } - else { - state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum = GetOnlySingleNode(state, - AlphaName(14), - ErrorsFound, - CurrentModuleObject, - AlphaName(1), - DataLoopNode::NodeFluidType::Air, - DataLoopNode::NodeConnectionType::Sensor, - 1, - ObjectIsNotParent); - } - - // check supply air node for matches with zone equipment supply air node - int zoneEqIndex = - DataZoneEquipment::GetControlledZoneIndex(state, state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - auto itStart = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.begin(); - auto itEnd = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.end(); - auto key = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum; - bool supplyNodeFound = false; - if (std::find(itStart, itEnd, key) != itEnd) { - supplyNodeFound = true; - } - - if (state.dataHeatBal->ZoneITEq(Loop).AirConnectionType == ITEInletAdjustedSupply && !supplyNodeFound) { - // supply air node must match zone equipment supply air node for these conditions - ShowSevereError(state, RoutineName + ": ElectricEquipment:ITE:AirCooled " + state.dataHeatBal->ZoneITEq(Loop).Name); - ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified."); - ErrorsFound = true; - } - else if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps && !supplyNodeFound) { - // supply air node must match zone equipment supply air node for these conditions - ShowSevereError(state, RoutineName + ": ElectricEquipment:ITE:AirCooled " + state.dataHeatBal->ZoneITEq(Loop).Name); - ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified."); - ErrorsFound = true; - } - else if (state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum != 0 && !supplyNodeFound) { - // the given supply air node does not match any zone equipment supply air nodes - ShowWarningError(state, - CurrentModuleObject + "name: '" + AlphaName(1) + ". " + "Supply Air Node Name '" + AlphaName(14) + - "' does not match any ZoneHVAC:EquipmentConnections objects."); - } - - // End-Use subcategories - if (NumAlpha > 16) { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU = AlphaName(17); - } - else { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU = "ITE-CPU"; - } - - if (NumAlpha > 17) { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan = AlphaName(18); - } - else { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan = "ITE-Fans"; - } - if (state.dataHeatBal->ZoneITEq(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - - if (NumAlpha > 18) { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS = AlphaName(19); - } - else { - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS = "ITE-UPS"; - } - if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - if (!state.dataIPShortCut->lAlphaFieldBlanks(20)) { - state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch = GetScheduleIndex(state, AlphaName(20)); - if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch == 0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(20) + " entered=" + AlphaName(20)); - ErrorsFound = true; - } - } - else { - if (!hasSupplyApproachTemp) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, - "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, either " + - state.dataIPShortCut->cNumericFieldNames(10) + " or " + state.dataIPShortCut->cAlphaFieldNames(20) + - " is required, but both are left blank."); - ErrorsFound = true; - } - } + } - if (!state.dataIPShortCut->lAlphaFieldBlanks(21)) { - state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTempSch = GetScheduleIndex(state, AlphaName(21)); - if (state.dataHeatBal->ZoneITEq(Loop).ReturnApproachTempSch == 0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(20) + " entered=" + AlphaName(20)); - ErrorsFound = true; - } - } - else { - if (!hasReturnApproachTemp) { - ShowSevereError(state, RoutineName + CurrentModuleObject + " \"" + AlphaName(1) + "\""); - ShowContinueError(state, - "For " + state.dataIPShortCut->cAlphaFieldNames(3) + "= FlowControlWithApproachTemperatures, either " + - state.dataIPShortCut->cNumericFieldNames(11) + " or " + state.dataIPShortCut->cAlphaFieldNames(21) + - " is required, but both are left blank."); - ErrorsFound = true; - } + if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + Real64 TAirInSizing = 0.0; + // Set the TAirInSizing to the maximun setpoint value to do sizing based on the maximum fan and cpu power of the ite object + SetPointManager::GetSetPointManagerInputData(state, ErrorsFound); + for (int SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { + if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum == Loop) { + TAirInSizing = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp; } } - if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - Real64 TAirInSizing = 0.0; - // Set the TAirInSizing to the maximun setpoint value to do sizing based on the maximum fan and cpu power of the ite object - SetPointManager::GetSetPointManagerInputData(state, ErrorsFound); - for (int SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { - if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum == Loop) { - TAirInSizing = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp; - } - } + state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn = max(TAirInSizing, state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn); + } - state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn = max(TAirInSizing, state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn); - } + // Object report variables + SetupOutputVariable(state, + "ITE CPU Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).CPUPower, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Fan Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).FanPower, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE UPS Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).UPSPower, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE CPU Electricity Rate at Design Inlet Conditions", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Fan Electricity Rate at Design Inlet Conditions", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE UPS Heat Gain to Zone Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Total Heat Gain to Zone Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); - // Object report variables - SetupOutputVariable(state, - "ITE CPU Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).CPUPower, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Fan Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).FanPower, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE UPS Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).UPSPower, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE CPU Electricity Rate at Design Inlet Conditions", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Fan Electricity Rate at Design Inlet Conditions", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE UPS Heat Gain to Zone Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - SetupOutputVariable(state, - "ITE Total Heat Gain to Zone Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE CPU Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).CPUConsumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); + SetupOutputVariable(state, + "ITE Fan Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).FanConsumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); + SetupOutputVariable(state, + "ITE UPS Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).UPSConsumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); + SetupOutputVariable(state, + "ITE CPU Electricity Energy at Design Inlet Conditions", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Fan Electricity Energy at Design Inlet Conditions", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE UPS Heat Gain to Zone Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Total Heat Gain to Zone Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Standard Density Air Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Current Density Air Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Mass Flow Rate", + OutputProcessor::Unit::kg_s, + state.dataHeatBal->ZoneITEq(Loop).AirMassFlow, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dry-Bulb Temperature", + OutputProcessor::Unit::C, + state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dewpoint Temperature", + OutputProcessor::Unit::C, + state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Relative Humidity", + OutputProcessor::Unit::Perc, + state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Outlet Dry-Bulb Temperature", + OutputProcessor::Unit::C, + state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + if (state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum != 0) { SetupOutputVariable(state, - "ITE CPU Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).CPUConsumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); - SetupOutputVariable(state, - "ITE Fan Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).FanConsumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); + "ITE Supply Heat Index", + OutputProcessor::Unit::None, + state.dataHeatBal->ZoneITEq(Loop).SHI, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + } + SetupOutputVariable(state, + "ITE Air Inlet Operating Range Exceeded Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dry-Bulb Temperature Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dry-Bulb Temperature Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dewpoint Temperature Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dewpoint Temperature Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Relative Humidity Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Relative Humidity Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH, + "Zone", + "Sum", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dry-Bulb Temperature Difference Above Operating Range", + OutputProcessor::Unit::deltaC, + state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dry-Bulb Temperature Difference Below Operating Range", + OutputProcessor::Unit::deltaC, + state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dewpoint Temperature Difference Above Operating Range", + OutputProcessor::Unit::deltaC, + state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Dewpoint Temperature Difference Below Operating Range", + OutputProcessor::Unit::deltaC, + state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Relative Humidity Difference Above Operating Range", + OutputProcessor::Unit::Perc, + state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + SetupOutputVariable(state, + "ITE Air Inlet Relative Humidity Difference Below Operating Range", + OutputProcessor::Unit::Perc, + state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH, + "Zone", + "Average", + state.dataHeatBal->ZoneITEq(Loop).Name); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneITEq(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneITEq(Loop).ZonePtr) = false; SetupOutputVariable(state, - "ITE UPS Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).UPSConsumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ListMultiplier); + "Zone ITE CPU Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE CPU Electricity Energy at Design Inlet Conditions", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Fan Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Fan Electricity Energy at Design Inlet Conditions", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE UPS Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE UPS Heat Gain to Zone Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE CPU Electricity Rate at Design Inlet Conditions", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUPowerAtDesign, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Total Heat Gain to Zone Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); - + "Zone ITE Fan Electricity Rate at Design Inlet Conditions", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanPowerAtDesign, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Standard Density Air Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE UPS Heat Gain to Zone Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSGainRateToZone, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Current Density Air Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Total Heat Gain to Zone Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqConGainRateToZone, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Mass Flow Rate", - OutputProcessor::Unit::kg_s, - state.dataHeatBal->ZoneITEq(Loop).AirMassFlow, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Adjusted Return Air Temperature", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEAdjReturnTemp, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature", - OutputProcessor::Unit::C, - state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE CPU Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUConsumption, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature", - OutputProcessor::Unit::C, - state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Fan Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanConsumption, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity", - OutputProcessor::Unit::Perc, - state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE UPS Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSConsumption, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Outlet Dry-Bulb Temperature", - OutputProcessor::Unit::C, - state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - if (state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum != 0) { - SetupOutputVariable(state, - "ITE Supply Heat Index", - OutputProcessor::Unit::None, - state.dataHeatBal->ZoneITEq(Loop).SHI, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - } + "Zone ITE CPU Electricity Energy at Design Inlet Conditions", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUEnergyAtDesign, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Operating Range Exceeded Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Fan Electricity Energy at Design Inlet Conditions", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanEnergyAtDesign, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE UPS Heat Gain to Zone Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSGainEnergyToZone, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Total Heat Gain to Zone Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqConGainEnergyToZone, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Standard Density Air Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqAirVolFlowStdDensity, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Air Mass Flow Rate", + OutputProcessor::Unit::kg_s, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqAirMassFlow, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Average Supply Heat Index", + OutputProcessor::Unit::None, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqSHI, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH, - "Zone", - "Sum", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Any Air Inlet Operating Range Exceeded Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeOutOfOperRange, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature Difference Above Operating Range", - OutputProcessor::Unit::deltaC, - state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Any Air Inlet Dry-Bulb Temperature Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveDryBulbT, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Dry-Bulb Temperature Difference Below Operating Range", - OutputProcessor::Unit::deltaC, - state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Any Air Inlet Dry-Bulb Temperature Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowDryBulbT, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature Difference Above Operating Range", - OutputProcessor::Unit::deltaC, - state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Any Air Inlet Dewpoint Temperature Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveDewpointT, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Dewpoint Temperature Difference Below Operating Range", - OutputProcessor::Unit::deltaC, - state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Any Air Inlet Dewpoint Temperature Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowDewpointT, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity Difference Above Operating Range", - OutputProcessor::Unit::Perc, - state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); + "Zone ITE Any Air Inlet Relative Humidity Above Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveRH, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); SetupOutputVariable(state, - "ITE Air Inlet Relative Humidity Difference Below Operating Range", - OutputProcessor::Unit::Perc, - state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH, - "Zone", - "Average", - state.dataHeatBal->ZoneITEq(Loop).Name); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneITEq(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneITEq(Loop).ZonePtr) = false; - SetupOutputVariable(state, - "Zone ITE CPU Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Fan Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE UPS Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE CPU Electricity Rate at Design Inlet Conditions", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUPowerAtDesign, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Fan Electricity Rate at Design Inlet Conditions", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanPowerAtDesign, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE UPS Heat Gain to Zone Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSGainRateToZone, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Total Heat Gain to Zone Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqConGainRateToZone, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Adjusted Return Air Temperature", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEAdjReturnTemp, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - - SetupOutputVariable(state, - "Zone ITE CPU Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUConsumption, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Fan Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanConsumption, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE UPS Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSConsumption, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE CPU Electricity Energy at Design Inlet Conditions", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqCPUEnergyAtDesign, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Fan Electricity Energy at Design Inlet Conditions", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqFanEnergyAtDesign, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE UPS Heat Gain to Zone Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqUPSGainEnergyToZone, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Total Heat Gain to Zone Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqConGainEnergyToZone, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - - SetupOutputVariable(state, - "Zone ITE Standard Density Air Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqAirVolFlowStdDensity, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Air Mass Flow Rate", - OutputProcessor::Unit::kg_s, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqAirMassFlow, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Average Supply Heat Index", - OutputProcessor::Unit::None, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqSHI, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Any Air Inlet Operating Range Exceeded Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeOutOfOperRange, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Any Air Inlet Dry-Bulb Temperature Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveDryBulbT, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Any Air Inlet Dry-Bulb Temperature Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowDryBulbT, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Any Air Inlet Dewpoint Temperature Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveDewpointT, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Any Air Inlet Dewpoint Temperature Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowDewpointT, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Any Air Inlet Relative Humidity Above Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeAboveRH, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone ITE Any Air Inlet Relative Humidity Below Operating Range Time", - OutputProcessor::Unit::hr, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowRH, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); - } - - // MJW - EMS Not in place yet - // if ( AnyEnergyManagementSystemInModel ) { - // SetupEMSActuator( "ElectricEquipment", ZoneITEq( Loop ).Name, "Electric Power Level", "[W]", ZoneITEq( Loop - // ).EMSZoneEquipOverrideOn, ZoneITEq( Loop ).EMSEquipPower ); SetupEMSInternalVariable( "Plug and Process Power Design Level", - // ZoneITEq( Loop ).Name, "[W]", ZoneITEq( Loop ).DesignTotalPower ); } // EMS - - if (!ErrorsFound) - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneITEq(Loop).ZonePtr, - "ElectricEquipment:ITE:AirCooled", - state.dataHeatBal->ZoneITEq(Loop).Name, - IntGainTypeOf_ElectricEquipmentITEAirCooled, - &state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone); - - } // Item - Number of ZoneITEq objects - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE && - (!state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps)) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\": invalid calculation method " + AlphaName(3) + - " for Zone: " + AlphaName(2)); - ShowContinueError(state, "...Multiple flow control methods apply to one zone. "); - ErrorsFound = true; - } + "Zone ITE Any Air Inlet Relative Humidity Below Operating Range Time", + OutputProcessor::Unit::hr, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).ITEqTimeBelowRH, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).Name); + } + + // MJW - EMS Not in place yet + // if ( AnyEnergyManagementSystemInModel ) { + // SetupEMSActuator( "ElectricEquipment", ZoneITEq( Loop ).Name, "Electric Power Level", "[W]", ZoneITEq( Loop + // ).EMSZoneEquipOverrideOn, ZoneITEq( Loop ).EMSEquipPower ); SetupEMSInternalVariable( "Plug and Process Power Design Level", + // ZoneITEq( Loop ).Name, "[W]", ZoneITEq( Loop ).DesignTotalPower ); } // EMS + + if (!ErrorsFound) + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneITEq(Loop).ZonePtr, + "ElectricEquipment:ITE:AirCooled", + state.dataHeatBal->ZoneITEq(Loop).Name, + IntGainTypeOf_ElectricEquipmentITEAirCooled, + &state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone); + + } // Item - Number of ZoneITEq objects + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE && + (!state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps)) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\": invalid calculation method " + AlphaName(3) + + " for Zone: " + AlphaName(2)); + ShowContinueError(state, "...Multiple flow control methods apply to one zone. "); + ErrorsFound = true; } - } // Check on number of ZoneITEq + } + } // Check on number of ZoneITEq - RepVarSet = true; - CurrentModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled"; - state.dataHeatBal->TotBBHeat = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->ZoneBBHeat.allocate(state.dataHeatBal->TotBBHeat); + RepVarSet = true; + CurrentModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled"; + state.dataHeatBal->TotBBHeat = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->ZoneBBHeat.allocate(state.dataHeatBal->TotBBHeat); - for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { - AlphaName = ""; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Loop, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->ZoneBBHeat(Loop).Name = AlphaName(1); - - state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - if (state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr == 0) { + for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { + AlphaName = ""; + IHGNumbers = 0.0; + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Loop, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->ZoneBBHeat(Loop).Name = AlphaName(1); + + state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + if (state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr == 0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(2) + " entered=" + AlphaName(2)); + ErrorsFound = true; + } + + state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + if (state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(2) + " entered=" + AlphaName(2)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + state.dataIPShortCut->cAlphaFieldNames(3) + + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); } - - state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - if (state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + ErrorsFound = true; + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + state.dataIPShortCut->cAlphaFieldNames(3) + - " is required."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; } - else { + if (SchMax < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); - } - ErrorsFound = true; - } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; - } - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; - } + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } } + } - if (NumAlpha > 3) { - state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory = AlphaName(4); - } - else { - state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory = "General"; - } + if (NumAlpha > 3) { + state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory = AlphaName(4); + } else { + state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory = "General"; + } - state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature = IHGNumbers(1); - state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature = IHGNumbers(2); - state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature = IHGNumbers(3); - state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature = IHGNumbers(4); - state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant = IHGNumbers(5); - state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected = 1.0 - state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant; - if (state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); - ErrorsFound = true; - } + state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature = IHGNumbers(1); + state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature = IHGNumbers(2); + state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature = IHGNumbers(3); + state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature = IHGNumbers(4); + state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant = IHGNumbers(5); + state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected = 1.0 - state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant; + if (state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected < 0.0) { + ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", Sum of Fractions > 1.0"); + ErrorsFound = true; + } - if (state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + if (state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - // Object report variables + // Object report variables + SetupOutputVariable(state, + "Baseboard Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneBBHeat(Loop).Power, + "Zone", + "Average", + state.dataHeatBal->ZoneBBHeat(Loop).Name); + SetupOutputVariable(state, + "Baseboard Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneBBHeat(Loop).Consumption, + "Zone", + "Sum", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + _, + "Electricity", + "InteriorEquipment", + state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory, + "Building", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Multiplier, + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).ListMultiplier); + + SetupOutputVariable(state, + "Baseboard Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneBBHeat(Loop).RadGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneBBHeat(Loop).Name); + SetupOutputVariable(state, + "Baseboard Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneBBHeat(Loop).Name); + SetupOutputVariable(state, + "Baseboard Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneBBHeat(Loop).ConGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneBBHeat(Loop).Name); + SetupOutputVariable(state, + "Baseboard Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneBBHeat(Loop).Name); + SetupOutputVariable(state, + "Baseboard Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZoneBBHeat(Loop).TotGainEnergy, + "Zone", + "Sum", + state.dataHeatBal->ZoneBBHeat(Loop).Name); + SetupOutputVariable(state, + "Baseboard Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneBBHeat(Loop).Name); + + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr) = false; SetupOutputVariable(state, - "Baseboard Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneBBHeat(Loop).Power, - "Zone", - "Average", - state.dataHeatBal->ZoneBBHeat(Loop).Name); + "Zone Baseboard Electricity Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatPower, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Baseboard Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneBBHeat(Loop).Consumption, - "Zone", - "Sum", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - _, - "Electricity", - "InteriorEquipment", - state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory, - "Building", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Multiplier, - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).ListMultiplier); + "Zone Baseboard Electricity Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatElecCons, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Baseboard Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneBBHeat(Loop).RadGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneBBHeat(Loop).Name); + "Zone Baseboard Radiant Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatRadGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Baseboard Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneBBHeat(Loop).Name); + "Zone Baseboard Radiant Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatRadGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Baseboard Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneBBHeat(Loop).ConGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneBBHeat(Loop).Name); + "Zone Baseboard Convective Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatConGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Baseboard Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneBBHeat(Loop).Name); + "Zone Baseboard Convective Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatConGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Baseboard Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZoneBBHeat(Loop).TotGainEnergy, - "Zone", - "Sum", - state.dataHeatBal->ZoneBBHeat(Loop).Name); + "Zone Baseboard Total Heating Energy", + OutputProcessor::Unit::J, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatTotGain, + "Zone", + "Sum", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); SetupOutputVariable(state, - "Baseboard Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneBBHeat(Loop).Name); - - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr) = false; - SetupOutputVariable(state, - "Zone Baseboard Electricity Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatPower, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Baseboard Electricity Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatElecCons, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - - SetupOutputVariable(state, - "Zone Baseboard Radiant Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatRadGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Baseboard Radiant Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatRadGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Baseboard Convective Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatConGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Baseboard Convective Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatConGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Baseboard Total Heating Energy", - OutputProcessor::Unit::J, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatTotGain, - "Zone", - "Sum", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - SetupOutputVariable(state, - "Zone Baseboard Total Heating Rate", - OutputProcessor::Unit::W, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatTotGainRate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); - } - - if (state.dataGlobal->AnyEnergyManagementSystemInModel) { - SetupEMSActuator(state, - "ZoneBaseboard:OutdoorTemperatureControlled", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - "Power Level", - "[W]", - state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardOverrideOn, - state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardPower); - SetupEMSInternalVariable(state, - "Simple Zone Baseboard Capacity At Low Temperature", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - "[W]", - state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature); - SetupEMSInternalVariable(state, - "Simple Zone Baseboard Capacity At High Temperature", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - "[W]", - state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature); - } // EMS - - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr, - "ZoneBaseboard:OutdoorTemperatureControlled", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - IntGainTypeOf_ZoneBaseboardOutdoorTemperatureControlled, - &state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate, - nullptr, - &state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate); + "Zone Baseboard Total Heating Rate", + OutputProcessor::Unit::W, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).BaseHeatTotGainRate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr).Name); } - RepVarSet = true; - CurrentModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide"; - state.dataHeatBal->TotCO2Gen = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataHeatBal->ZoneCO2Gen.allocate(state.dataHeatBal->TotCO2Gen); + if (state.dataGlobal->AnyEnergyManagementSystemInModel) { + SetupEMSActuator(state, + "ZoneBaseboard:OutdoorTemperatureControlled", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + "Power Level", + "[W]", + state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardOverrideOn, + state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardPower); + SetupEMSInternalVariable(state, + "Simple Zone Baseboard Capacity At Low Temperature", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + "[W]", + state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature); + SetupEMSInternalVariable(state, + "Simple Zone Baseboard Capacity At High Temperature", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + "[W]", + state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature); + } // EMS + + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr, + "ZoneBaseboard:OutdoorTemperatureControlled", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + IntGainTypeOf_ZoneBaseboardOutdoorTemperatureControlled, + &state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate, + nullptr, + &state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate); + } - for (Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) { - AlphaName = ""; - IHGNumbers = 0.0; - state.dataInputProcessing->inputProcessor->getObjectItem(state, - CurrentModuleObject, - Loop, - AlphaName, - NumAlpha, - IHGNumbers, - NumNumber, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); - - state.dataHeatBal->ZoneCO2Gen(Loop).Name = AlphaName(1); - - state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); - if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr == 0) { + RepVarSet = true; + CurrentModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide"; + state.dataHeatBal->TotCO2Gen = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataHeatBal->ZoneCO2Gen.allocate(state.dataHeatBal->TotCO2Gen); + + for (Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) { + AlphaName = ""; + IHGNumbers = 0.0; + state.dataInputProcessing->inputProcessor->getObjectItem(state, + CurrentModuleObject, + Loop, + AlphaName, + NumAlpha, + IHGNumbers, + NumNumber, + IOStat, + state.dataIPShortCut->lNumericFieldBlanks, + state.dataIPShortCut->lAlphaFieldBlanks, + state.dataIPShortCut->cAlphaFieldNames, + state.dataIPShortCut->cNumericFieldNames); + UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + + state.dataHeatBal->ZoneCO2Gen(Loop).Name = AlphaName(1); + + state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr = UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr == 0) { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(2) + " entered=" + AlphaName(2)); + ErrorsFound = true; + } + + state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); + if (state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr == 0) { + if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(2) + " entered=" + AlphaName(2)); - ErrorsFound = true; + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + state.dataIPShortCut->cAlphaFieldNames(3) + + " is required."); + } else { + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + + state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); } - - state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr = GetScheduleIndex(state, AlphaName(3)); - if (state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + ErrorsFound = true; + } else { // check min/max on schedule + SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); + SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); + if (SchMin < 0.0 || SchMax < 0.0) { + if (SchMin < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + state.dataIPShortCut->cAlphaFieldNames(3) + - " is required."); + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); + ErrorsFound = true; } - else { + if (SchMax < 0.0) { ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - state.dataIPShortCut->cAlphaFieldNames(3) + " entered=" + AlphaName(3)); - } - ErrorsFound = true; - } - else { // check min/max on schedule - SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); - SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); - if (SchMin < 0.0 || SchMax < 0.0) { - if (SchMin < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); - ErrorsFound = true; - } - if (SchMax < 0.0) { - ShowSevereError(state, - RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + - state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); - ErrorsFound = true; - } + RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + + state.dataIPShortCut->cAlphaFieldNames(3) + ", maximum is < 0.0"); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); + ErrorsFound = true; } } + } - state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate = IHGNumbers(1); - - if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later + state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate = IHGNumbers(1); - // Object report variables - SetupOutputVariable(state, - "Contaminant Source or Sink CO2 Gain Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate, - "Zone", - "Average", - state.dataHeatBal->ZoneCO2Gen(Loop).Name); + if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later - // Zone total report variables - if (RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr)) { - RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr) = false; + // Object report variables + SetupOutputVariable(state, + "Contaminant Source or Sink CO2 Gain Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate, + "Zone", + "Average", + state.dataHeatBal->ZoneCO2Gen(Loop).Name); - SetupOutputVariable(state, - "Zone Contaminant Source or Sink CO2 Gain Volume Flow Rate", - OutputProcessor::Unit::m3_s, - state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).CO2Rate, - "Zone", - "Average", - state.dataHeatBal->Zone(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).Name); - } + // Zone total report variables + if (RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr)) { + RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr) = false; - SetupZoneInternalGain(state, - state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr, - "ZoneContaminantSourceAndSink:CarbonDioxide", - state.dataHeatBal->ZoneCO2Gen(Loop).Name, - IntGainTypeOf_ZoneContaminantSourceAndSinkCarbonDioxide, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - &state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate); + SetupOutputVariable(state, + "Zone Contaminant Source or Sink CO2 Gain Volume Flow Rate", + OutputProcessor::Unit::m3_s, + state.dataHeatBal->ZnRpt(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).CO2Rate, + "Zone", + "Average", + state.dataHeatBal->Zone(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).Name); } - RepVarSet.deallocate(); - IHGNumbers.deallocate(); - AlphaName.deallocate(); + SetupZoneInternalGain(state, + state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr, + "ZoneContaminantSourceAndSink:CarbonDioxide", + state.dataHeatBal->ZoneCO2Gen(Loop).Name, + IntGainTypeOf_ZoneContaminantSourceAndSinkCarbonDioxide, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + &state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate); + } - if (ErrorsFound) { - ShowFatalError(state, RoutineName + "Errors found in Getting Internal Gains Input, Program Stopped"); - } + RepVarSet.deallocate(); + IHGNumbers.deallocate(); + AlphaName.deallocate(); - static constexpr auto Format_721( - "! ,Zone Name, Floor Area {{m2}},# Occupants,Area per Occupant " - "{{m2/person}},Occupant per Area {{person/m2}},Interior Lighting {{W/m2}},Electric Load {{W/m2}},Gas Load {{W/m2}},Other " - "Load {{W/m2}},Hot Water Eq {{W/m2}},Steam Equipment {{W/m2}},Sum Loads per Area {{W/m2}},Outdoor Controlled Baseboard " - "Heat\n"); - - print(state.files.eio, Format_721); - for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { - LightTot = 0.0; - ElecTot = 0.0; - GasTot = 0.0; - OthTot = 0.0; - HWETot = 0.0; - StmTot = 0.0; - BBHeatInd = "No"; - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotLights; ++Loop1) { - if (state.dataHeatBal->Lights(Loop1).ZonePtr != Loop) continue; - LightTot += state.dataHeatBal->Lights(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotElecEquip; ++Loop1) { - if (state.dataHeatBal->ZoneElectric(Loop1).ZonePtr != Loop) continue; - ElecTot += state.dataHeatBal->ZoneElectric(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->NumZoneITEqStatements; ++Loop1) { - if (state.dataHeatBal->ZoneITEq(Loop1).ZonePtr != Loop) continue; - ElecTot += state.dataHeatBal->ZoneITEq(Loop1).DesignTotalPower; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotGasEquip; ++Loop1) { - if (state.dataHeatBal->ZoneGas(Loop1).ZonePtr != Loop) continue; - GasTot += state.dataHeatBal->ZoneGas(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotOthEquip; ++Loop1) { - if (state.dataHeatBal->ZoneOtherEq(Loop1).ZonePtr != Loop) continue; - OthTot += state.dataHeatBal->ZoneOtherEq(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotStmEquip; ++Loop1) { - if (state.dataHeatBal->ZoneSteamEq(Loop1).ZonePtr != Loop) continue; - StmTot += state.dataHeatBal->ZoneSteamEq(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotHWEquip; ++Loop1) { - if (state.dataHeatBal->ZoneHWEq(Loop1).ZonePtr != Loop) continue; - HWETot += state.dataHeatBal->ZoneHWEq(Loop1).DesignLevel; - } - for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotBBHeat; ++Loop1) { - if (state.dataHeatBal->ZoneBBHeat(Loop1).ZonePtr != Loop) continue; - BBHeatInd = "Yes"; - } - state.dataHeatBal->Zone(Loop).InternalHeatGains = LightTot + ElecTot + GasTot + OthTot + HWETot + StmTot; - if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { - print(state.files.eio, - Format_720, - state.dataHeatBal->Zone(Loop).Name, - state.dataHeatBal->Zone(Loop).FloorArea, - state.dataHeatBal->Zone(Loop).TotOccupants); - print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(Loop).FloorArea, state.dataHeatBal->Zone(Loop).TotOccupants); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", LightTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", ElecTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", GasTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", OthTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", HWETot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, "{:.3R},", StmTot / state.dataHeatBal->Zone(Loop).FloorArea); - print(state.files.eio, - "{:.3R},{}\n", - state.dataHeatBal->Zone(Loop).InternalHeatGains / state.dataHeatBal->Zone(Loop).FloorArea, - BBHeatInd); - } - else { - print(state.files.eio, - Format_720, - state.dataHeatBal->Zone(Loop).Name, - state.dataHeatBal->Zone(Loop).FloorArea, - state.dataHeatBal->Zone(Loop).TotOccupants); - print(state.files.eio, "0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,{}\n", BBHeatInd); - } + if (ErrorsFound) { + ShowFatalError(state, RoutineName + "Errors found in Getting Internal Gains Input, Program Stopped"); + } + + static constexpr auto Format_721( + "! ,Zone Name, Floor Area {{m2}},# Occupants,Area per Occupant " + "{{m2/person}},Occupant per Area {{person/m2}},Interior Lighting {{W/m2}},Electric Load {{W/m2}},Gas Load {{W/m2}},Other " + "Load {{W/m2}},Hot Water Eq {{W/m2}},Steam Equipment {{W/m2}},Sum Loads per Area {{W/m2}},Outdoor Controlled Baseboard " + "Heat\n"); + + print(state.files.eio, Format_721); + for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { + LightTot = 0.0; + ElecTot = 0.0; + GasTot = 0.0; + OthTot = 0.0; + HWETot = 0.0; + StmTot = 0.0; + BBHeatInd = "No"; + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotLights; ++Loop1) { + if (state.dataHeatBal->Lights(Loop1).ZonePtr != Loop) continue; + LightTot += state.dataHeatBal->Lights(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotElecEquip; ++Loop1) { + if (state.dataHeatBal->ZoneElectric(Loop1).ZonePtr != Loop) continue; + ElecTot += state.dataHeatBal->ZoneElectric(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->NumZoneITEqStatements; ++Loop1) { + if (state.dataHeatBal->ZoneITEq(Loop1).ZonePtr != Loop) continue; + ElecTot += state.dataHeatBal->ZoneITEq(Loop1).DesignTotalPower; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotGasEquip; ++Loop1) { + if (state.dataHeatBal->ZoneGas(Loop1).ZonePtr != Loop) continue; + GasTot += state.dataHeatBal->ZoneGas(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotOthEquip; ++Loop1) { + if (state.dataHeatBal->ZoneOtherEq(Loop1).ZonePtr != Loop) continue; + OthTot += state.dataHeatBal->ZoneOtherEq(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotStmEquip; ++Loop1) { + if (state.dataHeatBal->ZoneSteamEq(Loop1).ZonePtr != Loop) continue; + StmTot += state.dataHeatBal->ZoneSteamEq(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotHWEquip; ++Loop1) { + if (state.dataHeatBal->ZoneHWEq(Loop1).ZonePtr != Loop) continue; + HWETot += state.dataHeatBal->ZoneHWEq(Loop1).DesignLevel; + } + for (Loop1 = 1; Loop1 <= state.dataHeatBal->TotBBHeat; ++Loop1) { + if (state.dataHeatBal->ZoneBBHeat(Loop1).ZonePtr != Loop) continue; + BBHeatInd = "Yes"; } - for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { - if (Loop == 1) { + state.dataHeatBal->Zone(Loop).InternalHeatGains = LightTot + ElecTot + GasTot + OthTot + HWETot + StmTot; + if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) { + print(state.files.eio, + Format_720, + state.dataHeatBal->Zone(Loop).Name, + state.dataHeatBal->Zone(Loop).FloorArea, + state.dataHeatBal->Zone(Loop).TotOccupants); + print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(Loop).FloorArea, state.dataHeatBal->Zone(Loop).TotOccupants); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", LightTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", ElecTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", GasTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", OthTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", HWETot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, "{:.3R},", StmTot / state.dataHeatBal->Zone(Loop).FloorArea); + print(state.files.eio, + "{:.3R},{}\n", + state.dataHeatBal->Zone(Loop).InternalHeatGains / state.dataHeatBal->Zone(Loop).FloorArea, + BBHeatInd); + } else { + print(state.files.eio, + Format_720, + state.dataHeatBal->Zone(Loop).Name, + state.dataHeatBal->Zone(Loop).FloorArea, + state.dataHeatBal->Zone(Loop).TotOccupants); + print(state.files.eio, "0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,{}\n", BBHeatInd); + } + } + for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "People", + "Number of People {},People/Floor Area {person/m2},Floor Area per person {m2/person},Fraction Radiant,Fraction " + "Convected,Sensible Fraction Calculation,Activity level,ASHRAE 55 Warnings,Carbon Dioxide Generation Rate,Nominal Minimum " + "Number of People,Nominal Maximum Number of People"); + if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || + state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { print(state.files.eio, - Format_723, - "People", - "Number of People {},People/Floor Area {person/m2},Floor Area per person {m2/person},Fraction Radiant,Fraction " - "Convected,Sensible Fraction Calculation,Activity level,ASHRAE 55 Warnings,Carbon Dioxide Generation Rate,Nominal Minimum " - "Number of People,Nominal Maximum Number of People"); - if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || - state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { - print(state.files.eio, - ",MRT Calculation Type,Work Efficiency, Clothing Insulation Calculation Method,Clothing " - "Insulation Calculation Method Schedule,Clothing,Air Velocity,Fanger Calculation,Pierce " - "Calculation,KSU Calculation,Cooling Effect Calculation,Ankle Draft Calculation\n"); - } - else { - print(state.files.eio, "\n"); - } + ",MRT Calculation Type,Work Efficiency, Clothing Insulation Calculation Method,Clothing " + "Insulation Calculation Method Schedule,Clothing,Air Velocity,Fanger Calculation,Pierce " + "Calculation,KSU Calculation,Cooling Effect Calculation,Ankle Draft Calculation\n"); + } else { + print(state.files.eio, "\n"); } + } - ZoneNum = state.dataHeatBal->People(Loop).ZonePtr; + ZoneNum = state.dataHeatBal->People(Loop).ZonePtr; - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "People-Illegal Zone specified", state.dataHeatBal->People(Loop).Name); - continue; - } + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "People-Illegal Zone specified", state.dataHeatBal->People(Loop).Name); + continue; + } - print(state.files.eio, - Format_722, - "People", - state.dataHeatBal->People(Loop).Name, - GetScheduleName(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); + print(state.files.eio, + Format_722, + "People", + state.dataHeatBal->People(Loop).Name, + GetScheduleName(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); - print(state.files.eio, "{:.1R},", state.dataHeatBal->People(Loop).NumberOfPeople); + print(state.files.eio, "{:.1R},", state.dataHeatBal->People(Loop).NumberOfPeople); - print_and_divide_if_greater_than_zero(state.dataHeatBal->People(Loop).NumberOfPeople, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->People(Loop).NumberOfPeople, state.dataHeatBal->Zone(ZoneNum).FloorArea); - if (state.dataHeatBal->People(Loop).NumberOfPeople > 0.0) { - print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(ZoneNum).FloorArea, state.dataHeatBal->People(Loop).NumberOfPeople); - } - else { + if (state.dataHeatBal->People(Loop).NumberOfPeople > 0.0) { + print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(ZoneNum).FloorArea, state.dataHeatBal->People(Loop).NumberOfPeople); + } else { + print(state.files.eio, "N/A,"); + } + + print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionConvected); + if (state.dataHeatBal->People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate) { + print(state.files.eio, "AutoCalculate,"); + } else { + print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).UserSpecSensFrac); + } + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ActivityLevelPtr)); + + if (state.dataHeatBal->People(Loop).Show55Warning) { + print(state.files.eio, "Yes,"); + } else { + print(state.files.eio, "No,"); + } + print(state.files.eio, "{:.4R},", state.dataHeatBal->People(Loop).CO2RateFactor); + print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMinNumberPeople); + + if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || + state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { + print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMaxNumberPeople); + + if (state.dataHeatBal->People(Loop).MRTCalcType == ZoneAveraged) { + print(state.files.eio, "Zone Averaged,"); + } else if (state.dataHeatBal->People(Loop).MRTCalcType == SurfaceWeighted) { + print(state.files.eio, "Surface Weighted,"); + } else if (state.dataHeatBal->People(Loop).MRTCalcType == AngleFactor) { + print(state.files.eio, "Angle Factor,"); + } else { print(state.files.eio, "N/A,"); } + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).WorkEffPtr)); - print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionConvected); - if (state.dataHeatBal->People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate) { - print(state.files.eio, "AutoCalculate,"); + if (state.dataHeatBal->People(Loop).ClothingType == 1) { + print(state.files.eio, "Clothing Insulation Schedule,"); + } else if (state.dataHeatBal->People(Loop).ClothingType == 2) { + print(state.files.eio, "Dynamic Clothing Model ASHRAE55,"); + } else if (state.dataHeatBal->People(Loop).ClothingType == 3) { + print(state.files.eio, "Calculation Method Schedule,"); + } else { + print(state.files.eio, "N/A,"); } - else { - print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).UserSpecSensFrac); + + if (state.dataHeatBal->People(Loop).ClothingType == 3) { + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingMethodPtr)); + } else { + print(state.files.eio, "N/A,"); } - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ActivityLevelPtr)); - if (state.dataHeatBal->People(Loop).Show55Warning) { + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingPtr)); + print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).AirVelocityPtr)); + + if (state.dataHeatBal->People(Loop).Fanger) { print(state.files.eio, "Yes,"); + } else { + print(state.files.eio, "No,"); } - else { + if (state.dataHeatBal->People(Loop).Pierce) { + print(state.files.eio, "Yes,"); + } else { print(state.files.eio, "No,"); } - print(state.files.eio, "{:.4R},", state.dataHeatBal->People(Loop).CO2RateFactor); - print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMinNumberPeople); - - if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || - state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { - print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMaxNumberPeople); - - if (state.dataHeatBal->People(Loop).MRTCalcType == ZoneAveraged) { - print(state.files.eio, "Zone Averaged,"); - } - else if (state.dataHeatBal->People(Loop).MRTCalcType == SurfaceWeighted) { - print(state.files.eio, "Surface Weighted,"); - } - else if (state.dataHeatBal->People(Loop).MRTCalcType == AngleFactor) { - print(state.files.eio, "Angle Factor,"); - } - else { - print(state.files.eio, "N/A,"); - } - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).WorkEffPtr)); - - if (state.dataHeatBal->People(Loop).ClothingType == 1) { - print(state.files.eio, "Clothing Insulation Schedule,"); - } - else if (state.dataHeatBal->People(Loop).ClothingType == 2) { - print(state.files.eio, "Dynamic Clothing Model ASHRAE55,"); - } - else if (state.dataHeatBal->People(Loop).ClothingType == 3) { - print(state.files.eio, "Calculation Method Schedule,"); - } - else { - print(state.files.eio, "N/A,"); - } - - if (state.dataHeatBal->People(Loop).ClothingType == 3) { - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingMethodPtr)); - } - else { - print(state.files.eio, "N/A,"); - } - - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingPtr)); - print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).AirVelocityPtr)); - - if (state.dataHeatBal->People(Loop).Fanger) { - print(state.files.eio, "Yes,"); - } - else { - print(state.files.eio, "No,"); - } - if (state.dataHeatBal->People(Loop).Pierce) { - print(state.files.eio, "Yes,"); - } - else { - print(state.files.eio, "No,"); - } - if (state.dataHeatBal->People(Loop).KSU) { - print(state.files.eio, "Yes,"); - } - else { - print(state.files.eio, "No,"); - } - if (state.dataHeatBal->People(Loop).CoolingEffectASH55) { - print(state.files.eio, "Yes,"); - } - else { - print(state.files.eio, "No,"); - } - if (state.dataHeatBal->People(Loop).AnkleDraftASH55) { - print(state.files.eio, "Yes\n"); - } - else { - print(state.files.eio, "No\n"); - } + if (state.dataHeatBal->People(Loop).KSU) { + print(state.files.eio, "Yes,"); + } else { + print(state.files.eio, "No,"); } - else { - print(state.files.eio, "{:.0R}\n", state.dataHeatBal->People(Loop).NomMaxNumberPeople); + if (state.dataHeatBal->People(Loop).CoolingEffectASH55) { + print(state.files.eio, "Yes,"); + } else { + print(state.files.eio, "No,"); } - } - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "Lights", - "Lighting Level {W},Lights/Floor Area {W/m2},Lights per person {W/person},Fraction Return " - "Air,Fraction Radiant,Fraction Short Wave,Fraction Convected,Fraction Replaceable,End-Use " - "Category,Nominal Minimum Lighting Level {W},Nominal Maximum Lighting Level {W}\n"); + if (state.dataHeatBal->People(Loop).AnkleDraftASH55) { + print(state.files.eio, "Yes\n"); + } else { + print(state.files.eio, "No\n"); } + } else { + print(state.files.eio, "{:.0R}\n", state.dataHeatBal->People(Loop).NomMaxNumberPeople); + } + } + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + if (Loop == 1) { + print(state.files.eio, + Format_723, + "Lights", + "Lighting Level {W},Lights/Floor Area {W/m2},Lights per person {W/person},Fraction Return " + "Air,Fraction Radiant,Fraction Short Wave,Fraction Convected,Fraction Replaceable,End-Use " + "Category,Nominal Minimum Lighting Level {W},Nominal Maximum Lighting Level {W}\n"); + } - ZoneNum = state.dataHeatBal->Lights(Loop).ZonePtr; + ZoneNum = state.dataHeatBal->Lights(Loop).ZonePtr; - if (ZoneNum == 0) { - print(state.files.eio, "Lights-Illegal Zone specified", state.dataHeatBal->Lights(Loop).Name); - continue; - } + if (ZoneNum == 0) { + print(state.files.eio, "Lights-Illegal Zone specified", state.dataHeatBal->Lights(Loop).Name); + continue; + } + print(state.files.eio, + Format_722, + "Lights", + state.dataHeatBal->Lights(Loop).Name, + GetScheduleName(state, state.dataHeatBal->Lights(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReturnAir); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionShortWave); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionConvected); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReplaceable); + print(state.files.eio, "{},", state.dataHeatBal->Lights(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->Lights(Loop).NomMaxDesignLevel); + } + for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { + if (Loop == 1) { print(state.files.eio, - Format_722, - "Lights", - state.dataHeatBal->Lights(Loop).Name, - GetScheduleName(state, state.dataHeatBal->Lights(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReturnAir); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionShortWave); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionConvected); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReplaceable); - print(state.files.eio, "{},", state.dataHeatBal->Lights(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->Lights(Loop).NomMaxDesignLevel); + Format_723, + "ElectricEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); } - for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "ElectricEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); - } - ZoneNum = state.dataHeatBal->ZoneElectric(Loop).ZonePtr; + ZoneNum = state.dataHeatBal->ZoneElectric(Loop).ZonePtr; - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Electric Equipment-Illegal Zone specified", state.dataHeatBal->ZoneElectric(Loop).Name); - continue; - } + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Electric Equipment-Illegal Zone specified", state.dataHeatBal->ZoneElectric(Loop).Name); + continue; + } + print(state.files.eio, + Format_722, + "ElectricEquipment", + state.dataHeatBal->ZoneElectric(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionConvected); + print(state.files.eio, "{},", state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneElectric(Loop).NomMaxDesignLevel); + } + for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { + if (Loop == 1) { print(state.files.eio, - Format_722, - "ElectricEquipment", - state.dataHeatBal->ZoneElectric(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionConvected); - print(state.files.eio, "{},", state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneElectric(Loop).NomMaxDesignLevel); + Format_723, + "GasEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); } - for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "GasEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); - } - ZoneNum = state.dataHeatBal->ZoneGas(Loop).ZonePtr; + ZoneNum = state.dataHeatBal->ZoneGas(Loop).ZonePtr; - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Gas Equipment-Illegal Zone specified", state.dataHeatBal->ZoneGas(Loop).Name); - continue; - } + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Gas Equipment-Illegal Zone specified", state.dataHeatBal->ZoneGas(Loop).Name); + continue; + } + + print(state.files.eio, + Format_722, + "GasEquipment", + state.dataHeatBal->ZoneGas(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionConvected); + print(state.files.eio, "{},", state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneGas(Loop).NomMaxDesignLevel); + } + for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { + if (Loop == 1) { print(state.files.eio, - Format_722, - "GasEquipment", - state.dataHeatBal->ZoneGas(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionConvected); - print(state.files.eio, "{},", state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneGas(Loop).NomMaxDesignLevel); + Format_723, + "HotWaterEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); } - for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "HotWaterEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); - } + ZoneNum = state.dataHeatBal->ZoneHWEq(Loop).ZonePtr; - ZoneNum = state.dataHeatBal->ZoneHWEq(Loop).ZonePtr; + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Hot Water Equipment-Illegal Zone specified", state.dataHeatBal->ZoneHWEq(Loop).Name); + continue; + } - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Hot Water Equipment-Illegal Zone specified", state.dataHeatBal->ZoneHWEq(Loop).Name); - continue; - } + print(state.files.eio, + Format_722, + "HotWaterEquipment", + state.dataHeatBal->ZoneHWEq(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionConvected); + print(state.files.eio, "{},", state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneHWEq(Loop).NomMaxDesignLevel); + } + for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { + if (Loop == 1) { print(state.files.eio, - Format_722, - "HotWaterEquipment", - state.dataHeatBal->ZoneHWEq(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionConvected); - print(state.files.eio, "{},", state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneHWEq(Loop).NomMaxDesignLevel); + Format_723, + "SteamEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); } - for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "SteamEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,End-Use SubCategory,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); - } + ZoneNum = state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr; - ZoneNum = state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr; + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Steam Equipment-Illegal Zone specified", state.dataHeatBal->ZoneSteamEq(Loop).Name); + continue; + } - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Steam Equipment-Illegal Zone specified", state.dataHeatBal->ZoneSteamEq(Loop).Name); - continue; - } + print(state.files.eio, + Format_722, + "SteamEquipment", + state.dataHeatBal->ZoneSteamEq(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected); + print(state.files.eio, "{},", state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneSteamEq(Loop).NomMaxDesignLevel); + } + for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { + if (Loop == 1) { print(state.files.eio, - Format_722, - "SteamEquipment", - state.dataHeatBal->ZoneSteamEq(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected); - print(state.files.eio, "{},", state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneSteamEq(Loop).NomMaxDesignLevel); + Format_723, + "OtherEquipment", + "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " + "Lost,Fraction Convected,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); } - for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "OtherEquipment", - "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction " - "Lost,Fraction Convected,Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}\n"); - } + ZoneNum = state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr; - ZoneNum = state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr; + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "Other Equipment-Illegal Zone specified", state.dataHeatBal->ZoneOtherEq(Loop).Name); + continue; + } - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "Other Equipment-Illegal Zone specified", state.dataHeatBal->ZoneOtherEq(Loop).Name); - continue; - } + print(state.files.eio, + Format_722, + "OtherEquipment", + state.dataHeatBal->ZoneOtherEq(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLost); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneOtherEq(Loop).NomMaxDesignLevel); + } + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + if (Loop == 1) { print(state.files.eio, - Format_722, - "OtherEquipment", - state.dataHeatBal->ZoneOtherEq(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea); - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLost); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R}\n", state.dataHeatBal->ZoneOtherEq(Loop).NomMaxDesignLevel); + Format_723, + "ElectricEquipment:ITE:AirCooled", + "Equipment Level {W}," + "Equipment/Floor Area {W/m2},Equipment per person {W/person}," + "Fraction Convected,CPU End-Use SubCategory,Fan End-Use SubCategory,UPS End-Use SubCategory," + "Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}, Design Air Volume Flow Rate {m3/s}\n"); } - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "ElectricEquipment:ITE:AirCooled", - "Equipment Level {W}," - "Equipment/Floor Area {W/m2},Equipment per person {W/person}," - "Fraction Convected,CPU End-Use SubCategory,Fan End-Use SubCategory,UPS End-Use SubCategory," - "Nominal Minimum Equipment Level {W},Nominal Maximum Equipment Level {W}, Design Air Volume Flow Rate {m3/s}\n"); - } + ZoneNum = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; - ZoneNum = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; + if (ZoneNum == 0) { + print(state.files.eio, Format_724, "ElectricEquipment:ITE:AirCooled-Illegal Zone specified", state.dataHeatBal->ZoneITEq(Loop).Name); + continue; + } + print(state.files.eio, + Format_722, + "ElectricEquipment:ITE:AirCooled", + state.dataHeatBal->ZoneITEq(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower); + + print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower, state.dataHeatBal->Zone(ZoneNum).FloorArea); + + // ElectricEquipment:ITE:AirCooled is 100% convective + print(state.files.eio, "1.0,"); + + print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU); + print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan); + print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMinDesignLevel); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMaxDesignLevel); + print(state.files.eio, "{:.10R}\n", state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate); + } - if (ZoneNum == 0) { - print(state.files.eio, Format_724, "ElectricEquipment:ITE:AirCooled-Illegal Zone specified", state.dataHeatBal->ZoneITEq(Loop).Name); - continue; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { + if (Loop == 1) { print(state.files.eio, - Format_722, - "ElectricEquipment:ITE:AirCooled", - state.dataHeatBal->ZoneITEq(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower); - - print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower, state.dataHeatBal->Zone(ZoneNum).FloorArea); - - // ElectricEquipment:ITE:AirCooled is 100% convective - print(state.files.eio, "1.0,"); - - print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU); - print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan); - print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMinDesignLevel); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMaxDesignLevel); - print(state.files.eio, "{:.10R}\n", state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate); + Format_723, + "Outdoor Controlled Baseboard Heat", + "Capacity at Low Temperature {W},Low Temperature {C},Capacity at High Temperature " + "{W},High Temperature {C},Fraction Radiant,Fraction Convected,End-Use Subcategory\n"); } - for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { - if (Loop == 1) { - print(state.files.eio, - Format_723, - "Outdoor Controlled Baseboard Heat", - "Capacity at Low Temperature {W},Low Temperature {C},Capacity at High Temperature " - "{W},High Temperature {C},Fraction Radiant,Fraction Convected,End-Use Subcategory\n"); - } + ZoneNum = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; - ZoneNum = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; - - if (ZoneNum == 0) { - print(state.files.eio, - Format_724, - "Outdoor Controlled Baseboard Heat-Illegal Zone specified", - state.dataHeatBal->ZoneBBHeat(Loop).Name); - continue; - } + if (ZoneNum == 0) { print(state.files.eio, - Format_722, - "Outdoor Controlled Baseboard Heat", - state.dataHeatBal->ZoneBBHeat(Loop).Name, - GetScheduleName(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr), - state.dataHeatBal->Zone(ZoneNum).Name, - state.dataHeatBal->Zone(ZoneNum).FloorArea, - state.dataHeatBal->Zone(ZoneNum).TotOccupants); - - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant); - print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected); - print(state.files.eio, "{}\n", state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory); + Format_724, + "Outdoor Controlled Baseboard Heat-Illegal Zone specified", + state.dataHeatBal->ZoneBBHeat(Loop).Name); + continue; } + print(state.files.eio, + Format_722, + "Outdoor Controlled Baseboard Heat", + state.dataHeatBal->ZoneBBHeat(Loop).Name, + GetScheduleName(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr), + state.dataHeatBal->Zone(ZoneNum).Name, + state.dataHeatBal->Zone(ZoneNum).FloorArea, + state.dataHeatBal->Zone(ZoneNum).TotOccupants); + + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant); + print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected); + print(state.files.eio, "{}\n", state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory); } + } - void InitInternalHeatGains(EnergyPlusData &state) - { - - // SUBROUTINE INFORMATION: - // AUTHOR Linda K. Lawrie - // DATE WRITTEN September 1997 - // MODIFIED November 1998, FW: add adjustment to elec lights for dayltg controls - // August 2003, FCW: add optional calculation of light-to-return fraction - // as a function of return plenum air temperature. - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // This subroutine sets up the zone internal heat gains - // that are independent of the zone air temperature. - - // Using/Aliasing - using namespace ScheduleManager; - using DaylightingDevices::FigureTDDZoneGains; - using FuelCellElectricGenerator::FigureFuelCellZoneGains; - using MicroCHPElectricGenerator::FigureMicroCHPZoneGains; - using OutputReportTabular::AllocateLoadComponentArrays; - using Psychrometrics::PsyRhoAirFnPbTdbW; - using RefrigeratedCase::FigureRefrigerationZoneGains; - using WaterThermalTanks::CalcWaterThermalTankZoneGains; - using WaterUse::CalcWaterUseZoneGains; - - // SUBROUTINE PARAMETER DEFINITIONS: - static Array1D const C( - 9, { 6.4611027, 0.946892, 0.0000255737, 7.139322, -0.0627909, 0.0000589271, -0.198550, 0.000940018, -0.00000149532 }); - static ZoneCatEUseData const zeroZoneCatEUse; // For initialization - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 ActivityLevel_WperPerson; // Units on Activity Level (Schedule) - Real64 NumberOccupants; // Number of occupants - int Loop; - Real64 Q; // , QR - Real64 TotalPeopleGain; // Total heat gain from people (intermediate calculational variable) - Real64 SensiblePeopleGain; // Sensible heat gain from people (intermediate calculational variable) - Real64 FractionConvected; // For general lighting, fraction of heat from lights convected to zone air - Real64 FractionReturnAir; // For general lighting, fraction of heat from lights convected to zone's return air - Real64 FractionRadiant; // For general lighting, fraction of heat from lights to zone that is long wave - Real64 ReturnPlenumTemp; // Air temperature of a zone's return air plenum (C) - Real64 pulseMultipler; // use to create a pulse for the load component report computations - - // REAL(r64), ALLOCATABLE, SAVE, DIMENSION(:) :: QSA - - // IF (.NOT. ALLOCATED(QSA)) ALLOCATE(QSA(NumOfZones)) - - // Zero out time step variables - for (auto &e : state.dataHeatBal->ZoneIntGain) { - e.NOFOCC = 0.0; - e.QOCTOT = 0.0; - e.QOCSEN = 0.0; - e.QOCLAT = 0.0; - e.QOCRAD = 0.0; - e.QOCCON = 0.0; - e.QLTSW = 0.0; - e.QLTCRA = 0.0; - e.QLTRAD = 0.0; - e.QLTCON = 0.0; - e.QLTTOT = 0.0; - - e.QEELAT = 0.0; - e.QEERAD = 0.0; - e.QEECON = 0.0; - e.QEELost = 0.0; - e.QGELAT = 0.0; - e.QGERAD = 0.0; - e.QGECON = 0.0; - e.QGELost = 0.0; - e.QBBRAD = 0.0; - e.QBBCON = 0.0; - e.QOELAT = 0.0; - e.QOERAD = 0.0; - e.QOECON = 0.0; - e.QOELost = 0.0; - e.QHWLAT = 0.0; - e.QHWRAD = 0.0; - e.QHWCON = 0.0; - e.QHWLost = 0.0; - e.QSELAT = 0.0; - e.QSERAD = 0.0; - e.QSECON = 0.0; - e.QSELost = 0.0; - } + void InitInternalHeatGains(EnergyPlusData &state) + { - state.dataHeatBal->ZoneIntEEuse = zeroZoneCatEUse; // Set all member arrays to zeros + // SUBROUTINE INFORMATION: + // AUTHOR Linda K. Lawrie + // DATE WRITTEN September 1997 + // MODIFIED November 1998, FW: add adjustment to elec lights for dayltg controls + // August 2003, FCW: add optional calculation of light-to-return fraction + // as a function of return plenum air temperature. + // RE-ENGINEERED na - for (auto &e : state.dataHeatBal->ZnRpt) { - e.LtsPower = 0.0; - e.ElecPower = 0.0; - e.GasPower = 0.0; - e.HWPower = 0.0; - e.SteamPower = 0.0; - e.BaseHeatPower = 0.0; - e.CO2Rate = 0.0; - } + // PURPOSE OF THIS SUBROUTINE: + // This subroutine sets up the zone internal heat gains + // that are independent of the zone air temperature. - for (auto &e : state.dataHeatBal->ZonePreDefRep) { - e.NumOcc = 0.0; - } + // Using/Aliasing + using namespace ScheduleManager; + using DaylightingDevices::FigureTDDZoneGains; + using FuelCellElectricGenerator::FigureFuelCellZoneGains; + using MicroCHPElectricGenerator::FigureMicroCHPZoneGains; + using OutputReportTabular::AllocateLoadComponentArrays; + using Psychrometrics::PsyRhoAirFnPbTdbW; + using RefrigeratedCase::FigureRefrigerationZoneGains; + using WaterThermalTanks::CalcWaterThermalTankZoneGains; + using WaterUse::CalcWaterUseZoneGains; + + // SUBROUTINE PARAMETER DEFINITIONS: + static Array1D const C( + 9, {6.4611027, 0.946892, 0.0000255737, 7.139322, -0.0627909, 0.0000589271, -0.198550, 0.000940018, -0.00000149532}); + static ZoneCatEUseData const zeroZoneCatEUse; // For initialization + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 ActivityLevel_WperPerson; // Units on Activity Level (Schedule) + Real64 NumberOccupants; // Number of occupants + int Loop; + Real64 Q; // , QR + Real64 TotalPeopleGain; // Total heat gain from people (intermediate calculational variable) + Real64 SensiblePeopleGain; // Sensible heat gain from people (intermediate calculational variable) + Real64 FractionConvected; // For general lighting, fraction of heat from lights convected to zone air + Real64 FractionReturnAir; // For general lighting, fraction of heat from lights convected to zone's return air + Real64 FractionRadiant; // For general lighting, fraction of heat from lights to zone that is long wave + Real64 ReturnPlenumTemp; // Air temperature of a zone's return air plenum (C) + Real64 pulseMultipler; // use to create a pulse for the load component report computations + + // REAL(r64), ALLOCATABLE, SAVE, DIMENSION(:) :: QSA + + // IF (.NOT. ALLOCATED(QSA)) ALLOCATE(QSA(NumOfZones)) + + // Zero out time step variables + for (auto &e : state.dataHeatBal->ZoneIntGain) { + e.NOFOCC = 0.0; + e.QOCTOT = 0.0; + e.QOCSEN = 0.0; + e.QOCLAT = 0.0; + e.QOCRAD = 0.0; + e.QOCCON = 0.0; + e.QLTSW = 0.0; + e.QLTCRA = 0.0; + e.QLTRAD = 0.0; + e.QLTCON = 0.0; + e.QLTTOT = 0.0; + + e.QEELAT = 0.0; + e.QEERAD = 0.0; + e.QEECON = 0.0; + e.QEELost = 0.0; + e.QGELAT = 0.0; + e.QGERAD = 0.0; + e.QGECON = 0.0; + e.QGELost = 0.0; + e.QBBRAD = 0.0; + e.QBBCON = 0.0; + e.QOELAT = 0.0; + e.QOERAD = 0.0; + e.QOECON = 0.0; + e.QOELost = 0.0; + e.QHWLAT = 0.0; + e.QHWRAD = 0.0; + e.QHWCON = 0.0; + e.QHWLost = 0.0; + e.QSELAT = 0.0; + e.QSERAD = 0.0; + e.QSECON = 0.0; + e.QSELost = 0.0; + } - // QSA = 0.0 - - // Process Internal Heat Gains, People done below - // Occupant Stuff - // METHOD: - // The function is based on a curve fit to data presented in - // Table 48 'Heat Gain From People' of Chapter 1 of the 'Carrier - // Handbook of Air Conditioning System Design', 1965. Values of - // Sensible gain were obtained from the table at average adjusted - // metabolic rates 350, 400, 450, 500, 750, 850, 1000, and - // 1450 Btu/hr each at temperatures 82, 80, 78, 75, and 70F. - // Sensible gains of 0.0 at 96F and equal to the metabolic rate - // at 30F were assumed in order to give reasonable values beyond - // The reported temperature range. - for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { - int NZ = state.dataHeatBal->People(Loop).ZonePtr; - NumberOccupants = - state.dataHeatBal->People(Loop).NumberOfPeople * GetCurrentScheduleValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); - if (state.dataHeatBal->People(Loop).EMSPeopleOn) NumberOccupants = state.dataHeatBal->People(Loop).EMSNumberOfPeople; - - TotalPeopleGain = 0.0; - SensiblePeopleGain = 0.0; - - if (NumberOccupants > 0.0) { - ActivityLevel_WperPerson = GetCurrentScheduleValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); - TotalPeopleGain = NumberOccupants * ActivityLevel_WperPerson; - // if the user did not specify a sensible fraction, calculate the sensible heat gain - if (state.dataHeatBal->People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate) { - if (!(state.dataRoomAirMod->IsZoneDV(NZ) || state.dataRoomAirMod->IsZoneUI(NZ))) { - SensiblePeopleGain = - NumberOccupants * - (C(1) + ActivityLevel_WperPerson * (C(2) + ActivityLevel_WperPerson * C(3)) + - state.dataHeatBalFanSys->MAT(NZ) * - ((C(4) + ActivityLevel_WperPerson * (C(5) + ActivityLevel_WperPerson * C(6))) + - state.dataHeatBalFanSys->MAT(NZ) * (C(7) + ActivityLevel_WperPerson * (C(8) + ActivityLevel_WperPerson * C(9))))); - } - else { // UCSD - DV or UI - SensiblePeopleGain = - NumberOccupants * - (C(1) + ActivityLevel_WperPerson * (C(2) + ActivityLevel_WperPerson * C(3)) + - state.dataRoomAirMod->TCMF(NZ) * - ((C(4) + ActivityLevel_WperPerson * (C(5) + ActivityLevel_WperPerson * C(6))) + - state.dataRoomAirMod->TCMF(NZ) * (C(7) + ActivityLevel_WperPerson * (C(8) + ActivityLevel_WperPerson * C(9))))); - } - } - else { // if the user did specify a sensible fraction, use it - SensiblePeopleGain = TotalPeopleGain * state.dataHeatBal->People(Loop).UserSpecSensFrac; - } + state.dataHeatBal->ZoneIntEEuse = zeroZoneCatEUse; // Set all member arrays to zeros + + for (auto &e : state.dataHeatBal->ZnRpt) { + e.LtsPower = 0.0; + e.ElecPower = 0.0; + e.GasPower = 0.0; + e.HWPower = 0.0; + e.SteamPower = 0.0; + e.BaseHeatPower = 0.0; + e.CO2Rate = 0.0; + } - if (SensiblePeopleGain > TotalPeopleGain) SensiblePeopleGain = TotalPeopleGain; - if (SensiblePeopleGain < 0.0) SensiblePeopleGain = 0.0; + for (auto &e : state.dataHeatBal->ZonePreDefRep) { + e.NumOcc = 0.0; + } - // For predefined tabular reports related to outside air ventilation - state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = true; // set flag to occupied to be used in tabular reporting for ventilation - state.dataHeatBal->ZonePreDefRep(NZ).NumOcc += NumberOccupants; - state.dataHeatBal->ZonePreDefRep(NZ).NumOccAccum += NumberOccupants * state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZonePreDefRep(NZ).NumOccAccumTime += state.dataGlobal->TimeStepZone; - } - else { - state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = false; // set flag to occupied to be used in tabular reporting for ventilation + // QSA = 0.0 + + // Process Internal Heat Gains, People done below + // Occupant Stuff + // METHOD: + // The function is based on a curve fit to data presented in + // Table 48 'Heat Gain From People' of Chapter 1 of the 'Carrier + // Handbook of Air Conditioning System Design', 1965. Values of + // Sensible gain were obtained from the table at average adjusted + // metabolic rates 350, 400, 450, 500, 750, 850, 1000, and + // 1450 Btu/hr each at temperatures 82, 80, 78, 75, and 70F. + // Sensible gains of 0.0 at 96F and equal to the metabolic rate + // at 30F were assumed in order to give reasonable values beyond + // The reported temperature range. + for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { + int NZ = state.dataHeatBal->People(Loop).ZonePtr; + NumberOccupants = + state.dataHeatBal->People(Loop).NumberOfPeople * GetCurrentScheduleValue(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr); + if (state.dataHeatBal->People(Loop).EMSPeopleOn) NumberOccupants = state.dataHeatBal->People(Loop).EMSNumberOfPeople; + + TotalPeopleGain = 0.0; + SensiblePeopleGain = 0.0; + + if (NumberOccupants > 0.0) { + ActivityLevel_WperPerson = GetCurrentScheduleValue(state, state.dataHeatBal->People(Loop).ActivityLevelPtr); + TotalPeopleGain = NumberOccupants * ActivityLevel_WperPerson; + // if the user did not specify a sensible fraction, calculate the sensible heat gain + if (state.dataHeatBal->People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate) { + if (!(state.dataRoomAirMod->IsZoneDV(NZ) || state.dataRoomAirMod->IsZoneUI(NZ))) { + SensiblePeopleGain = + NumberOccupants * + (C(1) + ActivityLevel_WperPerson * (C(2) + ActivityLevel_WperPerson * C(3)) + + state.dataHeatBalFanSys->MAT(NZ) * + ((C(4) + ActivityLevel_WperPerson * (C(5) + ActivityLevel_WperPerson * C(6))) + + state.dataHeatBalFanSys->MAT(NZ) * (C(7) + ActivityLevel_WperPerson * (C(8) + ActivityLevel_WperPerson * C(9))))); + } else { // UCSD - DV or UI + SensiblePeopleGain = + NumberOccupants * + (C(1) + ActivityLevel_WperPerson * (C(2) + ActivityLevel_WperPerson * C(3)) + + state.dataRoomAirMod->TCMF(NZ) * + ((C(4) + ActivityLevel_WperPerson * (C(5) + ActivityLevel_WperPerson * C(6))) + + state.dataRoomAirMod->TCMF(NZ) * (C(7) + ActivityLevel_WperPerson * (C(8) + ActivityLevel_WperPerson * C(9))))); + } + } else { // if the user did specify a sensible fraction, use it + SensiblePeopleGain = TotalPeopleGain * state.dataHeatBal->People(Loop).UserSpecSensFrac; } - state.dataHeatBal->People(Loop).NumOcc = NumberOccupants; - state.dataHeatBal->People(Loop).RadGainRate = SensiblePeopleGain * state.dataHeatBal->People(Loop).FractionRadiant; - state.dataHeatBal->People(Loop).ConGainRate = SensiblePeopleGain * state.dataHeatBal->People(Loop).FractionConvected; - state.dataHeatBal->People(Loop).SenGainRate = SensiblePeopleGain; - state.dataHeatBal->People(Loop).LatGainRate = TotalPeopleGain - SensiblePeopleGain; - state.dataHeatBal->People(Loop).TotGainRate = TotalPeopleGain; - state.dataHeatBal->People(Loop).CO2GainRate = TotalPeopleGain * state.dataHeatBal->People(Loop).CO2RateFactor; - - state.dataHeatBal->ZoneIntGain(NZ).NOFOCC += state.dataHeatBal->People(Loop).NumOcc; - state.dataHeatBal->ZoneIntGain(NZ).QOCRAD += state.dataHeatBal->People(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOCCON += state.dataHeatBal->People(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOCSEN += state.dataHeatBal->People(Loop).SenGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOCLAT += state.dataHeatBal->People(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOCTOT += state.dataHeatBal->People(Loop).TotGainRate; + if (SensiblePeopleGain > TotalPeopleGain) SensiblePeopleGain = TotalPeopleGain; + if (SensiblePeopleGain < 0.0) SensiblePeopleGain = 0.0; + + // For predefined tabular reports related to outside air ventilation + state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = true; // set flag to occupied to be used in tabular reporting for ventilation + state.dataHeatBal->ZonePreDefRep(NZ).NumOcc += NumberOccupants; + state.dataHeatBal->ZonePreDefRep(NZ).NumOccAccum += NumberOccupants * state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZonePreDefRep(NZ).NumOccAccumTime += state.dataGlobal->TimeStepZone; + } else { + state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = false; // set flag to occupied to be used in tabular reporting for ventilation } - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - int NZ = state.dataHeatBal->Lights(Loop).ZonePtr; - Q = state.dataHeatBal->Lights(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); + state.dataHeatBal->People(Loop).NumOcc = NumberOccupants; + state.dataHeatBal->People(Loop).RadGainRate = SensiblePeopleGain * state.dataHeatBal->People(Loop).FractionRadiant; + state.dataHeatBal->People(Loop).ConGainRate = SensiblePeopleGain * state.dataHeatBal->People(Loop).FractionConvected; + state.dataHeatBal->People(Loop).SenGainRate = SensiblePeopleGain; + state.dataHeatBal->People(Loop).LatGainRate = TotalPeopleGain - SensiblePeopleGain; + state.dataHeatBal->People(Loop).TotGainRate = TotalPeopleGain; + state.dataHeatBal->People(Loop).CO2GainRate = TotalPeopleGain * state.dataHeatBal->People(Loop).CO2RateFactor; + + state.dataHeatBal->ZoneIntGain(NZ).NOFOCC += state.dataHeatBal->People(Loop).NumOcc; + state.dataHeatBal->ZoneIntGain(NZ).QOCRAD += state.dataHeatBal->People(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOCCON += state.dataHeatBal->People(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOCSEN += state.dataHeatBal->People(Loop).SenGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOCLAT += state.dataHeatBal->People(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOCTOT += state.dataHeatBal->People(Loop).TotGainRate; + } - if (state.dataDaylightingData->ZoneDaylight(NZ).DaylightMethod == DataDaylighting::iDaylightingMethod::SplitFluxDaylighting || - state.dataDaylightingData->ZoneDaylight(NZ).DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) { + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + int NZ = state.dataHeatBal->Lights(Loop).ZonePtr; + Q = state.dataHeatBal->Lights(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->Lights(Loop).SchedPtr); - if (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0) { // FractionReplaceable can only be 0 or 1 for these models - Q *= state.dataDaylightingData->ZoneDaylight(NZ).ZonePowerReductionFactor; - } + if (state.dataDaylightingData->ZoneDaylight(NZ).DaylightMethod == DataDaylighting::iDaylightingMethod::SplitFluxDaylighting || + state.dataDaylightingData->ZoneDaylight(NZ).DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) { + + if (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0) { // FractionReplaceable can only be 0 or 1 for these models + Q *= state.dataDaylightingData->ZoneDaylight(NZ).ZonePowerReductionFactor; } + } - // Reduce lighting power due to demand limiting - if (state.dataHeatBal->Lights(Loop).ManageDemand && (Q > state.dataHeatBal->Lights(Loop).DemandLimit)) - Q = state.dataHeatBal->Lights(Loop).DemandLimit; - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->Lights(Loop).EMSLightsOn) Q = state.dataHeatBal->Lights(Loop).EMSLightingPower; - - FractionConvected = state.dataHeatBal->Lights(Loop).FractionConvected; - FractionReturnAir = state.dataHeatBal->Lights(Loop).FractionReturnAir; - FractionRadiant = state.dataHeatBal->Lights(Loop).FractionRadiant; - if (state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated && !state.dataGlobal->ZoneSizingCalc && - state.dataGlobal->SimTimeSteps > 1) { - // Calculate FractionReturnAir based on conditions in the zone's return air plenum, if there is one. - if (state.dataHeatBal->Zone(NZ).IsControlled) { - int retNum = state.dataHeatBal->Lights(Loop).ZoneReturnNum; - int ReturnZonePlenumCondNum = state.dataZoneEquip->ZoneEquipConfig(NZ).ReturnNodePlenumNum(retNum); - if (ReturnZonePlenumCondNum > 0) { - ReturnPlenumTemp = state.dataZonePlenum->ZoneRetPlenCond(ReturnZonePlenumCondNum).ZoneTemp; - FractionReturnAir = state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff1 - - state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff2 * ReturnPlenumTemp; - FractionReturnAir = max(0.0, min(1.0, FractionReturnAir)); - if (FractionReturnAir >= (1.0 - state.dataHeatBal->Lights(Loop).FractionShortWave)) { - FractionReturnAir = 1.0 - state.dataHeatBal->Lights(Loop).FractionShortWave; - FractionRadiant = 0.0; - FractionConvected = 0.0; - } - else { - FractionRadiant = - ((1.0 - FractionReturnAir - state.dataHeatBal->Lights(Loop).FractionShortWave) / - (state.dataHeatBal->Lights(Loop).FractionRadiant + state.dataHeatBal->Lights(Loop).FractionConvected)) * - state.dataHeatBal->Lights(Loop).FractionRadiant; - FractionConvected = 1.0 - (FractionReturnAir + FractionRadiant + state.dataHeatBal->Lights(Loop).FractionShortWave); - } + // Reduce lighting power due to demand limiting + if (state.dataHeatBal->Lights(Loop).ManageDemand && (Q > state.dataHeatBal->Lights(Loop).DemandLimit)) + Q = state.dataHeatBal->Lights(Loop).DemandLimit; + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->Lights(Loop).EMSLightsOn) Q = state.dataHeatBal->Lights(Loop).EMSLightingPower; + + FractionConvected = state.dataHeatBal->Lights(Loop).FractionConvected; + FractionReturnAir = state.dataHeatBal->Lights(Loop).FractionReturnAir; + FractionRadiant = state.dataHeatBal->Lights(Loop).FractionRadiant; + if (state.dataHeatBal->Lights(Loop).FractionReturnAirIsCalculated && !state.dataGlobal->ZoneSizingCalc && + state.dataGlobal->SimTimeSteps > 1) { + // Calculate FractionReturnAir based on conditions in the zone's return air plenum, if there is one. + if (state.dataHeatBal->Zone(NZ).IsControlled) { + int retNum = state.dataHeatBal->Lights(Loop).ZoneReturnNum; + int ReturnZonePlenumCondNum = state.dataZoneEquip->ZoneEquipConfig(NZ).ReturnNodePlenumNum(retNum); + if (ReturnZonePlenumCondNum > 0) { + ReturnPlenumTemp = state.dataZonePlenum->ZoneRetPlenCond(ReturnZonePlenumCondNum).ZoneTemp; + FractionReturnAir = state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff1 - + state.dataHeatBal->Lights(Loop).FractionReturnAirPlenTempCoeff2 * ReturnPlenumTemp; + FractionReturnAir = max(0.0, min(1.0, FractionReturnAir)); + if (FractionReturnAir >= (1.0 - state.dataHeatBal->Lights(Loop).FractionShortWave)) { + FractionReturnAir = 1.0 - state.dataHeatBal->Lights(Loop).FractionShortWave; + FractionRadiant = 0.0; + FractionConvected = 0.0; + } else { + FractionRadiant = + ((1.0 - FractionReturnAir - state.dataHeatBal->Lights(Loop).FractionShortWave) / + (state.dataHeatBal->Lights(Loop).FractionRadiant + state.dataHeatBal->Lights(Loop).FractionConvected)) * + state.dataHeatBal->Lights(Loop).FractionRadiant; + FractionConvected = 1.0 - (FractionReturnAir + FractionRadiant + state.dataHeatBal->Lights(Loop).FractionShortWave); } } } - - state.dataHeatBal->Lights(Loop).Power = Q; - state.dataHeatBal->Lights(Loop).RadGainRate = Q * FractionRadiant; - state.dataHeatBal->Lights(Loop).VisGainRate = Q * state.dataHeatBal->Lights(Loop).FractionShortWave; - state.dataHeatBal->Lights(Loop).ConGainRate = Q * FractionConvected; - state.dataHeatBal->Lights(Loop).RetAirGainRate = Q * FractionReturnAir; - state.dataHeatBal->Lights(Loop).TotGainRate = Q; - - state.dataHeatBal->ZnRpt(NZ).LtsPower += state.dataHeatBal->Lights(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QLTRAD += state.dataHeatBal->Lights(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QLTSW += state.dataHeatBal->Lights(Loop).VisGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QLTCON += state.dataHeatBal->Lights(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QLTCRA += state.dataHeatBal->Lights(Loop).RetAirGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QLTTOT += state.dataHeatBal->Lights(Loop).TotGainRate; } - for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { - Q = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); - - // Reduce equipment power due to demand limiting - if (state.dataHeatBal->ZoneElectric(Loop).ManageDemand && (Q > state.dataHeatBal->ZoneElectric(Loop).DemandLimit)) - Q = state.dataHeatBal->ZoneElectric(Loop).DemandLimit; - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneElectric(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneElectric(Loop).EMSEquipPower; - - state.dataHeatBal->ZoneElectric(Loop).Power = Q; - state.dataHeatBal->ZoneElectric(Loop).RadGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionRadiant; - state.dataHeatBal->ZoneElectric(Loop).ConGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionConvected; - state.dataHeatBal->ZoneElectric(Loop).LatGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionLatent; - state.dataHeatBal->ZoneElectric(Loop).LostRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionLost; - state.dataHeatBal->ZoneElectric(Loop).TotGainRate = Q - state.dataHeatBal->ZoneElectric(Loop).LostRate; - - int NZ = state.dataHeatBal->ZoneElectric(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).ElecPower += state.dataHeatBal->ZoneElectric(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QEERAD += state.dataHeatBal->ZoneElectric(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QEECON += state.dataHeatBal->ZoneElectric(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QEELAT += state.dataHeatBal->ZoneElectric(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QEELost += state.dataHeatBal->ZoneElectric(Loop).LostRate; - } + state.dataHeatBal->Lights(Loop).Power = Q; + state.dataHeatBal->Lights(Loop).RadGainRate = Q * FractionRadiant; + state.dataHeatBal->Lights(Loop).VisGainRate = Q * state.dataHeatBal->Lights(Loop).FractionShortWave; + state.dataHeatBal->Lights(Loop).ConGainRate = Q * FractionConvected; + state.dataHeatBal->Lights(Loop).RetAirGainRate = Q * FractionReturnAir; + state.dataHeatBal->Lights(Loop).TotGainRate = Q; + + state.dataHeatBal->ZnRpt(NZ).LtsPower += state.dataHeatBal->Lights(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QLTRAD += state.dataHeatBal->Lights(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QLTSW += state.dataHeatBal->Lights(Loop).VisGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QLTCON += state.dataHeatBal->Lights(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QLTCRA += state.dataHeatBal->Lights(Loop).RetAirGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QLTTOT += state.dataHeatBal->Lights(Loop).TotGainRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { - Q = state.dataHeatBal->ZoneGas(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneGas(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneGas(Loop).EMSEquipPower; - - state.dataHeatBal->ZoneGas(Loop).Power = Q; - state.dataHeatBal->ZoneGas(Loop).RadGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionRadiant; - state.dataHeatBal->ZoneGas(Loop).ConGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionConvected; - state.dataHeatBal->ZoneGas(Loop).LatGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionLatent; - state.dataHeatBal->ZoneGas(Loop).LostRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionLost; - state.dataHeatBal->ZoneGas(Loop).TotGainRate = Q - state.dataHeatBal->ZoneGas(Loop).LostRate; - state.dataHeatBal->ZoneGas(Loop).CO2GainRate = Q * state.dataHeatBal->ZoneGas(Loop).CO2RateFactor; - - int NZ = state.dataHeatBal->ZoneGas(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).GasPower += state.dataHeatBal->ZoneGas(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QGERAD += state.dataHeatBal->ZoneGas(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QGECON += state.dataHeatBal->ZoneGas(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QGELAT += state.dataHeatBal->ZoneGas(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QGELost += state.dataHeatBal->ZoneGas(Loop).LostRate; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { + Q = state.dataHeatBal->ZoneElectric(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr); + + // Reduce equipment power due to demand limiting + if (state.dataHeatBal->ZoneElectric(Loop).ManageDemand && (Q > state.dataHeatBal->ZoneElectric(Loop).DemandLimit)) + Q = state.dataHeatBal->ZoneElectric(Loop).DemandLimit; + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneElectric(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneElectric(Loop).EMSEquipPower; + + state.dataHeatBal->ZoneElectric(Loop).Power = Q; + state.dataHeatBal->ZoneElectric(Loop).RadGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionRadiant; + state.dataHeatBal->ZoneElectric(Loop).ConGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionConvected; + state.dataHeatBal->ZoneElectric(Loop).LatGainRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionLatent; + state.dataHeatBal->ZoneElectric(Loop).LostRate = Q * state.dataHeatBal->ZoneElectric(Loop).FractionLost; + state.dataHeatBal->ZoneElectric(Loop).TotGainRate = Q - state.dataHeatBal->ZoneElectric(Loop).LostRate; + + int NZ = state.dataHeatBal->ZoneElectric(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).ElecPower += state.dataHeatBal->ZoneElectric(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QEERAD += state.dataHeatBal->ZoneElectric(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QEECON += state.dataHeatBal->ZoneElectric(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QEELAT += state.dataHeatBal->ZoneElectric(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QEELost += state.dataHeatBal->ZoneElectric(Loop).LostRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { - Q = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); + for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { + Q = state.dataHeatBal->ZoneGas(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr); + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneGas(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneGas(Loop).EMSEquipPower; + + state.dataHeatBal->ZoneGas(Loop).Power = Q; + state.dataHeatBal->ZoneGas(Loop).RadGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionRadiant; + state.dataHeatBal->ZoneGas(Loop).ConGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionConvected; + state.dataHeatBal->ZoneGas(Loop).LatGainRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionLatent; + state.dataHeatBal->ZoneGas(Loop).LostRate = Q * state.dataHeatBal->ZoneGas(Loop).FractionLost; + state.dataHeatBal->ZoneGas(Loop).TotGainRate = Q - state.dataHeatBal->ZoneGas(Loop).LostRate; + state.dataHeatBal->ZoneGas(Loop).CO2GainRate = Q * state.dataHeatBal->ZoneGas(Loop).CO2RateFactor; + + int NZ = state.dataHeatBal->ZoneGas(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).GasPower += state.dataHeatBal->ZoneGas(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QGERAD += state.dataHeatBal->ZoneGas(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QGECON += state.dataHeatBal->ZoneGas(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QGELAT += state.dataHeatBal->ZoneGas(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QGELost += state.dataHeatBal->ZoneGas(Loop).LostRate; + } - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneOtherEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneOtherEq(Loop).EMSEquipPower; + for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { + Q = state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr); - state.dataHeatBal->ZoneOtherEq(Loop).Power = Q; - state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant; - state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected; - state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent; - state.dataHeatBal->ZoneOtherEq(Loop).LostRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionLost; - state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneOtherEq(Loop).LostRate; + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneOtherEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneOtherEq(Loop).EMSEquipPower; - int NZ = state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr; - state.dataHeatBal->ZoneIntGain(NZ).QOERAD += state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOECON += state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOELAT += state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QOELost += state.dataHeatBal->ZoneOtherEq(Loop).LostRate; - } + state.dataHeatBal->ZoneOtherEq(Loop).Power = Q; + state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant; + state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected; + state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent; + state.dataHeatBal->ZoneOtherEq(Loop).LostRate = Q * state.dataHeatBal->ZoneOtherEq(Loop).FractionLost; + state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneOtherEq(Loop).LostRate; - for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { - Q = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneHWEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneHWEq(Loop).EMSEquipPower; - - state.dataHeatBal->ZoneHWEq(Loop).Power = Q; - state.dataHeatBal->ZoneHWEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant; - state.dataHeatBal->ZoneHWEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionConvected; - state.dataHeatBal->ZoneHWEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionLatent; - state.dataHeatBal->ZoneHWEq(Loop).LostRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionLost; - state.dataHeatBal->ZoneHWEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneHWEq(Loop).LostRate; - - int NZ = state.dataHeatBal->ZoneHWEq(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).HWPower += state.dataHeatBal->ZoneHWEq(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QHWRAD += state.dataHeatBal->ZoneHWEq(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QHWCON += state.dataHeatBal->ZoneHWEq(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QHWLAT += state.dataHeatBal->ZoneHWEq(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QHWLost += state.dataHeatBal->ZoneHWEq(Loop).LostRate; - } + int NZ = state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr; + state.dataHeatBal->ZoneIntGain(NZ).QOERAD += state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOECON += state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOELAT += state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QOELost += state.dataHeatBal->ZoneOtherEq(Loop).LostRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { - Q = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); - - // Set Q to EMS override if being called for by EMs - if (state.dataHeatBal->ZoneSteamEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneSteamEq(Loop).EMSEquipPower; - - state.dataHeatBal->ZoneSteamEq(Loop).Power = Q; - state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant; - state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected; - state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent; - state.dataHeatBal->ZoneSteamEq(Loop).LostRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionLost; - state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneSteamEq(Loop).LostRate; - - int NZ = state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).SteamPower += state.dataHeatBal->ZoneSteamEq(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QSERAD += state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QSECON += state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QSELAT += state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QSELost += state.dataHeatBal->ZoneSteamEq(Loop).LostRate; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { + Q = state.dataHeatBal->ZoneHWEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr); + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneHWEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneHWEq(Loop).EMSEquipPower; + + state.dataHeatBal->ZoneHWEq(Loop).Power = Q; + state.dataHeatBal->ZoneHWEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant; + state.dataHeatBal->ZoneHWEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionConvected; + state.dataHeatBal->ZoneHWEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionLatent; + state.dataHeatBal->ZoneHWEq(Loop).LostRate = Q * state.dataHeatBal->ZoneHWEq(Loop).FractionLost; + state.dataHeatBal->ZoneHWEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneHWEq(Loop).LostRate; + + int NZ = state.dataHeatBal->ZoneHWEq(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).HWPower += state.dataHeatBal->ZoneHWEq(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QHWRAD += state.dataHeatBal->ZoneHWEq(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QHWCON += state.dataHeatBal->ZoneHWEq(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QHWLAT += state.dataHeatBal->ZoneHWEq(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QHWLost += state.dataHeatBal->ZoneHWEq(Loop).LostRate; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { - int NZ = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; - if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp >= state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature) { - Q = 0.0; - } - else if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp > state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) { - Q = (state.dataHeatBal->Zone(NZ).OutDryBulbTemp - state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) * + for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { + Q = state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr); + + // Set Q to EMS override if being called for by EMs + if (state.dataHeatBal->ZoneSteamEq(Loop).EMSZoneEquipOverrideOn) Q = state.dataHeatBal->ZoneSteamEq(Loop).EMSEquipPower; + + state.dataHeatBal->ZoneSteamEq(Loop).Power = Q; + state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant; + state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected; + state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent; + state.dataHeatBal->ZoneSteamEq(Loop).LostRate = Q * state.dataHeatBal->ZoneSteamEq(Loop).FractionLost; + state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate = Q - state.dataHeatBal->ZoneSteamEq(Loop).LostRate; + + int NZ = state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).SteamPower += state.dataHeatBal->ZoneSteamEq(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QSERAD += state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QSECON += state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QSELAT += state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QSELost += state.dataHeatBal->ZoneSteamEq(Loop).LostRate; + } + + for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { + int NZ = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; + if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp >= state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature) { + Q = 0.0; + } else if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp > state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) { + Q = (state.dataHeatBal->Zone(NZ).OutDryBulbTemp - state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) * (state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature - state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature) / (state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature - state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature) + - state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature; - } - else { - Q = state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature; - } - Q *= GetCurrentScheduleValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); - - // set with EMS value if being called for. - if (state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardOverrideOn) Q = state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardPower; - - state.dataHeatBal->ZoneBBHeat(Loop).Power = Q; - state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate = Q * state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant; - state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate = Q * state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected; - state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate = Q; - - NZ = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; - state.dataHeatBal->ZnRpt(NZ).BaseHeatPower += state.dataHeatBal->ZoneBBHeat(Loop).Power; - state.dataHeatBal->ZoneIntGain(NZ).QBBRAD += state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate; - state.dataHeatBal->ZoneIntGain(NZ).QBBCON += state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate; + state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature; + } else { + Q = state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature; } + Q *= GetCurrentScheduleValue(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr); - for (Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) { - int NZ = state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr; - state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate = - state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); - state.dataHeatBal->ZnRpt(NZ).CO2Rate += state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate; - } + // set with EMS value if being called for. + if (state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardOverrideOn) Q = state.dataHeatBal->ZoneBBHeat(Loop).EMSZoneBaseboardPower; - if (state.dataHeatBal->NumZoneITEqStatements > 0) CalcZoneITEq(state); + state.dataHeatBal->ZoneBBHeat(Loop).Power = Q; + state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate = Q * state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant; + state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate = Q * state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected; + state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate = Q; - CalcWaterThermalTankZoneGains(state); - PipeHeatTransfer::PipeHTData::CalcZonePipesHeatGain(state); - CalcWaterUseZoneGains(state); - FigureFuelCellZoneGains(state); - FigureMicroCHPZoneGains(state); - initializeElectricPowerServiceZoneGains(state); - FigureTDDZoneGains(state); - FigureRefrigerationZoneGains(state); + NZ = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr; + state.dataHeatBal->ZnRpt(NZ).BaseHeatPower += state.dataHeatBal->ZoneBBHeat(Loop).Power; + state.dataHeatBal->ZoneIntGain(NZ).QBBRAD += state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate; + state.dataHeatBal->ZoneIntGain(NZ).QBBCON += state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate; + } - // store pointer values to hold generic internal gain values constant for entire timestep - UpdateInternalGainValues(state); + for (Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) { + int NZ = state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr; + state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate = + state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr); + state.dataHeatBal->ZnRpt(NZ).CO2Rate += state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate; + } - for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { + if (state.dataHeatBal->NumZoneITEqStatements > 0) CalcZoneITEq(state); - SumAllInternalLatentGains(state, NZ, state.dataHeatBalFanSys->ZoneLatentGain(NZ)); - // Added for hybrid model - if (state.dataHybridModel->FlagHybridModel_PC) { - SumAllInternalLatentGainsExceptPeople(state, NZ, state.dataHeatBalFanSys->ZoneLatentGainExceptPeople(NZ)); - } - } + CalcWaterThermalTankZoneGains(state); + PipeHeatTransfer::PipeHTData::CalcZonePipesHeatGain(state); + CalcWaterUseZoneGains(state); + FigureFuelCellZoneGains(state); + FigureMicroCHPZoneGains(state); + initializeElectricPowerServiceZoneGains(state); + FigureTDDZoneGains(state); + FigureRefrigerationZoneGains(state); - // QL is per radiant enclosure (one or more zones if grouped by air boundaries) - for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++enclosureNum) { - auto &thisEnclosure(state.dataViewFactor->ZoneRadiantInfo(enclosureNum)); - state.dataHeatBal->QL(enclosureNum) = 0.0; - for (int const zoneNum : thisEnclosure.ZoneNums) { - Real64 zoneQL; - SumAllInternalRadiationGains(state, zoneNum, zoneQL); - state.dataHeatBal->QL(enclosureNum) += zoneQL; - } - } + // store pointer values to hold generic internal gain values constant for entire timestep + UpdateInternalGainValues(state); - state.dataHeatBalFanSys->SumConvHTRadSys = 0.0; + for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { - pulseMultipler = 0.01; // the W/sqft pulse for the zone - if (state.dataGlobal->CompLoadReportIsReq) { - AllocateLoadComponentArrays(state); - } - for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { // Loop through all surfaces... - int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; - int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; - if (firstSurf <= 0) continue; - for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { - int const radEnclosureNum = state.dataHeatBal->Zone(zoneNum).RadiantEnclosureNum; - if (!state.dataGlobal->doLoadComponentPulseNow) { - state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = - state.dataHeatBal->QL(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); - } - else { - state.dataInternalHeatGains->curQL = state.dataHeatBal->QL(radEnclosureNum); - // for the loads component report during the special sizing run increase the radiant portion - // a small amount to create a "pulse" of heat that is used for the delayed loads - state.dataInternalHeatGains->adjQL = - state.dataInternalHeatGains->curQL + state.dataViewFactor->ZoneRadiantInfo(radEnclosureNum).FloorArea * pulseMultipler; - // ITABSF is the Inside Thermal Absorptance - // TMULT is a multiplier for each zone - // QRadThermInAbs is the thermal radiation absorbed on inside surfaces - state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = - state.dataInternalHeatGains->adjQL * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); - // store the magnitude and time of the pulse - state.dataOutRptTab->radiantPulseTimestep(state.dataSize->CurOverallSimDay, zoneNum) = - (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - state.dataOutRptTab->radiantPulseReceived(state.dataSize->CurOverallSimDay, SurfNum) = - (state.dataInternalHeatGains->adjQL - state.dataInternalHeatGains->curQL) * state.dataHeatBal->TMULT(radEnclosureNum) * - state.dataHeatBal->ITABSF(SurfNum) * state.dataSurface->Surface(SurfNum).Area; - } - } + SumAllInternalLatentGains(state, NZ, state.dataHeatBalFanSys->ZoneLatentGain(NZ)); + // Added for hybrid model + if (state.dataHybridModel->FlagHybridModel_PC) { + SumAllInternalLatentGainsExceptPeople(state, NZ, state.dataHeatBalFanSys->ZoneLatentGainExceptPeople(NZ)); } } - void CheckReturnAirHeatGain(EnergyPlusData &state) - { - // SUBROUTINE INFORMATION: - // AUTHOR Xuan Luo - // DATE WRITTEN Jan 2018 - - // PURPOSE OF THIS SUBROUTINE: - // This subroutine currently creates the values for standard "zone loads" reporting - // from the heat balance module. + // QL is per radiant enclosure (one or more zones if grouped by air boundaries) + for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++enclosureNum) { + auto &thisEnclosure(state.dataViewFactor->ZoneRadiantInfo(enclosureNum)); + state.dataHeatBal->QL(enclosureNum) = 0.0; + for (int const zoneNum : thisEnclosure.ZoneNums) { + Real64 zoneQL; + SumAllInternalRadiationGains(state, zoneNum, zoneQL); + state.dataHeatBal->QL(enclosureNum) += zoneQL; + } + } - // Using/Aliasing + state.dataHeatBalFanSys->SumConvHTRadSys = 0.0; - for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasLtsRetAirGain) { - ShowFatalError(state, - "Return air heat gains from lights are not allowed when Air Flow Calculation Method = " - "FlowControlWithApproachTemperatures in zones with ITE objects."); - } - if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasAirFlowWindowReturn) { - ShowFatalError(state, - "Return air heat gains from windows are not allowed when Air Flow Calculation Method = " - "FlowControlWithApproachTemperatures in zones with ITE objects."); + pulseMultipler = 0.01; // the W/sqft pulse for the zone + if (state.dataGlobal->CompLoadReportIsReq) { + AllocateLoadComponentArrays(state); + } + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { // Loop through all surfaces... + int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; + int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; + if (firstSurf <= 0) continue; + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + int const radEnclosureNum = state.dataHeatBal->Zone(zoneNum).RadiantEnclosureNum; + if (!state.dataGlobal->doLoadComponentPulseNow) { + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = + state.dataHeatBal->QL(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); + } else { + state.dataInternalHeatGains->curQL = state.dataHeatBal->QL(radEnclosureNum); + // for the loads component report during the special sizing run increase the radiant portion + // a small amount to create a "pulse" of heat that is used for the delayed loads + state.dataInternalHeatGains->adjQL = + state.dataInternalHeatGains->curQL + state.dataViewFactor->ZoneRadiantInfo(radEnclosureNum).FloorArea * pulseMultipler; + // ITABSF is the Inside Thermal Absorptance + // TMULT is a multiplier for each zone + // QRadThermInAbs is the thermal radiation absorbed on inside surfaces + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = + state.dataInternalHeatGains->adjQL * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); + // store the magnitude and time of the pulse + state.dataOutRptTab->radiantPulseTimestep(state.dataSize->CurOverallSimDay, zoneNum) = + (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; + state.dataOutRptTab->radiantPulseReceived(state.dataSize->CurOverallSimDay, SurfNum) = + (state.dataInternalHeatGains->adjQL - state.dataInternalHeatGains->curQL) * state.dataHeatBal->TMULT(radEnclosureNum) * + state.dataHeatBal->ITABSF(SurfNum) * state.dataSurface->Surface(SurfNum).Area; } } } + } - void CalcZoneITEq(EnergyPlusData &state) - { - - // SUBROUTINE INFORMATION: - // AUTHOR M.J. Witte - // DATE WRITTEN October 2014 - - // PURPOSE OF THIS SUBROUTINE: - // This subroutine calculates the gains and other results for ElectricEquipment:ITE:AirCooled. - // This broken into a separate subroutine, because the calculations are more detailed than the other - // types of internal gains. - - using ScheduleManager::GetCurrentScheduleValue; - using namespace Psychrometrics; - using CurveManager::CurveValue; - using DataHVACGlobals::SmallAirVolFlow; - using DataHVACGlobals::SmallTempDiff; - - // Operating Limits for environmental class: None, A1, A2, A3, A4, B, C - // From ASHRAE 2011 Thermal Guidelines environmental classes for Air-Cooled ITE - static Array1D const DBMin(7, { -99.0, 15.0, 10.0, 5.0, 5.0, 5.0, 5.0 }); // Minimum dry-bulb temperature [C] - static Array1D const DBMax(7, { 99.0, 32.0, 35.0, 40.0, 45.0, 35.0, 40.0 }); // Maximum dry-bulb temperature [C] - static Array1D const DPMax(7, { 99.0, 17.0, 21.0, 24.0, 24.0, 28.0, 28.0 }); // Maximum dewpoint temperature [C] - static Array1D const DPMin(7, { -99.0, -99.0, -99.0, -12.0, -12.0, -99.0, -99.0 }); // Minimum dewpoint temperature [C] - static Array1D const RHMin(7, { 0.0, 20.0, 20.0, 8.0, 8.0, 8.0, 8.0 }); // Minimum relative humidity [%] - static Array1D const RHMax(7, { 99.0, 80.0, 80.0, 85.0, 90.0, 80.0, 80.0 }); // Maximum relative humidity [%] - - static std::string const RoutineName("CalcZoneITEq"); - int Loop; - int NZ; - int SupplyNodeNum; // Supply air node number (if zero, then not specified) - Real64 OperSchedFrac; // Operating schedule fraction - Real64 CPULoadSchedFrac; // CPU loading schedule fraction - Real64 AirConnection; // Air connection type - Real64 TSupply(0.0); // Supply air temperature [C] - Real64 WSupply; // Supply air humidity ratio [kgWater/kgDryAir] - Real64 RecircFrac; // Recirulation fraction - current - Real64 TRecirc; // Recirulation air temperature [C] - Real64 WRecirc; // Recirulation air humidity ratio [kgWater/kgDryAir] - Real64 TAirIn; // Entering air dry-bulb temperature [C] - Real64 TAirInDesign; // Design entering air dry-bulb temperature [C] - Real64 WAirIn; // Entering air humidity ratio [kgWater/kgDryAir] - Real64 TDPAirIn; // Entering air dewpoint temperature [C] - Real64 RHAirIn; // Entering air relative humidity [%] - Real64 SupplyHeatIndex; // Supply heat index - Real64 TAirOut; // Leaving air temperature [C] - Real64 AirVolFlowFrac; // Air volume flow fraction - Real64 AirVolFlowFracDesignT; // Air volume flow fraction at design entering air temperature - Real64 AirVolFlowRate; // Air volume flow rate at current density [m3/s] - Real64 AirMassFlowRate; // Air mass flow rate [kg/s] - Real64 CPUPower; // CPU power input [W] - Real64 FanPower; // Fan power input [W] - Real64 UPSPower; // UPS new power input (losses) [W] - Real64 UPSPartLoadRatio; // UPS part load ratio (current total power input / design total power input) - Real64 UPSHeatGain; // UPS convective heat gain to zone [W] - int EnvClass; // Index for environmental class (None=0, A1=1, A2=2, A3=3, A4=4, B=5, C=6) - - std::map> ZoneITEMap; - - // Zero out time step variables - // Object report variables - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - state.dataHeatBal->ZoneITEq(Loop).CPUPower = 0.0; - state.dataHeatBal->ZoneITEq(Loop).FanPower = 0.0; - state.dataHeatBal->ZoneITEq(Loop).UPSPower = 0.0; - state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign = 0.0; - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign = 0.0; - state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone = 0.0; - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = 0.0; - - state.dataHeatBal->ZoneITEq(Loop).CPUConsumption = 0.0; - state.dataHeatBal->ZoneITEq(Loop).FanConsumption = 0.0; - state.dataHeatBal->ZoneITEq(Loop).UPSConsumption = 0.0; - state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign = 0.0; - state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign = 0.0; - state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone = 0.0; - state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone = 0.0; - - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = 0.0; - state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).SHI = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = 0.0; - state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = 0.0; - state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = 0.0; - state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = 0.0; - state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = 0.0; - } // ZoneITEq init loop + void CheckReturnAirHeatGain(EnergyPlusData &state) + { + // SUBROUTINE INFORMATION: + // AUTHOR Xuan Luo + // DATE WRITTEN Jan 2018 - // Zone total report variables - for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { - state.dataHeatBal->ZnRpt(Loop).ITEqCPUPower = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqFanPower = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqUPSPower = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqCPUPowerAtDesign = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqFanPowerAtDesign = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqUPSGainRateToZone = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqConGainRateToZone = 0.0; - - state.dataHeatBal->ZnRpt(Loop).ITEAdjReturnTemp = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqCPUConsumption = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqFanConsumption = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqUPSConsumption = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqCPUEnergyAtDesign = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqFanEnergyAtDesign = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqUPSGainEnergyToZone = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqConGainEnergyToZone = 0.0; - - state.dataHeatBal->ZnRpt(Loop).ITEqAirVolFlowStdDensity = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqAirMassFlow = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqSHI = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeOutOfOperRange = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveDryBulbT = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowDryBulbT = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveDewpointT = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowDewpointT = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveRH = 0.0; - state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowRH = 0.0; - - state.dataHeatBal->ZnRpt(Loop).SumTinMinusTSup = 0.0; - state.dataHeatBal->ZnRpt(Loop).SumToutMinusTSup = 0.0; - } // Zone init loop + // PURPOSE OF THIS SUBROUTINE: + // This subroutine currently creates the values for standard "zone loads" reporting + // from the heat balance module. - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - // Get schedules - NZ = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; - OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); - CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); + // Using/Aliasing - // Determine inlet air temperature and humidity - AirConnection = state.dataHeatBal->ZoneITEq(Loop).AirConnectionType; - RecircFrac = 0.0; - SupplyNodeNum = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum; - if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp; - WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; - if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) { - TAirIn = TSupply + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch); - } - else { - TAirIn = TSupply + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp; - } - WAirIn = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; - } - else { - if (AirConnection == ITEInletAdjustedSupply) { - TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp; - WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; - if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve != 0) { - RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve, CPULoadSchedFrac, TSupply); - } - else { - RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac; - } - TRecirc = state.dataHeatBalFanSys->MAT(NZ); - WRecirc = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); - TAirIn = TRecirc * RecircFrac + TSupply * (1.0 - RecircFrac); - WAirIn = WRecirc * RecircFrac + WSupply * (1.0 - RecircFrac); - } - else if (AirConnection == ITEInletRoomAirModel) { - // Room air model option: TAirIn=TAirZone, according to EngineeringRef 17.1.4 - TAirIn = state.dataHeatBalFanSys->MAT(NZ); - TSupply = TAirIn; - WAirIn = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); - } - else { - // TAirIn = TRoomAirNodeIn, according to EngineeringRef 17.1.4 - int ZoneAirInletNode = state.dataZoneEquip->ZoneEquipConfig(NZ).InletNode(1); - TSupply = state.dataLoopNodes->Node(ZoneAirInletNode).Temp; - TAirIn = state.dataHeatBalFanSys->MAT(NZ); - WAirIn = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); + for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { + if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasLtsRetAirGain) { + ShowFatalError(state, + "Return air heat gains from lights are not allowed when Air Flow Calculation Method = " + "FlowControlWithApproachTemperatures in zones with ITE objects."); + } + if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasAirFlowWindowReturn) { + ShowFatalError(state, + "Return air heat gains from windows are not allowed when Air Flow Calculation Method = " + "FlowControlWithApproachTemperatures in zones with ITE objects."); + } + } + } + + void CalcZoneITEq(EnergyPlusData &state) + { + + // SUBROUTINE INFORMATION: + // AUTHOR M.J. Witte + // DATE WRITTEN October 2014 + + // PURPOSE OF THIS SUBROUTINE: + // This subroutine calculates the gains and other results for ElectricEquipment:ITE:AirCooled. + // This broken into a separate subroutine, because the calculations are more detailed than the other + // types of internal gains. + + using ScheduleManager::GetCurrentScheduleValue; + using namespace Psychrometrics; + using CurveManager::CurveValue; + using DataHVACGlobals::SmallAirVolFlow; + using DataHVACGlobals::SmallTempDiff; + + // Operating Limits for environmental class: None, A1, A2, A3, A4, B, C + // From ASHRAE 2011 Thermal Guidelines environmental classes for Air-Cooled ITE + static Array1D const DBMin(7, {-99.0, 15.0, 10.0, 5.0, 5.0, 5.0, 5.0}); // Minimum dry-bulb temperature [C] + static Array1D const DBMax(7, {99.0, 32.0, 35.0, 40.0, 45.0, 35.0, 40.0}); // Maximum dry-bulb temperature [C] + static Array1D const DPMax(7, {99.0, 17.0, 21.0, 24.0, 24.0, 28.0, 28.0}); // Maximum dewpoint temperature [C] + static Array1D const DPMin(7, {-99.0, -99.0, -99.0, -12.0, -12.0, -99.0, -99.0}); // Minimum dewpoint temperature [C] + static Array1D const RHMin(7, {0.0, 20.0, 20.0, 8.0, 8.0, 8.0, 8.0}); // Minimum relative humidity [%] + static Array1D const RHMax(7, {99.0, 80.0, 80.0, 85.0, 90.0, 80.0, 80.0}); // Maximum relative humidity [%] + + static std::string const RoutineName("CalcZoneITEq"); + int Loop; + int NZ; + int SupplyNodeNum; // Supply air node number (if zero, then not specified) + Real64 OperSchedFrac; // Operating schedule fraction + Real64 CPULoadSchedFrac; // CPU loading schedule fraction + Real64 AirConnection; // Air connection type + Real64 TSupply(0.0); // Supply air temperature [C] + Real64 WSupply; // Supply air humidity ratio [kgWater/kgDryAir] + Real64 RecircFrac; // Recirulation fraction - current + Real64 TRecirc; // Recirulation air temperature [C] + Real64 WRecirc; // Recirulation air humidity ratio [kgWater/kgDryAir] + Real64 TAirIn; // Entering air dry-bulb temperature [C] + Real64 TAirInDesign; // Design entering air dry-bulb temperature [C] + Real64 WAirIn; // Entering air humidity ratio [kgWater/kgDryAir] + Real64 TDPAirIn; // Entering air dewpoint temperature [C] + Real64 RHAirIn; // Entering air relative humidity [%] + Real64 SupplyHeatIndex; // Supply heat index + Real64 TAirOut; // Leaving air temperature [C] + Real64 AirVolFlowFrac; // Air volume flow fraction + Real64 AirVolFlowFracDesignT; // Air volume flow fraction at design entering air temperature + Real64 AirVolFlowRate; // Air volume flow rate at current density [m3/s] + Real64 AirMassFlowRate; // Air mass flow rate [kg/s] + Real64 CPUPower; // CPU power input [W] + Real64 FanPower; // Fan power input [W] + Real64 UPSPower; // UPS new power input (losses) [W] + Real64 UPSPartLoadRatio; // UPS part load ratio (current total power input / design total power input) + Real64 UPSHeatGain; // UPS convective heat gain to zone [W] + int EnvClass; // Index for environmental class (None=0, A1=1, A2=2, A3=3, A4=4, B=5, C=6) + + std::map> ZoneITEMap; + + // Zero out time step variables + // Object report variables + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + state.dataHeatBal->ZoneITEq(Loop).CPUPower = 0.0; + state.dataHeatBal->ZoneITEq(Loop).FanPower = 0.0; + state.dataHeatBal->ZoneITEq(Loop).UPSPower = 0.0; + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign = 0.0; + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign = 0.0; + state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone = 0.0; + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = 0.0; + + state.dataHeatBal->ZoneITEq(Loop).CPUConsumption = 0.0; + state.dataHeatBal->ZoneITEq(Loop).FanConsumption = 0.0; + state.dataHeatBal->ZoneITEq(Loop).UPSConsumption = 0.0; + state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign = 0.0; + state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign = 0.0; + state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone = 0.0; + state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone = 0.0; + + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = 0.0; + state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).SHI = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = 0.0; + state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = 0.0; + state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = 0.0; + state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = 0.0; + state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = 0.0; + } // ZoneITEq init loop + + // Zone total report variables + for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { + state.dataHeatBal->ZnRpt(Loop).ITEqCPUPower = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqFanPower = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqUPSPower = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqCPUPowerAtDesign = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqFanPowerAtDesign = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqUPSGainRateToZone = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqConGainRateToZone = 0.0; + + state.dataHeatBal->ZnRpt(Loop).ITEAdjReturnTemp = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqCPUConsumption = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqFanConsumption = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqUPSConsumption = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqCPUEnergyAtDesign = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqFanEnergyAtDesign = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqUPSGainEnergyToZone = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqConGainEnergyToZone = 0.0; + + state.dataHeatBal->ZnRpt(Loop).ITEqAirVolFlowStdDensity = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqAirMassFlow = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqSHI = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeOutOfOperRange = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveDryBulbT = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowDryBulbT = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveDewpointT = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowDewpointT = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeAboveRH = 0.0; + state.dataHeatBal->ZnRpt(Loop).ITEqTimeBelowRH = 0.0; + + state.dataHeatBal->ZnRpt(Loop).SumTinMinusTSup = 0.0; + state.dataHeatBal->ZnRpt(Loop).SumToutMinusTSup = 0.0; + } // Zone init loop + + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + // Get schedules + NZ = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; + OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); + CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); + + // Determine inlet air temperature and humidity + AirConnection = state.dataHeatBal->ZoneITEq(Loop).AirConnectionType; + RecircFrac = 0.0; + SupplyNodeNum = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum; + if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp; + WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; + if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) { + TAirIn = TSupply + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch); + } else { + TAirIn = TSupply + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp; + } + WAirIn = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; + } else { + if (AirConnection == ITEInletAdjustedSupply) { + TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp; + WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat; + if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve != 0) { + RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve, CPULoadSchedFrac, TSupply); + } else { + RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac; } + TRecirc = state.dataHeatBalFanSys->MAT(NZ); + WRecirc = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); + TAirIn = TRecirc * RecircFrac + TSupply * (1.0 - RecircFrac); + WAirIn = WRecirc * RecircFrac + WSupply * (1.0 - RecircFrac); + } else if (AirConnection == ITEInletRoomAirModel) { + // Room air model option: TAirIn=TAirZone, according to EngineeringRef 17.1.4 + TAirIn = state.dataHeatBalFanSys->MAT(NZ); + TSupply = TAirIn; + WAirIn = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); + } else { + // TAirIn = TRoomAirNodeIn, according to EngineeringRef 17.1.4 + int ZoneAirInletNode = state.dataZoneEquip->ZoneEquipConfig(NZ).InletNode(1); + TSupply = state.dataLoopNodes->Node(ZoneAirInletNode).Temp; + TAirIn = state.dataHeatBalFanSys->MAT(NZ); + WAirIn = state.dataHeatBalFanSys->ZoneAirHumRat(NZ); } - TDPAirIn = PsyTdpFnWPb(state, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); - RHAirIn = 100.0 * PsyRhFnTdbWPb(state, TAirIn, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); // RHAirIn is % + } + TDPAirIn = PsyTdpFnWPb(state, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); + RHAirIn = 100.0 * PsyRhFnTdbWPb(state, TAirIn, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); // RHAirIn is % - // Calculate power input and airflow - TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn; + // Calculate power input and airflow + TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn; - if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn; - if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) { - TAirInDesign = TAirInDesign + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch); - } - else { - TAirInDesign = TAirInDesign + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp; - } - OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); - CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); + TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn; + if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) { + TAirInDesign = TAirInDesign + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch); + } else { + TAirInDesign = TAirInDesign + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp; } + OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr); + CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr); + } - CPUPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirIn), - 0.0); - state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign = - max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac * + CPUPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirIn), + 0.0); + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign = + max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac * CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirInDesign), - 0.0); + 0.0); - AirVolFlowFrac = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirIn), 0.0); - AirVolFlowRate = state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate * OperSchedFrac * AirVolFlowFrac; - if (AirVolFlowRate < SmallAirVolFlow) { - AirVolFlowRate = 0.0; - } - AirVolFlowFracDesignT = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirInDesign), 0.0); + AirVolFlowFrac = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirIn), 0.0); + AirVolFlowRate = state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate * OperSchedFrac * AirVolFlowFrac; + if (AirVolFlowRate < SmallAirVolFlow) { + AirVolFlowRate = 0.0; + } + AirVolFlowFracDesignT = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirInDesign), 0.0); - FanPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFrac), - 0.0); - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign = - max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac * + FanPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFrac), + 0.0); + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign = + max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac * CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFracDesignT), - 0.0); + 0.0); - // Calculate UPS net power input (power in less power to ITEquip) and UPS heat gain to zone - if (state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower > 0.0) { - UPSPartLoadRatio = (CPUPower + FanPower) / state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; - } - else { - UPSPartLoadRatio = 0.0; - } - if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve != 0) { - UPSPower = - (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency * - CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve, UPSPartLoadRatio)), - 0.0); - } - else { - UPSPower = (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency), 0.0); - } - UPSHeatGain = UPSPower * state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac; + // Calculate UPS net power input (power in less power to ITEquip) and UPS heat gain to zone + if (state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower > 0.0) { + UPSPartLoadRatio = (CPUPower + FanPower) / state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower; + } else { + UPSPartLoadRatio = 0.0; + } + if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve != 0) { + UPSPower = + (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency * + CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve, UPSPartLoadRatio)), + 0.0); + } else { + UPSPower = (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency), 0.0); + } + UPSHeatGain = UPSPower * state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac; - // Calculate air outlet conditions and convective heat gain to zone + // Calculate air outlet conditions and convective heat gain to zone - AirMassFlowRate = AirVolFlowRate * PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, TAirIn, WAirIn, RoutineName); - if (AirMassFlowRate > 0.0) { - TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnW(WAirIn); - } - else { - TAirOut = TAirIn; - } + AirMassFlowRate = AirVolFlowRate * PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, TAirIn, WAirIn, RoutineName); + if (AirMassFlowRate > 0.0) { + TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnW(WAirIn); + } else { + TAirOut = TAirIn; + } - if (std::abs(TAirOut - TSupply) < SmallTempDiff) { - TAirOut = TSupply; - } + if (std::abs(TAirOut - TSupply) < SmallTempDiff) { + TAirOut = TSupply; + } - if ((SupplyNodeNum != 0) && (TAirOut != TSupply)) { - SupplyHeatIndex = (TAirIn - TSupply) / (TAirOut - TSupply); - } - else { - SupplyHeatIndex = 0.0; - } + if ((SupplyNodeNum != 0) && (TAirOut != TSupply)) { + SupplyHeatIndex = (TAirIn - TSupply) / (TAirOut - TSupply); + } else { + SupplyHeatIndex = 0.0; + } - if (AirConnection == ITEInletAdjustedSupply || AirConnection == ITEInletZoneAirNode) { - // If not a room air model, then all ITEquip power input is a convective heat gain to the zone heat balance, plus UPS heat gain - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = CPUPower + FanPower + UPSHeatGain; - } - else if (AirConnection == ITEInletRoomAirModel) { - // Room air model option not implemented yet - set room air model outlet node conditions here - // If a room air model, then the only convective heat gain to the zone heat balance is the UPS heat gain - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = UPSHeatGain; - } - if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE) { - ZoneITEMap[state.dataHeatBal->ZoneITEq(Loop).ZonePtr].push_back(Loop); - } - if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { - if (state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign > - state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower) { - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign; - } + if (AirConnection == ITEInletAdjustedSupply || AirConnection == ITEInletZoneAirNode) { + // If not a room air model, then all ITEquip power input is a convective heat gain to the zone heat balance, plus UPS heat gain + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = CPUPower + FanPower + UPSHeatGain; + } else if (AirConnection == ITEInletRoomAirModel) { + // Room air model option not implemented yet - set room air model outlet node conditions here + // If a room air model, then the only convective heat gain to the zone heat balance is the UPS heat gain + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = UPSHeatGain; + } + if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE) { + ZoneITEMap[state.dataHeatBal->ZoneITEq(Loop).ZonePtr].push_back(Loop); + } + if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) { + if (state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign > + state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower) { + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone = + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign; } - // Object report variables - state.dataHeatBal->ZoneITEq(Loop).CPUPower = CPUPower; - state.dataHeatBal->ZoneITEq(Loop).FanPower = FanPower; - state.dataHeatBal->ZoneITEq(Loop).UPSPower = UPSPower; - // ZoneITEq( Loop ).CPUPowerAtDesign = set above - // ZoneITEq( Loop ).FanPowerAtDesign = set above - state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone = UPSHeatGain; - // ZoneITEq( Loop ).ConGainRateToZone = set above - - state.dataHeatBal->ZnRpt(NZ).ITEqCPUPower += state.dataHeatBal->ZoneITEq(Loop).CPUPower; - state.dataHeatBal->ZnRpt(NZ).ITEqFanPower += state.dataHeatBal->ZoneITEq(Loop).FanPower; - state.dataHeatBal->ZnRpt(NZ).ITEqUPSPower += state.dataHeatBal->ZoneITEq(Loop).UPSPower; - state.dataHeatBal->ZnRpt(NZ).ITEqCPUPowerAtDesign += state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign; - state.dataHeatBal->ZnRpt(NZ).ITEqFanPowerAtDesign += state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign; - state.dataHeatBal->ZnRpt(NZ).ITEqUPSGainRateToZone += state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone; - state.dataHeatBal->ZnRpt(NZ).ITEqConGainRateToZone += state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone; - - state.dataHeatBal->ZoneITEq(Loop).CPUConsumption = CPUPower * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).FanConsumption = FanPower * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).UPSConsumption = UPSPower * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign = - state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign = - state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone = UPSHeatGain * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone = - state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone * state.dataGlobal->TimeStepZoneSec; - - state.dataHeatBal->ZnRpt(NZ).ITEqCPUConsumption += state.dataHeatBal->ZoneITEq(Loop).CPUConsumption; - state.dataHeatBal->ZnRpt(NZ).ITEqFanConsumption += state.dataHeatBal->ZoneITEq(Loop).FanConsumption; - state.dataHeatBal->ZnRpt(NZ).ITEqUPSConsumption += state.dataHeatBal->ZoneITEq(Loop).UPSConsumption; - state.dataHeatBal->ZnRpt(NZ).ITEqCPUEnergyAtDesign += state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign; - state.dataHeatBal->ZnRpt(NZ).ITEqFanEnergyAtDesign += state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign; - state.dataHeatBal->ZnRpt(NZ).ITEqUPSGainEnergyToZone += state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone; - state.dataHeatBal->ZnRpt(NZ).ITEqConGainEnergyToZone += state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone; - - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = AirMassFlowRate * state.dataEnvrn->StdRhoAir; - state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = AirVolFlowRate; - state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = AirMassFlowRate; - state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = TAirIn; - state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = TDPAirIn; - state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = RHAirIn; - state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = TAirOut; - state.dataHeatBal->ZoneITEq(Loop).SHI = SupplyHeatIndex; - - state.dataHeatBal->ZnRpt(NZ).ITEqAirVolFlowStdDensity += state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity; - state.dataHeatBal->ZnRpt(NZ).ITEqAirMassFlow += state.dataHeatBal->ZoneITEq(Loop).AirMassFlow; - state.dataHeatBal->ZnRpt(NZ).SumTinMinusTSup += (TAirIn - TSupply) * AirVolFlowRate; - state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup += (TAirOut - TSupply) * AirVolFlowRate; - - // Check environmental class operating range limits (defined as parameters in this subroutine) - EnvClass = state.dataHeatBal->ZoneITEq(Loop).Class; - if (EnvClass > 0) { - if (TAirIn > DBMax(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = TAirIn - DBMax(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveDryBulbT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (TAirIn < DBMin(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = TAirIn - DBMin(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowDryBulbT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (TDPAirIn > DPMax(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = TDPAirIn - DPMax(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveDewpointT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (TDPAirIn < DPMin(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = TDPAirIn - DPMin(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowDewpointT = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (RHAirIn > RHMax(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = RHAirIn - RHMax(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveRH = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } - if (RHAirIn < RHMin(EnvClass)) { - state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = RHAirIn - RHMin(EnvClass); - state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowRH = state.dataGlobal->TimeStepZone; - state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; - } + } + // Object report variables + state.dataHeatBal->ZoneITEq(Loop).CPUPower = CPUPower; + state.dataHeatBal->ZoneITEq(Loop).FanPower = FanPower; + state.dataHeatBal->ZoneITEq(Loop).UPSPower = UPSPower; + // ZoneITEq( Loop ).CPUPowerAtDesign = set above + // ZoneITEq( Loop ).FanPowerAtDesign = set above + state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone = UPSHeatGain; + // ZoneITEq( Loop ).ConGainRateToZone = set above + + state.dataHeatBal->ZnRpt(NZ).ITEqCPUPower += state.dataHeatBal->ZoneITEq(Loop).CPUPower; + state.dataHeatBal->ZnRpt(NZ).ITEqFanPower += state.dataHeatBal->ZoneITEq(Loop).FanPower; + state.dataHeatBal->ZnRpt(NZ).ITEqUPSPower += state.dataHeatBal->ZoneITEq(Loop).UPSPower; + state.dataHeatBal->ZnRpt(NZ).ITEqCPUPowerAtDesign += state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign; + state.dataHeatBal->ZnRpt(NZ).ITEqFanPowerAtDesign += state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign; + state.dataHeatBal->ZnRpt(NZ).ITEqUPSGainRateToZone += state.dataHeatBal->ZoneITEq(Loop).UPSGainRateToZone; + state.dataHeatBal->ZnRpt(NZ).ITEqConGainRateToZone += state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone; + + state.dataHeatBal->ZoneITEq(Loop).CPUConsumption = CPUPower * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).FanConsumption = FanPower * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).UPSConsumption = UPSPower * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign = + state.dataHeatBal->ZoneITEq(Loop).CPUPowerAtDesign * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign = + state.dataHeatBal->ZoneITEq(Loop).FanPowerAtDesign * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone = UPSHeatGain * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone = + state.dataHeatBal->ZoneITEq(Loop).ConGainRateToZone * state.dataGlobal->TimeStepZoneSec; + + state.dataHeatBal->ZnRpt(NZ).ITEqCPUConsumption += state.dataHeatBal->ZoneITEq(Loop).CPUConsumption; + state.dataHeatBal->ZnRpt(NZ).ITEqFanConsumption += state.dataHeatBal->ZoneITEq(Loop).FanConsumption; + state.dataHeatBal->ZnRpt(NZ).ITEqUPSConsumption += state.dataHeatBal->ZoneITEq(Loop).UPSConsumption; + state.dataHeatBal->ZnRpt(NZ).ITEqCPUEnergyAtDesign += state.dataHeatBal->ZoneITEq(Loop).CPUEnergyAtDesign; + state.dataHeatBal->ZnRpt(NZ).ITEqFanEnergyAtDesign += state.dataHeatBal->ZoneITEq(Loop).FanEnergyAtDesign; + state.dataHeatBal->ZnRpt(NZ).ITEqUPSGainEnergyToZone += state.dataHeatBal->ZoneITEq(Loop).UPSGainEnergyToZone; + state.dataHeatBal->ZnRpt(NZ).ITEqConGainEnergyToZone += state.dataHeatBal->ZoneITEq(Loop).ConGainEnergyToZone; + + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = AirMassFlowRate * state.dataEnvrn->StdRhoAir; + state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = AirVolFlowRate; + state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = AirMassFlowRate; + state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = TAirIn; + state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = TDPAirIn; + state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = RHAirIn; + state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = TAirOut; + state.dataHeatBal->ZoneITEq(Loop).SHI = SupplyHeatIndex; + + state.dataHeatBal->ZnRpt(NZ).ITEqAirVolFlowStdDensity += state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity; + state.dataHeatBal->ZnRpt(NZ).ITEqAirMassFlow += state.dataHeatBal->ZoneITEq(Loop).AirMassFlow; + state.dataHeatBal->ZnRpt(NZ).SumTinMinusTSup += (TAirIn - TSupply) * AirVolFlowRate; + state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup += (TAirOut - TSupply) * AirVolFlowRate; + + // Check environmental class operating range limits (defined as parameters in this subroutine) + EnvClass = state.dataHeatBal->ZoneITEq(Loop).Class; + if (EnvClass > 0) { + if (TAirIn > DBMax(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = TAirIn - DBMax(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveDryBulbT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (TAirIn < DBMin(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = TAirIn - DBMin(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowDryBulbT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (TDPAirIn > DPMax(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = TDPAirIn - DPMax(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveDewpointT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (TDPAirIn < DPMin(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = TDPAirIn - DPMin(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowDewpointT = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (RHAirIn > RHMax(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = RHAirIn - RHMax(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeAboveRH = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; + } + if (RHAirIn < RHMin(EnvClass)) { + state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = RHAirIn - RHMin(EnvClass); + state.dataHeatBal->ZnRpt(NZ).ITEqTimeBelowRH = state.dataGlobal->TimeStepZone; + state.dataHeatBal->ZnRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone; } + } - } // ZoneITEq calc loop + } // ZoneITEq calc loop - // Zone-level sensible heat index - for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { - int ZN = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; - if (state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup != 0.0) { - state.dataHeatBal->ZnRpt(ZN).ITEqSHI = state.dataHeatBal->ZnRpt(NZ).SumTinMinusTSup / state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup; - } + // Zone-level sensible heat index + for (Loop = 1; Loop <= state.dataHeatBal->NumZoneITEqStatements; ++Loop) { + int ZN = state.dataHeatBal->ZoneITEq(Loop).ZonePtr; + if (state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup != 0.0) { + state.dataHeatBal->ZnRpt(ZN).ITEqSHI = state.dataHeatBal->ZnRpt(NZ).SumTinMinusTSup / state.dataHeatBal->ZnRpt(NZ).SumToutMinusTSup; } + } - std::map>::iterator it = ZoneITEMap.begin(); - Real64 totalGain; - Real64 totalRate; - Real64 TAirReturn; - while (it != ZoneITEMap.end()) { - if (state.dataHeatBal->Zone(it->first).HasAdjustedReturnTempByITE) { - totalGain = 0; - totalRate = 0; - for (int i : it->second) { - if (state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch != 0) { - TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + - GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch); - } - else { - TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + state.dataHeatBal->ZoneITEq(i).ReturnApproachTemp; - } - totalRate += state.dataHeatBal->ZoneITEq(i).AirMassFlow; - totalGain += state.dataHeatBal->ZoneITEq(i).AirMassFlow * TAirReturn; - } - if (totalRate != 0) { - state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE = totalGain / totalRate; - state.dataHeatBal->ZnRpt(it->first).ITEAdjReturnTemp = state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE; + std::map>::iterator it = ZoneITEMap.begin(); + Real64 totalGain; + Real64 totalRate; + Real64 TAirReturn; + while (it != ZoneITEMap.end()) { + if (state.dataHeatBal->Zone(it->first).HasAdjustedReturnTempByITE) { + totalGain = 0; + totalRate = 0; + for (int i : it->second) { + if (state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch != 0) { + TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch); + } else { + TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + state.dataHeatBal->ZoneITEq(i).ReturnApproachTemp; } + totalRate += state.dataHeatBal->ZoneITEq(i).AirMassFlow; + totalGain += state.dataHeatBal->ZoneITEq(i).AirMassFlow * TAirReturn; + } + if (totalRate != 0) { + state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE = totalGain / totalRate; + state.dataHeatBal->ZnRpt(it->first).ITEAdjReturnTemp = state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE; } - it++; } + it++; + } - } // End CalcZoneITEq - - void ReportInternalHeatGains(EnergyPlusData &state) - { - - // SUBROUTINE INFORMATION: - // AUTHOR Richard Liesen - // DATE WRITTEN June 1997 - // MODIFIED July 1997 RKS - // RE-ENGINEERED December 1998 LKL - - // PURPOSE OF THIS SUBROUTINE: - // This subroutine currently creates the values for standard "zone loads" reporting - // from the heat balance module. - - // METHODOLOGY EMPLOYED: - // The reporting methodology is described in the OutputDataStructure.doc - // as the "modified modular" format. - - // REFERENCES: - // OutputDataStructure.doc (EnergyPlus documentation) - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Loop; - int ZoneLoop; // Counter for the # of zones (nz) - static const Array1D_int TradIntGainTypes(8, - { IntGainTypeOf_People, - IntGainTypeOf_Lights, - IntGainTypeOf_ElectricEquipment, - IntGainTypeOf_ElectricEquipmentITEAirCooled, - IntGainTypeOf_GasEquipment, - IntGainTypeOf_HotWaterEquipment, - IntGainTypeOf_SteamEquipment, - IntGainTypeOf_OtherEquipment }); - - for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { - state.dataHeatBal->People(Loop).RadGainEnergy = state.dataHeatBal->People(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->People(Loop).ConGainEnergy = state.dataHeatBal->People(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->People(Loop).SenGainEnergy = state.dataHeatBal->People(Loop).SenGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->People(Loop).LatGainEnergy = state.dataHeatBal->People(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->People(Loop).TotGainEnergy = state.dataHeatBal->People(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + } // End CalcZoneITEq - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - state.dataHeatBal->Lights(Loop).Consumption = state.dataHeatBal->Lights(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).RadGainEnergy = state.dataHeatBal->Lights(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).VisGainEnergy = state.dataHeatBal->Lights(Loop).VisGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).ConGainEnergy = state.dataHeatBal->Lights(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).RetAirGainEnergy = state.dataHeatBal->Lights(Loop).RetAirGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->Lights(Loop).TotGainEnergy = state.dataHeatBal->Lights(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - if (!state.dataGlobal->WarmupFlag) { - if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && - (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // for weather simulations only - // for tabular report, accumulate the total electricity used for each Light object - state.dataHeatBal->Lights(Loop).SumConsumption += state.dataHeatBal->Lights(Loop).Consumption; - // for tabular report, accumulate the time when each Light has consumption (using a very small threshold instead of zero) - if (state.dataHeatBal->Lights(Loop).Power > 0.01 * state.dataHeatBal->Lights(Loop).DesignLevel) { - state.dataHeatBal->Lights(Loop).SumTimeNotZeroCons += state.dataGlobal->TimeStepZone; - } + void ReportInternalHeatGains(EnergyPlusData &state) + { + + // SUBROUTINE INFORMATION: + // AUTHOR Richard Liesen + // DATE WRITTEN June 1997 + // MODIFIED July 1997 RKS + // RE-ENGINEERED December 1998 LKL + + // PURPOSE OF THIS SUBROUTINE: + // This subroutine currently creates the values for standard "zone loads" reporting + // from the heat balance module. + + // METHODOLOGY EMPLOYED: + // The reporting methodology is described in the OutputDataStructure.doc + // as the "modified modular" format. + + // REFERENCES: + // OutputDataStructure.doc (EnergyPlus documentation) + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int Loop; + int ZoneLoop; // Counter for the # of zones (nz) + static const Array1D_int TradIntGainTypes(8, + {IntGainTypeOf_People, + IntGainTypeOf_Lights, + IntGainTypeOf_ElectricEquipment, + IntGainTypeOf_ElectricEquipmentITEAirCooled, + IntGainTypeOf_GasEquipment, + IntGainTypeOf_HotWaterEquipment, + IntGainTypeOf_SteamEquipment, + IntGainTypeOf_OtherEquipment}); + + for (Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) { + state.dataHeatBal->People(Loop).RadGainEnergy = state.dataHeatBal->People(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->People(Loop).ConGainEnergy = state.dataHeatBal->People(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->People(Loop).SenGainEnergy = state.dataHeatBal->People(Loop).SenGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->People(Loop).LatGainEnergy = state.dataHeatBal->People(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->People(Loop).TotGainEnergy = state.dataHeatBal->People(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } + + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + state.dataHeatBal->Lights(Loop).Consumption = state.dataHeatBal->Lights(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).RadGainEnergy = state.dataHeatBal->Lights(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).VisGainEnergy = state.dataHeatBal->Lights(Loop).VisGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).ConGainEnergy = state.dataHeatBal->Lights(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).RetAirGainEnergy = state.dataHeatBal->Lights(Loop).RetAirGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->Lights(Loop).TotGainEnergy = state.dataHeatBal->Lights(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + if (!state.dataGlobal->WarmupFlag) { + if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && + (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // for weather simulations only + // for tabular report, accumulate the total electricity used for each Light object + state.dataHeatBal->Lights(Loop).SumConsumption += state.dataHeatBal->Lights(Loop).Consumption; + // for tabular report, accumulate the time when each Light has consumption (using a very small threshold instead of zero) + if (state.dataHeatBal->Lights(Loop).Power > 0.01 * state.dataHeatBal->Lights(Loop).DesignLevel) { + state.dataHeatBal->Lights(Loop).SumTimeNotZeroCons += state.dataGlobal->TimeStepZone; } } } + } - for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { - state.dataHeatBal->ZoneElectric(Loop).Consumption = state.dataHeatBal->ZoneElectric(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).RadGainEnergy = - state.dataHeatBal->ZoneElectric(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).ConGainEnergy = - state.dataHeatBal->ZoneElectric(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).LatGainEnergy = - state.dataHeatBal->ZoneElectric(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).LostEnergy = state.dataHeatBal->ZoneElectric(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneElectric(Loop).TotGainEnergy = - state.dataHeatBal->ZoneElectric(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) { + state.dataHeatBal->ZoneElectric(Loop).Consumption = state.dataHeatBal->ZoneElectric(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).RadGainEnergy = + state.dataHeatBal->ZoneElectric(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).ConGainEnergy = + state.dataHeatBal->ZoneElectric(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).LatGainEnergy = + state.dataHeatBal->ZoneElectric(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).LostEnergy = state.dataHeatBal->ZoneElectric(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneElectric(Loop).TotGainEnergy = + state.dataHeatBal->ZoneElectric(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { - state.dataHeatBal->ZoneGas(Loop).Consumption = state.dataHeatBal->ZoneGas(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).RadGainEnergy = state.dataHeatBal->ZoneGas(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).ConGainEnergy = state.dataHeatBal->ZoneGas(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).LatGainEnergy = state.dataHeatBal->ZoneGas(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).LostEnergy = state.dataHeatBal->ZoneGas(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneGas(Loop).TotGainEnergy = state.dataHeatBal->ZoneGas(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) { + state.dataHeatBal->ZoneGas(Loop).Consumption = state.dataHeatBal->ZoneGas(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).RadGainEnergy = state.dataHeatBal->ZoneGas(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).ConGainEnergy = state.dataHeatBal->ZoneGas(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).LatGainEnergy = state.dataHeatBal->ZoneGas(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).LostEnergy = state.dataHeatBal->ZoneGas(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneGas(Loop).TotGainEnergy = state.dataHeatBal->ZoneGas(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { - state.dataHeatBal->ZoneOtherEq(Loop).Consumption = state.dataHeatBal->ZoneOtherEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).LostEnergy = state.dataHeatBal->ZoneOtherEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOtherEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) { + state.dataHeatBal->ZoneOtherEq(Loop).Consumption = state.dataHeatBal->ZoneOtherEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).LostEnergy = state.dataHeatBal->ZoneOtherEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOtherEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneOtherEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { - state.dataHeatBal->ZoneHWEq(Loop).Consumption = state.dataHeatBal->ZoneHWEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).LostEnergy = state.dataHeatBal->ZoneHWEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneHWEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) { + state.dataHeatBal->ZoneHWEq(Loop).Consumption = state.dataHeatBal->ZoneHWEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).LostEnergy = state.dataHeatBal->ZoneHWEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneHWEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneHWEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { - state.dataHeatBal->ZoneSteamEq(Loop).Consumption = state.dataHeatBal->ZoneSteamEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).LostEnergy = state.dataHeatBal->ZoneSteamEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneSteamEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) { + state.dataHeatBal->ZoneSteamEq(Loop).Consumption = state.dataHeatBal->ZoneSteamEq(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).RadGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).ConGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).LatGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).LatGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).LostEnergy = state.dataHeatBal->ZoneSteamEq(Loop).LostRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneSteamEq(Loop).TotGainEnergy = state.dataHeatBal->ZoneSteamEq(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { - state.dataHeatBal->ZoneBBHeat(Loop).Consumption = state.dataHeatBal->ZoneBBHeat(Loop).Power * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneBBHeat(Loop).RadGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneBBHeat(Loop).ConGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneBBHeat(Loop).TotGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) { + state.dataHeatBal->ZoneBBHeat(Loop).Consumption = state.dataHeatBal->ZoneBBHeat(Loop).Power * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneBBHeat(Loop).RadGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).RadGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneBBHeat(Loop).ConGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).ConGainRate * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneBBHeat(Loop).TotGainEnergy = state.dataHeatBal->ZoneBBHeat(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; + } - for (ZoneLoop = 1; ZoneLoop <= state.dataGlobal->NumOfZones; ++ZoneLoop) { - // People - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleNumOcc = state.dataHeatBal->ZoneIntGain(ZoneLoop).NOFOCC; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCRAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCCON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleSenGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCSEN * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCLAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleTotGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCTOT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCRAD; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCCON; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleSenGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCSEN; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCLAT; - state.dataHeatBal->ZnRpt(ZoneLoop).PeopleTotGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCTOT; - - // General Lights - state.dataHeatBal->ZnRpt(ZoneLoop).LtsRetAirGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCRA * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTRAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTTOT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTSW * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsRetAirGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCRA; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTRAD; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTTOT; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCON; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTSW; - state.dataHeatBal->ZnRpt(ZoneLoop).LtsElecConsump = state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGain; - - // Electric Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEECON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEERAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEECON; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEERAD; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELAT; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELost; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecConsump = - state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLost; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).ElecTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGainRate; - - // Gas Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGECON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGERAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).GasLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).GasConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGECON; - state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGERAD; - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELAT; - state.dataHeatBal->ZnRpt(ZoneLoop).GasLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELost; - state.dataHeatBal->ZnRpt(ZoneLoop).GasConsump = - state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).GasLost; - state.dataHeatBal->ZnRpt(ZoneLoop).GasTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).GasTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).GasConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGainRate; - - // Hot Water Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWCON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWRAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).HWLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).HWConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWCON; - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWRAD; - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLAT; - state.dataHeatBal->ZnRpt(ZoneLoop).HWLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLost; - state.dataHeatBal->ZnRpt(ZoneLoop).HWConsump = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).HWLost; - state.dataHeatBal->ZnRpt(ZoneLoop).HWTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).HWTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGainRate; - - // Steam Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSECON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSERAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSECON; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSERAD; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELAT; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELost; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamConsump = - state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLost; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).SteamTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGainRate; - - // Other Equipment - state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOECON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOERAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELAT * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELost * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOECON; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOERAD; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELAT; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELost; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherConsump = - state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLost; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain; - state.dataHeatBal->ZnRpt(ZoneLoop).OtherTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGainRate; - - // Baseboard Heat - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBCON * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBRAD * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBCON; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBRAD; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGain = - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGain + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGain; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGainRate = - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGainRate; - state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatElecCons = state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGain; - - // Overall Zone Variables - - // these overalls include component gains from devices like water heater, water use, and generators - // working vars QFCConv QGenConv QFCRad QGenRad WaterUseLatentGain WaterThermalTankGain WaterUseSensibleGain - - state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGain = state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGain; - state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGainRate; - - SumInternalRadiationGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate); - state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGain = - state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate * state.dataGlobal->TimeStepZoneSec; - - SumInternalConvectionGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate); - state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGain = - state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate * state.dataGlobal->TimeStepZoneSec; - - SumInternalLatentGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate); - state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGain = - state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate * state.dataGlobal->TimeStepZoneSec; - - state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGainRate = - state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate + - state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGainRate; - state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGain = - state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGainRate * state.dataGlobal->TimeStepZoneSec; - } + for (ZoneLoop = 1; ZoneLoop <= state.dataGlobal->NumOfZones; ++ZoneLoop) { + // People + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleNumOcc = state.dataHeatBal->ZoneIntGain(ZoneLoop).NOFOCC; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCRAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCCON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleSenGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCSEN * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCLAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleTotGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCTOT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCRAD; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCCON; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleSenGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCSEN; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCLAT; + state.dataHeatBal->ZnRpt(ZoneLoop).PeopleTotGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOCTOT; + + // General Lights + state.dataHeatBal->ZnRpt(ZoneLoop).LtsRetAirGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCRA * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTRAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTTOT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTSW * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsRetAirGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCRA; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTRAD; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTTOT; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTCON; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QLTSW; + state.dataHeatBal->ZnRpt(ZoneLoop).LtsElecConsump = state.dataHeatBal->ZnRpt(ZoneLoop).LtsTotGain; + + // Electric Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEECON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEERAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEECON; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEERAD; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELAT; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QEELost; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecConsump = + state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLost; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).ElecTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).ElecConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).ElecLatGainRate; + + // Gas Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGECON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGERAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).GasLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).GasConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGECON; + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGERAD; + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELAT; + state.dataHeatBal->ZnRpt(ZoneLoop).GasLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QGELost; + state.dataHeatBal->ZnRpt(ZoneLoop).GasConsump = + state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).GasLost; + state.dataHeatBal->ZnRpt(ZoneLoop).GasTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).GasConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).GasTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).GasConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).GasRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).GasLatGainRate; + + // Hot Water Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWCON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWRAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).HWLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).HWConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWCON; + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWRAD; + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLAT; + state.dataHeatBal->ZnRpt(ZoneLoop).HWLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QHWLost; + state.dataHeatBal->ZnRpt(ZoneLoop).HWConsump = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).HWLost; + state.dataHeatBal->ZnRpt(ZoneLoop).HWTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).HWTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).HWConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).HWRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).HWLatGainRate; + + // Steam Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSECON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSERAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSECON; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSERAD; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELAT; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QSELost; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamConsump = + state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLost; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).SteamTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).SteamConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).SteamLatGainRate; + + // Other Equipment + state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOECON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOERAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELAT * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLost = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELost * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOECON; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOERAD; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELAT; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLostRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QOELost; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherConsump = + state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLost; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherTotGain = state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGain + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGain + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGain; + state.dataHeatBal->ZnRpt(ZoneLoop).OtherTotGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).OtherConGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherRadGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).OtherLatGainRate; + + // Baseboard Heat + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBCON * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGain = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBRAD * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBCON; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGainRate = state.dataHeatBal->ZoneIntGain(ZoneLoop).QBBRAD; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGain = + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGain + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGain; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGainRate = + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatConGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatRadGainRate; + state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatElecCons = state.dataHeatBal->ZnRpt(ZoneLoop).BaseHeatTotGain; + + // Overall Zone Variables + + // these overalls include component gains from devices like water heater, water use, and generators + // working vars QFCConv QGenConv QFCRad QGenRad WaterUseLatentGain WaterThermalTankGain WaterUseSensibleGain + + state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGain = state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGain; + state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGainRate = state.dataHeatBal->ZnRpt(ZoneLoop).LtsVisGainRate; + + SumInternalRadiationGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate); + state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGain = + state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate * state.dataGlobal->TimeStepZoneSec; + + SumInternalConvectionGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate); + state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGain = + state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate * state.dataGlobal->TimeStepZoneSec; + + SumInternalLatentGainsByTypes(state, ZoneLoop, TradIntGainTypes, state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate); + state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGain = + state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate * state.dataGlobal->TimeStepZoneSec; + + state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGainRate = + state.dataHeatBal->ZnRpt(ZoneLoop).TotLatentGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).TotRadiantGainRate + + state.dataHeatBal->ZnRpt(ZoneLoop).TotConvectiveGainRate + state.dataHeatBal->ZnRpt(ZoneLoop).TotVisHeatGainRate; + state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGain = + state.dataHeatBal->ZnRpt(ZoneLoop).TotTotalHeatGainRate * state.dataGlobal->TimeStepZoneSec; } + } + + Real64 GetDesignLightingLevelForZone(EnergyPlusData &state, int const WhichZone) // name of zone + { - Real64 GetDesignLightingLevelForZone(EnergyPlusData &state, int const WhichZone) // name of zone - { + // FUNCTION INFORMATION: + // AUTHOR Linda Lawrie + // DATE WRITTEN April 2007; January 2008 - moved to InternalGains + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS FUNCTION: + // This routine sums the Lighting Level for a zone. + // Will issue a severe error for illegal zone. + // Must be called after InternalHeatGains get input. - // FUNCTION INFORMATION: - // AUTHOR Linda Lawrie - // DATE WRITTEN April 2007; January 2008 - moved to InternalGains - // MODIFIED na - // RE-ENGINEERED na + // Using/Aliasing + using namespace DataHeatBalance; + // Return value + Real64 DesignLightingLevelSum; // Sum of design lighting level for this zone - // PURPOSE OF THIS FUNCTION: - // This routine sums the Lighting Level for a zone. - // Will issue a severe error for illegal zone. - // Must be called after InternalHeatGains get input. + // FUNCTION LOCAL VARIABLE DECLARATIONS: + int Loop; - // Using/Aliasing - using namespace DataHeatBalance; - // Return value - Real64 DesignLightingLevelSum; // Sum of design lighting level for this zone + if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { + ShowFatalError(state, "GetDesignLightingLevelForZone: Function called prior to Getting Lights Input."); + } - // FUNCTION LOCAL VARIABLE DECLARATIONS: - int Loop; + DesignLightingLevelSum = 0.0; - if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { - ShowFatalError(state, "GetDesignLightingLevelForZone: Function called prior to Getting Lights Input."); + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + if (state.dataHeatBal->Lights(Loop).ZonePtr == WhichZone) { + DesignLightingLevelSum += state.dataHeatBal->Lights(Loop).DesignLevel; } + } - DesignLightingLevelSum = 0.0; + return DesignLightingLevelSum; + } - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - if (state.dataHeatBal->Lights(Loop).ZonePtr == WhichZone) { - DesignLightingLevelSum += state.dataHeatBal->Lights(Loop).DesignLevel; - } - } + bool CheckThermalComfortSchedules(bool const WorkEffSch, // Blank work efficiency schedule = true + bool const CloInsSch, // Blank clothing insulation schedule = true + bool const AirVeloSch) // Blank air velocity schedule = true + { + bool TCSchedsPresent = false; - return DesignLightingLevelSum; + if (!WorkEffSch || !CloInsSch || !AirVeloSch) { + TCSchedsPresent = true; } - bool CheckThermalComfortSchedules(bool const WorkEffSch, // Blank work efficiency schedule = true - bool const CloInsSch, // Blank clothing insulation schedule = true - bool const AirVeloSch) // Blank air velocity schedule = true - { - bool TCSchedsPresent = false; + return TCSchedsPresent; + } - if (!WorkEffSch || !CloInsSch || !AirVeloSch) { - TCSchedsPresent = true; - } + void CheckLightsReplaceableMinMaxForZone(EnergyPlusData &state, int const WhichZone) // Zone Number + { + + // SUBROUTINE INFORMATION: + // AUTHOR Linda Lawrie + // DATE WRITTEN April 2007 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // Daylighting is not available unless Lights (replaceable) is 0.0 or 1.0. No dimming will be done + // unless the lights replaceable fraction is 1.0. This is documented in the InputOutputReference but + // not warned about. Also, this will sum the Zone Design Lighting level, in case the calling routine + // would like to have an error if the lights is zero and daylighting is requested. - return TCSchedsPresent; + // METHODOLOGY EMPLOYED: + // Traverse the LIGHTS structure and get fraction replaceable - min/max as well as lighting + // level for a zone. + + // Using/Aliasing + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int Loop; + Real64 LightsRepMin; // Minimum Lighting replacement fraction for any lights statement for this zone + Real64 LightsRepMax; // Maximum Lighting replacement fraction for any lights statement for this zone + int NumLights; // Number of Lights statement for that zone. + + if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { + ShowFatalError(state, "CheckLightsReplaceableMinMaxForZone: Function called prior to Getting Lights Input."); } - void CheckLightsReplaceableMinMaxForZone(EnergyPlusData &state, int const WhichZone) // Zone Number - { - - // SUBROUTINE INFORMATION: - // AUTHOR Linda Lawrie - // DATE WRITTEN April 2007 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // Daylighting is not available unless Lights (replaceable) is 0.0 or 1.0. No dimming will be done - // unless the lights replaceable fraction is 1.0. This is documented in the InputOutputReference but - // not warned about. Also, this will sum the Zone Design Lighting level, in case the calling routine - // would like to have an error if the lights is zero and daylighting is requested. - - // METHODOLOGY EMPLOYED: - // Traverse the LIGHTS structure and get fraction replaceable - min/max as well as lighting - // level for a zone. - - // Using/Aliasing - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Loop; - Real64 LightsRepMin; // Minimum Lighting replacement fraction for any lights statement for this zone - Real64 LightsRepMax; // Maximum Lighting replacement fraction for any lights statement for this zone - int NumLights; // Number of Lights statement for that zone. - - if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) { - ShowFatalError(state, "CheckLightsReplaceableMinMaxForZone: Function called prior to Getting Lights Input."); + LightsRepMin = 99999.0; + LightsRepMax = -99999.0; + NumLights = 0; + + for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { + if (state.dataHeatBal->Lights(Loop).ZonePtr != WhichZone) continue; + LightsRepMin = min(LightsRepMin, state.dataHeatBal->Lights(Loop).FractionReplaceable); + LightsRepMax = max(LightsRepMax, state.dataHeatBal->Lights(Loop).FractionReplaceable); + ++NumLights; + if ((state.dataDaylightingData->ZoneDaylight(state.dataHeatBal->Lights(Loop).ZonePtr).DaylightMethod == + DataDaylighting::iDaylightingMethod::SplitFluxDaylighting || + state.dataDaylightingData->ZoneDaylight(state.dataHeatBal->Lights(Loop).ZonePtr).DaylightMethod == + DataDaylighting::iDaylightingMethod::DElightDaylighting) && + (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0 && state.dataHeatBal->Lights(Loop).FractionReplaceable < 1.0)) { + ShowWarningError(state, "CheckLightsReplaceableMinMaxForZone: Fraction Replaceable must be 0.0 or 1.0 if used with daylighting."); + ShowContinueError(state, + "..Lights=\"" + state.dataHeatBal->Lights(Loop).Name + + "\", Fraction Replaceable will be reset to 1.0 to allow dimming controls"); + ShowContinueError(state, "..in Zone=" + state.dataHeatBal->Zone(WhichZone).Name); + state.dataHeatBal->Lights(Loop).FractionReplaceable = 1.0; } + } - LightsRepMin = 99999.0; - LightsRepMax = -99999.0; - NumLights = 0; - - for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { - if (state.dataHeatBal->Lights(Loop).ZonePtr != WhichZone) continue; - LightsRepMin = min(LightsRepMin, state.dataHeatBal->Lights(Loop).FractionReplaceable); - LightsRepMax = max(LightsRepMax, state.dataHeatBal->Lights(Loop).FractionReplaceable); - ++NumLights; - if ((state.dataDaylightingData->ZoneDaylight(state.dataHeatBal->Lights(Loop).ZonePtr).DaylightMethod == - DataDaylighting::iDaylightingMethod::SplitFluxDaylighting || - state.dataDaylightingData->ZoneDaylight(state.dataHeatBal->Lights(Loop).ZonePtr).DaylightMethod == - DataDaylighting::iDaylightingMethod::DElightDaylighting) && - (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0 && state.dataHeatBal->Lights(Loop).FractionReplaceable < 1.0)) { - ShowWarningError(state, "CheckLightsReplaceableMinMaxForZone: Fraction Replaceable must be 0.0 or 1.0 if used with daylighting."); - ShowContinueError(state, - "..Lights=\"" + state.dataHeatBal->Lights(Loop).Name + - "\", Fraction Replaceable will be reset to 1.0 to allow dimming controls"); - ShowContinueError(state, "..in Zone=" + state.dataHeatBal->Zone(WhichZone).Name); - state.dataHeatBal->Lights(Loop).FractionReplaceable = 1.0; - } + if (state.dataDaylightingData->ZoneDaylight(WhichZone).DaylightMethod == DataDaylighting::iDaylightingMethod::SplitFluxDaylighting) { + if (LightsRepMax == 0.0) { + ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); + ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable."); + ShowContinueError(state, "The daylighting controls will have no effect."); } - - if (state.dataDaylightingData->ZoneDaylight(WhichZone).DaylightMethod == DataDaylighting::iDaylightingMethod::SplitFluxDaylighting) { - if (LightsRepMax == 0.0) { - ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); - ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable."); - ShowContinueError(state, "The daylighting controls will have no effect."); - } - if (NumLights == 0) { - ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); - ShowContinueError(state, "but there are no LIGHTS objects in that zone."); - ShowContinueError(state, "The daylighting controls will have no effect."); - } + if (NumLights == 0) { + ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); + ShowContinueError(state, "but there are no LIGHTS objects in that zone."); + ShowContinueError(state, "The daylighting controls will have no effect."); } - else if (state.dataDaylightingData->ZoneDaylight(WhichZone).DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) { - if (LightsRepMax == 0.0) { - ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); - ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable."); - ShowContinueError(state, "The daylighting controls will have no effect."); - } - if (NumLights == 0) { - ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); - ShowContinueError(state, "but there are no LIGHTS objects in that zone."); - ShowContinueError(state, "The daylighting controls will have no effect."); - } + } else if (state.dataDaylightingData->ZoneDaylight(WhichZone).DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) { + if (LightsRepMax == 0.0) { + ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); + ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable."); + ShowContinueError(state, "The daylighting controls will have no effect."); + } + if (NumLights == 0) { + ShowWarningError(state, "CheckLightsReplaceable: Zone \"" + state.dataHeatBal->Zone(WhichZone).Name + "\" has Daylighting:Controls."); + ShowContinueError(state, "but there are no LIGHTS objects in that zone."); + ShowContinueError(state, "The daylighting controls will have no effect."); } } + } - void UpdateInternalGainValues(EnergyPlusData &state, Optional_bool_const SuppressRadiationUpdate, Optional_bool_const SumLatentGains) - { + void UpdateInternalGainValues(EnergyPlusData &state, Optional_bool_const SuppressRadiationUpdate, Optional_bool_const SumLatentGains) + { - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na - // Using/Aliasing + // Using/Aliasing - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Loop; - int NZ; - bool DoRadiationUpdate; - bool ReSumLatentGains; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int Loop; + int NZ; + bool DoRadiationUpdate; + bool ReSumLatentGains; - DoRadiationUpdate = true; - ReSumLatentGains = false; + DoRadiationUpdate = true; + ReSumLatentGains = false; - if (present(SuppressRadiationUpdate)) { - if (SuppressRadiationUpdate) DoRadiationUpdate = false; - } + if (present(SuppressRadiationUpdate)) { + if (SuppressRadiationUpdate) DoRadiationUpdate = false; + } - if (present(SumLatentGains)) { - if (SumLatentGains) ReSumLatentGains = true; - } + if (present(SumLatentGains)) { + if (SumLatentGains) ReSumLatentGains = true; + } - // store pointer values to hold generic internal gain values constant for entire timestep - for (NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { - for (Loop = 1; Loop <= state.dataHeatBal->ZoneIntGain(NZ).NumberOfDevices; ++Loop) { - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ConvectGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrConvectGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ReturnAirConvGainRate = - *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrReturnAirConvGainRate; - if (DoRadiationUpdate) - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).RadiantGainRate = + // store pointer values to hold generic internal gain values constant for entire timestep + for (NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { + for (Loop = 1; Loop <= state.dataHeatBal->ZoneIntGain(NZ).NumberOfDevices; ++Loop) { + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ConvectGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrConvectGainRate; + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ReturnAirConvGainRate = + *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrReturnAirConvGainRate; + if (DoRadiationUpdate) + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).RadiantGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrRadiantGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).LatentGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrLatentGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ReturnAirLatentGainRate = - *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrReturnAirLatentGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).CarbonDioxideGainRate = - *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrCarbonDioxideGainRate; - state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).GenericContamGainRate = - *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrGenericContamGainRate; - } - if (ReSumLatentGains) { - SumAllInternalLatentGains(state, NZ, state.dataHeatBalFanSys->ZoneLatentGain(NZ)); - // Added for the hybrid model - if (state.dataHybridModel->FlagHybridModel_PC) { - SumAllInternalLatentGainsExceptPeople(state, NZ, state.dataHeatBalFanSys->ZoneLatentGainExceptPeople(NZ)); - } - } + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).LatentGainRate = *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrLatentGainRate; + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).ReturnAirLatentGainRate = + *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrReturnAirLatentGainRate; + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).CarbonDioxideGainRate = + *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrCarbonDioxideGainRate; + state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).GenericContamGainRate = + *state.dataHeatBal->ZoneIntGain(NZ).Device(Loop).PtrGenericContamGainRate; } - - if (state.dataContaminantBalance->Contaminant.GenericContamSimulation && allocated(state.dataContaminantBalance->ZoneGCGain)) { - for (NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { - SumAllInternalGenericContamGains(state, NZ, state.dataContaminantBalance->ZoneGCGain(NZ)); - state.dataHeatBal->ZnRpt(NZ).GCRate = state.dataContaminantBalance->ZoneGCGain(NZ); + if (ReSumLatentGains) { + SumAllInternalLatentGains(state, NZ, state.dataHeatBalFanSys->ZoneLatentGain(NZ)); + // Added for the hybrid model + if (state.dataHybridModel->FlagHybridModel_PC) { + SumAllInternalLatentGainsExceptPeople(state, NZ, state.dataHeatBalFanSys->ZoneLatentGainExceptPeople(NZ)); } } } - void SumAllInternalConvectionGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumConvGainRate) - { + if (state.dataContaminantBalance->Contaminant.GenericContamSimulation && allocated(state.dataContaminantBalance->ZoneGCGain)) { + for (NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) { + SumAllInternalGenericContamGains(state, NZ, state.dataContaminantBalance->ZoneGCGain(NZ)); + state.dataHeatBal->ZnRpt(NZ).GCRate = state.dataContaminantBalance->ZoneGCGain(NZ); + } + } + } - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na + void SumAllInternalConvectionGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumConvGainRate) + { - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumConvGainRate; - int DeviceNum; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - tmpSumConvGainRate = 0.0; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumConvGainRate = 0.0; - return; - } + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumConvGainRate; + int DeviceNum; - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; - } + tmpSumConvGainRate = 0.0; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumConvGainRate = 0.0; + return; + } - SumConvGainRate = tmpSumConvGainRate; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; } - // For HybridModel - void SumAllInternalConvectionGainsExceptPeople(EnergyPlusData &state, int const ZoneNum, Real64 &SumConvGainRateExceptPeople) - { - Real64 tmpSumConvGainRateExceptPeople; - int DeviceNum; - std::string str_people = "PEOPLE"; - tmpSumConvGainRateExceptPeople = 0.0; - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumConvGainRateExceptPeople = 0.0; - return; - } + SumConvGainRate = tmpSumConvGainRate; + } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectType != str_people) { - tmpSumConvGainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; - } - } + // For HybridModel + void SumAllInternalConvectionGainsExceptPeople(EnergyPlusData &state, int const ZoneNum, Real64 &SumConvGainRateExceptPeople) + { + Real64 tmpSumConvGainRateExceptPeople; + int DeviceNum; + std::string str_people = "PEOPLE"; + tmpSumConvGainRateExceptPeople = 0.0; - SumConvGainRateExceptPeople = tmpSumConvGainRateExceptPeople; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumConvGainRateExceptPeople = 0.0; + return; } - void SumInternalConvectionGainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumConvGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011cl - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumConvGainRate; - int DeviceNum; - int TypeNum; - - NumberOfTypes = size(GainTypeARR); - tmpSumConvGainRate = 0.0; - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumConvGainRate = 0.0; - return; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectType != str_people) { + tmpSumConvGainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; } + } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; - } - } - } + SumConvGainRateExceptPeople = tmpSumConvGainRateExceptPeople; + } - SumConvGainRate = tmpSumConvGainRate; - } + void SumInternalConvectionGainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumConvGainRate) + { - void SumAllReturnAirConvectionGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumReturnAirGainRate, - int const ReturnNodeNum // return air node number - ) - { + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011cl + // MODIFIED na + // RE-ENGINEERED na - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumConvGainRate; + int DeviceNum; + int TypeNum; - Real64 tmpSumRetAirGainRate; - int DeviceNum; + NumberOfTypes = size(GainTypeARR); + tmpSumConvGainRate = 0.0; - tmpSumRetAirGainRate = 0.0; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumConvGainRate = 0.0; + return; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumReturnAirGainRate = 0.0; - return; - } + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum - if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirNodeNum)) { - tmpSumRetAirGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate; } } + } + + SumConvGainRate = tmpSumConvGainRate; + } + + void SumAllReturnAirConvectionGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumReturnAirGainRate, + int const ReturnNodeNum // return air node number + ) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types + + Real64 tmpSumRetAirGainRate; + int DeviceNum; + + tmpSumRetAirGainRate = 0.0; - SumReturnAirGainRate = tmpSumRetAirGainRate; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumReturnAirGainRate = 0.0; + return; } - void SumReturnAirConvectionGainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumReturnAirGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumRetAirConvGainRate; - int DeviceNum; - int TypeNum; - - NumberOfTypes = size(GainTypeARR); - tmpSumRetAirConvGainRate = 0.0; - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumReturnAirGainRate = 0.0; - return; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum + if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirNodeNum)) { + tmpSumRetAirGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate; } + } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + SumReturnAirGainRate = tmpSumRetAirGainRate; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumRetAirConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate; - } + void SumReturnAirConvectionGainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumReturnAirGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumRetAirConvGainRate; + int DeviceNum; + int TypeNum; + + NumberOfTypes = size(GainTypeARR); + tmpSumRetAirConvGainRate = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumReturnAirGainRate = 0.0; + return; + } + + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumRetAirConvGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate; } } - - SumReturnAirGainRate = tmpSumRetAirConvGainRate; } - void SumAllInternalRadiationGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumRadGainRate) - { + SumReturnAirGainRate = tmpSumRetAirConvGainRate; + } - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na + void SumAllInternalRadiationGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumRadGainRate) + { - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumRadGainRate; - int DeviceNum; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - tmpSumRadGainRate = 0.0; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumRadGainRate; + int DeviceNum; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumRadGainRate = 0.0; - return; - } + tmpSumRadGainRate = 0.0; - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumRadGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).RadiantGainRate; - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumRadGainRate = 0.0; + return; + } - SumRadGainRate = tmpSumRadGainRate; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumRadGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).RadiantGainRate; } - void SumInternalRadiationGainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumRadiationGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumRadiationGainRate; - int DeviceNum; - int TypeNum; - - NumberOfTypes = size(GainTypeARR); - tmpSumRadiationGainRate = 0.0; - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumRadiationGainRate = 0.0; - return; - } + SumRadGainRate = tmpSumRadGainRate; + } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + void SumInternalRadiationGainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumRadiationGainRate) + { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumRadiationGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).RadiantGainRate; - } + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumRadiationGainRate; + int DeviceNum; + int TypeNum; + + NumberOfTypes = size(GainTypeARR); + tmpSumRadiationGainRate = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumRadiationGainRate = 0.0; + return; + } + + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumRadiationGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).RadiantGainRate; } } - - SumRadiationGainRate = tmpSumRadiationGainRate; } - void SumAllInternalLatentGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumLatentGainRate) - { + SumRadiationGainRate = tmpSumRadiationGainRate; + } - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na + void SumAllInternalLatentGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumLatentGainRate) + { - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumLatentGainRate; - int DeviceNum; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - tmpSumLatentGainRate = 0.0; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumLatentGainRate; + int DeviceNum; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumLatentGainRate = 0.0; - return; - } + tmpSumLatentGainRate = 0.0; - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumLatentGainRate = 0.0; + return; + } - SumLatentGainRate = tmpSumLatentGainRate; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; } - // Added for hybrid model -- calculate the latent gain from all sources except for people - void SumAllInternalLatentGainsExceptPeople(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumLatentGainRateExceptPeople) - { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumLatentGainRateExceptPeople = 0.0; - return; - } - for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOf_People) { - SumLatentGainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; - } + SumLatentGainRate = tmpSumLatentGainRate; + } + + // Added for hybrid model -- calculate the latent gain from all sources except for people + void SumAllInternalLatentGainsExceptPeople(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumLatentGainRateExceptPeople) + { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumLatentGainRateExceptPeople = 0.0; + return; + } + for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOf_People) { + SumLatentGainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; } } + } + + void SumInternalLatentGainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumLatentGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na - void SumInternalLatentGainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumLatentGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumLatentGainRate; - int DeviceNum; - int TypeNum; - - NumberOfTypes = size(GainTypeARR); - tmpSumLatentGainRate = 0.0; - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumLatentGainRate = 0.0; - return; - } + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumLatentGainRate; + int DeviceNum; + int TypeNum; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; - } + NumberOfTypes = size(GainTypeARR); + tmpSumLatentGainRate = 0.0; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumLatentGainRate = 0.0; + return; + } + + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate; } } - - SumLatentGainRate = tmpSumLatentGainRate; } - void SumAllReturnAirLatentGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumRetAirLatentGainRate, - int const ReturnNodeNum // return air node number - ) - { + SumLatentGainRate = tmpSumLatentGainRate; + } - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Nov. 2011 - // MODIFIED na - // RE-ENGINEERED na + void SumAllReturnAirLatentGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumRetAirLatentGainRate, + int const ReturnNodeNum // return air node number + ) + { - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Nov. 2011 + // MODIFIED na + // RE-ENGINEERED na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumLatentGainRate; - int DeviceNum; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - tmpSumLatentGainRate = 0.0; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumLatentGainRate; + int DeviceNum; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumRetAirLatentGainRate = 0.0; - return; - } + tmpSumLatentGainRate = 0.0; - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum - if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirNodeNum)) { - tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirLatentGainRate; - } - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumRetAirLatentGainRate = 0.0; + return; + } - SumRetAirLatentGainRate = tmpSumLatentGainRate; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum + if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirNodeNum)) { + tmpSumLatentGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirLatentGainRate; + } } - void SumAllInternalCO2Gains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumCO2GainRate) - { + SumRetAirLatentGainRate = tmpSumLatentGainRate; + } - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na + void SumAllInternalCO2Gains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumCO2GainRate) + { - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumCO2GainRate; - int DeviceNum; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types - tmpSumCO2GainRate = 0.0; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumCO2GainRate; + int DeviceNum; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumCO2GainRate = 0.0; - return; - } + tmpSumCO2GainRate = 0.0; - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumCO2GainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumCO2GainRate = 0.0; + return; + } - SumCO2GainRate = tmpSumCO2GainRate; + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumCO2GainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; } - // Added for hybrid model -- function for calculating CO2 gains except people - void SumAllInternalCO2GainsExceptPeople(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumCO2GainRateExceptPeople) - { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumCO2GainRateExceptPeople = 0.0; - return; - } + SumCO2GainRate = tmpSumCO2GainRate; + } + + // Added for hybrid model -- function for calculating CO2 gains except people + void SumAllInternalCO2GainsExceptPeople(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumCO2GainRateExceptPeople) + { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumCO2GainRateExceptPeople = 0.0; + return; + } - for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOf_People) { - SumCO2GainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; - } + for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOf_People) { + SumCO2GainRateExceptPeople += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; } } + } + + void SumInternalCO2GainsByTypes(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types + Real64 &SumCO2GainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN Dec. 2011 + // MODIFIED na + // RE-ENGINEERED na - void SumInternalCO2GainsByTypes(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types - Real64 &SumCO2GainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN Dec. 2011 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gain types - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfTypes; - Real64 tmpSumCO2GainRate; - int DeviceNum; - int TypeNum; - - NumberOfTypes = size(GainTypeARR); - tmpSumCO2GainRate = 0.0; - - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumCO2GainRate = 0.0; - return; - } + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gain types - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfTypes; + Real64 tmpSumCO2GainRate; + int DeviceNum; + int TypeNum; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { - tmpSumCO2GainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; - } - } - } + NumberOfTypes = size(GainTypeARR); + tmpSumCO2GainRate = 0.0; - SumCO2GainRate = tmpSumCO2GainRate; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumCO2GainRate = 0.0; + return; } - void SumAllInternalGenericContamGains(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - Real64 &SumGCGainRate) - { + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + for (TypeNum = 1; TypeNum <= NumberOfTypes; ++TypeNum) { + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == GainTypeARR(TypeNum)) { + tmpSumCO2GainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CarbonDioxideGainRate; + } + } + } - // SUBROUTINE INFORMATION: - // AUTHOR L. Gu - // DATE WRITTEN Feb. 2012 - // MODIFIED na - // RE-ENGINEERED na + SumCO2GainRate = tmpSumCO2GainRate; + } - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing all the internal gain types based on the existing subrotine SumAllInternalCO2Gains + void SumAllInternalGenericContamGains(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + Real64 &SumGCGainRate) + { - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tmpSumGCGainRate; - int DeviceNum; + // SUBROUTINE INFORMATION: + // AUTHOR L. Gu + // DATE WRITTEN Feb. 2012 + // MODIFIED na + // RE-ENGINEERED na - tmpSumGCGainRate = 0.0; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing all the internal gain types based on the existing subrotine SumAllInternalCO2Gains - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumGCGainRate = 0.0; - return; - } + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 tmpSumGCGainRate; + int DeviceNum; - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - tmpSumGCGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).GenericContamGainRate; - } + tmpSumGCGainRate = 0.0; - SumGCGainRate = tmpSumGCGainRate; + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumGCGainRate = 0.0; + return; } - void GatherComponentLoadsIntGain(EnergyPlusData &state) - { - // SUBROUTINE INFORMATION: - // AUTHOR Jason Glazer - // DATE WRITTEN September 2012 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // Gather values during sizing used for loads component report. - - // METHODOLOGY EMPLOYED: - // Save sequence of values for report during sizing. - - // Using/Aliasing - using namespace DataHeatBalance; - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static const Array1D_int IntGainTypesPeople(1, { IntGainTypeOf_People }); - static const Array1D_int IntGainTypesLight(1, { IntGainTypeOf_Lights }); - static const Array1D_int IntGainTypesEquip(6, - { IntGainTypeOf_ElectricEquipment, - IntGainTypeOf_ElectricEquipmentITEAirCooled, - IntGainTypeOf_GasEquipment, - IntGainTypeOf_HotWaterEquipment, - IntGainTypeOf_SteamEquipment, - IntGainTypeOf_OtherEquipment }); - static const Array1D_int IntGainTypesRefrig(10, - { IntGainTypeOf_RefrigerationCase, - IntGainTypeOf_RefrigerationCompressorRack, - IntGainTypeOf_RefrigerationSystemAirCooledCondenser, - IntGainTypeOf_RefrigerationSystemSuctionPipe, - IntGainTypeOf_RefrigerationSecondaryReceiver, - IntGainTypeOf_RefrigerationSecondaryPipe, - IntGainTypeOf_RefrigerationWalkIn, - IntGainTypeOf_RefrigerationTransSysAirCooledGasCooler, - IntGainTypeOf_RefrigerationTransSysSuctionPipeMT, - IntGainTypeOf_RefrigerationTransSysSuctionPipeLT }); - static const Array1D_int IntGainTypesWaterUse( - 3, { IntGainTypeOf_WaterUseEquipment, IntGainTypeOf_WaterHeaterMixed, IntGainTypeOf_WaterHeaterStratified }); - static const Array1D_int IntGainTypesHvacLoss(20, - { IntGainTypeOf_ZoneBaseboardOutdoorTemperatureControlled, - IntGainTypeOf_ThermalStorageChilledWaterMixed, - IntGainTypeOf_ThermalStorageChilledWaterStratified, - IntGainTypeOf_PipeIndoor, - IntGainTypeOf_Pump_VarSpeed, - IntGainTypeOf_Pump_ConSpeed, - IntGainTypeOf_Pump_Cond, - IntGainTypeOf_PumpBank_VarSpeed, - IntGainTypeOf_PumpBank_ConSpeed, - IntGainTypeOf_PlantComponentUserDefined, - IntGainTypeOf_CoilUserDefined, - IntGainTypeOf_ZoneHVACForcedAirUserDefined, - IntGainTypeOf_AirTerminalUserDefined, - IntGainTypeOf_PackagedTESCoilTank, - IntGainTypeOf_FanSystemModel, - IntGainTypeOf_SecCoolingDXCoilSingleSpeed, - IntGainTypeOf_SecHeatingDXCoilSingleSpeed, - IntGainTypeOf_SecCoolingDXCoilTwoSpeed, - IntGainTypeOf_SecCoolingDXCoilMultiSpeed, - IntGainTypeOf_SecHeatingDXCoilMultiSpeed }); - static const Array1D_int IntGainTypesPowerGen(10, - { IntGainTypeOf_GeneratorFuelCell, - IntGainTypeOf_GeneratorMicroCHP, - IntGainTypeOf_ElectricLoadCenterTransformer, - IntGainTypeOf_ElectricLoadCenterInverterSimple, - IntGainTypeOf_ElectricLoadCenterInverterFunctionOfPower, - IntGainTypeOf_ElectricLoadCenterInverterLookUpTable, - IntGainTypeOf_ElectricLoadCenterStorageLiIonNmcBattery, - IntGainTypeOf_ElectricLoadCenterStorageBattery, - IntGainTypeOf_ElectricLoadCenterStorageSimple, - IntGainTypeOf_ElectricLoadCenterConverter }); - - if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { - int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - SumInternalConvectionGainsByTypes( - state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes( - state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes( - state, iZone, IntGainTypesLight, state.dataOutRptTab->lightInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumReturnAirConvectionGainsByTypes( - state, iZone, IntGainTypesLight, state.dataOutRptTab->lightRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesLight, state.dataOutRptTab->lightLWRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes( - state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes( - state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes( - state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumReturnAirConvectionGainsByTypes( - state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes( - state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes(state, - iZone, - IntGainTypesWaterUse, - state.dataOutRptTab->waterUseInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes(state, - iZone, - IntGainTypesWaterUse, - state.dataOutRptTab->waterUseLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes(state, - iZone, - IntGainTypesHvacLoss, - state.dataOutRptTab->hvacLossInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesHvacLoss, state.dataOutRptTab->hvacLossRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - - SumInternalConvectionGainsByTypes(state, - iZone, - IntGainTypesPowerGen, - state.dataOutRptTab->powerGenInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes( - state, iZone, IntGainTypesPowerGen, state.dataOutRptTab->powerGenRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); - } - } + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + tmpSumGCGainRate += state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).GenericContamGainRate; } - void GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number - std::string const &IntGainName, // Internal gain name - int &DeviceIndex, // Device index - bool &ErrorFound) - { + SumGCGainRate = tmpSumGCGainRate; + } - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN June 2012 - // MODIFIED na - // RE-ENGINEERED na + void GatherComponentLoadsIntGain(EnergyPlusData &state) + { + // SUBROUTINE INFORMATION: + // AUTHOR Jason Glazer + // DATE WRITTEN September 2012 + // MODIFIED na + // RE-ENGINEERED na - // PURPOSE OF THIS SUBROUTINE: - // utility to retrieve index pointer to a specific internal gain + // PURPOSE OF THIS SUBROUTINE: + // Gather values during sizing used for loads component report. - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - bool Found; - int DeviceNum; + // METHODOLOGY EMPLOYED: + // Save sequence of values for report during sizing. - Found = false; + // Using/Aliasing + using namespace DataHeatBalance; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - DeviceIndex = -1; - ErrorFound = true; - return; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + static const Array1D_int IntGainTypesPeople(1, {IntGainTypeOf_People}); + static const Array1D_int IntGainTypesLight(1, {IntGainTypeOf_Lights}); + static const Array1D_int IntGainTypesEquip(6, + {IntGainTypeOf_ElectricEquipment, + IntGainTypeOf_ElectricEquipmentITEAirCooled, + IntGainTypeOf_GasEquipment, + IntGainTypeOf_HotWaterEquipment, + IntGainTypeOf_SteamEquipment, + IntGainTypeOf_OtherEquipment}); + static const Array1D_int IntGainTypesRefrig(10, + {IntGainTypeOf_RefrigerationCase, + IntGainTypeOf_RefrigerationCompressorRack, + IntGainTypeOf_RefrigerationSystemAirCooledCondenser, + IntGainTypeOf_RefrigerationSystemSuctionPipe, + IntGainTypeOf_RefrigerationSecondaryReceiver, + IntGainTypeOf_RefrigerationSecondaryPipe, + IntGainTypeOf_RefrigerationWalkIn, + IntGainTypeOf_RefrigerationTransSysAirCooledGasCooler, + IntGainTypeOf_RefrigerationTransSysSuctionPipeMT, + IntGainTypeOf_RefrigerationTransSysSuctionPipeLT}); + static const Array1D_int IntGainTypesWaterUse( + 3, {IntGainTypeOf_WaterUseEquipment, IntGainTypeOf_WaterHeaterMixed, IntGainTypeOf_WaterHeaterStratified}); + static const Array1D_int IntGainTypesHvacLoss(20, + {IntGainTypeOf_ZoneBaseboardOutdoorTemperatureControlled, + IntGainTypeOf_ThermalStorageChilledWaterMixed, + IntGainTypeOf_ThermalStorageChilledWaterStratified, + IntGainTypeOf_PipeIndoor, + IntGainTypeOf_Pump_VarSpeed, + IntGainTypeOf_Pump_ConSpeed, + IntGainTypeOf_Pump_Cond, + IntGainTypeOf_PumpBank_VarSpeed, + IntGainTypeOf_PumpBank_ConSpeed, + IntGainTypeOf_PlantComponentUserDefined, + IntGainTypeOf_CoilUserDefined, + IntGainTypeOf_ZoneHVACForcedAirUserDefined, + IntGainTypeOf_AirTerminalUserDefined, + IntGainTypeOf_PackagedTESCoilTank, + IntGainTypeOf_FanSystemModel, + IntGainTypeOf_SecCoolingDXCoilSingleSpeed, + IntGainTypeOf_SecHeatingDXCoilSingleSpeed, + IntGainTypeOf_SecCoolingDXCoilTwoSpeed, + IntGainTypeOf_SecCoolingDXCoilMultiSpeed, + IntGainTypeOf_SecHeatingDXCoilMultiSpeed}); + static const Array1D_int IntGainTypesPowerGen(10, + {IntGainTypeOf_GeneratorFuelCell, + IntGainTypeOf_GeneratorMicroCHP, + IntGainTypeOf_ElectricLoadCenterTransformer, + IntGainTypeOf_ElectricLoadCenterInverterSimple, + IntGainTypeOf_ElectricLoadCenterInverterFunctionOfPower, + IntGainTypeOf_ElectricLoadCenterInverterLookUpTable, + IntGainTypeOf_ElectricLoadCenterStorageLiIonNmcBattery, + IntGainTypeOf_ElectricLoadCenterStorageBattery, + IntGainTypeOf_ElectricLoadCenterStorageSimple, + IntGainTypeOf_ElectricLoadCenterConverter}); + + if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { + int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + SumInternalConvectionGainsByTypes( + state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes( + state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesPeople, state.dataOutRptTab->peopleRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes( + state, iZone, IntGainTypesLight, state.dataOutRptTab->lightInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumReturnAirConvectionGainsByTypes( + state, iZone, IntGainTypesLight, state.dataOutRptTab->lightRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesLight, state.dataOutRptTab->lightLWRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes( + state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes( + state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesEquip, state.dataOutRptTab->equipRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes( + state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumReturnAirConvectionGainsByTypes( + state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes( + state, iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes(state, + iZone, + IntGainTypesWaterUse, + state.dataOutRptTab->waterUseInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes(state, + iZone, + IntGainTypesWaterUse, + state.dataOutRptTab->waterUseLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes(state, + iZone, + IntGainTypesHvacLoss, + state.dataOutRptTab->hvacLossInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesHvacLoss, state.dataOutRptTab->hvacLossRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + + SumInternalConvectionGainsByTypes(state, + iZone, + IntGainTypesPowerGen, + state.dataOutRptTab->powerGenInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes( + state, iZone, IntGainTypesPowerGen, state.dataOutRptTab->powerGenRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone)); } + } + } + + void GetInternalGainDeviceIndex(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number + std::string const &IntGainName, // Internal gain name + int &DeviceIndex, // Device index + bool &ErrorFound) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN June 2012 + // MODIFIED na + // RE-ENGINEERED na - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (UtilityRoutines::SameString(state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName, IntGainName)) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOfNum) { - ErrorFound = true; - } - else { - ErrorFound = false; - } - Found = true; - DeviceIndex = DeviceNum; - break; - } - else { + // PURPOSE OF THIS SUBROUTINE: + // utility to retrieve index pointer to a specific internal gain + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + bool Found; + int DeviceNum; + + Found = false; + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + DeviceIndex = -1; + ErrorFound = true; + return; + } + + for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { + if (UtilityRoutines::SameString(state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName, IntGainName)) { + if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOfNum) { ErrorFound = true; + } else { + ErrorFound = false; } + Found = true; + DeviceIndex = DeviceNum; + break; + } else { + ErrorFound = true; } } + } + + void SumInternalConvectionGainsByIndices( + EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation + const Array1D &FractionARR, // array of fractional multipliers to apply to devices + Real64 &SumConvGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN June 2012 + // MODIFIED na + // RE-ENGINEERED na - void SumInternalConvectionGainsByIndices( - EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation - const Array1D &FractionARR, // array of fractional multipliers to apply to devices - Real64 &SumConvGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN June 2012 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gains by index - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfIndices; - int NumberOfFractions; - Real64 tmpSumConvGainRate; - int loop; - int DeviceNum; - Real64 DeviceFraction; - - NumberOfIndices = isize(DeviceIndexARR); - NumberOfFractions = isize(FractionARR); - tmpSumConvGainRate = 0.0; - - // remove this next safety check after testing code - if (NumberOfIndices != NumberOfFractions) { // throw error - ShowSevereError(state, "SumInternalConvectionGainsByIndices: bad arguments, sizes do not match"); - } + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gains by index - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumConvGainRate = 0.0; - return; - } + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfIndices; + int NumberOfFractions; + Real64 tmpSumConvGainRate; + int loop; + int DeviceNum; + Real64 DeviceFraction; - for (loop = 1; loop <= NumberOfIndices; ++loop) { - DeviceNum = DeviceIndexARR(loop); - DeviceFraction = FractionARR(loop); - tmpSumConvGainRate = tmpSumConvGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate * DeviceFraction; - } - SumConvGainRate = tmpSumConvGainRate; + NumberOfIndices = isize(DeviceIndexARR); + NumberOfFractions = isize(FractionARR); + tmpSumConvGainRate = 0.0; + + // remove this next safety check after testing code + if (NumberOfIndices != NumberOfFractions) { // throw error + ShowSevereError(state, "SumInternalConvectionGainsByIndices: bad arguments, sizes do not match"); } - void SumInternalLatentGainsByIndices( - EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation - const Array1D &FractionARR, // array of fractional multipliers to apply to devices - Real64 &SumLatentGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN June 2012 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gains by index - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfIndices; - int NumberOfFractions; - Real64 tmpSumLatentGainRate; - int loop; - int DeviceNum; - Real64 DeviceFraction; - - NumberOfIndices = isize(DeviceIndexARR); - NumberOfFractions = isize(FractionARR); - tmpSumLatentGainRate = 0.0; - - // remove this next safety check after testing code - if (NumberOfIndices != NumberOfFractions) { // throw error - ShowSevereError(state, "SumInternalLatentGainsByIndices: bad arguments, sizes do not match"); - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumConvGainRate = 0.0; + return; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumLatentGainRate = 0.0; - return; - } + for (loop = 1; loop <= NumberOfIndices; ++loop) { + DeviceNum = DeviceIndexARR(loop); + DeviceFraction = FractionARR(loop); + tmpSumConvGainRate = tmpSumConvGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ConvectGainRate * DeviceFraction; + } + SumConvGainRate = tmpSumConvGainRate; + } + + void SumInternalLatentGainsByIndices( + EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation + const Array1D &FractionARR, // array of fractional multipliers to apply to devices + Real64 &SumLatentGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN June 2012 + // MODIFIED na + // RE-ENGINEERED na - for (loop = 1; loop <= NumberOfIndices; ++loop) { - DeviceNum = DeviceIndexARR(loop); - DeviceFraction = FractionARR(loop); - tmpSumLatentGainRate = tmpSumLatentGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate * DeviceFraction; - } - SumLatentGainRate = tmpSumLatentGainRate; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gains by index + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfIndices; + int NumberOfFractions; + Real64 tmpSumLatentGainRate; + int loop; + int DeviceNum; + Real64 DeviceFraction; + + NumberOfIndices = isize(DeviceIndexARR); + NumberOfFractions = isize(FractionARR); + tmpSumLatentGainRate = 0.0; + + // remove this next safety check after testing code + if (NumberOfIndices != NumberOfFractions) { // throw error + ShowSevereError(state, "SumInternalLatentGainsByIndices: bad arguments, sizes do not match"); } - void SumReturnAirConvectionGainsByIndices( - EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation - const Array1D &FractionARR, // array of fractional multipliers to apply to devices - Real64 &SumReturnAirGainRate) - { - - // SUBROUTINE INFORMATION: - // AUTHOR B. Griffith - // DATE WRITTEN June 2012 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // worker routine for summing a subset of the internal gains by index - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NumberOfIndices; - int NumberOfFractions; - Real64 tmpSumReturnAirGainRate; - int loop; - int DeviceNum; - Real64 DeviceFraction; - - NumberOfIndices = isize(DeviceIndexARR); - NumberOfFractions = isize(FractionARR); - tmpSumReturnAirGainRate = 0.0; - - // remove this next safety check after testing code - if (NumberOfIndices != NumberOfFractions) { // throw error - ShowSevereError(state, "SumReturnAirConvectionGainsByIndice: bad arguments, sizes do not match"); - } + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumLatentGainRate = 0.0; + return; + } - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { - SumReturnAirGainRate = 0.0; - return; - } + for (loop = 1; loop <= NumberOfIndices; ++loop) { + DeviceNum = DeviceIndexARR(loop); + DeviceFraction = FractionARR(loop); + tmpSumLatentGainRate = tmpSumLatentGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).LatentGainRate * DeviceFraction; + } + SumLatentGainRate = tmpSumLatentGainRate; + } + + void SumReturnAirConvectionGainsByIndices( + EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + const Array1D_int &DeviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation + const Array1D &FractionARR, // array of fractional multipliers to apply to devices + Real64 &SumReturnAirGainRate) + { + + // SUBROUTINE INFORMATION: + // AUTHOR B. Griffith + // DATE WRITTEN June 2012 + // MODIFIED na + // RE-ENGINEERED na - for (loop = 1; loop <= NumberOfIndices; ++loop) { - DeviceNum = DeviceIndexARR(loop); - DeviceFraction = FractionARR(loop); - tmpSumReturnAirGainRate = - tmpSumReturnAirGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate * DeviceFraction; - } - SumReturnAirGainRate = tmpSumReturnAirGainRate; + // PURPOSE OF THIS SUBROUTINE: + // worker routine for summing a subset of the internal gains by index + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + int NumberOfIndices; + int NumberOfFractions; + Real64 tmpSumReturnAirGainRate; + int loop; + int DeviceNum; + Real64 DeviceFraction; + + NumberOfIndices = isize(DeviceIndexARR); + NumberOfFractions = isize(FractionARR); + tmpSumReturnAirGainRate = 0.0; + + // remove this next safety check after testing code + if (NumberOfIndices != NumberOfFractions) { // throw error + ShowSevereError(state, "SumReturnAirConvectionGainsByIndice: bad arguments, sizes do not match"); + } + + if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { + SumReturnAirGainRate = 0.0; + return; + } + + for (loop = 1; loop <= NumberOfIndices; ++loop) { + DeviceNum = DeviceIndexARR(loop); + DeviceFraction = FractionARR(loop); + tmpSumReturnAirGainRate = + tmpSumReturnAirGainRate + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).ReturnAirConvGainRate * DeviceFraction; } + SumReturnAirGainRate = tmpSumReturnAirGainRate; + } - } // namespace InternalHeatGains +} // namespace InternalHeatGains } // namespace EnergyPlus From c653ddcbe52774783f9a9c78a4ee2d9d7a5c9f28 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Wed, 14 Apr 2021 10:25:26 -0600 Subject: [PATCH 05/11] Update clang format --- .../unit/RoomAirflowNetwork.unit.cc | 171 +++++++++--------- 1 file changed, 85 insertions(+), 86 deletions(-) diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index f14f1bc7f89..87bfc60138c 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -75,8 +75,6 @@ #include #include - - using namespace EnergyPlus; using namespace DataEnvironment; using namespace EnergyPlus::DataSizing; @@ -295,15 +293,15 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataMstBal->HMassConvInFD(1) = state->dataHeatBal->HConvIn(1) / ((PsyRhoAirFnPbTdbW( - *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + - state->dataMstBal->RhoVaporAirIn(1)) * - PsyCpAirFnW(state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum))); + *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + + state->dataMstBal->RhoVaporAirIn(1)) * + PsyCpAirFnW(state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum))); state->dataMstBal->HMassConvInFD(2) = state->dataHeatBal->HConvIn(2) / ((PsyRhoAirFnPbTdbW( - *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + - state->dataMstBal->RhoVaporAirIn(2)) * - PsyCpAirFnW(state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum))); + *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + + state->dataMstBal->RhoVaporAirIn(2)) * + PsyCpAirFnW(state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum))); RoomAirNode = 1; auto &thisRAFN(state->dataRoomAirflowNetModel->RAFN(ZoneNum)); @@ -367,46 +365,47 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) } TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) { - // different names between internal gain objects and room air objects for internal gains result in fatal error from GetInternalGainDeviceIndex function. + // different names between internal gain objects and room air objects for internal gains result in fatal error from GetInternalGainDeviceIndex + // function. bool ErrorsFound(false); std::string const idf_objects = delimited_string({ - "Zone,living_unit1;", - - "BuildingSurface:Detailed,", - " unit1, !- Name", - " Wall, !- Surface Type", - " PARTITION, !- Construction Name", - " living_unit1, !- Zone Name", - " Outdoors, !- Outside Boundary Condition", - " , !- Outside Boundary Condition Object", - " SunExposed, !- Sun Exposure", - " WindExposed, !- Wind Exposure", - " 0.5000000, !- View Factor to Ground", - " 4, !- Number of Vertices", - " 0,0,3.048000, !- X,Y,Z ==> Vertex 1 {m}", - " 0,0,0, !- X,Y,Z ==> Vertex 2 {m}", - " 6.096000,0,0, !- X,Y,Z ==> Vertex 3 {m}", - " 6.096000,0,3.048000; !- X,Y,Z ==> Vertex 4 {m}", - - "Construction,", - " PARTITION, !- Name", - " GYP BOARD; !- Outside Layer", - - "Material,", - " GYP BOARD, !- Name", - " Smooth, !- Roughness", - " 1.9050000E-02, !- Thickness {m}", - " 0.7264224, !- Conductivity {W/m-K}", - " 1601.846, !- Density {kg/m3}", - " 836.8000, !- Specific Heat {J/kg-K}", - " 0.9000000, !- Thermal Absorptance", - " 0.9200000, !- Solar Absorptance", - " 0.9200000; !- Visible Absorptance", - - "Schedule:Constant,sch_act,,120.0;", - "Schedule:Constant,sch,,1.0;", - "People,", + "Zone,living_unit1;", + + "BuildingSurface:Detailed,", + " unit1, !- Name", + " Wall, !- Surface Type", + " PARTITION, !- Construction Name", + " living_unit1, !- Zone Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,3.048000, !- X,Y,Z ==> Vertex 1 {m}", + " 0,0,0, !- X,Y,Z ==> Vertex 2 {m}", + " 6.096000,0,0, !- X,Y,Z ==> Vertex 3 {m}", + " 6.096000,0,3.048000; !- X,Y,Z ==> Vertex 4 {m}", + + "Construction,", + " PARTITION, !- Name", + " GYP BOARD; !- Outside Layer", + + "Material,", + " GYP BOARD, !- Name", + " Smooth, !- Roughness", + " 1.9050000E-02, !- Thickness {m}", + " 0.7264224, !- Conductivity {W/m-K}", + " 1601.846, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.9200000, !- Solar Absorptance", + " 0.9200000; !- Visible Absorptance", + + "Schedule:Constant,sch_act,,120.0;", + "Schedule:Constant,sch,,1.0;", + "People,", " people_unit1, !- Name", " living_unit1, !- Zone or ZoneList Name", " sch, !- Number of People Schedule Name", @@ -419,7 +418,7 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " sch_act, !- Activity Level Schedule Name", " ; !- Carbon Dioxide Generation Rate {m3 / s - W}", - "Lights,", + "Lights,", " Living Hardwired Lighting1, !- Name", " living_unit1, !- Zone or ZoneList Name", " sch, !- Schedule Name", @@ -431,7 +430,7 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " 0.6, !- Fraction Radiant", " 0.2, !- Fraction Visible", " 0; !- Fraction Replaceable", - " ElectricEquipment,", + " ElectricEquipment,", " Electric Equipment 1, !- Name", " living_unit1, !- Zone or ZoneList Name", " sch, !- Schedule Name", @@ -443,43 +442,43 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " 0.5000, !- Fraction Radiant", " 0.0000; !- Fraction Lost", - "RoomAirModelType,", - " RoomAirWithAirflowNetwork, !- Name", - " living_unit1, !- Zone Name", - " AirflowNetwork, !- Room - Air Modeling Type", - " DIRECT; !- Air Temperature Coupling Strategy", - - "RoomAir:Node:AirflowNetwork,", - " Node1, !- Name", - " living_unit1, !- Zone Name", - " 1, !- Fraction of Zone Air Volume", - " unit1_List, !- RoomAir : Node : AirflowNetwork : AdjacentSurfaceList Name", - " Node1_Gain, !- RoomAir : Node : AirflowNetwork : InternalGains Name", - " Node1_HVAC; !- RoomAir:Node:AirflowNetwork:HVACEquipment Name", - - "RoomAir:Node:AirflowNetwork:AdjacentSurfaceList,", - " unit1_List, !- Name", - " unit1; !- Surface 1 Name", - - "RoomAir:Node:AirflowNetwork:InternalGains,", - " Node1_Gain, !- Name", - " People, !- Internal Gain Object 1 Type", - " living_unit1 People, !- Internal Gain Object 1 Name", - " 1, !- Fraction of Gains to Node 1", - " Lights, !- Internal Gain Object 2 Type", - " living_unit1 Lights, !- Internal Gain Object 2 Name", - " 1, !- Fraction of Gains to Node 2", - " ElectricEquipment, !- Internal Gain Object 3 Type", - " living_unit1 Equip, !- Internal Gain Object 3 Name", - " 1; !- Fraction of Gains to Node 3", - - "RoomAirSettings:AirflowNetwork,", - " living_unit1, !- Name", - " living_unit1, !- Zone Name", - " Node1, !- Control Point RoomAirflowNetwork : Node Name", - " Node1; !- RoomAirflowNetwork : Node Name 1", - - }); + "RoomAirModelType,", + " RoomAirWithAirflowNetwork, !- Name", + " living_unit1, !- Zone Name", + " AirflowNetwork, !- Room - Air Modeling Type", + " DIRECT; !- Air Temperature Coupling Strategy", + + "RoomAir:Node:AirflowNetwork,", + " Node1, !- Name", + " living_unit1, !- Zone Name", + " 1, !- Fraction of Zone Air Volume", + " unit1_List, !- RoomAir : Node : AirflowNetwork : AdjacentSurfaceList Name", + " Node1_Gain, !- RoomAir : Node : AirflowNetwork : InternalGains Name", + " Node1_HVAC; !- RoomAir:Node:AirflowNetwork:HVACEquipment Name", + + "RoomAir:Node:AirflowNetwork:AdjacentSurfaceList,", + " unit1_List, !- Name", + " unit1; !- Surface 1 Name", + + "RoomAir:Node:AirflowNetwork:InternalGains,", + " Node1_Gain, !- Name", + " People, !- Internal Gain Object 1 Type", + " living_unit1 People, !- Internal Gain Object 1 Name", + " 1, !- Fraction of Gains to Node 1", + " Lights, !- Internal Gain Object 2 Type", + " living_unit1 Lights, !- Internal Gain Object 2 Name", + " 1, !- Fraction of Gains to Node 2", + " ElectricEquipment, !- Internal Gain Object 3 Type", + " living_unit1 Equip, !- Internal Gain Object 3 Name", + " 1; !- Fraction of Gains to Node 3", + + "RoomAirSettings:AirflowNetwork,", + " living_unit1, !- Name", + " living_unit1, !- Zone Name", + " Node1, !- Control Point RoomAirflowNetwork : Node Name", + " Node1; !- RoomAirflowNetwork : Node Name 1", + + }); ASSERT_TRUE(process_idf(idf_objects)); EXPECT_FALSE(has_err_output()); @@ -520,7 +519,7 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) EXPECT_TRUE(ErrorsFound); std::string const error_string = - delimited_string({ " ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 PEOPLE", + delimited_string({" ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 PEOPLE", " ** ~~~ ** Entered in RoomAir:Node:AirflowNetwork:InternalGains = NODE1_GAIN", " ** ~~~ ** Internal gain did not match correctly", " ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 LIGHTS", @@ -528,7 +527,7 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) " ** ~~~ ** Internal gain did not match correctly", " ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 EQUIP", " ** ~~~ ** Entered in RoomAir:Node:AirflowNetwork:InternalGains = NODE1_GAIN", - " ** ~~~ ** Internal gain did not match correctly" }); + " ** ~~~ ** Internal gain did not match correctly"}); EXPECT_TRUE(compare_err_stream(error_string, true)); } From 3a769d47145b5beb59bf080c4d002ecea0e2b004 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Sun, 2 May 2021 08:01:02 -0600 Subject: [PATCH 06/11] Update the function GetInternalGainDeviceIndex --- src/EnergyPlus/InternalHeatGains.cc | 32 +++++++------------ src/EnergyPlus/InternalHeatGains.hh | 11 +++---- src/EnergyPlus/RoomAirModelManager.cc | 10 +++--- .../unit/RoomAirflowNetwork.unit.cc | 3 +- 4 files changed, 21 insertions(+), 35 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 818de6ebb2e..73031c2bb1c 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -8038,12 +8038,11 @@ namespace InternalHeatGains { } } - void GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number - std::string const &IntGainName, // Internal gain name - int &DeviceIndex, // Device index - bool &ErrorFound) + int GetInternalGainDeviceIndex(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number + std::string const IntGainName, // Internal gain name + int &DeviceIndex) // Device Index { // SUBROUTINE INFORMATION: @@ -8054,33 +8053,24 @@ namespace InternalHeatGains { // PURPOSE OF THIS SUBROUTINE: // utility to retrieve index pointer to a specific internal gain + // the subroutine returns the index of matched internal gain device or -1 if no match found. // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - bool Found; int DeviceNum; - - Found = false; - if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { DeviceIndex = -1; - ErrorFound = true; - return; + return DeviceIndex; } - for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (UtilityRoutines::SameString(state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName, IntGainName)) { - if (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum != IntGainTypeOfNum) { - ErrorFound = true; - } else { - ErrorFound = false; - } - Found = true; + if (UtilityRoutines::SameString(state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName, IntGainName) && + state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == IntGainTypeOfNum) { DeviceIndex = DeviceNum; break; } else { - ErrorFound = true; + DeviceIndex = -1; } } + return DeviceIndex; } void SumInternalConvectionGainsByIndices( diff --git a/src/EnergyPlus/InternalHeatGains.hh b/src/EnergyPlus/InternalHeatGains.hh index 74a070cc4d0..580834e9cb2 100644 --- a/src/EnergyPlus/InternalHeatGains.hh +++ b/src/EnergyPlus/InternalHeatGains.hh @@ -99,12 +99,11 @@ namespace InternalHeatGains { const Array1D_int &GainTypeARR, // variable length 1-d array of integer valued gain types Real64 &SumConvGainRate); - void GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number - std::string const &IntGainName, // Internal gain name - int &DeviceIndex, // Device index - bool &ErrorFound); + int GetInternalGainDeviceIndex(EnergyPlusData &state, + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number + std::string const IntGainName, // Internal gain name + int &DeviceIndex); // Device Index void SumInternalConvectionGainsByIndices( EnergyPlusData &state, diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 8003bad0611..b57ce3af767 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1397,7 +1397,7 @@ namespace RoomAirModelManager { int TotNumOfRAFNNodeSurfLists; int TotNumOfRAFNNodeGainsLists; int TotNumOfRAFNNodeHVACLists; - bool IntGainError; + int IntGainIndex; int RAFNNodeNum; bool foundList; int NumSurfsThisNode; @@ -1710,15 +1710,13 @@ namespace RoomAirModelManager { state.dataIPShortCut->cAlphaArgs(gainsLoop * 2 + 1); // verify type and name and get pointer to device in internal gains structure array - IntGainError = false; - GetInternalGainDeviceIndex( + IntGainIndex = GetInternalGainDeviceIndex( state, ZoneNum, state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).TypeOfNum, state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Name, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsDeviceIndices(gainsLoop), - IntGainError); - if (IntGainError) { + state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsDeviceIndices(gainsLoop)); + if (IntGainIndex<0) { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid " + state.dataIPShortCut->cAlphaFieldNames(gainsLoop * 2 + 1) + " = " + state.dataIPShortCut->cAlphaArgs(gainsLoop * 2 + 1)); diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 87bfc60138c..c13009d0d28 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -365,8 +365,7 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) } TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) { - // different names between internal gain objects and room air objects for internal gains result in fatal error from GetInternalGainDeviceIndex - // function. + // different names between internal gain objects and room air objects for internal gains result in fatal error from GetInternalGainDeviceIndex. bool ErrorsFound(false); std::string const idf_objects = delimited_string({ From 325f9fc943e33b7a59ff3f8c5c74dd3742456b97 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Sun, 2 May 2021 08:38:00 -0600 Subject: [PATCH 07/11] Update clang-format --- src/EnergyPlus/InternalHeatGains.cc | 6 +++--- src/EnergyPlus/InternalHeatGains.hh | 6 +++--- src/EnergyPlus/RoomAirModelManager.cc | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 73031c2bb1c..f6ecaf9338f 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -8039,10 +8039,10 @@ namespace InternalHeatGains { } int GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number std::string const IntGainName, // Internal gain name - int &DeviceIndex) // Device Index + int &DeviceIndex) // Device Index { // SUBROUTINE INFORMATION: diff --git a/src/EnergyPlus/InternalHeatGains.hh b/src/EnergyPlus/InternalHeatGains.hh index 580834e9cb2..2bb2b32b218 100644 --- a/src/EnergyPlus/InternalHeatGains.hh +++ b/src/EnergyPlus/InternalHeatGains.hh @@ -100,10 +100,10 @@ namespace InternalHeatGains { Real64 &SumConvGainRate); int GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number std::string const IntGainName, // Internal gain name - int &DeviceIndex); // Device Index + int &DeviceIndex); // Device Index void SumInternalConvectionGainsByIndices( EnergyPlusData &state, diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index b57ce3af767..1abf0acb631 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1716,7 +1716,7 @@ namespace RoomAirModelManager { state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).TypeOfNum, state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Name, state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsDeviceIndices(gainsLoop)); - if (IntGainIndex<0) { + if (IntGainIndex < 0) { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid " + state.dataIPShortCut->cAlphaFieldNames(gainsLoop * 2 + 1) + " = " + state.dataIPShortCut->cAlphaArgs(gainsLoop * 2 + 1)); From 6af3da1c8860242424ac40e9bf1a0cc40b6edafc Mon Sep 17 00:00:00 2001 From: LipingWang Date: Wed, 5 May 2021 20:06:11 -0600 Subject: [PATCH 08/11] Update the function GetInternalGainDeviceIndex --- src/EnergyPlus/InternalHeatGains.cc | 8 ++++---- src/EnergyPlus/InternalHeatGains.hh | 9 ++++----- src/EnergyPlus/RoomAirModelManager.cc | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index f6ecaf9338f..7e445583f26 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -8039,10 +8039,9 @@ namespace InternalHeatGains { } int GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number - std::string const IntGainName, // Internal gain name - int &DeviceIndex) // Device Index + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number + std::string const IntGainName) // Internal gain name { // SUBROUTINE INFORMATION: @@ -8057,6 +8056,7 @@ namespace InternalHeatGains { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int DeviceNum; + int DeviceIndex; if (state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices == 0) { DeviceIndex = -1; return DeviceIndex; diff --git a/src/EnergyPlus/InternalHeatGains.hh b/src/EnergyPlus/InternalHeatGains.hh index 2bb2b32b218..5f8a5a183c9 100644 --- a/src/EnergyPlus/InternalHeatGains.hh +++ b/src/EnergyPlus/InternalHeatGains.hh @@ -100,11 +100,10 @@ namespace InternalHeatGains { Real64 &SumConvGainRate); int GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number - std::string const IntGainName, // Internal gain name - int &DeviceIndex); // Device Index - + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number + std::string const IntGainName); // Internal gain name + void SumInternalConvectionGainsByIndices( EnergyPlusData &state, int const ZoneNum, // zone index pointer for which zone to sum gains for diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 1abf0acb631..2207f75bdd6 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1714,8 +1714,8 @@ namespace RoomAirModelManager { state, ZoneNum, state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).TypeOfNum, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Name, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsDeviceIndices(gainsLoop)); + state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Name); + state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsDeviceIndices(gainsLoop)=IntGainIndex; if (IntGainIndex < 0) { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid " + state.dataIPShortCut->cAlphaFieldNames(gainsLoop * 2 + 1) + From e4524f4e56d3266940be77644dfeeed4875834ea Mon Sep 17 00:00:00 2001 From: LipingWang Date: Wed, 5 May 2021 20:27:23 -0600 Subject: [PATCH 09/11] Update clang format --- src/EnergyPlus/InternalHeatGains.cc | 4 ++-- src/EnergyPlus/InternalHeatGains.hh | 2 +- src/EnergyPlus/RoomAirModelManager.cc | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 7e445583f26..ad5959727e4 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -8039,8 +8039,8 @@ namespace InternalHeatGains { } int GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number std::string const IntGainName) // Internal gain name { diff --git a/src/EnergyPlus/InternalHeatGains.hh b/src/EnergyPlus/InternalHeatGains.hh index 5f8a5a183c9..e132cc548ad 100644 --- a/src/EnergyPlus/InternalHeatGains.hh +++ b/src/EnergyPlus/InternalHeatGains.hh @@ -103,7 +103,7 @@ namespace InternalHeatGains { int const ZoneNum, // zone index pointer for which zone to sum gains for int const IntGainTypeOfNum, // zone internal gain type number std::string const IntGainName); // Internal gain name - + void SumInternalConvectionGainsByIndices( EnergyPlusData &state, int const ZoneNum, // zone index pointer for which zone to sum gains for diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 2207f75bdd6..1fcf6ac5ed0 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1715,7 +1715,8 @@ namespace RoomAirModelManager { ZoneNum, state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).TypeOfNum, state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Name); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsDeviceIndices(gainsLoop)=IntGainIndex; + state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsDeviceIndices(gainsLoop) = + IntGainIndex; if (IntGainIndex < 0) { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid " + state.dataIPShortCut->cAlphaFieldNames(gainsLoop * 2 + 1) + From 619adf6df86deb0b04d250901eb6259bf015ba8f Mon Sep 17 00:00:00 2001 From: LipingWang Date: Thu, 6 May 2021 12:29:33 -0600 Subject: [PATCH 10/11] String_view declaration with passing reference parameters --- src/EnergyPlus/InternalHeatGains.cc | 10 +++++----- src/EnergyPlus/InternalHeatGains.hh | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index ad5959727e4..855de63e9de 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -8039,9 +8039,9 @@ namespace InternalHeatGains { } int GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number - std::string const IntGainName) // Internal gain name + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number + std::string_view const &IntGainName) // Internal gain name { // SUBROUTINE INFORMATION: @@ -8062,8 +8062,8 @@ namespace InternalHeatGains { return DeviceIndex; } for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if (UtilityRoutines::SameString(state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName, IntGainName) && - state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == IntGainTypeOfNum) { + if ((state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName == IntGainName) && + (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == IntGainTypeOfNum)) { DeviceIndex = DeviceNum; break; } else { diff --git a/src/EnergyPlus/InternalHeatGains.hh b/src/EnergyPlus/InternalHeatGains.hh index e132cc548ad..1c7dc4c26f3 100644 --- a/src/EnergyPlus/InternalHeatGains.hh +++ b/src/EnergyPlus/InternalHeatGains.hh @@ -100,9 +100,9 @@ namespace InternalHeatGains { Real64 &SumConvGainRate); int GetInternalGainDeviceIndex(EnergyPlusData &state, - int const ZoneNum, // zone index pointer for which zone to sum gains for - int const IntGainTypeOfNum, // zone internal gain type number - std::string const IntGainName); // Internal gain name + int const ZoneNum, // zone index pointer for which zone to sum gains for + int const IntGainTypeOfNum, // zone internal gain type number + std::string_view const &IntGainName); // Internal gain name void SumInternalConvectionGainsByIndices( EnergyPlusData &state, From ecab5475d852a79eca920d2fe493402f2ecd0b26 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Thu, 6 May 2021 15:52:49 -0600 Subject: [PATCH 11/11] Update string comparison --- src/EnergyPlus/InternalHeatGains.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 855de63e9de..22da492c368 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -8062,7 +8062,7 @@ namespace InternalHeatGains { return DeviceIndex; } for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->ZoneIntGain(ZoneNum).NumberOfDevices; ++DeviceNum) { - if ((state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName == IntGainName) && + if ((UtilityRoutines::SameString(state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompObjectName, IntGainName.data())) && (state.dataHeatBal->ZoneIntGain(ZoneNum).Device(DeviceNum).CompTypeOfNum == IntGainTypeOfNum)) { DeviceIndex = DeviceNum; break;