From 0eab3ccc1a4e11a23329e2ac48a8c9cb02685d79 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Tue, 23 Mar 2021 19:10:04 -0600 Subject: [PATCH 01/21] checkpoint - SASZ --- src/EnergyPlus/Psychrometrics.cc | 23 ++- src/EnergyPlus/Psychrometrics.hh | 10 ++ src/EnergyPlus/Pumps.cc | 44 +++--- src/EnergyPlus/Pumps.hh | 20 +++ src/EnergyPlus/SimAirServingZones.cc | 211 +++++++++++---------------- src/EnergyPlus/SimAirServingZones.hh | 35 +++++ 6 files changed, 174 insertions(+), 169 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 8a09d3772fa..ad09f796187 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -515,7 +515,6 @@ namespace Psychrometrics { // FUNCTION PARAMETER DEFINITIONS: int const itmax(100); // Maximum No of Iterations - static Real64 convTol(0.0001); static std::string const RoutineName("PsyTwbFnTdbWPb"); // INTERFACE BLOCK SPECIFICATIONS @@ -526,8 +525,6 @@ namespace Psychrometrics { // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 tBoil; // Boiling temperature of water at given pressure - static Real64 last_Patm(-99999.0); // barometric pressure {Pascals} (last) - static Real64 last_tBoil(-99999.0); // Boiling temperature of water at given pressure (last) Real64 newW; // Humidity ratio calculated with wet bulb guess Real64 W; // Humidity ratio entered and corrected as necessary Real64 ResultX; // ResultX is the final Iteration result passed back to the calling routine @@ -592,12 +589,12 @@ namespace Psychrometrics { } // Initial temperature guess at atmospheric pressure - if (Patm != last_Patm) { + if (Patm != state.dataPsychrometrics->last_Patm) { tBoil = PsyTsatFnPb(state, Patm, (CalledFrom.empty() ? RoutineName : CalledFrom)); - last_Patm = Patm; - last_tBoil = tBoil; + state.dataPsychrometrics->last_Patm = Patm; + state.dataPsychrometrics->last_tBoil = tBoil; } else { - tBoil = last_tBoil; + tBoil = state.dataPsychrometrics->last_tBoil; } // Set initial guess of WetBulbTemp=Entering Dry Bulb Temperature @@ -630,7 +627,7 @@ namespace Psychrometrics { error = W - newW; // Using Iterative Procedure to Calculate WetBulb - Iterate(ResultX, convTol, WBT, error, X1, Y1, iter, icvg); + Iterate(ResultX, state.dataPsychrometrics->iconvTol, WBT, error, X1, Y1, iter, icvg); WBT = ResultX; // If converged, leave iteration loop. @@ -1350,8 +1347,6 @@ namespace Psychrometrics { // FUNCTION LOCAL VARIABLE DECLARATIONS: bool FlagError; // set when errors should be flagged - static Real64 Press_Save(-99999.0); - static Real64 tSat_Save(-99999.0); Real64 tSat; // Water temperature guess int iter; // Iteration counter @@ -1378,10 +1373,10 @@ namespace Psychrometrics { } } #endif - if (Press == Press_Save) { - return tSat_Save; + if (Press == state.dataPsychrometrics->Press_Save) { + return state.dataPsychrometrics->tSat_Save; } - Press_Save = Press; + state.dataPsychrometrics->Press_Save = Press; // Uses an iterative process to determine the saturation temperature at a given // pressure by correlating saturated water vapor as a function of temperature. @@ -1459,7 +1454,7 @@ namespace Psychrometrics { #endif // Result is SatTemperature - Real64 const Temp = tSat_Save = tSat; // result=> saturation temperature {C} + Real64 const Temp = state.dataPsychrometrics->tSat_Save = tSat; // result=> saturation temperature {C} #ifdef EP_psych_errors if (FlagError) { diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index aeddc1cb16e..3a6949d4ab9 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -1396,9 +1396,19 @@ namespace Psychrometrics { struct PsychrometricsData : BaseGlobalStruct { + Real64 iconvTol = 0.0001; + Real64 last_Patm = -99999.0; // barometric pressure {Pascals} (last) + Real64 last_tBoil = -99999.0; // Boiling temperature of water at given pressure (last) + Real64 Press_Save = -99999.0; + Real64 tSat_Save = -99999.0; void clear_state() override { + iconvTol = 0.0001; + last_Patm = -99999.0; // barometric pressure {Pascals} (last) + last_tBoil = -99999.0; // Boiling temperature of water at given pressure (last) + Press_Save = -99999.0; + tSat_Save = -99999.0; } }; diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index ae2a089ddcd..c32c6578794 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -265,7 +265,6 @@ namespace EnergyPlus::Pumps { int NumConstPumpBankSimple; Real64 SteamDensity; Real64 TempWaterDensity; - static int DummyWaterIndex(1); ErrorsFound = false; @@ -710,7 +709,7 @@ namespace EnergyPlus::Pumps { } else { // Calc Condensate Pump Water Volume Flow Rate SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, StartTemp, 1.0, state.dataPumps->PumpEquip(PumpNum).FluidIndex, RoutineNameNoColon); - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, state.dataPumps->iDummyWaterIndex, RoutineName); state.dataPumps->PumpEquip(PumpNum).NomVolFlowRate = (state.dataPumps->PumpEquip(PumpNum).NomSteamVolFlowRate * SteamDensity) / TempWaterDensity; } @@ -1208,7 +1207,6 @@ namespace EnergyPlus::Pumps { int OutletNode; // pump outlet node number Real64 TotalEffic; Real64 SteamDensity; // Density of working fluid - static int DummyWaterIndex(1); Real64 TempWaterDensity; bool errFlag; Real64 mdotMax; // local fluid mass flow rate maximum @@ -1354,7 +1352,7 @@ namespace EnergyPlus::Pumps { if (state.dataPumps->PumpEquip(PumpNum).PumpInitFlag && state.dataGlobal->BeginEnvrnFlag) { if (state.dataPumps->PumpEquip(PumpNum).PumpType == Pump_Cond) { - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, state.dataPumps->ipDummyWaterIndex, RoutineName); SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, StartTemp, 1.0, state.dataPumps->PumpEquip(PumpNum).FluidIndex, RoutineName); state.dataPumps->PumpEquip(PumpNum).NomVolFlowRate = (state.dataPumps->PumpEquip(PumpNum).NomSteamVolFlowRate * SteamDensity) / TempWaterDensity; @@ -1912,7 +1910,6 @@ namespace EnergyPlus::Pumps { Real64 PumpSizFac; // pump sizing factor Real64 SteamDensity; Real64 TempWaterDensity; - static int DummyWaterIndex(1); Real64 DesVolFlowRatePerBranch; // local temporary for split of branch pumps // Calculate density at InitConvTemp once here, to remove RhoH2O calls littered throughout @@ -1923,7 +1920,7 @@ namespace EnergyPlus::Pumps { state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).FluidIndex, RoutineName); } else { - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, state.dataPumps->spDummyWaterIndex, RoutineName); } PlantSizNum = 0; @@ -1968,7 +1965,7 @@ namespace EnergyPlus::Pumps { if (!state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).LoopSide(state.dataPumps->PumpEquip(PumpNum).LoopSideNum).BranchPumpsExist) { // size pump to full flow of plant loop if (state.dataPumps->PumpEquip(PumpNum).PumpType == Pump_Cond) { - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, state.dataPumps->spDummyWaterIndex, RoutineName); SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, StartTemp, 1.0, state.dataPumps->PumpEquip(PumpNum).FluidIndex, RoutineNameSizePumps); state.dataPumps->PumpEquip(PumpNum).NomSteamVolFlowRate = state.dataSize->PlantSizData(PlantSizNum).DesVolFlowRate * PumpSizFac; state.dataPumps->PumpEquip(PumpNum).NomVolFlowRate = state.dataPumps->PumpEquip(PumpNum).NomSteamVolFlowRate * SteamDensity / TempWaterDensity; @@ -1980,7 +1977,7 @@ namespace EnergyPlus::Pumps { DesVolFlowRatePerBranch = state.dataSize->PlantSizData(PlantSizNum).DesVolFlowRate / state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).LoopSide(state.dataPumps->PumpEquip(PumpNum).LoopSideNum).TotalPumps; if (state.dataPumps->PumpEquip(PumpNum).PumpType == Pump_Cond) { - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, state.dataPumps->spDummyWaterIndex, RoutineName); SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, StartTemp, 1.0, state.dataPumps->PumpEquip(PumpNum).FluidIndex, RoutineNameSizePumps); state.dataPumps->PumpEquip(PumpNum).NomSteamVolFlowRate = DesVolFlowRatePerBranch * PumpSizFac; state.dataPumps->PumpEquip(PumpNum).NomVolFlowRate = state.dataPumps->PumpEquip(PumpNum).NomSteamVolFlowRate * SteamDensity / TempWaterDensity; @@ -2187,17 +2184,10 @@ namespace EnergyPlus::Pumps { using PlantUtilities::SetComponentFlowRate; using ScheduleManager::GetCurrentScheduleValue; - static Real64 PumpMassFlowRateMaxPress(0.0); // Maximum mass flow rate associated with maximum pressure limit - static Real64 PumpMassFlowRateMinPress(0.0); // Minimum mass flow rate associated with minimum pressure limit - static Real64 RotSpeed_Max(0.0); // Maximum rotational speed in rps - static Real64 RotSpeed_Min(0.0); // Minimum rotational speed in rps - static Real64 MinPress(0.0); // Minimum pressure - static Real64 MaxPress(0.0); // Maximum pressure - - RotSpeed_Min = GetCurrentScheduleValue(state, state.dataPumps->PumpEquip(PumpNum).VFD.MinRPMSchedIndex); - RotSpeed_Max = GetCurrentScheduleValue(state, state.dataPumps->PumpEquip(PumpNum).VFD.MaxRPMSchedIndex); - MinPress = GetCurrentScheduleValue(state, state.dataPumps->PumpEquip(PumpNum).VFD.LowerPsetSchedIndex); - MaxPress = GetCurrentScheduleValue(state, state.dataPumps->PumpEquip(PumpNum).VFD.UpperPsetSchedIndex); + state.dataPumps->GRMFRRotSpeed_Min = GetCurrentScheduleValue(state, state.dataPumps->PumpEquip(PumpNum).VFD.MinRPMSchedIndex); + state.dataPumps->GRMFRRotSpeed_Max = GetCurrentScheduleValue(state, state.dataPumps->PumpEquip(PumpNum).VFD.MaxRPMSchedIndex); + state.dataPumps->GRMFRMinPress = GetCurrentScheduleValue(state, state.dataPumps->PumpEquip(PumpNum).VFD.LowerPsetSchedIndex); + state.dataPumps->GRMFRMaxPress = GetCurrentScheduleValue(state, state.dataPumps->PumpEquip(PumpNum).VFD.UpperPsetSchedIndex); // Calculate maximum and minimum mass flow rate associated with maximun and minimum RPM if (state.dataPumps->PumpEquip(PumpNum).LoopNum > 0) { @@ -2207,14 +2197,14 @@ namespace EnergyPlus::Pumps { state.dataPumps->PumpEquip(PumpNum).PumpMassFlowRateMaxRPM = ResolveLoopFlowVsPressure(state, state.dataPumps->PumpEquip(PumpNum).LoopNum, InletNodeMassFlowRate, state.dataPumps->PumpEquip(PumpNum).PressureCurve_Index, - RotSpeed_Max, + state.dataPumps->GRMFRRotSpeed_Max, state.dataPumps->PumpEquip(PumpNum).ImpellerDiameter, state.dataPumps->PumpEquip(PumpNum).MinPhiValue, state.dataPumps->PumpEquip(PumpNum).MaxPhiValue); state.dataPumps->PumpEquip(PumpNum).PumpMassFlowRateMinRPM = ResolveLoopFlowVsPressure(state, state.dataPumps->PumpEquip(PumpNum).LoopNum, InletNodeMassFlowRate, state.dataPumps->PumpEquip(PumpNum).PressureCurve_Index, - RotSpeed_Min, + state.dataPumps->GRMFRRotSpeed_Min, state.dataPumps->PumpEquip(PumpNum).ImpellerDiameter, state.dataPumps->PumpEquip(PumpNum).MinPhiValue, state.dataPumps->PumpEquip(PumpNum).MaxPhiValue); @@ -2229,28 +2219,28 @@ namespace EnergyPlus::Pumps { // Calculate maximum and minimum mass flow rate associated with operating pressure range if (state.dataPumps->PumpEquip(PumpNum).LoopNum > 0) { if (state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK > 0.0) { - PumpMassFlowRateMaxPress = std::sqrt(MaxPress / state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK); - PumpMassFlowRateMinPress = std::sqrt(MinPress / state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK); + state.dataPumps->PumpMassFlowRateMaxPress = std::sqrt(state.dataPumps->GRMFRMaxPress / state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK); + state.dataPumps->PumpMassFlowRateMinPress = std::sqrt(state.dataPumps->GRMFRMinPress / state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK); } } // Decide operating range for mass flow rate // Maximum mass flow rate value of the range - if (state.dataPumps->PumpEquip(PumpNum).PumpMassFlowRateMaxRPM > PumpMassFlowRateMaxPress) { + if (state.dataPumps->PumpEquip(PumpNum).PumpMassFlowRateMaxRPM > state.dataPumps->PumpMassFlowRateMaxPress) { // Maximum pressure value governs maximum VFD range value - PumpMaxMassFlowRateVFDRange = PumpMassFlowRateMaxPress; + PumpMaxMassFlowRateVFDRange = state.dataPumps->PumpMassFlowRateMaxPress; } else { // Maximum RPM value governs maximum VFD range value PumpMaxMassFlowRateVFDRange = state.dataPumps->PumpEquip(PumpNum).PumpMassFlowRateMaxRPM; } // Minimum mass flow rate value of the range - if (state.dataPumps->PumpEquip(PumpNum).PumpMassFlowRateMinRPM > PumpMassFlowRateMinPress) { + if (state.dataPumps->PumpEquip(PumpNum).PumpMassFlowRateMinRPM > state.dataPumps->PumpMassFlowRateMinPress) { // Minimum pressure value governs minimum VFD range value PumpMinMassFlowRateVFDRange = state.dataPumps->PumpEquip(PumpNum).PumpMassFlowRateMinRPM; } else { // Minimum pressure range value governs minimum VFD range value - PumpMinMassFlowRateVFDRange = PumpMassFlowRateMinPress; + PumpMinMassFlowRateVFDRange = state.dataPumps->PumpMassFlowRateMinPress; } // Set the mass flow rate within VFD operating range diff --git a/src/EnergyPlus/Pumps.hh b/src/EnergyPlus/Pumps.hh index 807daea3a83..82cc2966a6d 100644 --- a/src/EnergyPlus/Pumps.hh +++ b/src/EnergyPlus/Pumps.hh @@ -285,6 +285,16 @@ struct PumpsData : BaseGlobalStruct { Array1D PumpEquipReport; std::unordered_map PumpUniqueNames; + int iDummyWaterIndex = 1; + int ipDummyWaterIndex = 1; + int spDummyWaterIndex = 1; + Real64 PumpMassFlowRateMaxPress = 0.0; // Maximum mass flow rate associated with maximum pressure limit + Real64 PumpMassFlowRateMinPress = 0.0; // Minimum mass flow rate associated with minimum pressure limit + Real64 GRMFRRotSpeed_Max = 0.0; // Maximum rotational speed in rps + Real64 GRMFRRotSpeed_Min = 0.0; // Minimum rotational speed in rps + Real64 GRMFRMinPress = 0.0; // Minimum pressure + Real64 GRMFRMaxPress = 0.0; // Maximum pressure + void clear_state() override { this->NumPumps = 0; @@ -298,6 +308,16 @@ struct PumpsData : BaseGlobalStruct { this->PumpEquip.deallocate(); this->PumpEquipReport.deallocate(); this->PumpUniqueNames.clear(); + + this->iDummyWaterIndex = 1; + this->ipDummyWaterIndex = 1; + this->spDummyWaterIndex = 1; + this->PumpMassFlowRateMaxPress = 0.0; // Maximum mass flow rate associated with maximum pressure limit + this->PumpMassFlowRateMinPress = 0.0; // Minimum mass flow rate associated with minimum pressure limit + this->GRMFRRotSpeed_Max = 0.0; // Maximum rotational speed in rps + this->GRMFRRotSpeed_Min = 0.0; // Minimum rotational speed in rps + this->GRMFRMinPress = 0.0; // Minimum pressure + this->GRMFRMaxPress = 0.0; // Maximum pressure } }; diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 84b275d5e94..b88be850ed1 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -68,7 +68,6 @@ #include #include #include -#include #include #include #include @@ -1421,7 +1420,6 @@ namespace EnergyPlus::SimAirServingZones { int PlenumOutNum; // DO loop index of supply plenum outlets Real64 MassFlowSaved; // mass flow rate for a node saved from previous call Real64 MassFlowSet; // desired mass flow rate for a node - static Real64 SumZoneDesFlow(0.0); // sum of the zone design air mass flow rates for zones served by a system int SupAirPath; // supply air path do loop index int SupAirPathNum; // specific supply air path index int SplitterNum; // Zone equip splitter index @@ -1436,16 +1434,12 @@ namespace EnergyPlus::SimAirServingZones { int SupFanIndex; int RetFanIndex; bool FoundOASys; - static int TUInNode(0); // inlet node number of a terminal unit // Dimension the local subcomponent arrays auto & NumPrimaryAirSys = state.dataHVACGlobal->NumPrimaryAirSys; bool ErrorsFound; - static Real64 OAReliefDiff(0.0); // local for massflow change across OA system, kg/s - static Real64 MassFlowSetToler; - Array1D_int tmpNodeARR; int nodeLoop; int ZoneNum; @@ -1473,7 +1467,7 @@ namespace EnergyPlus::SimAirServingZones { state.dataSimAirServingZones->TermUnitSizingNumsCool.allocate(state.dataGlobal->NumOfZones); state.dataSimAirServingZones->TermUnitSizingNumsHeat.allocate(state.dataGlobal->NumOfZones); - MassFlowSetToler = DataConvergParams::HVACFlowRateToler * 0.00001; + state.dataSimAirServingZones->MassFlowSetToler = DataConvergParams::HVACFlowRateToler * 0.00001; for (SupAirPath = 1; SupAirPath <= state.dataZoneEquip->NumSupplyAirPaths; ++SupAirPath) { @@ -2081,15 +2075,15 @@ namespace EnergyPlus::SimAirServingZones { // calculate the ratio of air loop design flow to the sum of the zone design flows for (AirLoopNum = 1; AirLoopNum <= NumPrimaryAirSys; ++AirLoopNum) { - SumZoneDesFlow = 0.0; + state.dataSimAirServingZones->SumZoneDesFlow = 0.0; state.dataAirLoop->AirLoopFlow(AirLoopNum).DesSupply = PrimaryAirSystems(AirLoopNum).DesignVolFlowRate * state.dataEnvrn->StdRhoAir; state.dataAirLoop->AirLoopFlow(AirLoopNum).DesReturnFrac = PrimaryAirSystems(AirLoopNum).DesignReturnFlowFraction; for (ZoneInSysIndex = 1; ZoneInSysIndex <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++ZoneInSysIndex) { - TUInNode = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolInletNodes(ZoneInSysIndex); - SumZoneDesFlow += state.dataLoopNodes->Node(TUInNode).MassFlowRateMax; + state.dataSimAirServingZones->TUInNode = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolInletNodes(ZoneInSysIndex); + state.dataSimAirServingZones->SumZoneDesFlow += state.dataLoopNodes->Node(state.dataSimAirServingZones->TUInNode).MassFlowRateMax; } - if (SumZoneDesFlow > VerySmallMassFlow) { - state.dataAirLoop->AirLoopFlow(AirLoopNum).SysToZoneDesFlowRatio = state.dataAirLoop->AirLoopFlow(AirLoopNum).DesSupply / SumZoneDesFlow; + if (state.dataSimAirServingZones->SumZoneDesFlow > VerySmallMassFlow) { + state.dataAirLoop->AirLoopFlow(AirLoopNum).SysToZoneDesFlowRatio = state.dataAirLoop->AirLoopFlow(AirLoopNum).DesSupply / state.dataSimAirServingZones->SumZoneDesFlow; } else { state.dataAirLoop->AirLoopFlow(AirLoopNum).SysToZoneDesFlowRatio = 1.0; } @@ -2202,7 +2196,7 @@ namespace EnergyPlus::SimAirServingZones { state.dataLoopNodes->Node(NodeNumOut).MassFlowRateSetPoint = 0.0; } - if (state.dataLoopNodes->Node(NodeNumOut).MassFlowRateSetPoint < MassFlowSetToler) { + if (state.dataLoopNodes->Node(NodeNumOut).MassFlowRateSetPoint < state.dataSimAirServingZones->MassFlowSetToler) { state.dataLoopNodes->Node(NodeNumOut).MassFlowRateSetPoint = 0.0; } @@ -2211,9 +2205,9 @@ namespace EnergyPlus::SimAirServingZones { NodeNum = PrimaryAirSystems(AirLoopNum).Branch(OutBranchNum).NodeNum(BranchNodeIndex); if (PrimaryAirSystems(AirLoopNum).OASysExists && (NodeNum == PrimaryAirSystems(AirLoopNum).OASysInletNodeNum)) { // need to modify if OA relief and supply not balanced because of exhaust fans - OAReliefDiff = state.dataLoopNodes->Node(PrimaryAirSystems(AirLoopNum).OASysOutletNodeNum).MassFlowRate - state.dataLoopNodes->Node(NodeNum).MassFlowRate; - if (OAReliefDiff > 0.0) { - state.dataLoopNodes->Node(NodeNum).MassFlowRateSetPoint = state.dataLoopNodes->Node(NodeNumOut).MassFlowRateSetPoint - OAReliefDiff; + state.dataSimAirServingZones->OAReliefDiff = state.dataLoopNodes->Node(PrimaryAirSystems(AirLoopNum).OASysOutletNodeNum).MassFlowRate - state.dataLoopNodes->Node(NodeNum).MassFlowRate; + if (state.dataSimAirServingZones->OAReliefDiff > 0.0) { + state.dataLoopNodes->Node(NodeNum).MassFlowRateSetPoint = state.dataLoopNodes->Node(NodeNumOut).MassFlowRateSetPoint - state.dataSimAirServingZones->OAReliefDiff; } else { state.dataLoopNodes->Node(NodeNum).MassFlowRateSetPoint = state.dataLoopNodes->Node(NodeNumOut).MassFlowRateSetPoint; } @@ -2414,12 +2408,6 @@ namespace EnergyPlus::SimAirServingZones { // Used to control when to reset the statistic counters for each new HVAC step. static Real64 SavedPreviousHVACTime(0.0); Real64 rxTime; - // Maximum of iteration counters across all air loops - static int IterMax(0); - // Aggregated number of iterations across all air loops - static int IterTot(0); - // Aggregated number fo times SimAirLoopComponents() has been invoked across all air loops - static int NumCallsTot(0); // Primary Air Sys DO loop index int AirLoopNum; // Max number of iterations performed by controllers on each air loop @@ -2441,16 +2429,16 @@ namespace EnergyPlus::SimAirServingZones { // Set up output variables if (!state.dataSimAirServingZones->OutputSetupFlag) { - SetupOutputVariable(state, "Air System Simulation Maximum Iteration Count", OutputProcessor::Unit::None, IterMax, "HVAC", "Sum", "SimAir"); - SetupOutputVariable(state, "Air System Simulation Iteration Count", OutputProcessor::Unit::None, IterTot, "HVAC", "Sum", "SimAir"); - SetupOutputVariable(state, "Air System Component Model Simulation Calls", OutputProcessor::Unit::None, NumCallsTot, "HVAC", "Sum", "SimAir"); + SetupOutputVariable(state, "Air System Simulation Maximum Iteration Count", OutputProcessor::Unit::None, state.dataSimAirServingZones->salIterMax, "HVAC", "Sum", "SimAir"); + SetupOutputVariable(state, "Air System Simulation Iteration Count", OutputProcessor::Unit::None, state.dataSimAirServingZones->salIterTot, "HVAC", "Sum", "SimAir"); + SetupOutputVariable(state, "Air System Component Model Simulation Calls", OutputProcessor::Unit::None, state.dataSimAirServingZones->NumCallsTot, "HVAC", "Sum", "SimAir"); state.dataSimAirServingZones->OutputSetupFlag = true; } // BUG: IterMax should not be aggregated as a Sum output variable // We need a new aggregation scheme to track the max value across HVAC steps // instead of summing it up. - IterMax = 0; + state.dataSimAirServingZones->salIterMax = 0; // Reset counters to capture statistics for the current zone time step // Aggregate statistics over all HVAC time steps, even the rejected ones, to properly @@ -2460,8 +2448,8 @@ namespace EnergyPlus::SimAirServingZones { rxTime = GetPreviousHVACTime(state); if (SavedPreviousHVACTime != rxTime) { SavedPreviousHVACTime = rxTime; - IterTot = 0; - NumCallsTot = 0; + state.dataSimAirServingZones->salIterTot = 0; + state.dataSimAirServingZones->NumCallsTot = 0; } } @@ -2497,11 +2485,11 @@ namespace EnergyPlus::SimAirServingZones { SimAirLoop(state, FirstHVACIteration, AirLoopNum, AirLoopPass, AirLoopIterMax, AirLoopIterTot, AirLoopNumCalls); // Update tracker for maximum number of iterations needed by any controller on all air loops - IterMax = max(IterMax, AirLoopIterMax); + state.dataSimAirServingZones->salIterMax = max(state.dataSimAirServingZones->salIterMax, AirLoopIterMax); // Update tracker for aggregated number of iterations needed by all controllers on all air loops - IterTot += AirLoopIterTot; + state.dataSimAirServingZones->salIterTot += AirLoopIterTot; // Update tracker for total number of times SimAirLoopComponents() has been invoked across all air loops - NumCallsTot += AirLoopNumCalls; + state.dataSimAirServingZones->NumCallsTot += AirLoopNumCalls; // At the end of the first pass, check whether a second pass is needed or not if (AirLoopPass == 1) { @@ -2571,11 +2559,11 @@ namespace EnergyPlus::SimAirServingZones { SimAirLoop(state, FirstHVACIteration, AirLoopNum, AirLoopPass, AirLoopIterMax, AirLoopIterTot, AirLoopNumCalls); // Update tracker for maximum number of iterations needed by any controller on all air loops - IterMax = max(IterMax, AirLoopIterMax); + state.dataSimAirServingZones->salIterMax = max(state.dataSimAirServingZones->salIterMax, AirLoopIterMax); // Update tracker for aggregated number of iterations needed by all controllers on all air loops - IterTot += AirLoopIterTot; + state.dataSimAirServingZones->salIterTot += AirLoopIterTot; // Update tracker for total number of times SimAirLoopComponents() has been invoked across all air loops - NumCallsTot += AirLoopNumCalls; + state.dataSimAirServingZones->NumCallsTot += AirLoopNumCalls; // At the end of the first pass, check whether a second pass is needed or not if (AirLoopPass == 1) { @@ -2659,20 +2647,6 @@ namespace EnergyPlus::SimAirServingZones { // Total number of times SimAirLoopComponents() has been invoked to simulate this air loop // SUBROUTINE LOCAL VARIABLE DEFINITIONS - // Maximum number of iterations performed by each controller on this air loop - static int IterMax(0); - // Aggregated number of iterations performed by each controller on this air loop - static int IterTot(0); - // Number of times SimAirLoopComponents() has been invoked per air loop for either Solve or ReSolve operations - static int NumCalls(0); - // TRUE when primary air system & controllers simulation has converged; - static bool AirLoopConvergedFlag(false); - // TRUE when speculative warm restart is allowed; FALSE otherwise. - static bool DoWarmRestartFlag(false); - // If Status<0, no speculative warm restart attempted. - // If Status==0, warm restart failed. - // If Status>0, warm restart succeeded. - static int WarmRestartStatus(iControllerWarmRestartNone); auto &PrimaryAirSystems(state.dataAirSystemsData->PrimaryAirSystems); auto &AirLoopControlInfo(state.dataAirLoop->AirLoopControlInfo); @@ -2695,38 +2669,38 @@ namespace EnergyPlus::SimAirServingZones { // Next condition is true whenever the final check for the air loop was converged // at the previous SimAirLoop call // Next conditions should detect when air mass flow rates have changed - DoWarmRestartFlag = PrimaryAirSystems(AirLoopNum).NumControllers > 0 && AirLoopControlInfo(AirLoopNum).AllowWarmRestartFlag && + state.dataSimAirServingZones->DoWarmRestartFlagSAL = PrimaryAirSystems(AirLoopNum).NumControllers > 0 && AirLoopControlInfo(AirLoopNum).AllowWarmRestartFlag && !FirstHVACIteration && !state.dataGlobal->SysSizingCalc && AirLoopControlInfo(AirLoopNum).ConvergedFlag && !AirLoopControlInfo(AirLoopNum).LoopFlowRateSet && !AirLoopControlInfo(AirLoopNum).NewFlowRateFlag; - if (!DoWarmRestartFlag) { + if (!state.dataSimAirServingZones->DoWarmRestartFlagSAL) { // Solve controllers with cold start using default initial values - SolveAirLoopControllers(state, FirstHVACIteration, AirLoopNum, AirLoopConvergedFlag, IterMax, IterTot, NumCalls); + SolveAirLoopControllers(state, FirstHVACIteration, AirLoopNum, state.dataSimAirServingZones->AirLoopConvergedFlagSAL, state.dataSimAirServingZones->IterMaxSAL2, state.dataSimAirServingZones->IterTotSAL2, state.dataSimAirServingZones->NumCallsSAL2); // Update air loop trackers - WarmRestartStatus = iControllerWarmRestartNone; - AirLoopNumCalls += NumCalls; - AirLoopIterMax = max(AirLoopIterMax, IterMax); - AirLoopIterTot += IterTot; + state.dataSimAirServingZones->WarmRestartStatusSAL = iControllerWarmRestartNone; + AirLoopNumCalls += state.dataSimAirServingZones->NumCallsSAL2; + AirLoopIterMax = max(AirLoopIterMax, state.dataSimAirServingZones->IterMaxSAL2); + AirLoopIterTot += state.dataSimAirServingZones->IterTotSAL2; } else { // First try with speculative warm restart using previous solution - ReSolveAirLoopControllers(state, FirstHVACIteration, AirLoopNum, AirLoopConvergedFlag, IterMax, IterTot, NumCalls); + ReSolveAirLoopControllers(state, FirstHVACIteration, AirLoopNum, state.dataSimAirServingZones->AirLoopConvergedFlagSAL, state.dataSimAirServingZones->IterMaxSAL2, state.dataSimAirServingZones->IterTotSAL2, state.dataSimAirServingZones->NumCallsSAL2); // Update air loop trackers - WarmRestartStatus = iControllerWarmRestartSuccess; - AirLoopNumCalls += NumCalls; - AirLoopIterMax = max(AirLoopIterMax, IterMax); - AirLoopIterTot += IterTot; + state.dataSimAirServingZones->WarmRestartStatusSAL = iControllerWarmRestartSuccess; + AirLoopNumCalls += state.dataSimAirServingZones->NumCallsSAL2; + AirLoopIterMax = max(AirLoopIterMax, state.dataSimAirServingZones->IterMaxSAL2); + AirLoopIterTot += state.dataSimAirServingZones->IterTotSAL2; // Retry with cold start using default initial values if speculative warm restart did not work - if (!AirLoopConvergedFlag) { - SolveAirLoopControllers(state, FirstHVACIteration, AirLoopNum, AirLoopConvergedFlag, IterMax, IterTot, NumCalls); + if (!state.dataSimAirServingZones->AirLoopConvergedFlagSAL) { + SolveAirLoopControllers(state, FirstHVACIteration, AirLoopNum, state.dataSimAirServingZones->AirLoopConvergedFlagSAL, state.dataSimAirServingZones->IterMaxSAL2, state.dataSimAirServingZones->IterTotSAL2, state.dataSimAirServingZones->NumCallsSAL2); // Update air loop trackers - WarmRestartStatus = iControllerWarmRestartFail; - AirLoopNumCalls += NumCalls; - AirLoopIterMax = max(AirLoopIterMax, IterMax); - AirLoopIterTot += IterTot; + state.dataSimAirServingZones->WarmRestartStatusSAL = iControllerWarmRestartFail; + AirLoopNumCalls += state.dataSimAirServingZones->NumCallsSAL2; + AirLoopIterMax = max(AirLoopIterMax, state.dataSimAirServingZones->IterMaxSAL2); + AirLoopIterTot += state.dataSimAirServingZones->IterTotSAL2; } } @@ -2734,14 +2708,14 @@ namespace EnergyPlus::SimAirServingZones { // To enable runtime statistics tracking for each air loop, define the environment variable // TRACK_AIRLOOP=YES or TRACK_AIRLOOP=Y if (state.dataSysVars->TrackAirLoopEnvFlag) { - TrackAirLoopControllers(state, AirLoopNum, WarmRestartStatus, AirLoopIterMax, AirLoopIterTot, AirLoopNumCalls); + TrackAirLoopControllers(state, AirLoopNum, state.dataSimAirServingZones->WarmRestartStatusSAL, AirLoopIterMax, AirLoopIterTot, AirLoopNumCalls); } // Generate trace for all controllers on this air loop // To enable generating a trace file with the converged solution for all controllers on each air loop, // define the environment variable TRACE_AIRLOOP=YES or TRACE_AIRLOOP=Y. if (state.dataSysVars->TraceAirLoopEnvFlag) { - TraceAirLoopControllers(state, FirstHVACIteration, AirLoopNum, AirLoopPass, AirLoopConvergedFlag, AirLoopNumCalls); + TraceAirLoopControllers(state, FirstHVACIteration, AirLoopNum, AirLoopPass, state.dataSimAirServingZones->AirLoopConvergedFlagSAL, AirLoopNumCalls); } // When there is more than 1 controller on an air loop, each controller sensing @@ -2751,7 +2725,7 @@ namespace EnergyPlus::SimAirServingZones { // happen if // If this is the case then we do not want to try a warm restart as it is very // unlikely to succeed. - AirLoopControlInfo(AirLoopNum).ConvergedFlag = AirLoopConvergedFlag; + AirLoopControlInfo(AirLoopNum).ConvergedFlag = state.dataSimAirServingZones->AirLoopConvergedFlagSAL; } void SolveAirLoopControllers(EnergyPlusData &state, @@ -2812,17 +2786,8 @@ namespace EnergyPlus::SimAirServingZones { bool ControllerConvergedFlag; // TRUE when air loop has been evaluated with latest actuated variables bool IsUpToDateFlag; - // Iteration counter - static int Iter(0); - // Number of times that the maximum iterations was exceeded - static int ErrCount(0); - // Number of times that the maximum iterations was exceeded - static int MaxErrCount(0); // Placeholder for environment name used in error reporting static std::string ErrEnvironmentName; - // A character string equivalent of ErrCount - static bool BypassOAController; // logical to tell ManageControllers to sim or not sim controller in OA System (don't sim here) - auto &PrimaryAirSystems(state.dataAirSystemsData->PrimaryAirSystems); auto &AirLoopControlInfo(state.dataAirLoop->AirLoopControlInfo); @@ -2834,7 +2799,7 @@ namespace EnergyPlus::SimAirServingZones { IterTot = 0; AirLoopConvergedFlag = true; - BypassOAController = true; // don't simulate OA contollers at this time (see SolveWaterCoilController) + state.dataSimAirServingZones->BypassOAControllerSALC = true; // don't simulate OA contollers at this time (see SolveWaterCoilController) IsUpToDateFlag = false; PrimaryAirSystems(AirLoopNum).ControlConverged = false; @@ -2869,7 +2834,7 @@ namespace EnergyPlus::SimAirServingZones { iControllerOpColdStart, ControllerConvergedFlag, IsUpToDateFlag, - BypassOAController, + state.dataSimAirServingZones->BypassOAControllerSALC, AllowWarmRestartFlag); // Detect whether the speculative warm restart feature is supported by each controller // on this air loop. @@ -2884,7 +2849,7 @@ namespace EnergyPlus::SimAirServingZones { // Loop over the air sys controllers until convergence or MaxIter iterations for (int AirLoopControlNum = 1; AirLoopControlNum <= PrimaryAirSystems(AirLoopNum).NumControllers; ++AirLoopControlNum) { - Iter = 0; + state.dataSimAirServingZones->IterSALC = 0; ControllerConvergedFlag = false; // if the controller can be locked out by the economizer operation and the economizer is active, leave the controller inactive if (AirLoopControlInfo(AirLoopNum).EconoActive) { @@ -2898,7 +2863,7 @@ namespace EnergyPlus::SimAirServingZones { // For each controller in sequence, iterate until convergence while (!ControllerConvergedFlag) { - ++Iter; + ++state.dataSimAirServingZones->IterSALC; ManageControllers(state, PrimaryAirSystems(AirLoopNum).ControllerName(AirLoopControlNum), @@ -2908,21 +2873,21 @@ namespace EnergyPlus::SimAirServingZones { iControllerOpIterate, ControllerConvergedFlag, IsUpToDateFlag, - BypassOAController); + state.dataSimAirServingZones->BypassOAControllerSALC); PrimaryAirSystems(AirLoopNum).ControlConverged(AirLoopControlNum) = ControllerConvergedFlag; if (!ControllerConvergedFlag) { // Only check abnormal termination if not yet converged // The iteration counter has been exceeded. - if (Iter > MaxIter) { + if (state.dataSimAirServingZones->IterSALC > MaxIter) { // Indicate that this air loop is not converged AirLoopConvergedFlag = false; // The warning message will be suppressed during the warm up days. if (!state.dataGlobal->WarmupFlag) { - ++ErrCount; - if (ErrCount < 15) { + ++state.dataSimAirServingZones->ErrCountSALC; + if (state.dataSimAirServingZones->ErrCountSALC < 15) { ErrEnvironmentName = state.dataEnvrn->EnvironmentName; const auto CharErrOut = fmt::to_string(MaxIter); ShowWarningError(state, "SolveAirLoopControllers: Maximum iterations (" + CharErrOut + ") exceeded for " + @@ -2931,12 +2896,12 @@ namespace EnergyPlus::SimAirServingZones { state.dataEnvrn->CurMnDy + ' ' + CreateSysTimeIntervalString(state)); } else { if (state.dataEnvrn->EnvironmentName != ErrEnvironmentName) { - MaxErrCount = 0; + state.dataSimAirServingZones->MaxErrCountSALC = 0; ErrEnvironmentName = state.dataEnvrn->EnvironmentName; } ShowRecurringWarningErrorAtEnd(state, "SolveAirLoopControllers: Exceeding Maximum iterations for " + PrimaryAirSystems(AirLoopNum).Name + " during " + state.dataEnvrn->EnvironmentName + " continues", - MaxErrCount); + state.dataSimAirServingZones->MaxErrCountSALC); } } @@ -2962,10 +2927,10 @@ namespace EnergyPlus::SimAirServingZones { } // End of the Convergence Iteration // Update tracker for max iteration counter across all controllers on this air loops - IterMax = max(IterMax, Iter); + IterMax = max(IterMax, state.dataSimAirServingZones->IterSALC); // Update tracker for aggregated counter of air loop inner iterations across controllers // on this air loop - IterTot += Iter; + IterTot += state.dataSimAirServingZones->IterSALC; } // End of controller loop @@ -2990,7 +2955,7 @@ namespace EnergyPlus::SimAirServingZones { iControllerOpEnd, ControllerConvergedFlag, IsUpToDateFlag, - BypassOAController); + state.dataSimAirServingZones->BypassOAControllerSALC); PrimaryAirSystems(AirLoopNum).ControlConverged(AirLoopControlNum) = ControllerConvergedFlag; @@ -3052,17 +3017,9 @@ namespace EnergyPlus::SimAirServingZones { bool ControllerConvergedFlag; // TRUE when air loop has been evaluated with latest actuated variables bool IsUpToDateFlag; - // Iteration counter - static int Iter(0); - // Number of times that the maximum iterations was exceeded - static int ErrCount(0); - // Number of times that the maximum iterations was exceeded - static int MaxErrCount(0); // Placeholder for environment name used in error reporting static std::string ErrEnvironmentName; // A character string equivalent of ErrCount - int static AirLoopPass; - static bool BypassOAController; auto &PrimaryAirSystems(state.dataAirSystemsData->PrimaryAirSystems); auto &AirLoopControlInfo(state.dataAirLoop->AirLoopControlInfo); @@ -3071,9 +3028,9 @@ namespace EnergyPlus::SimAirServingZones { if (AirLoopNum > 0) { AirLoopCheck = true; } - BypassOAController = false; // simulate OA water coil controllers + state.dataSimAirServingZones->BypassOAControllerSWCC = false; // simulate OA water coil controllers if (AirLoopCheck) { - AirLoopPass = AirLoopControlInfo(AirLoopNum).AirLoopPass; + state.dataSimAirServingZones->AirLoopPassSWCC = AirLoopControlInfo(AirLoopNum).AirLoopPass; } IsUpToDateFlag = false; if (AirLoopCheck) { @@ -3096,7 +3053,7 @@ namespace EnergyPlus::SimAirServingZones { iControllerOpColdStart, ControllerConvergedFlag, IsUpToDateFlag, - BypassOAController, + state.dataSimAirServingZones->BypassOAControllerSWCC, AllowWarmRestartFlag); // Detect whether the speculative warm restart feature is supported by each controller on this air loop. @@ -3113,7 +3070,7 @@ namespace EnergyPlus::SimAirServingZones { IsUpToDateFlag = true; // Loop over the air sys controllers until convergence or MaxIter iterations - Iter = 0; + state.dataSimAirServingZones->IterSWCC = 0; ControllerConvergedFlag = false; // if the controller can be locked out by the economizer operation and the economizer is active, leave the controller inactive if (AirLoopCheck) { @@ -3127,7 +3084,7 @@ namespace EnergyPlus::SimAirServingZones { // For this controller, iterate until convergence while (!ControllerConvergedFlag) { - ++Iter; + ++state.dataSimAirServingZones->IterSWCC; ManageControllers(state, ControllerName, @@ -3137,7 +3094,7 @@ namespace EnergyPlus::SimAirServingZones { iControllerOpIterate, ControllerConvergedFlag, IsUpToDateFlag, - BypassOAController); + state.dataSimAirServingZones->BypassOAControllerSWCC); if (AirLoopCheck) { PrimaryAirSystems(AirLoopNum).ControlConverged(state.dataHVACControllers->ControllerProps(ControllerIndex).AirLoopControllerIndex) = @@ -3147,12 +3104,12 @@ namespace EnergyPlus::SimAirServingZones { if (!ControllerConvergedFlag) { // Only check abnormal termination if not yet converged // The iteration counter has been exceeded. - if (Iter > MaxIter) { + if (state.dataSimAirServingZones->IterSWCC > MaxIter) { // The warning message will be suppressed during the warm up days. if (!state.dataGlobal->WarmupFlag) { - ++ErrCount; - if (ErrCount < 15) { + ++state.dataSimAirServingZones->ErrCountSWCC; + if (state.dataSimAirServingZones->ErrCountSWCC < 15) { ErrEnvironmentName = state.dataEnvrn->EnvironmentName; const auto CharErrOut = fmt::to_string(MaxIter); ShowWarningError(state, "SolveAirLoopControllers: Maximum iterations (" + CharErrOut + ") exceeded for " + @@ -3160,12 +3117,12 @@ namespace EnergyPlus::SimAirServingZones { ' ' + CreateSysTimeIntervalString(state)); } else { if (state.dataEnvrn->EnvironmentName != ErrEnvironmentName) { - MaxErrCount = 0; + state.dataSimAirServingZones->MaxErrCountSWCC = 0; ErrEnvironmentName = state.dataEnvrn->EnvironmentName; } ShowRecurringWarningErrorAtEnd(state, "SolveAirLoopControllers: Exceeding Maximum iterations for " + PrimaryAirSystems(AirLoopNum).Name + " during " + state.dataEnvrn->EnvironmentName + " continues", - MaxErrCount); + state.dataSimAirServingZones->MaxErrCountSWCC); } } @@ -3199,7 +3156,7 @@ namespace EnergyPlus::SimAirServingZones { iControllerOpEnd, ControllerConvergedFlag, IsUpToDateFlag, - BypassOAController); + state.dataSimAirServingZones->BypassOAControllerSWCC); // pass convergence of OA system water coils back to SolveAirLoopControllers via PrimaryAirSystem().ControlConverged flag if (AirLoopCheck) { @@ -3260,7 +3217,6 @@ namespace EnergyPlus::SimAirServingZones { // TRUE when air loop needs to be refreshed. // Note that it is not used by ManageControllers() in the WARM_RESTART mode. bool IsUpToDateFlag; - static bool BypassOAController; // logical to bypass HVAC controller calcs auto &PrimaryAirSystems(state.dataAirSystemsData->PrimaryAirSystems); @@ -3272,7 +3228,7 @@ namespace EnergyPlus::SimAirServingZones { IterTot = 0; AirLoopConvergedFlag = true; - BypassOAController = false; // not exactly sure of this but it seems all controllers need to be simulated -- don't bypass + state.dataSimAirServingZones->BypassOAControllerRSALC = false; // not exactly sure of this but it seems all controllers need to be simulated -- don't bypass IsUpToDateFlag = false; PrimaryAirSystems(AirLoopNum).ControlConverged = false; @@ -3289,7 +3245,7 @@ namespace EnergyPlus::SimAirServingZones { iControllerOpWarmRestart, ControllerConvergedFlag, IsUpToDateFlag, - BypassOAController); + state.dataSimAirServingZones->BypassOAControllerRSALC); } // Evaluate air loop components with new actuated variables @@ -3311,7 +3267,7 @@ namespace EnergyPlus::SimAirServingZones { iControllerOpEnd, ControllerConvergedFlag, IsUpToDateFlag, - BypassOAController); + state.dataSimAirServingZones->BypassOAControllerRSALC); PrimaryAirSystems(AirLoopNum).ControlConverged(AirLoopControlNum) = ControllerConvergedFlag; @@ -4634,7 +4590,6 @@ namespace EnergyPlus::SimAirServingZones { Real64 MinOAFlow; // design minimum outside air flow for a system Real64 ZoneOAFracCooling; // zone OA fraction for cooling design air flow Real64 ZoneOAFracHeating; // zone OA fraction for heating design air flow - static Real64 Ep(1.0); // zone primary air fraction Real64 ZoneSA; // Zone supply air flow rate Real64 ZonePA; // Zone primary air flow rate Real64 ClgSupplyAirAdjustFactor; // temporary variable @@ -4777,7 +4732,7 @@ namespace EnergyPlus::SimAirServingZones { ZoneSA = 0.0; ZonePA = 0.0; - Ep = 1.0; + state.dataSimAirServingZones->EpSSOA = 1.0; if (TermUnitFinalZoneSizing(TermUnitSizingIndex).ZoneSecondaryRecirculation > 0.0) { // multi-path system // Vpz: "Primary" supply air from main air handler served by an oa mixer ZonePA = TermUnitFinalZoneSizing(TermUnitSizingIndex).DesCoolVolFlow; @@ -4822,9 +4777,9 @@ namespace EnergyPlus::SimAirServingZones { } // calc zone primary air fraction - if (ZoneSA > 0.0) Ep = ZonePA / ZoneSA; - if (Ep > 1.0) Ep = 1.0; - TermUnitFinalZoneSizing(TermUnitSizingIndex).ZonePrimaryAirFraction = Ep; + if (ZoneSA > 0.0) state.dataSimAirServingZones->EpSSOA = ZonePA / ZoneSA; + if (state.dataSimAirServingZones->EpSSOA > 1.0) state.dataSimAirServingZones->EpSSOA = 1.0; + TermUnitFinalZoneSizing(TermUnitSizingIndex).ZonePrimaryAirFraction = state.dataSimAirServingZones->EpSSOA; TermUnitFinalZoneSizing(TermUnitSizingIndex).ZoneOAFracCooling = ZoneOAFracCooling; // determined cooled zone floor area in an airloop @@ -4942,7 +4897,7 @@ namespace EnergyPlus::SimAirServingZones { ZoneSA = 0.0; ZonePA = 0.0; - Ep = 1.0; + state.dataSimAirServingZones->EpSSOA = 1.0; if (TermUnitFinalZoneSizing(TermUnitSizingIndex).ZoneSecondaryRecirculation > 0.0) { // multi-path system // Vpz: "Primary" supply air from main air handler served by an oa mixer ZonePA = TermUnitFinalZoneSizing(TermUnitSizingIndex).DesHeatVolFlow; @@ -4978,9 +4933,9 @@ namespace EnergyPlus::SimAirServingZones { } // calc zone primary air fraction - if (ZoneSA > 0.0) Ep = ZonePA / ZoneSA; - if (Ep > 1.0) Ep = 1.0; - TermUnitFinalZoneSizing(TermUnitSizingIndex).ZonePrimaryAirFractionHtg = Ep; + if (ZoneSA > 0.0) state.dataSimAirServingZones->EpSSOA = ZonePA / ZoneSA; + if (state.dataSimAirServingZones->EpSSOA > 1.0) state.dataSimAirServingZones->EpSSOA = 1.0; + TermUnitFinalZoneSizing(TermUnitSizingIndex).ZonePrimaryAirFractionHtg = state.dataSimAirServingZones->EpSSOA; TermUnitFinalZoneSizing(TermUnitSizingIndex).ZoneOAFracHeating = ZoneOAFracHeating; // determined heated zone floor area in an airloop @@ -5062,10 +5017,10 @@ namespace EnergyPlus::SimAirServingZones { } // calc zone primary air fraction - Ep = 1.0; - if (ZoneSA > 0.0) Ep = ZonePA / ZoneSA; - if (Ep > 1.0) Ep = 1.0; - TermUnitFinalZoneSizing(TermUnitSizingIndex).ZonePrimaryAirFractionHtg = Ep; + state.dataSimAirServingZones->EpSSOA = 1.0; + if (ZoneSA > 0.0) state.dataSimAirServingZones->EpSSOA = ZonePA / ZoneSA; + if (state.dataSimAirServingZones->EpSSOA > 1.0) state.dataSimAirServingZones->EpSSOA = 1.0; + TermUnitFinalZoneSizing(TermUnitSizingIndex).ZonePrimaryAirFractionHtg = state.dataSimAirServingZones->EpSSOA; TermUnitFinalZoneSizing(TermUnitSizingIndex).ZoneOAFracHeating = ZoneOAFracHeating; TermUnitFinalZoneSizing(TermUnitSizingIndex).SupplyAirAdjustFactor = max(ClgSupplyAirAdjustFactor, HtgSupplyAirAdjustFactor); diff --git a/src/EnergyPlus/SimAirServingZones.hh b/src/EnergyPlus/SimAirServingZones.hh index 85d8e56309a..e1d3ba2abd2 100644 --- a/src/EnergyPlus/SimAirServingZones.hh +++ b/src/EnergyPlus/SimAirServingZones.hh @@ -55,6 +55,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -226,6 +227,40 @@ struct SimAirServingZonesData : BaseGlobalStruct { Array1D_int SupNode; Array1D_int SupNodeType; + int TUInNode = 0; // inlet node number of a terminal unit + Real64 SumZoneDesFlow = 0.0; // sum of the zone design air mass flow rates for zones served by a system + Real64 OAReliefDiff = 0.0; // local for massflow change across OA system, kg/s + Real64 MassFlowSetToler; + int salIterMax = 0; // Maximum of iteration counters across all air loops + int salIterTot = 0; // Aggregated number of iterations across all air loops + int NumCallsTot = 0; // Aggregated number fo times SimAirLoopComponents() has been invoked across all air loops + int IterMaxSAL2 = 0; // Maximum number of iterations performed by each controller on this air loop + int IterTotSAL2 = 0; // Aggregated number of iterations performed by each controller on this air loop + int NumCallsSAL2 = 0; // Number of times SimAirLoopComponents() has been invoked per air loop for either Solve or ReSolve operations + // TRUE when primary air system & controllers simulation has converged; + bool AirLoopConvergedFlagSAL = false; + // TRUE when speculative warm restart is allowed; FALSE otherwise. + bool DoWarmRestartFlagSAL = false; + // If Status<0, no speculative warm restart attempted. + // If Status==0, warm restart failed. + // If Status>0, warm restart succeeded. + int WarmRestartStatusSAL = DataHVACControllers::iControllerWarmRestartNone; + int IterSALC = 0; // Iteration counter + int ErrCountSALC = 0; // Number of times that the maximum iterations was exceeded + int MaxErrCountSALC = 0; // Number of times that the maximum iterations was exceeded + // A character string equivalent of ErrCount + bool BypassOAControllerSALC; // logical to tell ManageControllers to sim or not sim controller in OA System (don't sim here) + // Iteration counter + int IterSWCC = 0; + // Number of times that the maximum iterations was exceeded + int ErrCountSWCC = 0; + // Number of times that the maximum iterations was exceeded + int MaxErrCountSWCC = 0; + int AirLoopPassSWCC; + bool BypassOAControllerSWCC; + bool BypassOAControllerRSALC; // logical to bypass HVAC controller calcs + Real64 EpSSOA = 1.0; // zone primary air fraction + void clear_state() override { this->GetAirLoopInputFlag = true; From c5e6a3f8515bac241401cf7c1b250c3872210259 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Tue, 23 Mar 2021 21:50:49 -0600 Subject: [PATCH 02/21] Single Duct --- src/EnergyPlus/SimAirServingZones.hh | 20 + src/EnergyPlus/SingleDuct.cc | 1717 +++++++++++++------------- src/EnergyPlus/SingleDuct.hh | 132 +- 3 files changed, 974 insertions(+), 895 deletions(-) diff --git a/src/EnergyPlus/SimAirServingZones.hh b/src/EnergyPlus/SimAirServingZones.hh index e1d3ba2abd2..85d0d1095f5 100644 --- a/src/EnergyPlus/SimAirServingZones.hh +++ b/src/EnergyPlus/SimAirServingZones.hh @@ -297,6 +297,26 @@ struct SimAirServingZonesData : BaseGlobalStruct { this->TermUnitSizingNumsHeat.clear(); this->SupNode.clear(); this->SupNodeType.clear(); + + this->TUInNode = 0; // inlet node number of a terminal unit + this->SumZoneDesFlow = 0.0; // sum of the zone design air mass flow rates for zones served by a system + this->OAReliefDiff = 0.0; // local for massflow change across OA system, kg/s + this->salIterMax = 0; // Maximum of iteration counters across all air loops + this->salIterTot = 0; // Aggregated number of iterations across all air loops + this->NumCallsTot = 0; // Aggregated number fo times SimAirLoopComponents() has been invoked across all air loops + this->IterMaxSAL2 = 0; // Maximum number of iterations performed by each controller on this air loop + this->IterTotSAL2 = 0; // Aggregated number of iterations performed by each controller on this air loop + this->NumCallsSAL2 = 0; // Number of times SimAirLoopComponents() has been invoked per air loop for either Solve or ReSolve operations + this->AirLoopConvergedFlagSAL = false; + this->DoWarmRestartFlagSAL = false; + this->WarmRestartStatusSAL = DataHVACControllers::iControllerWarmRestartNone; + this->IterSALC = 0; // Iteration counter + this->ErrCountSALC = 0; // Number of times that the maximum iterations was exceeded + this->MaxErrCountSALC = 0; // Number of times that the maximum iterations was exceeded + this->IterSWCC = 0; + this->ErrCountSWCC = 0; + this->MaxErrCountSWCC = 0; + this->EpSSOA = 1.0; // zone primary air fraction } }; diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 68eac0c8a22..09be00c27e5 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -261,16 +261,6 @@ namespace EnergyPlus::SingleDuct { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static int SysNum(0); // The Sys that you are currently loading input into - static int SysIndex(0); // The Sys that you are currently loading input into - static int NumVAVSys(0); - static int NumNoRHVAVSys(0); - static int NumVAVVS(0); - static int NumCBVAVSys(0); - static int NumNoRHCBVAVSys(0); - static int NumAlphas(0); - static int NumNums(0); - static int NumCVNoReheatSys(0); int NumZoneSiz; int ZoneSizIndex; int IOStat; @@ -286,262 +276,261 @@ namespace EnergyPlus::SingleDuct { Array1D Numbers; // Numeric input items for object Array1D_bool lAlphaBlanks; // Logical array, alpha field input BLANK = .TRUE. Array1D_bool lNumericBlanks; // Logical array, numeric field input BLANK = .TRUE. - static int MaxNums(0); // Maximum number of numeric input fields - static int MaxAlphas(0); // Maximum number of alpha input fields - static int TotalArgs(0); // Total number of alpha and numeric arguments (max) for a + // certain object in the input file std::string AirTermSysInletNodeName; // air terminal single duct system inlet node name std::string AirTermSysOutletNodeName; // air terminal single duct system outlet node name - NumVAVSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:Reheat"); - NumNoRHVAVSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:NoReheat"); + state.dataSingleDuct->NumVAVSysGSI = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:Reheat"); + state.dataSingleDuct->NumNoRHVAVSysGSI = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:NoReheat"); state.dataSingleDuct->NumConstVolSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:ConstantVolume:Reheat"); - NumCVNoReheatSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:ConstantVolume:NoReheat"); - NumVAVVS = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan"); - NumCBVAVSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat"); - NumNoRHCBVAVSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat"); - state.dataSingleDuct->NumSDAirTerminal = NumVAVSys + state.dataSingleDuct->NumConstVolSys + NumCVNoReheatSys + NumNoRHVAVSys + NumVAVVS + NumCBVAVSys + NumNoRHCBVAVSys; + state.dataSingleDuct->NumCVNoReheatSysGSI = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:ConstantVolume:NoReheat"); + state.dataSingleDuct->NumVAVVSGSI = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan"); + state.dataSingleDuct->NumCBVAVSysGSI = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat"); + state.dataSingleDuct->NumNoRHCBVAVSysGSI = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat"); + state.dataSingleDuct->NumSDAirTerminal = + state.dataSingleDuct->NumVAVSysGSI + state.dataSingleDuct->NumConstVolSys + state.dataSingleDuct->NumCVNoReheatSysGSI + state.dataSingleDuct->NumNoRHVAVSysGSI + state.dataSingleDuct->NumVAVVSGSI + state.dataSingleDuct->NumCBVAVSysGSI + state.dataSingleDuct->NumNoRHCBVAVSysGSI; state.dataSingleDuct->sd_airterminal.allocate(state.dataSingleDuct->NumSDAirTerminal); state.dataSingleDuct->SysUniqueNames.reserve(static_cast(state.dataSingleDuct->NumSDAirTerminal)); state.dataSingleDuct->CheckEquipName.dimension(state.dataSingleDuct->NumSDAirTerminal, true); - inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:Reheat", TotalArgs, NumAlphas, NumNums); - MaxNums = max(MaxNums, NumNums); - MaxAlphas = max(MaxAlphas, NumAlphas); - inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:NoReheat", TotalArgs, NumAlphas, NumNums); - MaxNums = max(MaxNums, NumNums); - MaxAlphas = max(MaxAlphas, NumAlphas); - inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:ConstantVolume:Reheat", TotalArgs, NumAlphas, NumNums); - MaxNums = max(MaxNums, NumNums); - MaxAlphas = max(MaxAlphas, NumAlphas); - inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:ConstantVolume:NoReheat", TotalArgs, NumAlphas, NumNums); - MaxNums = max(MaxNums, NumNums); - MaxAlphas = max(MaxAlphas, NumAlphas); - inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", TotalArgs, NumAlphas, NumNums); - MaxNums = max(MaxNums, NumNums); - MaxAlphas = max(MaxAlphas, NumAlphas); - inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", TotalArgs, NumAlphas, NumNums); - MaxNums = max(MaxNums, NumNums); - MaxAlphas = max(MaxAlphas, NumAlphas); - inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat", TotalArgs, NumAlphas, NumNums); - MaxNums = max(MaxNums, NumNums); - MaxAlphas = max(MaxAlphas, NumAlphas); - - Alphas.allocate(MaxAlphas); - cAlphaFields.allocate(MaxAlphas); - cNumericFields.allocate(MaxNums); - Numbers.dimension(MaxNums, 0.0); - lAlphaBlanks.dimension(MaxAlphas, true); - lNumericBlanks.dimension(MaxNums, true); + inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:Reheat", state.dataSingleDuct->TotalArgsGSI, state.dataSingleDuct->NumAlphasGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxNumsGSI = max(state.dataSingleDuct->MaxNumsGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxAlphasGSI = max(state.dataSingleDuct->MaxAlphasGSI, state.dataSingleDuct->NumAlphasGSI); + inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:NoReheat", state.dataSingleDuct->TotalArgsGSI, state.dataSingleDuct->NumAlphasGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxNumsGSI = max(state.dataSingleDuct->MaxNumsGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxAlphasGSI = max(state.dataSingleDuct->MaxAlphasGSI, state.dataSingleDuct->NumAlphasGSI); + inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:ConstantVolume:Reheat", state.dataSingleDuct->TotalArgsGSI, state.dataSingleDuct->NumAlphasGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxNumsGSI = max(state.dataSingleDuct->MaxNumsGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxAlphasGSI = max(state.dataSingleDuct->MaxAlphasGSI, state.dataSingleDuct->NumAlphasGSI); + inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:ConstantVolume:NoReheat", state.dataSingleDuct->TotalArgsGSI, state.dataSingleDuct->NumAlphasGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxNumsGSI = max(state.dataSingleDuct->MaxNumsGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxAlphasGSI = max(state.dataSingleDuct->MaxAlphasGSI, state.dataSingleDuct->NumAlphasGSI); + inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", state.dataSingleDuct->TotalArgsGSI, state.dataSingleDuct->NumAlphasGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxNumsGSI = max(state.dataSingleDuct->MaxNumsGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxAlphasGSI = max(state.dataSingleDuct->MaxAlphasGSI, state.dataSingleDuct->NumAlphasGSI); + inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", state.dataSingleDuct->TotalArgsGSI, state.dataSingleDuct->NumAlphasGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxNumsGSI = max(state.dataSingleDuct->MaxNumsGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxAlphasGSI = max(state.dataSingleDuct->MaxAlphasGSI, state.dataSingleDuct->NumAlphasGSI); + inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat", state.dataSingleDuct->TotalArgsGSI, state.dataSingleDuct->NumAlphasGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxNumsGSI = max(state.dataSingleDuct->MaxNumsGSI, state.dataSingleDuct->NumNumsGSI); + state.dataSingleDuct->MaxAlphasGSI = max(state.dataSingleDuct->MaxAlphasGSI, state.dataSingleDuct->NumAlphasGSI); + + Alphas.allocate(state.dataSingleDuct->MaxAlphasGSI); + cAlphaFields.allocate(state.dataSingleDuct->MaxAlphasGSI); + cNumericFields.allocate(state.dataSingleDuct->MaxNumsGSI); + Numbers.dimension(state.dataSingleDuct->MaxNumsGSI, 0.0); + lAlphaBlanks.dimension(state.dataSingleDuct->MaxAlphasGSI, true); + lNumericBlanks.dimension(state.dataSingleDuct->MaxNumsGSI, true); // Start Loading the System Input - for (SysIndex = 1; SysIndex <= NumVAVSys; ++SysIndex) { + for (state.dataSingleDuct->SysIndexGSI = 1; state.dataSingleDuct->SysIndexGSI <= state.dataSingleDuct->NumVAVSysGSI; ++state.dataSingleDuct->SysIndexGSI) { CurrentModuleObject = "AirTerminal:SingleDuct:VAV:Reheat"; inputProcessor->getObjectItem(state, CurrentModuleObject, - SysIndex, + state.dataSingleDuct->SysIndexGSI, Alphas, - NumAlphas, + state.dataSingleDuct->NumAlphasGSI, Numbers, - NumNums, + state.dataSingleDuct->NumNumsGSI, IOStat, lNumericBlanks, lAlphaBlanks, cAlphaFields, cNumericFields); - SysNum = SysIndex; - state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + state.dataSingleDuct->SysNumGSI = state.dataSingleDuct->SysIndexGSI; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysNum = state.dataSingleDuct->SysNumGSI; GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); - state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; - state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctVAVReheat; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = Alphas(7); - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Gas; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Electric; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SimpleHeating; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SteamAirHeating; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; - } else if (!state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp.empty()) { - ShowSevereError(state, "Illegal " + cAlphaFields(8) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp + '.'); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctVAVReheat; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = Alphas(7); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Gas; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Electric")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Electric; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Water")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SimpleHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Steam")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + } else if (!state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp.empty()) { + ShowSevereError(state, "Illegal " + cAlphaFields(8) + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = Alphas(8); - ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName = Alphas(8); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } else { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } // For node connections, this object is both a parent and a non-parent, because the // VAV damper is not called out as a separate component, its nodes must be connected // as ObjectIsNotParent. But for the reheat coil, the nodes are connected as ObjectIsParent - state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Outlet, 1, ObjectIsNotParent, cAlphaFields(3)); - state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Inlet, 1, ObjectIsNotParent, cAlphaFields(4)); - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRate = Numbers(1); if (UtilityRoutines::SameString(Alphas(5), "Constant")) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Constant; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Constant; } else if (UtilityRoutines::SameString(Alphas(5), "FixedFlowRate")) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Fixed; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Fixed; } else if (UtilityRoutines::SameString(Alphas(5), "Scheduled")) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Scheduled; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Scheduled; } else { ShowSevereError(state, cAlphaFields(5) + " = " + Alphas(5) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = Numbers(2); if (lNumericBlanks(2)) { - state.dataSingleDuct->sd_airterminal(SysNum).ConstantMinAirFracSetByUser = false; - state.dataSingleDuct->sd_airterminal(SysNum).DesignMinAirFrac = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ConstantMinAirFracSetByUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DesignMinAirFrac = 0.0; } else { - state.dataSingleDuct->sd_airterminal(SysNum).ConstantMinAirFracSetByUser = true; - state.dataSingleDuct->sd_airterminal(SysNum).DesignMinAirFrac = Numbers(2); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Fixed) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ConstantMinAirFracSetByUser = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DesignMinAirFrac = Numbers(2); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod == MinFlowFraction::Fixed) { ShowWarningError(state, "Since " + cAlphaFields(5) + " = " + Alphas(5) + ", input for " + cNumericFields(2) + " will be ignored."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = 0.0; } } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFixedMinAir = Numbers(3); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFixedMinAir = Numbers(3); if (lNumericBlanks(3)) { - state.dataSingleDuct->sd_airterminal(SysNum).FixedMinAirSetByUser = false; - state.dataSingleDuct->sd_airterminal(SysNum).DesignMinAirFrac = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FixedMinAirSetByUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DesignMinAirFrac = 0.0; } else { - state.dataSingleDuct->sd_airterminal(SysNum).FixedMinAirSetByUser = true; - state.dataSingleDuct->sd_airterminal(SysNum).DesignMinAirFrac = Numbers(3); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Constant) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FixedMinAirSetByUser = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DesignMinAirFrac = Numbers(3); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod == MinFlowFraction::Constant) { ShowWarningError(state, "Since " + cAlphaFields(5) + " = " + Alphas(5) + ", input for " + cNumericFields(3) + " will be ignored."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFixedMinAir = 0.0; + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFixedMinAir = 0.0; } } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr = GetScheduleIndex(state, Alphas(6)); - if ((state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr == 0) && (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracSchPtr = GetScheduleIndex(state, Alphas(6)); + if ((state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracSchPtr == 0) && (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { ShowSevereError(state, cAlphaFields(6) + " = " + Alphas(6) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "A valid schedule is required"); ErrorsFound = true; - } else if ((state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr > 0) && (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { + } else if ((state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracSchPtr > 0) && (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { // check range of values in schedule - if (!CheckScheduleValueMinMax(state, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr, ">=", 0.0, "<=", 1.0)) { + if (!CheckScheduleValueMinMax(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracSchPtr, ">=", 0.0, "<=", 1.0)) { ShowSevereError(state, "Error found in " + cAlphaFields(6) + " = " + Alphas(6)); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "Schedule values must be (>=0., <=1.)"); } } // The reheat coil control node is necessary for hot water and steam reheat, but not necessary for // electric or gas reheat. - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num != HeatingCoilType::Gas && state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num != HeatingCoilType::Electric) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num != HeatingCoilType::Gas && state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num != HeatingCoilType::Electric) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = - GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = + GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } else { IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } } - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = GetOnlySingleNode(state, Alphas(9), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = GetOnlySingleNode(state, Alphas(9), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Outlet, 1, ObjectIsParent, cAlphaFields(9)); - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(4); - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(5); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatSteamVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatSteamVolFlow = Numbers(5); } else { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(4); - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(5); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatWaterVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatWaterVolFlow = Numbers(5); } - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = Numbers(6); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = Numbers(6); // Set default convergence tolerance - if (state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset <= 0.0) { - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.001; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset <= 0.0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = 0.001; } if (UtilityRoutines::SameString(Alphas(10), "Reverse")) { - state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::ReverseAction; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::ReverseAction; } else if (UtilityRoutines::SameString(Alphas(10), "Normal")) { - state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::Normal; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::Normal; } else if (UtilityRoutines::SameString(Alphas(10), "ReverseWithLimits")) { - state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::ReverseActionWithLimits; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::ReverseActionWithLimits; } else { ShowSevereError(state, cAlphaFields(10) + " = " + Alphas(10) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } // Register component set data - TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, - state.dataSingleDuct->sd_airterminal(SysNum).SysName, - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum), + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode), "Air Nodes"); for (ADUNum = 1; ADUNum <= state.dataDefineEquipment->NumAirDistUnits; ++ADUNum) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { - state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { + state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + - state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + ',' + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -549,202 +538,202 @@ namespace EnergyPlus::SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= state.dataZoneEquip->ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).TermUnitSizingNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).ZoneEqNum = CtrlZone; } - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).FloorArea * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).Multiplier * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).ListMultiplier; } } } } if (Numbers(7) == DataGlobalConstants::AutoCalculate) { - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat = Numbers(7); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRateDuringReheat = Numbers(7); } else { - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat = Numbers(7) * state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRateDuringReheat = Numbers(7) * state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFloorArea; } - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFractionDuringReheat = Numbers(8); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFractionDuringReheat = Numbers(8); - if (state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction != Action::ReverseActionWithLimits) { - if (state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat > 0.0) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction != Action::ReverseActionWithLimits) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRateDuringReheat > 0.0) { ShowWarningError(state, "Since " + cAlphaFields(10) + " = " + Alphas(10) + ", input for " + cNumericFields(7) + " will be ignored."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); } - if (state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFractionDuringReheat > 0.0) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFractionDuringReheat > 0.0) { ShowWarningError(state, "Since " + cAlphaFields(10) + " = " + Alphas(10) + ", input for " + cNumericFields(8) + " will be ignored."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); } } // Maximum reheat air temperature, i.e. the maximum supply air temperature leaving the reheat coil if (!lNumericBlanks(9)) { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTemp = Numbers(9); - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatTemp = Numbers(9); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatTempSetByUser = true; } else { // user does not specify maximum supply air temperature // sd_airterminal(SysNum)%MaxReheatTemp = 35.0D0 !C - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatTempSetByUser = false; } if (!lAlphaBlanks(11)) { - state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(11), state.dataSize->OARequirements); - if (state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(11), state.dataSize->OARequirements); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr == 0) { ShowSevereError(state, cAlphaFields(11) + " = " + Alphas(11) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } else { - state.dataSingleDuct->sd_airterminal(SysNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).NoOAFlowInputFromUser = false; } } if (lAlphaBlanks(12)) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = false; } else { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(12)); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(12)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(12) + " = " + Alphas(12) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = true; } - ValidateComponent(state, Alphas(7), Alphas(8), IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); + ValidateComponent(state, Alphas(7), Alphas(8), IsNotOK, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } // Add reheat coil to component sets array - SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, state.dataSingleDuct->sd_airterminal(SysNum).SysName, Alphas(7), Alphas(8), Alphas(3), Alphas(9)); + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, Alphas(7), Alphas(8), Alphas(3), Alphas(9)); // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperPosition, "System", "Average", - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); SetupOutputVariable(state, "Zone Air Terminal Minimum Air Flow Fraction", OutputProcessor::Unit::None, - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracReport, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracReport, "System", "Average", - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); } // end Number of Sys Loop - for (SysIndex = 1; SysIndex <= NumCBVAVSys; ++SysIndex) { + for (state.dataSingleDuct->SysIndexGSI = 1; state.dataSingleDuct->SysIndexGSI <= state.dataSingleDuct->NumCBVAVSysGSI; ++state.dataSingleDuct->SysIndexGSI) { CurrentModuleObject = "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat"; inputProcessor->getObjectItem(state, CurrentModuleObject, - SysIndex, + state.dataSingleDuct->SysIndexGSI, Alphas, - NumAlphas, + state.dataSingleDuct->NumAlphasGSI, Numbers, - NumNums, + state.dataSingleDuct->NumNumsGSI, IOStat, lNumericBlanks, lAlphaBlanks, cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys; - state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + state.dataSingleDuct->SysNumGSI = state.dataSingleDuct->SysIndexGSI + state.dataSingleDuct->NumVAVSysGSI; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysNum = state.dataSingleDuct->SysNumGSI; GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); - state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; - state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctCBVAVReheat; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = Alphas(5); - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Gas; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Electric; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SimpleHeating; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SteamAirHeating; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; - } else if (!state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp.empty()) { - ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp + '.'); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctCBVAVReheat; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = Alphas(5); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Gas; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Electric")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Electric; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Water")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SimpleHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Steam")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + } else if (!state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp.empty()) { + ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = Alphas(6); - ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName = Alphas(6); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } else { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } // For node connections, this object is both a parent and a non-parent, because the // VAV damper is not called out as a separate component, its nodes must be connected // as ObjectIsNotParent. But for the reheat coil, the nodes are connected as ObjectIsParent - state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Outlet, 1, ObjectIsNotParent, cAlphaFields(3)); - state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Inlet, 1, ObjectIsNotParent, cAlphaFields(4)); - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes < 0.0) { - ShowWarningError(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType + " \"" + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "\""); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = Numbers(2); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes < 0.0) { + ShowWarningError(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " \"" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName + "\""); ShowContinueError(state, cNumericFields(2) + " must be greater than or equal to 0. Resetting to 0 and the simulation continues."); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = 0.0; } - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes > 1.0) { - ShowWarningError(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType + " \"" + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "\""); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes > 1.0) { + ShowWarningError(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " \"" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName + "\""); ShowContinueError(state, cNumericFields(2) + " must be less than or equal to 1. Resetting to 1 and the simulation continues."); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 1.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = 1.0; } // The reheat coil control node is necessary for hot water and steam reheat, but not necessary for // electric or gas reheat. - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Gas || state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Electric) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::Gas || state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::Electric) { // IF(.NOT. lAlphaBlanks(5)) THEN // CALL ShowWarningError(state, 'In '//TRIM(sd_airterminal(SysNum)%SysType)//' = ' //TRIM(sd_airterminal(SysNum)%SysName) & // // ' the '//TRIM(cAlphaFields(5))//' is not needed and will be ignored.') @@ -756,21 +745,21 @@ namespace EnergyPlus::SingleDuct { // // ' the '//TRIM(cAlphaFields(5))//' is undefined.') // ErrorsFound=.TRUE. // ELSE - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = - GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = + GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } // GetOnlySingleNode(state, Alphas(5),ErrorsFound,sd_airterminal(SysNum)%SysType,Alphas(1), & // DataLoopNode::NodeFluidType::Steam,DataLoopNode::NodeConnectionType::Actuator,1,ObjectIsParent) } else { IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } // GetOnlySingleNode(state, Alphas(5),ErrorsFound,Sys(SysNum)%SysType,Alphas(1), & @@ -778,49 +767,49 @@ namespace EnergyPlus::SingleDuct { } // END IF } - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = GetOnlySingleNode(state, Alphas(7), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = GetOnlySingleNode(state, Alphas(7), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Outlet, 1, ObjectIsParent, cAlphaFields(7)); - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(3); - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(4); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatSteamVolFlow = Numbers(3); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatSteamVolFlow = Numbers(4); } else { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(3); - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatWaterVolFlow = Numbers(3); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatWaterVolFlow = Numbers(4); } - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = Numbers(5); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = Numbers(5); // Set default convergence tolerance - if (state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset <= 0.0) { - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.001; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset <= 0.0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = 0.001; } - state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::ReverseAction; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::ReverseAction; // Register component set data - TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, - state.dataSingleDuct->sd_airterminal(SysNum).SysName, - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum), + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode), "Air Nodes"); for (ADUNum = 1; ADUNum <= state.dataDefineEquipment->NumAirDistUnits; ++ADUNum) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { - state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { + state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + - state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + ',' + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -828,140 +817,140 @@ namespace EnergyPlus::SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= state.dataZoneEquip->ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).TermUnitSizingNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).ZoneEqNum = CtrlZone; } - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).FloorArea * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).Multiplier * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).ListMultiplier; } } } } if (!lNumericBlanks(6)) { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTemp = Numbers(6); - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatTemp = Numbers(6); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatTempSetByUser = true; } else { // user does not specify maximum supply air temperature // sd_airterminal(SysNum)%MaxReheatTemp = 35.0D0 !C - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatTempSetByUser = false; } - ValidateComponent(state, Alphas(5), Alphas(6), IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); + ValidateComponent(state, Alphas(5), Alphas(6), IsNotOK, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } if (lAlphaBlanks(8)) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = false; } else { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(8)); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(8)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(8) + " = " + Alphas(8) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = true; } // Add reheat coil to component sets array - SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, state.dataSingleDuct->sd_airterminal(SysNum).SysName, Alphas(5), Alphas(6), Alphas(3), Alphas(7)); + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, Alphas(5), Alphas(6), Alphas(3), Alphas(7)); // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperPosition, "System", "Average", - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); } // end Number of VAVHeatandCool Sys Loop CurrentModuleObject = "AirTerminal:SingleDuct:ConstantVolume:Reheat"; - for (SysIndex = 1; SysIndex <= state.dataSingleDuct->NumConstVolSys; ++SysIndex) { + for (state.dataSingleDuct->SysIndexGSI = 1; state.dataSingleDuct->SysIndexGSI <= state.dataSingleDuct->NumConstVolSys; ++state.dataSingleDuct->SysIndexGSI) { inputProcessor->getObjectItem(state, CurrentModuleObject, - SysIndex, + state.dataSingleDuct->SysIndexGSI, Alphas, - NumAlphas, + state.dataSingleDuct->NumAlphasGSI, Numbers, - NumNums, + state.dataSingleDuct->NumNumsGSI, IOStat, lNumericBlanks, lAlphaBlanks, cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys + NumCBVAVSys; - state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + state.dataSingleDuct->SysNumGSI = state.dataSingleDuct->SysIndexGSI + state.dataSingleDuct->NumVAVSysGSI + state.dataSingleDuct->NumCBVAVSysGSI; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysNum = state.dataSingleDuct->SysNumGSI; GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); - state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; - state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctConstVolReheat; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = Alphas(5); - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Gas; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Electric; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SimpleHeating; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SteamAirHeating; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctConstVolReheat; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = Alphas(5); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Gas; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Electric")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Electric; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Water")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SimpleHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Steam")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; } else { - ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp + '.'); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = Alphas(6); - ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName = Alphas(6); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } else { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } - state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Outlet, 1, ObjectIsParent, cAlphaFields(3)); - state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Inlet, @@ -970,7 +959,7 @@ namespace EnergyPlus::SingleDuct { cAlphaFields(4)); // The reheat coil control node is necessary for hot water reheat, but not necessary for // electric or gas reheat. - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Gas || state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Electric) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::Gas || state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::Electric) { // IF(.NOT. lAlphaBlanks(5)) THEN // CALL ShowWarningError(state, 'In '//TRIM(Sys(SysNum)%SysType)//' = ' // TRIM(Sys(SysNum)%SysName) & // // ' the '//TRIM(cAlphaFields(5))//' is not needed and will be ignored.') @@ -982,73 +971,73 @@ namespace EnergyPlus::SingleDuct { // // ' the '//TRIM(cAlphaFields(5))//' is undefined.') // ErrorsFound=.TRUE. // END IF - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = - GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = + GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } // GetOnlySingleNode(state, Alphas(5),ErrorsFound,sd_airterminal(SysNum)%SysType,Alphas(1), & // DataLoopNode::NodeFluidType::Steam,DataLoopNode::NodeConnectionType::Actuator,1,ObjectIsParent) } else { IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } // GetOnlySingleNode(state, Alphas(5),ErrorsFound,sd_airterminal(SysNum)%SysType,Alphas(1), & // DataLoopNode::NodeFluidType::Water,DataLoopNode::NodeConnectionType::Actuator,1,ObjectIsParent) } } - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::MinFracNotUsed; - state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(2); - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(3); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::MinFracNotUsed; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::HeatingActionNotUsed; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatSteamVolFlow = Numbers(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatSteamVolFlow = Numbers(3); } else { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(2); - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(3); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatWaterVolFlow = Numbers(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatWaterVolFlow = Numbers(3); } - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = Numbers(4); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = Numbers(4); // Set default convergence tolerance - if (state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset <= 0.0) { - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.001; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset <= 0.0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = 0.001; } // Maximum reheat air temperature, i.e. the maximum supply air temperature leaving the reheat coil if (!lNumericBlanks(5)) { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTemp = Numbers(5); - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatTemp = Numbers(5); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatTempSetByUser = true; } else { // user does not specify maximum supply air temperature // sd_airterminal(SysNum)%MaxReheatTemp = 35.0D0 !C - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatTempSetByUser = false; } // Register component set data - TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, - state.dataSingleDuct->sd_airterminal(SysNum).SysName, - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum), + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum), "Air Nodes"); for (ADUNum = 1; ADUNum <= state.dataDefineEquipment->NumAirDistUnits; ++ADUNum) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { - state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { + state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + - state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + ',' + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -1056,40 +1045,40 @@ namespace EnergyPlus::SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= state.dataZoneEquip->ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).TermUnitSizingNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).ZoneEqNum = CtrlZone; } - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).FloorArea * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).Multiplier * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).ListMultiplier; } } } } - ValidateComponent(state, Alphas(5), Alphas(6), IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); + ValidateComponent(state, Alphas(5), Alphas(6), IsNotOK, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } // Add reheat coil to component sets array - SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, state.dataSingleDuct->sd_airterminal(SysNum).SysName, Alphas(5), Alphas(6), Alphas(4), Alphas(3)); + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, Alphas(5), Alphas(6), Alphas(4), Alphas(3)); // Setup the Average damper Position output variable // BG removed 9-10-2009 during work on CR 7770, constant volume has no damper @@ -1100,51 +1089,51 @@ namespace EnergyPlus::SingleDuct { CurrentModuleObject = "AirTerminal:SingleDuct:ConstantVolume:NoReheat"; - for (SysIndex = 1; SysIndex <= NumCVNoReheatSys; ++SysIndex) { + for (state.dataSingleDuct->SysIndexGSI = 1; state.dataSingleDuct->SysIndexGSI <= state.dataSingleDuct->NumCVNoReheatSysGSI; ++state.dataSingleDuct->SysIndexGSI) { inputProcessor->getObjectItem(state, CurrentModuleObject, - SysIndex, + state.dataSingleDuct->SysIndexGSI, Alphas, - NumAlphas, + state.dataSingleDuct->NumAlphasGSI, Numbers, - NumNums, + state.dataSingleDuct->NumNumsGSI, IOStat, lNumericBlanks, lAlphaBlanks, cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys + NumCBVAVSys + state.dataSingleDuct->NumConstVolSys; - state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + state.dataSingleDuct->SysNumGSI = state.dataSingleDuct->SysIndexGSI + state.dataSingleDuct->NumVAVSysGSI + state.dataSingleDuct->NumCBVAVSysGSI + state.dataSingleDuct->NumConstVolSys; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysNum = state.dataSingleDuct->SysNumGSI; GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); - state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; - state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctConstVolNoReheat; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctConstVolNoReheat; - state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } else { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } - state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Inlet, 1, ObjectIsNotParent, cAlphaFields(3)); - state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Outlet, @@ -1152,38 +1141,38 @@ namespace EnergyPlus::SingleDuct { ObjectIsNotParent, cAlphaFields(4)); - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::MinFracNotUsed; - state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::MinFracNotUsed; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::HeatingActionNotUsed; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = 0; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.000001; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = 0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = 0.000001; // Register component set data - TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, - state.dataSingleDuct->sd_airterminal(SysNum).SysName, - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum), + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum), "Air Nodes"); for (ADUNum = 1; ADUNum <= state.dataDefineEquipment->NumAirDistUnits; ++ADUNum) { - if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { - state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { + state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + - state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + ',' + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum)); ErrorsFound = true; } else { @@ -1191,54 +1180,54 @@ namespace EnergyPlus::SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= state.dataZoneEquip->ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).TermUnitSizingNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).ZoneEqNum = CtrlZone; } - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).FloorArea * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).Multiplier * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).ListMultiplier; } } } } if (lAlphaBlanks(5)) { - state.dataSingleDuct->sd_airterminal(SysNum).NoOAFlowInputFromUser = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).NoOAFlowInputFromUser = true; } else { - state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(5), state.dataSize->OARequirements); - if (state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(5), state.dataSize->OARequirements); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr == 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", invalid data."); ShowContinueError(state, "..invalid " + cAlphaFields(5) + "=\"" + Alphas(5) + "\"."); ErrorsFound = true; } else { - state.dataSingleDuct->sd_airterminal(SysNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).NoOAFlowInputFromUser = false; } } if (lAlphaBlanks(6)) { - state.dataSingleDuct->sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; } else { if (Alphas(6) == "CURRENTOCCUPANCY") { - state.dataSingleDuct->sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; } else if (Alphas(6) == "DESIGNOCCUPANCY") { - state.dataSingleDuct->sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonByDesignLevel; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OAPerPersonMode = DataZoneEquipment::PerPersonByDesignLevel; } else { - state.dataSingleDuct->sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", invalid data."); ShowContinueError(state, "..invalid " + cAlphaFields(6) + "=\"" + Alphas(6) + "\". The default input of CurrentOccupancy is assigned"); } @@ -1247,158 +1236,158 @@ namespace EnergyPlus::SingleDuct { if (state.dataGlobal->AnyEnergyManagementSystemInModel) { // model results related actuators SetupEMSActuator(state, "AirTerminal:SingleDuct:ConstantVolume:NoReheat", - state.dataSingleDuct->sd_airterminal(SysNum).SysName, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, "Mass Flow Rate", "[kg/s]", - state.dataSingleDuct->sd_airterminal(SysNum).EMSOverrideAirFlow, - state.dataSingleDuct->sd_airterminal(SysNum).EMSMassFlowRateValue); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).EMSOverrideAirFlow, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).EMSMassFlowRateValue); // model input related internal variables SetupEMSInternalVariable(state, "AirTerminal:SingleDuct:ConstantVolume:NoReheat Maximum Mass Flow Rate", - state.dataSingleDuct->sd_airterminal(SysNum).SysName, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, "[kg/s]", - state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).AirMassFlowRateMax); } } // End Number of Sys Loop - for (SysIndex = 1; SysIndex <= NumNoRHVAVSys; ++SysIndex) { + for (state.dataSingleDuct->SysIndexGSI = 1; state.dataSingleDuct->SysIndexGSI <= state.dataSingleDuct->NumNoRHVAVSysGSI; ++state.dataSingleDuct->SysIndexGSI) { CurrentModuleObject = "AirTerminal:SingleDuct:VAV:NoReheat"; inputProcessor->getObjectItem(state, CurrentModuleObject, - SysIndex, + state.dataSingleDuct->SysIndexGSI, Alphas, - NumAlphas, + state.dataSingleDuct->NumAlphasGSI, Numbers, - NumNums, + state.dataSingleDuct->NumNumsGSI, IOStat, lNumericBlanks, lAlphaBlanks, cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys + NumCBVAVSys + state.dataSingleDuct->NumConstVolSys + NumCVNoReheatSys; - state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + state.dataSingleDuct->SysNumGSI = state.dataSingleDuct->SysIndexGSI + state.dataSingleDuct->NumVAVSysGSI + state.dataSingleDuct->NumCBVAVSysGSI + state.dataSingleDuct->NumConstVolSys + state.dataSingleDuct->NumCVNoReheatSysGSI; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysNum = state.dataSingleDuct->SysNumGSI; GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); - state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; - state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctVAVNoReheat; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = ""; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = ""; - state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctVAVNoReheat; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = ""; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName = ""; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } else { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } - state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Outlet, 1, ObjectIsNotParent, cAlphaFields(3)); - state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Inlet, 1, ObjectIsNotParent, cAlphaFields(4)); - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRate = Numbers(1); if (UtilityRoutines::SameString(Alphas(5), "Constant")) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Constant; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Constant; } else if (UtilityRoutines::SameString(Alphas(5), "FixedFlowRate")) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Fixed; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Fixed; } else if (UtilityRoutines::SameString(Alphas(5), "Scheduled")) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Scheduled; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Scheduled; } else { ShowSevereError(state, cAlphaFields(5) + " = " + Alphas(5) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = Numbers(2); if (lNumericBlanks(2)) { - state.dataSingleDuct->sd_airterminal(SysNum).ConstantMinAirFracSetByUser = false; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ConstantMinAirFracSetByUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = 0.0; } else { - state.dataSingleDuct->sd_airterminal(SysNum).ConstantMinAirFracSetByUser = true; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Fixed) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ConstantMinAirFracSetByUser = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = Numbers(2); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod == MinFlowFraction::Fixed) { ShowWarningError(state, "Since " + cAlphaFields(5) + " = " + Alphas(5) + ", input for " + cNumericFields(2) + " will be ignored."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = 0.0; } } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFixedMinAir = Numbers(3); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFixedMinAir = Numbers(3); if (lNumericBlanks(3)) { - state.dataSingleDuct->sd_airterminal(SysNum).FixedMinAirSetByUser = false; - state.dataSingleDuct->sd_airterminal(SysNum).DesignFixedMinAir = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FixedMinAirSetByUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DesignFixedMinAir = 0.0; } else { - state.dataSingleDuct->sd_airterminal(SysNum).FixedMinAirSetByUser = true; - state.dataSingleDuct->sd_airterminal(SysNum).DesignFixedMinAir = Numbers(3); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Constant) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FixedMinAirSetByUser = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DesignFixedMinAir = Numbers(3); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod == MinFlowFraction::Constant) { ShowWarningError(state, "Since " + cAlphaFields(5) + " = " + Alphas(5) + ", input for " + cNumericFields(3) + " will be ignored."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFixedMinAir = 0.0; + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFixedMinAir = 0.0; } } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr = GetScheduleIndex(state, Alphas(6)); - if ((state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr == 0) && (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracSchPtr = GetScheduleIndex(state, Alphas(6)); + if ((state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracSchPtr == 0) && (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { ShowSevereError(state, cAlphaFields(6) + " = " + Alphas(6) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "A valid schedule is required"); ErrorsFound = true; - } else if ((state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr > 0) && (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { + } else if ((state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracSchPtr > 0) && (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { // check range of values in schedule - if (!CheckScheduleValueMinMax(state, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr, ">=", 0.0, "<=", 1.0)) { + if (!CheckScheduleValueMinMax(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracSchPtr, ">=", 0.0, "<=", 1.0)) { ShowSevereError(state, "Error found in " + cAlphaFields(6) + " = " + Alphas(6)); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "Schedule values must be (>=0., <=1.)"); } } - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = 0; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.000001; - state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = 0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = 0.000001; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::HeatingActionNotUsed; // Register component set data - TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, - state.dataSingleDuct->sd_airterminal(SysNum).SysName, - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum), + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum), "Air Nodes"); for (ADUNum = 1; ADUNum <= state.dataDefineEquipment->NumAirDistUnits; ++ADUNum) { - if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { - state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { + state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + - state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + ',' + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -1406,167 +1395,167 @@ namespace EnergyPlus::SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= state.dataZoneEquip->ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).TermUnitSizingNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).ZoneEqNum = CtrlZone; } - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).FloorArea * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).Multiplier * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).ListMultiplier; } } } } if (!lAlphaBlanks(7)) { - state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(7), state.dataSize->OARequirements); - if (state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(7), state.dataSize->OARequirements); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr == 0) { ShowSevereError(state, cAlphaFields(7) + " = " + Alphas(7) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } else { - state.dataSingleDuct->sd_airterminal(SysNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).NoOAFlowInputFromUser = false; } } if (lAlphaBlanks(8)) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = false; } else { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(8)); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(8)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(8) + " = " + Alphas(8) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = true; } // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperPosition, "System", "Average", - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); SetupOutputVariable(state, "Zone Air Terminal Minimum Air Flow Fraction", OutputProcessor::Unit::None, - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracReport, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracReport, "System", "Average", - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); } // end Number of Sys Loop - for (SysIndex = 1; SysIndex <= NumNoRHCBVAVSys; ++SysIndex) { + for (state.dataSingleDuct->SysIndexGSI = 1; state.dataSingleDuct->SysIndexGSI <= state.dataSingleDuct->NumNoRHCBVAVSysGSI; ++state.dataSingleDuct->SysIndexGSI) { CurrentModuleObject = "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat"; inputProcessor->getObjectItem(state, CurrentModuleObject, - SysIndex, + state.dataSingleDuct->SysIndexGSI, Alphas, - NumAlphas, + state.dataSingleDuct->NumAlphasGSI, Numbers, - NumNums, + state.dataSingleDuct->NumNumsGSI, IOStat, lNumericBlanks, lAlphaBlanks, cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys + NumCBVAVSys + state.dataSingleDuct->NumConstVolSys + NumCVNoReheatSys + NumNoRHVAVSys; - state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + state.dataSingleDuct->SysNumGSI = state.dataSingleDuct->SysIndexGSI + state.dataSingleDuct->NumVAVSysGSI + state.dataSingleDuct->NumCBVAVSysGSI + state.dataSingleDuct->NumConstVolSys + state.dataSingleDuct->NumCVNoReheatSysGSI + state.dataSingleDuct->NumNoRHVAVSysGSI; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysNum = state.dataSingleDuct->SysNumGSI; GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); - state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; - state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctCBVAVNoReheat; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = ""; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = ""; - state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctCBVAVNoReheat; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = ""; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName = ""; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } else { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } - state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Outlet, 1, ObjectIsNotParent, cAlphaFields(3)); - state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, Alphas(1), DataLoopNode::NodeFluidType::Air, DataLoopNode::NodeConnectionType::Inlet, 1, ObjectIsNotParent, cAlphaFields(4)); - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes < 0.0) { - ShowWarningError(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = \"" + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = Numbers(2); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes < 0.0) { + ShowWarningError(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = \"" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, cNumericFields(2) + " must be greater than or equal to 0. Resetting to 0 and the simulation continues."); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = 0.0; } - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes > 1.0) { - ShowWarningError(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = \"" + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes > 1.0) { + ShowWarningError(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = \"" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, cNumericFields(2) + " must be less than or equal to 1. Resetting to 1 and the simulation continues."); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 1.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = 1.0; } - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = 0; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = 0.0; - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.000001; - state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = 0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = 0.000001; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::HeatingActionNotUsed; // Register component set data - TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, - state.dataSingleDuct->sd_airterminal(SysNum).SysName, - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum), + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum), "Air Nodes"); for (ADUNum = 1; ADUNum <= state.dataDefineEquipment->NumAirDistUnits; ++ADUNum) { - if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { - state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { + state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + - state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + ',' + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -1574,180 +1563,182 @@ namespace EnergyPlus::SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= state.dataZoneEquip->ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).TermUnitSizingNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).ZoneEqNum = CtrlZone; } - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).FloorArea * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).Multiplier * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).ListMultiplier; } } } } if (lAlphaBlanks(5)) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = false; } else { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(5)); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(5)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(5) + " = " + Alphas(5) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = true; } // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperPosition, "System", "Average", - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); } // end Number of VAVHeatandCool:NoReheat Sys Loop // read in the SINGLE DUCT:VAV:REHEAT:VS FAN data - for (SysIndex = 1; SysIndex <= NumVAVVS; ++SysIndex) { + for (state.dataSingleDuct->SysIndexGSI = 1; state.dataSingleDuct->SysIndexGSI <= state.dataSingleDuct->NumVAVVSGSI; ++state.dataSingleDuct->SysIndexGSI) { CurrentModuleObject = "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan"; inputProcessor->getObjectItem(state, CurrentModuleObject, - SysIndex, + state.dataSingleDuct->SysIndexGSI, Alphas, - NumAlphas, + state.dataSingleDuct->NumAlphasGSI, Numbers, - NumNums, + state.dataSingleDuct->NumNumsGSI, IOStat, lNumericBlanks, lAlphaBlanks, cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys + NumCBVAVSys + state.dataSingleDuct->NumConstVolSys + NumCVNoReheatSys + NumNoRHVAVSys + NumNoRHCBVAVSys; - state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + state.dataSingleDuct->SysNumGSI = + state.dataSingleDuct->SysIndexGSI + state.dataSingleDuct->NumVAVSysGSI + state.dataSingleDuct->NumCBVAVSysGSI + state.dataSingleDuct->NumConstVolSys + state.dataSingleDuct->NumCVNoReheatSysGSI + state.dataSingleDuct->NumNoRHVAVSysGSI + + state.dataSingleDuct->NumNoRHCBVAVSysGSI; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysNum = state.dataSingleDuct->SysNumGSI; GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); - state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; - state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctVAVReheatVSFan; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = Alphas(7); - state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = Alphas(8); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctVAVReheatVSFan; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = Alphas(7); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName = Alphas(8); IsNotOK = false; - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Gas; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = - GetHeatingCoilOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); - state.dataSingleDuct->sd_airterminal(SysNum).ReheatCoilMaxCapacity = - GetHeatingCoilCapacity(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); - if (IsNotOK) ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Electric; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = - GetHeatingCoilOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); - state.dataSingleDuct->sd_airterminal(SysNum).ReheatCoilMaxCapacity = - GetHeatingCoilCapacity(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); - if (IsNotOK) ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SimpleHeating; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SteamAirHeating; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; - } else if (!state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp.empty()) { - ShowSevereError(state, "Illegal " + cAlphaFields(7) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp + '.'); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Gas; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = + GetHeatingCoilOutletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatCoilMaxCapacity = + GetHeatingCoilCapacity(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); + if (IsNotOK) ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Electric")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Electric; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = + GetHeatingCoilOutletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatCoilMaxCapacity = + GetHeatingCoilCapacity(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); + if (IsNotOK) ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Water")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SimpleHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Steam")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + } else if (!state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp.empty()) { + ShowSevereError(state, "Illegal " + cAlphaFields(7) + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).FanType = Alphas(5); - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).FanType, "Fan:VariableVolume")) { - state.dataSingleDuct->sd_airterminal(SysNum).Fan_Num = DataHVACGlobals::FanType_SimpleVAV; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).FanType, "Fan:SystemModel")) { - state.dataSingleDuct->sd_airterminal(SysNum).Fan_Num = DataHVACGlobals::FanType_SystemModelObject; - } else if (!state.dataSingleDuct->sd_airterminal(SysNum).FanType.empty()) { - ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).FanType + '.'); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType = Alphas(5); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType, "Fan:VariableVolume")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Num = DataHVACGlobals::FanType_SimpleVAV; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType, "Fan:SystemModel")) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Num = DataHVACGlobals::FanType_SystemModelObject; + } else if (!state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType.empty()) { + ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).FanName = Alphas(6); - ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).FanType, state.dataSingleDuct->sd_airterminal(SysNum).FanName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanName = Alphas(6); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanName, IsNotOK, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - if (state.dataSingleDuct->sd_airterminal(SysNum).Fan_Num == DataHVACGlobals::FanType_SystemModelObject) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Num == DataHVACGlobals::FanType_SystemModelObject) { HVACFan::fanObjs.emplace_back(new HVACFan::FanSystem( - state, state.dataSingleDuct->sd_airterminal(SysNum).FanName)); // call constructor, safe here because get input is not using DataIPShortCuts. - state.dataSingleDuct->sd_airterminal(SysNum).Fan_Index = HVACFan::getFanObjectVectorIndex(state, state.dataSingleDuct->sd_airterminal(SysNum).FanName); - state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = HVACFan::fanObjs[state.dataSingleDuct->sd_airterminal(SysNum).Fan_Index]->outletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = HVACFan::fanObjs[state.dataSingleDuct->sd_airterminal(SysNum).Fan_Index]->inletNodeNum; - HVACFan::fanObjs[state.dataSingleDuct->sd_airterminal(SysNum).Fan_Index]->fanIsSecondaryDriver = true; - } else if (state.dataSingleDuct->sd_airterminal(SysNum).Fan_Num == DataHVACGlobals::FanType_SimpleVAV) { + state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanName)); // call constructor, safe here because get input is not using DataIPShortCuts. + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Index = HVACFan::getFanObjectVectorIndex(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum = HVACFan::fanObjs[state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Index]->outletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum = HVACFan::fanObjs[state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Index]->inletNodeNum; + HVACFan::fanObjs[state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Index]->fanIsSecondaryDriver = true; + } else if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Num == DataHVACGlobals::FanType_SimpleVAV) { IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = - GetFanOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).FanType, state.dataSingleDuct->sd_airterminal(SysNum).FanName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum = + GetFanOutletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetFanInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).FanType, state.dataSingleDuct->sd_airterminal(SysNum).FanName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum = GetFanInletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } - state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } else { - state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } - AirTermSysInletNodeName = state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum); + AirTermSysInletNodeName = state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum); if (!UtilityRoutines::SameString(Alphas(3), AirTermSysInletNodeName)) { - ShowWarningError(state, RoutineName + "Invalid air terminal object air inlet node name in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowWarningError(state, RoutineName + "Invalid air terminal object air inlet node name in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, " Specified air inlet node name is = " + Alphas(3) + "."); ShowContinueError(state, " Expected air inlet node name is = " + AirTermSysInletNodeName + "."); // ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - state.dataSingleDuct->sd_airterminal(SysNum).MaxHeatAirVolFlowRate = Numbers(2); - state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(3); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxHeatAirVolFlowRate = Numbers(2); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracDes = Numbers(3); // The reheat coil control node is necessary for hot water reheat, but not necessary for // electric or gas reheat. - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Gas || state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Electric) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::Gas || state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::Electric) { // IF(.NOT. lAlphaBlanks(6)) THEN // CALL ShowWarningError(state, 'In '//TRIM(sd_airterminal(SysNum)%SysType)//' = ' // TRIM(sd_airterminal(SysNum)%SysName) & // // ' the '//TRIM(cAlphaFields(6))//' is not needed and will be ignored.') @@ -1759,12 +1750,12 @@ namespace EnergyPlus::SingleDuct { // // ' the '//TRIM(cAlphaFields(6))//' is undefined') // ErrorsFound=.TRUE. // END IF - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = - GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = + GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } else { // A4, \field Unit supply air outlet node @@ -1772,10 +1763,10 @@ namespace EnergyPlus::SingleDuct { // \note same as zone inlet node // \type alpha IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = - GetCoilAirOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = + GetCoilAirOutletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } @@ -1783,9 +1774,9 @@ namespace EnergyPlus::SingleDuct { // DataLoopNode::NodeFluidType::Steam,DataLoopNode::NodeConnectionType::Actuator,1,ObjectIsParent) } else { IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } else { // A4, \field Unit supply air outlet node @@ -1793,10 +1784,10 @@ namespace EnergyPlus::SingleDuct { // \note same as zone inlet node // \type alpha IsNotOK = false; - state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = - GetCoilOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = + GetCoilOutletNode(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } } @@ -1811,48 +1802,48 @@ namespace EnergyPlus::SingleDuct { // sd_airterminal(SysNum)%ReheatAirOutletNode = & // GetOnlySingleNode(state, Alphas(4),ErrorsFound,sd_airterminal(SysNum)%SysType,Alphas(1), & // DataLoopNode::NodeFluidType::Air,DataLoopNode::NodeConnectionType::Outlet,1,ObjectIsParent) - AirTermSysOutletNodeName = state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode); + AirTermSysOutletNodeName = state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode); if (!UtilityRoutines::SameString(Alphas(4), AirTermSysOutletNodeName)) { - ShowWarningError(state, RoutineName + "Invalid air terminal object air outlet node name in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowWarningError(state, RoutineName + "Invalid air terminal object air outlet node name in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, " Specified air outlet node name is = " + Alphas(4) + "."); ShowContinueError(state, " Expected air outlet node name is = " + AirTermSysOutletNodeName + "."); // ErrorsFound = true; } - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(4); - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(5); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatSteamVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatSteamVolFlow = Numbers(5); } else { - state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(4); - state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(5); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxReheatWaterVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MinReheatWaterVolFlow = Numbers(5); } - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = Numbers(6); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = Numbers(6); // Set default convergence tolerance - if (state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset <= 0.0) { - state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.001; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset <= 0.0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = 0.001; } - state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::HeatingActionNotUsed; // Register component set data - TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, - state.dataSingleDuct->sd_airterminal(SysNum).SysName, - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum), + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode), "Air Nodes"); for (ADUNum = 1; ADUNum <= state.dataDefineEquipment->NumAirDistUnits; ++ADUNum) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { - state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode == state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum) { + state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + - state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + ',' + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -1862,72 +1853,72 @@ namespace EnergyPlus::SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= state.dataZoneEquip->ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode == state.dataZoneEquip->ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { IsNotOK = false; if (state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; - state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum; + state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).TermUnitSizingNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ADUNum).ZoneEqNum = CtrlZone; } - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * - state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum = state.dataZoneEquip->ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneFloorArea = state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).FloorArea * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).Multiplier * + state.dataHeatBal->Zone(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ActualZoneNum).ListMultiplier; } } } } if (IsNotOK) { ShowWarningError(state, "Did not Match Supply Air Outlet Node to any Zone Node"); - ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); } if (lAlphaBlanks(9)) { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = false; } else { - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(9)); - if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(9)); + if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(9) + " = " + Alphas(9) + " not found."); - ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); ErrorsFound = true; } - state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneTurndownMinAirFracSchExist = true; } // Add reheat coil to component sets array - SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, - state.dataSingleDuct->sd_airterminal(SysNum).SysName, + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, Alphas(7), Alphas(8), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum), + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode)); // Add fan to component sets array - SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, - state.dataSingleDuct->sd_airterminal(SysNum).SysName, + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName, Alphas(5), Alphas(6), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), - state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum)); + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum), + state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OutletNodeNum)); // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperPosition, "System", "Average", - state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName); } // common report variable for all single duct air terminals @@ -1945,13 +1936,13 @@ namespace EnergyPlus::SingleDuct { NumZoneSiz = inputProcessor->getNumObjectsFound(state, "Sizing:Zone"); if (NumZoneSiz > 0) { - for (SysIndex = 1; SysIndex <= state.dataSingleDuct->NumSDAirTerminal; ++SysIndex) { + for (state.dataSingleDuct->SysIndexGSI = 1; state.dataSingleDuct->SysIndexGSI <= state.dataSingleDuct->NumSDAirTerminal; ++state.dataSingleDuct->SysIndexGSI) { for (ZoneSizIndex = 1; ZoneSizIndex <= NumZoneSiz; ++ZoneSizIndex) { if (state.dataGlobal->DoZoneSizing) { - if (state.dataSize->FinalZoneSizing(ZoneSizIndex).ActualZoneNum == state.dataSingleDuct->sd_airterminal(SysIndex).ActualZoneNum) { + if (state.dataSize->FinalZoneSizing(ZoneSizIndex).ActualZoneNum == state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysIndexGSI).ActualZoneNum) { if (state.dataSize->FinalZoneSizing(ZoneSizIndex).ZoneSecondaryRecirculation > 0.0) { ShowWarningError(state, RoutineName + "A zone secondary recirculation fraction is specified for zone served by "); - ShowContinueError(state, "...terminal unit \"" + state.dataSingleDuct->sd_airterminal(SysIndex).SysName + + ShowContinueError(state, "...terminal unit \"" + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysIndexGSI).SysName + "\" , that indicates a single path system"); ShowContinueError(state, "...The zone secondary recirculation for that zone was set to 0.0"); state.dataSize->FinalZoneSizing(ZoneSizIndex).ZoneSecondaryRecirculation = 0.0; @@ -2370,28 +2361,17 @@ namespace EnergyPlus::SingleDuct { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int PltSizHeatNum; // index of plant sizing object for 1st heating loop - static Real64 CoilInTemp(0.0); - static Real64 DesCoilLoad(0.0); - static Real64 DesZoneHeatLoad(0.0); - static Real64 ZoneDesTemp(0.0); - static Real64 ZoneDesHumRat(0.0); Real64 DesMassFlow; Real64 TempSteamIn; Real64 EnthSteamOutWet; Real64 EnthSteamInDry; Real64 LatentHeatSteam; Real64 SteamDensity; - static int CoilWaterInletNode(0); - static int CoilWaterOutletNode(0); - static int CoilSteamInletNode(0); - static int CoilSteamOutletNode(0); bool ErrorsFound; bool PlantSizingErrorsFound; Real64 rho; // local fluid density Real64 Cp; // local fluid specific heat - static int DummyWaterIndex(1); - static Real64 UserInputMaxHeatAirVolFlowRate(0.0); // user input for MaxHeatAirVolFlowRate bool IsAutoSize; int ZoneNum(0); Real64 MinMinFlowRatio(0.0); // the minimum minimum flow ratio @@ -2492,7 +2472,7 @@ namespace EnergyPlus::SingleDuct { } if (state.dataSize->CurTermUnitSizingNum > 0) { if (!IsAutoSize && !state.dataSize->ZoneSizingRunDone) { // simulation should continue - UserInputMaxHeatAirVolFlowRate = this->MaxHeatAirVolFlowRate; + state.dataSingleDuct->UserInputMaxHeatAirVolFlowRateSS = this->MaxHeatAirVolFlowRate; if (this->MaxHeatAirVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, this->SysType, this->SysName, "User-Specified Maximum Heating Air Flow Rate [m3/s]", this->MaxHeatAirVolFlowRate); @@ -2505,13 +2485,13 @@ namespace EnergyPlus::SingleDuct { } if (IsAutoSize) { this->MaxHeatAirVolFlowRate = MaxHeatAirVolFlowRateDes; - UserInputMaxHeatAirVolFlowRate = 0.0; + state.dataSingleDuct->UserInputMaxHeatAirVolFlowRateSS = 0.0; BaseSizer::reportSizerOutput(state, this->SysType, this->SysName, "Design Size Maximum Heating Air Flow Rate [m3/s]", MaxHeatAirVolFlowRateDes); } else { // Hard-size with sizing data if (this->MaxHeatAirVolFlowRate > 0.0 && MaxHeatAirVolFlowRateDes > 0.0) { MaxHeatAirVolFlowRateUser = this->MaxHeatAirVolFlowRate; - UserInputMaxHeatAirVolFlowRate = this->MaxHeatAirVolFlowRate; + state.dataSingleDuct->UserInputMaxHeatAirVolFlowRateSS = this->MaxHeatAirVolFlowRate; BaseSizer::reportSizerOutput(state, this->SysType, this->SysName, "Design Size Maximum Heating Air Flow Rate [m3/s]", @@ -2872,7 +2852,7 @@ namespace EnergyPlus::SingleDuct { if (state.dataSize->ZoneSizingRunDone) { if (this->SysType_Num == SysType::SingleDuctVAVReheatVSFan) { TermUnitSizing(state.dataSize->CurTermUnitSizingNum).AirVolFlow = - max(UserInputMaxHeatAirVolFlowRate, + max(state.dataSingleDuct->UserInputMaxHeatAirVolFlowRateSS, state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).NonAirSysDesHeatVolFlow, this->MaxAirVolFlowRate * this->ZoneMinAirFracDes * this->ZoneTurndownMinAirFrac); } else { @@ -2948,25 +2928,25 @@ namespace EnergyPlus::SingleDuct { } else { CheckZoneSizing(state, this->SysType, this->SysName); if (UtilityRoutines::SameString(this->ReheatComp, "Coil:Heating:Water")) { - CoilWaterInletNode = GetCoilWaterInletNode(state, "Coil:Heating:Water", this->ReheatName, ErrorsFound); - CoilWaterOutletNode = GetCoilWaterOutletNode(state, "Coil:Heating:Water", this->ReheatName, ErrorsFound); + state.dataSingleDuct->CoilWaterInletNodeSS = GetCoilWaterInletNode(state, "Coil:Heating:Water", this->ReheatName, ErrorsFound); + state.dataSingleDuct->CoilWaterOutletNodeSS = GetCoilWaterOutletNode(state, "Coil:Heating:Water", this->ReheatName, ErrorsFound); if (IsAutoSize) { PlantSizingErrorsFound = false; PltSizHeatNum = MyPlantSizingIndex(state, - "Coil:Heating:Water", this->ReheatName, CoilWaterInletNode, CoilWaterOutletNode, PlantSizingErrorsFound); + "Coil:Heating:Water", this->ReheatName, state.dataSingleDuct->CoilWaterInletNodeSS, state.dataSingleDuct->CoilWaterOutletNodeSS, PlantSizingErrorsFound); if (PlantSizingErrorsFound) { ShowContinueError(state, "...Occurs in " + this->SysType + ':' + this->SysName); ErrorsFound = true; } if (PltSizHeatNum > 0) { - CoilInTemp = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatCoilInTempTU; + state.dataSingleDuct->CoilInTempSS = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatCoilInTempTU; DesMassFlow = state.dataEnvrn->StdRhoAir * TermUnitSizing(state.dataSize->CurTermUnitSizingNum).AirVolFlow; - DesZoneHeatLoad = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).NonAirSysDesHeatLoad; - ZoneDesTemp = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).ZoneTempAtHeatPeak; - ZoneDesHumRat = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).ZoneHumRatAtHeatPeak; + state.dataSingleDuct->DesZoneHeatLoadSS = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).NonAirSysDesHeatLoad; + state.dataSingleDuct->ZoneDesTempSS = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).ZoneTempAtHeatPeak; + state.dataSingleDuct->ZoneDesHumRatSS = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).ZoneHumRatAtHeatPeak; // the coil load is the zone design heating load plus (or minus!) the reheat load - DesCoilLoad = DesZoneHeatLoad + PsyCpAirFnW(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); - if (DesCoilLoad >= SmallLoad) { + state.dataSingleDuct->DesCoilLoadSS = state.dataSingleDuct->DesZoneHeatLoadSS + PsyCpAirFnW(state.dataSingleDuct->ZoneDesHumRatSS) * DesMassFlow * (state.dataSingleDuct->ZoneDesTempSS - state.dataSingleDuct->CoilInTempSS); + if (state.dataSingleDuct->DesCoilLoadSS >= SmallLoad) { rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, @@ -2978,7 +2958,7 @@ namespace EnergyPlus::SingleDuct { state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); - MaxReheatWaterVolFlowDes = DesCoilLoad / (state.dataSize->PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); + MaxReheatWaterVolFlowDes = state.dataSingleDuct->DesCoilLoadSS / (state.dataSize->PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); } else { MaxReheatWaterVolFlowDes = 0.0; } @@ -3048,33 +3028,34 @@ namespace EnergyPlus::SingleDuct { } else { CheckZoneSizing(state, this->SysType, this->SysName); if (UtilityRoutines::SameString(this->ReheatComp, "Coil:Heating:Steam")) { - CoilSteamInletNode = GetCoilSteamInletNode(state, "Coil:Heating:Steam", this->ReheatName, ErrorsFound); - CoilSteamOutletNode = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", this->ReheatName, ErrorsFound); + state.dataSingleDuct->CoilSteamInletNodeSS = GetCoilSteamInletNode(state, "Coil:Heating:Steam", this->ReheatName, ErrorsFound); + state.dataSingleDuct->CoilSteamOutletNodeSS = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", this->ReheatName, ErrorsFound); if (IsAutoSize) { PlantSizingErrorsFound = false; PltSizHeatNum = MyPlantSizingIndex(state, - "Coil:Heating:Steam", this->ReheatName, CoilSteamInletNode, CoilSteamOutletNode, PlantSizingErrorsFound); + "Coil:Heating:Steam", this->ReheatName, state.dataSingleDuct->CoilSteamInletNodeSS, state.dataSingleDuct->CoilSteamOutletNodeSS, PlantSizingErrorsFound); if (PlantSizingErrorsFound) { ShowContinueError(state, "...Occurs in " + this->SysType + ':' + this->SysName); ErrorsFound = true; } if (PltSizHeatNum > 0) { - CoilInTemp = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatCoilInTempTU; + state.dataSingleDuct->CoilInTempSS = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatCoilInTempTU; DesMassFlow = state.dataEnvrn->StdRhoAir * TermUnitSizing(state.dataSize->CurTermUnitSizingNum).AirVolFlow; - DesZoneHeatLoad = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).NonAirSysDesHeatLoad; - ZoneDesTemp = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).ZoneTempAtHeatPeak; - ZoneDesHumRat = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).ZoneHumRatAtHeatPeak; + state.dataSingleDuct->DesZoneHeatLoadSS = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).NonAirSysDesHeatLoad; + state.dataSingleDuct->ZoneDesTempSS = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).ZoneTempAtHeatPeak; + state.dataSingleDuct->ZoneDesHumRatSS = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).ZoneHumRatAtHeatPeak; // the coil load is the zone design heating load plus (or minus!) the reheat load - DesCoilLoad = DesZoneHeatLoad + PsyCpAirFnW(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); - if (DesCoilLoad >= SmallLoad) { + state.dataSingleDuct->DesCoilLoadSS = state.dataSingleDuct->DesZoneHeatLoadSS + PsyCpAirFnW(state.dataSingleDuct->ZoneDesHumRatSS) * DesMassFlow * (state.dataSingleDuct->ZoneDesTempSS - state.dataSingleDuct->CoilInTempSS); + if (state.dataSingleDuct->DesCoilLoadSS >= SmallLoad) { TempSteamIn = 100.00; EnthSteamInDry = GetSatEnthalpyRefrig(state, fluidNameSteam, TempSteamIn, 1.0, this->FluidIndex, RoutineNameFull); EnthSteamOutWet = GetSatEnthalpyRefrig(state, fluidNameSteam, TempSteamIn, 0.0, this->FluidIndex, RoutineNameFull); LatentHeatSteam = EnthSteamInDry - EnthSteamOutWet; SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, this->FluidIndex, RoutineNameFull); - Cp = GetSpecificHeatGlycol(state, fluidNameWater, state.dataSize->PlantSizData(PltSizHeatNum).ExitTemp, DummyWaterIndex, RoutineName); - MaxReheatSteamVolFlowDes = DesCoilLoad / (SteamDensity * (LatentHeatSteam + state.dataSize->PlantSizData(PltSizHeatNum).DeltaT * Cp)); + Cp = GetSpecificHeatGlycol(state, fluidNameWater, state.dataSize->PlantSizData(PltSizHeatNum).ExitTemp, state.dataSingleDuct->DummyWaterIndexSS, RoutineName); + MaxReheatSteamVolFlowDes = + state.dataSingleDuct->DesCoilLoadSS / (SteamDensity * (LatentHeatSteam + state.dataSize->PlantSizData(PltSizHeatNum).DeltaT * Cp)); } else { MaxReheatSteamVolFlowDes = 0.0; } @@ -3123,7 +3104,7 @@ namespace EnergyPlus::SingleDuct { TermUnitSizing(state.dataSize->CurTermUnitSizingNum).MinFlowFrac = this->ZoneMinAirFracDes * this->ZoneTurndownMinAirFrac; TermUnitSizing(state.dataSize->CurTermUnitSizingNum).MaxHWVolFlow = this->MaxReheatWaterVolFlow; TermUnitSizing(state.dataSize->CurTermUnitSizingNum).MaxSTVolFlow = this->MaxReheatSteamVolFlow; - TermUnitSizing(state.dataSize->CurTermUnitSizingNum).DesHeatingLoad = DesCoilLoad; // Coil Summary report + TermUnitSizing(state.dataSize->CurTermUnitSizingNum).DesHeatingLoad = state.dataSingleDuct->DesCoilLoadSS; // Coil Summary report if (this->ReheatComp_Num == HeatingCoilType::SimpleHeating) { if (this->DamperHeatingAction == Action::Normal) { SetCoilDesFlow(state, @@ -3226,8 +3207,6 @@ namespace EnergyPlus::SingleDuct { Real64 QHeatingDelivered; // the actual output from heating coil Real64 LeakLoadMult; // load multiplier to adjust for downstream leaks Real64 MinFlowFrac; // minimum flow fraction (and minimum damper position) - static Real64 MinAirMassFlowRevAct(0.0); // minimum air mass flow rate used in "reverse action" air mass flow rate calculation - static Real64 MaxAirMassFlowRevAct(0.0); // maximum air mass flow rate used in "reverse action" air mass flow rate calculation Real64 MassFlowBasedOnOA; // supply air mass flow rate based on zone OA requirements Real64 AirLoopOAFrac; // fraction of outside air entering air loop Real64 DummyMdot; // temporary mass flow rate argument @@ -3509,16 +3488,17 @@ namespace EnergyPlus::SingleDuct { if (this->DamperHeatingAction == Action::ReverseAction || this->DamperHeatingAction == Action::ReverseActionWithLimits) { if (state.dataLoopNodes->Node(this->ReheatControlNode).MassFlowRate == MaxFlowWater) { // fill limits for air flow for controller - MinAirMassFlowRevAct = this->AirMassFlowRateMax * this->ZoneMinAirFrac; - MinAirMassFlowRevAct = min(MinAirMassFlowRevAct, this->sd_airterminalInlet.AirMassFlowRateMaxAvail); - MinAirMassFlowRevAct = max(MinAirMassFlowRevAct, this->sd_airterminalInlet.AirMassFlowRateMinAvail); + state.dataSingleDuct->MinAirMassFlowRevActSVAV = this->AirMassFlowRateMax * this->ZoneMinAirFrac; + state.dataSingleDuct->MinAirMassFlowRevActSVAV = min(state.dataSingleDuct->MinAirMassFlowRevActSVAV, this->sd_airterminalInlet.AirMassFlowRateMaxAvail); + state.dataSingleDuct->MinAirMassFlowRevActSVAV = max(state.dataSingleDuct->MinAirMassFlowRevActSVAV, this->sd_airterminalInlet.AirMassFlowRateMinAvail); - MaxAirMassFlowRevAct = this->AirMassFlowRateMax; - MaxAirMassFlowRevAct = min(MaxAirMassFlowRevAct, MaxDeviceAirMassFlowReheat); - MaxAirMassFlowRevAct = max(MaxAirMassFlowRevAct, MinAirMassFlowRevAct); - MaxAirMassFlowRevAct = min(MaxAirMassFlowRevAct, this->sd_airterminalInlet.AirMassFlowRateMaxAvail); + state.dataSingleDuct->MaxAirMassFlowRevActSVAV = this->AirMassFlowRateMax; + state.dataSingleDuct->MaxAirMassFlowRevActSVAV = min(state.dataSingleDuct->MaxAirMassFlowRevActSVAV, MaxDeviceAirMassFlowReheat); + state.dataSingleDuct->MaxAirMassFlowRevActSVAV = max(state.dataSingleDuct->MaxAirMassFlowRevActSVAV, state.dataSingleDuct->MinAirMassFlowRevActSVAV); + state.dataSingleDuct->MaxAirMassFlowRevActSVAV = min(state.dataSingleDuct->MaxAirMassFlowRevActSVAV, this->sd_airterminalInlet.AirMassFlowRateMaxAvail); - state.dataLoopNodes->Node(this->OutletNodeNum).MassFlowRateMaxAvail = MaxAirMassFlowRevAct; // suspect, check how/if used in ControlCompOutput + state.dataLoopNodes->Node(this->OutletNodeNum).MassFlowRateMaxAvail = + state.dataSingleDuct->MaxAirMassFlowRevActSVAV; // suspect, check how/if used in ControlCompOutput ControlCompOutput(state, this->ReheatName, this->ReheatComp, @@ -3526,8 +3506,8 @@ namespace EnergyPlus::SingleDuct { FirstHVACIteration, QZoneMax2, this->OutletNodeNum, - MaxAirMassFlowRevAct, - MinAirMassFlowRevAct, + state.dataSingleDuct->MaxAirMassFlowRevActSVAV, + state.dataSingleDuct->MinAirMassFlowRevActSVAV, this->ControllerOffset, this->ControlCompTypeNum, this->CompErrIndex, @@ -3783,15 +3763,6 @@ namespace EnergyPlus::SingleDuct { Real64 DummyMdot; Real64 QActualHeating; Real64 MinFlowFrac; // minimum flow fraction (and minimum damper position) - static Real64 ZoneTemp(0.0); // zone air temperature [C] - static Real64 MaxHeatTemp(0.0); // maximum supply air temperature [C] - static Real64 MassFlowReq(0.0); // air mass flow rate required to meet the coil heating load [W] - static Real64 MassFlowActual(0.0); // air mass flow rate actually used [W] - static Real64 QZoneMax(0.0); // maximum zone heat addition rate given constraints of MaxHeatTemp and max - // available air mass flow rate [W] - static Real64 MinMassAirFlow(0.0); // the air flow rate during heating for normal acting damper - static Real64 QZoneMax2(0.0); // temporary variable - static Real64 QZoneMax3(0.0); // temporary variable // sd_airterminal(SysNum)%InletNodeNum is the inlet node to the terminal unit and the damper // sd_airterminal(SysNum)%OutletNodeNum is the outlet node of the damper and the inlet node of the heating coil @@ -3805,8 +3776,8 @@ namespace EnergyPlus::SingleDuct { SysInletNode = this->InletNodeNum; CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(ZoneNodeNum).HumRat); MinFlowFrac = this->ZoneMinAirFrac; - MinMassAirFlow = MinFlowFrac * state.dataEnvrn->StdRhoAir * this->MaxAirVolFlowRate; - ZoneTemp = state.dataLoopNodes->Node(ZoneNodeNum).Temp; + state.dataSingleDuct->MinMassAirFlowSCBVAV = MinFlowFrac * state.dataEnvrn->StdRhoAir * this->MaxAirVolFlowRate; + state.dataSingleDuct->ZoneTempSCBVAV = state.dataLoopNodes->Node(ZoneNodeNum).Temp; // Then depending on if the Load is for heating or cooling it is handled differently. First // the massflow rate for cooling is determined to meet the entire load. Then @@ -3815,7 +3786,7 @@ namespace EnergyPlus::SingleDuct { if (this->sd_airterminalInlet.AirMassFlowRateMaxAvail > 0.0) { // Calculate the flow required for cooling CpAirSysIn = PsyCpAirFnW(this->sd_airterminalInlet.AirHumRat); - DeltaTemp = CpAirSysIn * this->sd_airterminalInlet.AirTemp - CpAirZn * ZoneTemp; + DeltaTemp = CpAirSysIn * this->sd_airterminalInlet.AirTemp - CpAirZn * state.dataSingleDuct->ZoneTempSCBVAV; // Need to check DeltaTemp and ensure that it is not zero if (DeltaTemp != 0.0) { @@ -3856,7 +3827,7 @@ namespace EnergyPlus::SingleDuct { // Need to make sure that the damper outlets are passed to the coil inlet this->UpdateSys(state); - QActualHeating = QToHeatSetPt - MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - ZoneTemp); + QActualHeating = QToHeatSetPt - MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - state.dataSingleDuct->ZoneTempSCBVAV); if ((MassFlow > SmallMassFlow) && (QActualHeating > 0.0) && (state.dataHeatBalFanSys->TempControlType(ZoneNum) != SingleCoolingSetPoint)) { // VAVHeatandCool boxes operate at varying mass flow rates when reheating, VAV boxes operate at min flow @@ -3873,38 +3844,38 @@ namespace EnergyPlus::SingleDuct { // and solving for the air mass flow rate that will meet the load. If the flow rate is between the min and // max we are in condition 2. - QZoneMax2 = QToHeatSetPt; + state.dataSingleDuct->QZoneMax2SCBVAV = QToHeatSetPt; if (this->MaxReheatTempSetByUser) { - MaxHeatTemp = this->MaxReheatTemp; + state.dataSingleDuct->MaxHeatTempSCBVAV = this->MaxReheatTemp; if (QToHeatSetPt > SmallLoad) { // zone has a positive load to heating setpoint - MassFlowReq = QToHeatSetPt / (CpAirZn * (MaxHeatTemp - ZoneTemp)); + state.dataSingleDuct->MassFlowReqSCBVAV = QToHeatSetPt / (CpAirZn * (state.dataSingleDuct->MaxHeatTempSCBVAV - state.dataSingleDuct->ZoneTempSCBVAV)); } else { - MassFlowReq = MassFlow; + state.dataSingleDuct->MassFlowReqSCBVAV = MassFlow; } - QZoneMax3 = CpAirZn * (MaxHeatTemp - ZoneTemp) * MassFlow; + state.dataSingleDuct->QZoneMax3SCBVAV = CpAirZn * (state.dataSingleDuct->MaxHeatTempSCBVAV - state.dataSingleDuct->ZoneTempSCBVAV) * MassFlow; - MassFlowActual = MassFlow; + state.dataSingleDuct->MassFlowActualSCBVAV = MassFlow; - if (QZoneMax3 < QToHeatSetPt) { - MassFlowActual = MassFlowReq; + if (state.dataSingleDuct->QZoneMax3SCBVAV < QToHeatSetPt) { + state.dataSingleDuct->MassFlowActualSCBVAV = state.dataSingleDuct->MassFlowReqSCBVAV; // QZoneMax3 = CpAirZn * (MaxHeatTemp - ZoneTemp) * MassFlowActual } - if (MassFlowActual <= MinMassAirFlow) { - MassFlowActual = MinMassAirFlow; - } else if (MassFlowActual >= this->AirMassFlowRateMax) { - MassFlowActual = this->AirMassFlowRateMax; + if (state.dataSingleDuct->MassFlowActualSCBVAV <= state.dataSingleDuct->MinMassAirFlowSCBVAV) { + state.dataSingleDuct->MassFlowActualSCBVAV = state.dataSingleDuct->MinMassAirFlowSCBVAV; + } else if (state.dataSingleDuct->MassFlowActualSCBVAV >= this->AirMassFlowRateMax) { + state.dataSingleDuct->MassFlowActualSCBVAV = this->AirMassFlowRateMax; } - QZoneMax = CpAirZn * MassFlowActual * (MaxHeatTemp - ZoneTemp); + state.dataSingleDuct->QZoneMaxSCBVAV = CpAirZn * state.dataSingleDuct->MassFlowActualSCBVAV * (state.dataSingleDuct->MaxHeatTempSCBVAV - state.dataSingleDuct->ZoneTempSCBVAV); // temporary variable - QZoneMax2 = min(QZoneMax, QToHeatSetPt); + state.dataSingleDuct->QZoneMax2SCBVAV = min(state.dataSingleDuct->QZoneMaxSCBVAV, QToHeatSetPt); - MassFlow = MassFlowActual; + MassFlow = state.dataSingleDuct->MassFlowActualSCBVAV; } // IF (sd_airterminal(SysNum)%MaxReheatTempSetByUser) THEN @@ -3920,7 +3891,7 @@ namespace EnergyPlus::SingleDuct { // Determine the load required to pass to the Component controller // Although this equation looks strange (using temp instead of deltaT), it is corrected later in ControlCompOutput // and is working as-is, temperature setpoints are maintained as expected. - QZnReq = QZoneMax2 + MassFlow * CpAirZn * state.dataLoopNodes->Node(ZoneNodeNum).Temp; + QZnReq = state.dataSingleDuct->QZoneMax2SCBVAV + MassFlow * CpAirZn * state.dataLoopNodes->Node(ZoneNodeNum).Temp; if (QZnReq < SmallLoad) QZnReq = 0.0; // Initialize hot water flow rate to zero. @@ -3971,7 +3942,7 @@ namespace EnergyPlus::SingleDuct { this->ReheatComp, this->ReheatComp_Index, FirstHVACIteration, - QZoneMax2, + state.dataSingleDuct->QZoneMax2SCBVAV, this->OutletNodeNum, this->sd_airterminalInlet.AirMassFlowRateMaxAvail, this->sd_airterminalInlet.AirMassFlowRateMinAvail, @@ -4025,7 +3996,7 @@ namespace EnergyPlus::SingleDuct { } } else if (SELECT_CASE_var == HeatingCoilType::SteamAirHeating) { // ! COIL:STEAM:AIRHEATING // Determine the load required to pass to the Component controller - QZnReq = QZoneMax2 - MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - ZoneTemp); + QZnReq = state.dataSingleDuct->QZoneMax2SCBVAV - MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - state.dataSingleDuct->ZoneTempSCBVAV); if (QZnReq < SmallLoad) QZnReq = 0.0; // Simulate reheat coil for the VAV system @@ -4033,8 +4004,8 @@ namespace EnergyPlus::SingleDuct { } else if (SELECT_CASE_var == HeatingCoilType::Electric) { // COIL:ELECTRIC:HEATING // Determine the load required to pass to the Component controller - QSupplyAir = MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - ZoneTemp); - QZnReq = QZoneMax2 - QSupplyAir; + QSupplyAir = MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - state.dataSingleDuct->ZoneTempSCBVAV); + QZnReq = state.dataSingleDuct->QZoneMax2SCBVAV - QSupplyAir; if (QZnReq < SmallLoad) QZnReq = 0.0; // Simulate reheat coil for the VAV system @@ -4042,7 +4013,7 @@ namespace EnergyPlus::SingleDuct { } else if (SELECT_CASE_var == HeatingCoilType::Gas) { // COIL:GAS:HEATING // Determine the load required to pass to the Component controller - QZnReq = QZoneMax2 - MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - ZoneTemp); + QZnReq = state.dataSingleDuct->QZoneMax2SCBVAV - MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - state.dataSingleDuct->ZoneTempSCBVAV); if (QZnReq < SmallLoad) QZnReq = 0.0; // Simulate reheat coil for the VAV system @@ -4570,21 +4541,17 @@ namespace EnergyPlus::SingleDuct { Real64 MaxFlowWater; // This is the value passed to the Controller depending if FirstHVACIteration or not Real64 MinFlowWater; // This is the value passed to the Controller depending if FirstHVACIteration or not Real64 QActualHeating; // the heating load seen by the reheat coil - static Real64 TAirMax(0.0); // Maximum zone supply air temperature [C] - static Real64 QMax(0.0); // Maximum heat addition rate imposed by the max zone supply air temperature [W] - static Real64 ZoneTemp(0.0); // Zone temperature [C] - static Real64 QMax2(0.0); Real64 DummyMdot; // local fluid mass flow rate QToHeatSetPt = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; // The calculated load from the Heat Balance MassFlow = this->sd_airterminalInlet.AirMassFlowRateMaxAvail; // System massflow is set to the Available - QMax2 = QToHeatSetPt; - ZoneTemp = state.dataLoopNodes->Node(ZoneNodeNum).Temp; + state.dataSingleDuct->QMax2SCV = QToHeatSetPt; + state.dataSingleDuct->ZoneTempSCV = state.dataLoopNodes->Node(ZoneNodeNum).Temp; CpAir = PsyCpAirFnW(state.dataLoopNodes->Node(ZoneNodeNum).HumRat); // zone air specific heat if (this->MaxReheatTempSetByUser) { - TAirMax = this->MaxReheatTemp; - QMax = CpAir * MassFlow * (TAirMax - ZoneTemp); - QMax2 = min(QToHeatSetPt, QMax); + state.dataSingleDuct->TAirMaxSCV = this->MaxReheatTemp; + state.dataSingleDuct->QMaxSCV = CpAir * MassFlow * (state.dataSingleDuct->TAirMaxSCV - state.dataSingleDuct->ZoneTempSCV); + state.dataSingleDuct->QMax2SCV = min(QToHeatSetPt, state.dataSingleDuct->QMaxSCV); } // if (this->MaxReheatTempSetByUser) { if (((this->sd_airterminalInlet.AirMassFlowRateMaxAvail == 0.0) && (this->sd_airterminalInlet.AirMassFlowRateMinAvail == 0.0)) || @@ -4606,7 +4573,7 @@ namespace EnergyPlus::SingleDuct { this->sd_airterminalOutlet.AirMassFlowRateMinAvail = this->sd_airterminalInlet.AirMassFlowRateMinAvail; this->UpdateSys(state); - QActualHeating = QToHeatSetPt - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - ZoneTemp); // reheat needed + QActualHeating = QToHeatSetPt - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - state.dataSingleDuct->ZoneTempSCV); // reheat needed // Now the massflow for reheating has been determined. If it is zero, or in SetBack, or the // system scheduled OFF then not operational and shut the system down. if ((MassFlow > SmallMassFlow) && (QActualHeating > 0.0) && (state.dataHeatBalFanSys->TempControlType(ZoneNum) != SingleCoolingSetPoint)) { @@ -4616,7 +4583,7 @@ namespace EnergyPlus::SingleDuct { if (SELECT_CASE_var == HeatingCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING // Determine the load required to pass to the Component controller - QZnReq = QMax2 + MassFlow * CpAir * ZoneTemp; + QZnReq = state.dataSingleDuct->QMax2SCV + MassFlow * CpAir * state.dataSingleDuct->ZoneTempSCV; // Before Iterating through the Reheat Coil and Controller set the flags for the // Do Loop to initialized conditions. @@ -4661,20 +4628,20 @@ namespace EnergyPlus::SingleDuct { } else if (SELECT_CASE_var == HeatingCoilType::SteamAirHeating) { // COIL:STEAM:STEAMAIRHEATING // Determine the load required to pass to the Component controller - QZnReq = QMax2 - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - ZoneTemp); + QZnReq = state.dataSingleDuct->QMax2SCV - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - state.dataSingleDuct->ZoneTempSCV); // Simulate reheat coil for the VAV system SimulateSteamCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index, QZnReq); } else if (SELECT_CASE_var == HeatingCoilType::Electric) { // COIL:ELECTRIC:HEATING // Determine the load required to pass to the Component controller - QZnReq = QMax2 - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - ZoneTemp); + QZnReq = state.dataSingleDuct->QMax2SCV - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - state.dataSingleDuct->ZoneTempSCV); // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, QZnReq, this->ReheatComp_Index); } else if (SELECT_CASE_var == HeatingCoilType::Gas) { // COIL:GAS:HEATING // Determine the load required to pass to the Component controller - QZnReq = QMax2 - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - ZoneTemp); + QZnReq = state.dataSingleDuct->QMax2SCV - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - state.dataSingleDuct->ZoneTempSCV); // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, QZnReq, this->ReheatComp_Index); @@ -5323,27 +5290,26 @@ namespace EnergyPlus::SingleDuct { // Simulate an Air Terminal Mixer component // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static int SysNum(0); if (state.dataSingleDuct->GetATMixerFlag) { state.dataSingleDuct->GetATMixerFlag = false; } if (SysIndex == 0) { - SysNum = UtilityRoutines::FindItemInList(SysName, state.dataSingleDuct->SysATMixer); - SysIndex = SysNum; - if (SysNum == 0) { + state.dataSingleDuct->SysNumSATM = UtilityRoutines::FindItemInList(SysName, state.dataSingleDuct->SysATMixer); + SysIndex = state.dataSingleDuct->SysNumSATM; + if (state.dataSingleDuct->SysNumSATM == 0) { ShowFatalError(state, "Object " + SysName + " not found"); } } else { - SysNum = SysIndex; + state.dataSingleDuct->SysNumSATM = SysIndex; } - state.dataSingleDuct->SysATMixer(SysNum).InitATMixer(state, FirstHVACIteration); + state.dataSingleDuct->SysATMixer(state.dataSingleDuct->SysNumSATM).InitATMixer(state, FirstHVACIteration); - CalcATMixer(state, SysNum); + CalcATMixer(state, state.dataSingleDuct->SysNumSATM); - UpdateATMixer(state, SysNum); + UpdateATMixer(state, state.dataSingleDuct->SysNumSATM); } void GetATMixers(EnergyPlusData &state) @@ -5737,60 +5703,45 @@ namespace EnergyPlus::SingleDuct { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static Real64 PriMassFlowRate(0.0); - static Real64 PriEnthalpy(0.0); - static Real64 PriHumRat(0.0); - static Real64 PriTemp(0.0); - - static Real64 SecAirMassFlowRate(0.0); - static Real64 SecAirEnthalpy(0.0); - static Real64 SecAirHumRat(0.0); - static Real64 SecAirTemp(0.0); - - static Real64 MixedAirMassFlowRate(0.0); - static Real64 MixedAirEnthalpy(0.0); - static Real64 MixedAirHumRat(0.0); - static Real64 MixedAirTemp(0.0); - - PriEnthalpy = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).Enthalpy; - PriHumRat = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).HumRat; - PriTemp = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).Temp; - PriMassFlowRate = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).MassFlowRate; + state.dataSingleDuct->PriEnthalpyCATM = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).Enthalpy; + state.dataSingleDuct->PriHumRatCATM = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).HumRat; + state.dataSingleDuct->PriTempCATM = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).Temp; + state.dataSingleDuct->PriMassFlowRateCATM = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).MassFlowRate; - SecAirMassFlowRate = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).MassFlowRate; - SecAirEnthalpy = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).Enthalpy; - SecAirHumRat = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).HumRat; - SecAirTemp = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).Temp; + state.dataSingleDuct->SecAirMassFlowRateCATM = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).MassFlowRate; + state.dataSingleDuct->SecAirEnthalpyCATM = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).Enthalpy; + state.dataSingleDuct->SecAirHumRatCATM = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).HumRat; + state.dataSingleDuct->SecAirTempCATM = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).Temp; if (state.dataSingleDuct->SysATMixer(SysNum).MixerType == ATMixer_SupplySide) { - MixedAirMassFlowRate = SecAirMassFlowRate + PriMassFlowRate; + state.dataSingleDuct->MixedAirMassFlowRateCATM = state.dataSingleDuct->SecAirMassFlowRateCATM + state.dataSingleDuct->PriMassFlowRateCATM; } else { // for inlet side mixer, the mixed air flow has been set, but we don't know the secondary flow - MixedAirMassFlowRate = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).MixedAirOutNode).MassFlowRate; - SecAirMassFlowRate = max(MixedAirMassFlowRate - PriMassFlowRate, 0.0); - state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).MassFlowRate = SecAirMassFlowRate; - if (std::abs(PriMassFlowRate + SecAirMassFlowRate - MixedAirMassFlowRate) > SmallMassFlow) { + state.dataSingleDuct->MixedAirMassFlowRateCATM = state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).MixedAirOutNode).MassFlowRate; + state.dataSingleDuct->SecAirMassFlowRateCATM = max(state.dataSingleDuct->MixedAirMassFlowRateCATM - state.dataSingleDuct->PriMassFlowRateCATM, 0.0); + state.dataLoopNodes->Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).MassFlowRate = state.dataSingleDuct->SecAirMassFlowRateCATM; + if (std::abs(state.dataSingleDuct->PriMassFlowRateCATM + state.dataSingleDuct->SecAirMassFlowRateCATM - state.dataSingleDuct->MixedAirMassFlowRateCATM) > SmallMassFlow) { ShowSevereError(state, "CalcATMixer: Invalid mass flow rates in AirTerminal:SingleDuct:Mixer=" + state.dataSingleDuct->SysATMixer(SysNum).Name); ShowContinueErrorTimeStamp(state, format("Primary mass flow rate={:.6R}Secondary mass flow rate={:.6R}Mixed mass flow rate={:.6R}", - PriMassFlowRate, - SecAirMassFlowRate, - MixedAirMassFlowRate)); + state.dataSingleDuct->PriMassFlowRateCATM, + state.dataSingleDuct->SecAirMassFlowRateCATM, + state.dataSingleDuct->MixedAirMassFlowRateCATM)); ShowFatalError(state, "Simulation terminates."); } } // now calculate the mixed (outlet) conditions - if (MixedAirMassFlowRate > 0.0) { - MixedAirEnthalpy = (SecAirMassFlowRate * SecAirEnthalpy + PriMassFlowRate * PriEnthalpy) / MixedAirMassFlowRate; - MixedAirHumRat = (SecAirMassFlowRate * SecAirHumRat + PriMassFlowRate * PriHumRat) / MixedAirMassFlowRate; + if (state.dataSingleDuct->MixedAirMassFlowRateCATM > 0.0) { + state.dataSingleDuct->MixedAirEnthalpyCATM = (state.dataSingleDuct->SecAirMassFlowRateCATM * state.dataSingleDuct->SecAirEnthalpyCATM + state.dataSingleDuct->PriMassFlowRateCATM * state.dataSingleDuct->PriEnthalpyCATM) / state.dataSingleDuct->MixedAirMassFlowRateCATM; + state.dataSingleDuct->MixedAirHumRatCATM = (state.dataSingleDuct->SecAirMassFlowRateCATM * state.dataSingleDuct->SecAirHumRatCATM + state.dataSingleDuct->PriMassFlowRateCATM * state.dataSingleDuct->PriHumRatCATM) / state.dataSingleDuct->MixedAirMassFlowRateCATM; // Mixed air temperature is calculated from the mixed air enthalpy and humidity ratio. - MixedAirTemp = PsyTdbFnHW(MixedAirEnthalpy, MixedAirHumRat); + state.dataSingleDuct->MixedAirTempCATM = PsyTdbFnHW(state.dataSingleDuct->MixedAirEnthalpyCATM, state.dataSingleDuct->MixedAirHumRatCATM); } - state.dataSingleDuct->SysATMixer(SysNum).MixedAirMassFlowRate = MixedAirMassFlowRate; - state.dataSingleDuct->SysATMixer(SysNum).MixedAirEnthalpy = MixedAirEnthalpy; - state.dataSingleDuct->SysATMixer(SysNum).MixedAirHumRat = MixedAirHumRat; - state.dataSingleDuct->SysATMixer(SysNum).MixedAirTemp = MixedAirTemp; + state.dataSingleDuct->SysATMixer(SysNum).MixedAirMassFlowRate = state.dataSingleDuct->MixedAirMassFlowRateCATM; + state.dataSingleDuct->SysATMixer(SysNum).MixedAirEnthalpy = state.dataSingleDuct->MixedAirEnthalpyCATM; + state.dataSingleDuct->SysATMixer(SysNum).MixedAirHumRat = state.dataSingleDuct->MixedAirHumRatCATM; + state.dataSingleDuct->SysATMixer(SysNum).MixedAirTemp = state.dataSingleDuct->MixedAirTempCATM; } void UpdateATMixer(EnergyPlusData &state, int const SysNum) diff --git a/src/EnergyPlus/SingleDuct.hh b/src/EnergyPlus/SingleDuct.hh index ba3aabbf2d3..18914caf37d 100644 --- a/src/EnergyPlus/SingleDuct.hh +++ b/src/EnergyPlus/SingleDuct.hh @@ -354,19 +354,127 @@ struct SingleDuctData : BaseGlobalStruct { bool InitATMixerFlag = true; // Flag set to make sure you do begin simulation initializaztions once for mixer bool ZoneEquipmentListChecked = false; // True after the Zone Equipment List has been checked for items + int SysNumGSI = 0; // The Sys that you are currently loading input into + int SysIndexGSI = 0; // The Sys that you are currently loading input into + int NumVAVSysGSI = 0; + int NumNoRHVAVSysGSI = 0; + int NumVAVVSGSI = 0; + int NumCBVAVSysGSI = 0; + int NumNoRHCBVAVSysGSI = 0; + int NumAlphasGSI = 0; + int NumNumsGSI = 0; + int NumCVNoReheatSysGSI = 0; + int MaxNumsGSI = 0; // Maximum number of numeric input fields + int MaxAlphasGSI = 0; // Maximum number of alpha input fields + int TotalArgsGSI = 0; // Total number of alpha and numeric arguments = max for a + Real64 CoilInTempSS = 0.0; + Real64 DesCoilLoadSS = 0.0; + Real64 DesZoneHeatLoadSS = 0.0; + Real64 ZoneDesTempSS = 0.0; + Real64 ZoneDesHumRatSS = 0.0; + int CoilWaterInletNodeSS = 0; + int CoilWaterOutletNodeSS = 0; + int CoilSteamInletNodeSS = 0; + int CoilSteamOutletNodeSS = 0; + int DummyWaterIndexSS = 1; + Real64 UserInputMaxHeatAirVolFlowRateSS = 0.0; // user input for MaxHeatAirVolFlowRate + Real64 MinAirMassFlowRevActSVAV = 0.0; // minimum air mass flow rate used in "reverse action" air mass flow rate calculation + Real64 MaxAirMassFlowRevActSVAV = 0.0; // maximum air mass flow rate used in "reverse action" air mass flow rate calculation + Real64 ZoneTempSCBVAV = 0.0; // zone air temperature [C] + Real64 MaxHeatTempSCBVAV = 0.0; // maximum supply air temperature [C] + Real64 MassFlowReqSCBVAV = 0.0; // air mass flow rate required to meet the coil heating load [W] + Real64 MassFlowActualSCBVAV = 0.0; // air mass flow rate actually used [W] + Real64 QZoneMaxSCBVAV = 0.0; // maximum zone heat addition rate given constraints of MaxHeatTemp and max / + // available air mass flow rate [W] + Real64 MinMassAirFlowSCBVAV = 0.0; // the air flow rate during heating for normal acting damper + Real64 QZoneMax2SCBVAV = 0.0; // temporary variable + Real64 QZoneMax3SCBVAV = 0.0; // temporary variable + Real64 TAirMaxSCV = 0.0; // Maximum zone supply air temperature [C] + Real64 QMaxSCV = 0.0; // Maximum heat addition rate imposed by the max zone supply air temperature [W] + Real64 ZoneTempSCV = 0.0; // Zone temperature [C] + Real64 QMax2SCV = 0.0; + int SysNumSATM = 0; + Real64 PriMassFlowRateCATM = 0.0; + Real64 PriEnthalpyCATM = 0.0; + Real64 PriHumRatCATM = 0.0; + Real64 PriTempCATM = 0.0; + + Real64 SecAirMassFlowRateCATM = 0.0; + Real64 SecAirEnthalpyCATM = 0.0; + Real64 SecAirHumRatCATM = 0.0; + Real64 SecAirTempCATM = 0.0; + + Real64 MixedAirMassFlowRateCATM = 0.0; + Real64 MixedAirEnthalpyCATM = 0.0; + Real64 MixedAirHumRatCATM = 0.0; + Real64 MixedAirTempCATM = 0.0; + + void clear_state() override { - SysATMixer.deallocate(); - sd_airterminal.deallocate(); - SysUniqueNames.clear(); - CheckEquipName.deallocate(); - NumATMixers = 0; - NumConstVolSys = 0; - NumSDAirTerminal = 0; - GetInputFlag = true; - GetATMixerFlag = true; - InitSysFlag = true; - InitATMixerFlag = true; - ZoneEquipmentListChecked = false; + this->SysATMixer.deallocate(); + this->sd_airterminal.deallocate(); + this->SysUniqueNames.clear(); + this->CheckEquipName.deallocate(); + this->NumATMixers = 0; + this->NumConstVolSys = 0; + this->NumSDAirTerminal = 0; + this->GetInputFlag = true; + this->GetATMixerFlag = true; + this->InitSysFlag = true; + this->InitATMixerFlag = true; + this->ZoneEquipmentListChecked = false; + + this->SysNumGSI = 0; // The Sys that you are currently loading input into + this->SysIndexGSI = 0; // The Sys that you are currently loading input into + this->NumVAVSysGSI = 0; + this->NumNoRHVAVSysGSI = 0; + this->NumVAVVSGSI = 0; + this->NumCBVAVSysGSI = 0; + this->NumNoRHCBVAVSysGSI = 0; + this->NumAlphasGSI = 0; + this->NumNumsGSI = 0; + this->NumCVNoReheatSysGSI = 0; + this->MaxNumsGSI = 0; // Maximum number of numeric input fields + this->MaxAlphasGSI = 0; // Maximum number of alpha input fields + this->TotalArgsGSI = 0; // Total number of alpha and numeric arguments = max for a + this->CoilInTempSS = 0.0; + this->DesCoilLoadSS = 0.0; + this->DesZoneHeatLoadSS = 0.0; + this->ZoneDesTempSS = 0.0; + this->ZoneDesHumRatSS = 0.0; + this->CoilWaterInletNodeSS = 0; + this->CoilWaterOutletNodeSS = 0; + this->CoilSteamInletNodeSS = 0; + this->CoilSteamOutletNodeSS = 0; + this->DummyWaterIndexSS = 1; + this->UserInputMaxHeatAirVolFlowRateSS = 0.0; // user input for MaxHeatAirVolFlowRate + this->MinAirMassFlowRevActSVAV = 0.0; // minimum air mass flow rate used in "reverse action" air mass flow rate calculation + this->MaxAirMassFlowRevActSVAV = 0.0; // maximum air mass flow rate used in "reverse action" air mass flow rate calculation + this->ZoneTempSCBVAV = 0.0; // zone air temperature [C] + this->MaxHeatTempSCBVAV = 0.0; // maximum supply air temperature [C] + this->MassFlowReqSCBVAV = 0.0; // air mass flow rate required to meet the coil heating load [W] + this->MassFlowActualSCBVAV = 0.0; // air mass flow rate actually used [W] + this->QZoneMaxSCBVAV = 0.0; // maximum zone heat addition rate given constraints of MaxHeatTemp and max / + this->MinMassAirFlowSCBVAV = 0.0; // the air flow rate during heating for normal acting damper + this->QZoneMax2SCBVAV = 0.0; // temporary variable + this->QZoneMax3SCBVAV = 0.0; // temporary variable + this->TAirMaxSCV = 0.0; // Maximum zone supply air temperature [C] + this->QMaxSCV = 0.0; // Maximum heat addition rate imposed by the max zone supply air temperature [W] + this->ZoneTempSCV = 0.0; // Zone temperature [C] + this->QMax2SCV = 0.0; + this->SysNumSATM = 0; + this->PriMassFlowRateCATM = 0.0; + this->PriEnthalpyCATM = 0.0; + this->PriHumRatCATM = 0.0; + this->PriTempCATM = 0.0; + this->SecAirMassFlowRateCATM = 0.0; + this->SecAirEnthalpyCATM = 0.0; + this->SecAirHumRatCATM = 0.0; + this->SecAirTempCATM = 0.0; + this->MixedAirMassFlowRateCATM = 0.0; + this->MixedAirEnthalpyCATM = 0.0; + this->MixedAirHumRatCATM = 0.0; + this->MixedAirTempCATM = 0.0; } }; From 76512fee040cf25ff496fb65a82947431694638f Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Wed, 24 Mar 2021 09:23:05 -0600 Subject: [PATCH 03/21] OutputReportTabular --- src/EnergyPlus/OutputReportTabular.cc | 1258 ++++++++++++------------- src/EnergyPlus/OutputReportTabular.hh | 193 ++++ 2 files changed, 774 insertions(+), 677 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index e236ea36c12..710be2aef4a 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -553,10 +553,7 @@ namespace EnergyPlus::OutputReportTabular { int mColumn; int ColumnsRecount; int TablesRecount; - static Real64 BigNum(0.0); bool environmentKeyFound; - static bool VarWarning(true); - static int ErrCount1(0); auto &ort(state.dataOutRptTab); // if not a running a weather simulation do not create reports @@ -728,8 +725,8 @@ namespace EnergyPlus::OutputReportTabular { //#endif if (KeyCount == 0) { - ++ErrCount1; - if (ErrCount1 == 1 && !state.dataGlobal->DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { + ++state.dataOutRptTab->ErrCount1; + if (state.dataOutRptTab->ErrCount1 == 1 && !state.dataGlobal->DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { ShowWarningError(state, "Processing Monthly Tabular Reports: Variable names not valid for this simulation"); ShowContinueError(state, "...use Output:Diagnostics,DisplayExtraWarnings; to show more details on individual variables."); } @@ -737,10 +734,10 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataGlobal->DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { ShowWarningError(state, "Processing Monthly Tabular Reports: " + ort->MonthlyInput(TabNum).name); ShowContinueError(state, "..Variable name=" + curVariMeter + " not valid for this simulation."); - if (VarWarning) { + if (state.dataOutRptTab->VarWarning) { ShowContinueError(state, "..Variables not valid for this simulation will have \"[Invalid/Undefined]\" in the Units Column of " "the Table Report."); - VarWarning = false; + state.dataOutRptTab->VarWarning = false; } } } @@ -855,10 +852,10 @@ namespace EnergyPlus::OutputReportTabular { ort->MonthlyColumns(mColumn).reslt = 0.0; ort->MonthlyColumns(mColumn).duration = 0.0; } else if (SELECT_CASE_var == iAggType::Maximum) { - ort->MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); + ort->MonthlyColumns(mColumn).reslt = -HUGE_(state.dataOutRptTab->BigNum); ort->MonthlyColumns(mColumn).timeStamp = 0; } else if (SELECT_CASE_var == iAggType::Minimum) { - ort->MonthlyColumns(mColumn).reslt = HUGE_(BigNum); + ort->MonthlyColumns(mColumn).reslt = HUGE_(state.dataOutRptTab->BigNum); ort->MonthlyColumns(mColumn).timeStamp = 0; } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { ort->MonthlyColumns(mColumn).reslt = 0.0; @@ -878,10 +875,10 @@ namespace EnergyPlus::OutputReportTabular { ort->MonthlyColumns(mColumn).reslt = 0.0; ort->MonthlyColumns(mColumn).duration = 0.0; } else if (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) { - ort->MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); + ort->MonthlyColumns(mColumn).reslt = -HUGE_(state.dataOutRptTab->BigNum); ort->MonthlyColumns(mColumn).timeStamp = 0; } else if (SELECT_CASE_var == iAggType::MinimumDuringHoursShown) { - ort->MonthlyColumns(mColumn).reslt = HUGE_(BigNum); + ort->MonthlyColumns(mColumn).reslt = HUGE_(state.dataOutRptTab->BigNum); ort->MonthlyColumns(mColumn).timeStamp = 0; } } @@ -892,10 +889,10 @@ namespace EnergyPlus::OutputReportTabular { ShowContinueError(state, "..Variable name=" + curVariMeter + " not valid for this simulation."); ShowContinueError(state, "..i.e., Variable name=" + UniqueKeyNames(kUniqueKey) + ':' + curVariMeter + " not valid for this simulation."); - if (VarWarning) { + if (state.dataOutRptTab->VarWarning) { ShowContinueError(state, "..Variables not valid for this simulation will have \"[Invalid/Undefined]\" in the Units Column " "of the Table Report."); - VarWarning = false; + state.dataOutRptTab->VarWarning = false; } } ort->MonthlyColumns(mColumn).varName = curVariMeter; @@ -3524,13 +3521,6 @@ namespace EnergyPlus::OutputReportTabular { // local copies of some of the MonthlyColumns array references since // profiling showed that they were slow. - static Array1D_int MonthlyColumnsTypeOfVar; - static Array1D MonthlyColumnsStepType; - static Array1D MonthlyColumnsAggType; - static Array1D_int MonthlyColumnsVarNum; - static Array1D_int MonthlyTablesNumColumns; - static int curFirstColumn(0); - if (!state.dataGlobal->DoWeathSim) return; auto &ort(state.dataOutRptTab); assert(state.dataGlobal->TimeStepZoneSec > 0.0); @@ -3538,22 +3528,22 @@ namespace EnergyPlus::OutputReportTabular { // create temporary arrays to speed processing of these arrays if (ort->GatherMonthlyResultsForTimestepRunOnce) { // MonthlyColumns - MonthlyColumnsTypeOfVar.allocate(ort->MonthlyColumns.I()); - MonthlyColumnsStepType.allocate(ort->MonthlyColumns.I()); - MonthlyColumnsAggType.allocate(ort->MonthlyColumns.I()); - MonthlyColumnsVarNum.allocate(ort->MonthlyColumns.I()); + state.dataOutRptTab->MonthlyColumnsTypeOfVar.allocate(ort->MonthlyColumns.I()); + state.dataOutRptTab->MonthlyColumnsStepType.allocate(ort->MonthlyColumns.I()); + state.dataOutRptTab->MonthlyColumnsAggType.allocate(ort->MonthlyColumns.I()); + state.dataOutRptTab->MonthlyColumnsVarNum.allocate(ort->MonthlyColumns.I()); for (int i = ort->MonthlyColumns.l(), e = ort->MonthlyColumns.u(); i <= e; ++i) { auto const &col(ort->MonthlyColumns(i)); - MonthlyColumnsTypeOfVar(i) = col.typeOfVar; - MonthlyColumnsStepType(i) = col.stepType; - MonthlyColumnsAggType(i) = col.aggType; - MonthlyColumnsVarNum(i) = col.varNum; + state.dataOutRptTab->MonthlyColumnsTypeOfVar(i) = col.typeOfVar; + state.dataOutRptTab->MonthlyColumnsStepType(i) = col.stepType; + state.dataOutRptTab->MonthlyColumnsAggType(i) = col.aggType; + state.dataOutRptTab->MonthlyColumnsVarNum(i) = col.varNum; } // MonthlyTables - MonthlyTablesNumColumns.allocate(ort->MonthlyTables.I()); + state.dataOutRptTab->MonthlyTablesNumColumns.allocate(ort->MonthlyTables.I()); for (int i = ort->MonthlyTables.l(), e = ort->MonthlyTables.u(); i <= e; ++i) { - MonthlyTablesNumColumns(i) = ort->MonthlyTables(i).numColumns; + state.dataOutRptTab->MonthlyTablesNumColumns(i) = ort->MonthlyTables(i).numColumns; } // set flag so this block is only executed once @@ -3570,18 +3560,18 @@ namespace EnergyPlus::OutputReportTabular { for (iTable = 1; iTable <= ort->MonthlyTablesCount; ++iTable) { activeMinMax = false; // at the beginning of the new timestep activeHoursShown = false; // fix by JG addressing CR6482 - curFirstColumn = ort->MonthlyTables(iTable).firstColumn; - for (jColumn = 1; jColumn <= MonthlyTablesNumColumns(iTable); ++jColumn) { - curCol = jColumn + curFirstColumn - 1; - curTypeOfVar = MonthlyColumnsTypeOfVar(curCol); - curStepType = MonthlyColumnsStepType(curCol); + state.dataOutRptTab->curFirstColumn = ort->MonthlyTables(iTable).firstColumn; + for (jColumn = 1; jColumn <= state.dataOutRptTab->MonthlyTablesNumColumns(iTable); ++jColumn) { + curCol = jColumn + state.dataOutRptTab->curFirstColumn - 1; + curTypeOfVar = state.dataOutRptTab->MonthlyColumnsTypeOfVar(curCol); + curStepType = state.dataOutRptTab->MonthlyColumnsStepType(curCol); if (((curStepType == OutputProcessor::TimeStepType::TimeStepZone) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) || ((curStepType == OutputProcessor::TimeStepType::TimeStepSystem) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem))) { // the above condition used to include the following prior to new scan method // (MonthlyColumns(curCol)%aggType .EQ. iAggType::ValueWhenMaxMin) - curVarNum = MonthlyColumnsVarNum(curCol); + curVarNum = state.dataOutRptTab->MonthlyColumnsVarNum(curCol); curValue = GetInternalVariableValue(state, curTypeOfVar, curVarNum); // Get the value from the result array oldResultValue = ort->MonthlyColumns(curCol).reslt(state.dataEnvrn->Month); @@ -3601,7 +3591,7 @@ namespace EnergyPlus::OutputReportTabular { // perform the selected aggregation type // use next lines since it is faster was: SELECT CASE (MonthlyColumns(curCol)%aggType) { - auto const SELECT_CASE_var(MonthlyColumnsAggType(curCol)); + auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumnsAggType(curCol)); if (SELECT_CASE_var == iAggType::SumOrAvg) { if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable newResultValue = oldResultValue + curValue; @@ -4516,22 +4506,6 @@ namespace EnergyPlus::OutputReportTabular { using General::DetermineMinuteForReporting; using General::EncodeMonDayHrMin; - static int iZone(0); - static int iRadiant(0); - static int iunit(0); - static int curZone(0); - static Real64 eqpSens(0.0); - static Real64 total(0.0); - // the following arrays store the radiant total for each timestep - static Array1D radiantHeat; - static Array1D radiantCool; - static Array1D ATUHeat; - static Array1D ATUCool; - static int timestepTimeStamp(0); - static Real64 bldgHtPk(0.0); - static Real64 bldgClPk(0.0); - static Real64 timeStepRatio(0.0); - auto &Zone(state.dataHeatBal->Zone); auto &ZonePreDefRep(state.dataHeatBal->ZonePreDefRep); @@ -4548,299 +4522,301 @@ namespace EnergyPlus::OutputReportTabular { auto &ort(state.dataOutRptTab); if (ort->GatherHeatGainReportfirstTime) { - radiantHeat.allocate(state.dataGlobal->NumOfZones); - radiantCool.allocate(state.dataGlobal->NumOfZones); - ATUHeat.allocate(state.dataGlobal->NumOfZones); - ATUCool.allocate(state.dataGlobal->NumOfZones); + state.dataOutRptTab->radiantHeat.allocate(state.dataGlobal->NumOfZones); + state.dataOutRptTab->radiantCool.allocate(state.dataGlobal->NumOfZones); + state.dataOutRptTab->ATUHeat.allocate(state.dataGlobal->NumOfZones); + state.dataOutRptTab->ATUCool.allocate(state.dataGlobal->NumOfZones); ort->GatherHeatGainReportfirstTime = false; } // clear the radiant surface accumulation variables - radiantHeat = 0.0; - radiantCool = 0.0; + state.dataOutRptTab->radiantHeat = 0.0; + state.dataOutRptTab->radiantCool = 0.0; // clear the ATU accumulation variables - ATUHeat = 0.0; - ATUCool = 0.0; + state.dataOutRptTab->ATUHeat = 0.0; + state.dataOutRptTab->ATUCool = 0.0; //-------------------- // ANNUAL //-------------------- // HVAC annual heating by ATU // HVAC annual cooling by ATU - for (iunit = 1; iunit <= state.dataDefineEquipment->NumAirDistUnits; ++iunit) { + for (state.dataOutRptTab->iunitGHGR = 1; state.dataOutRptTab->iunitGHGR <= state.dataDefineEquipment->NumAirDistUnits; ++state.dataOutRptTab->iunitGHGR) { // HVAC equipment should already have the multipliers included, no "* mult" needed (assumes autosized or multiplied hard-sized air flow). - curZone = state.dataDefineEquipment->AirDistUnit(iunit).ZoneNum; - if ((curZone > 0) && (curZone <= state.dataGlobal->NumOfZones)) { - ZonePreDefRep(curZone).SHGSAnHvacATUHt += state.dataDefineEquipment->AirDistUnit(iunit).HeatGain; - ZonePreDefRep(curZone).SHGSAnHvacATUCl -= state.dataDefineEquipment->AirDistUnit(iunit).CoolGain; - ATUHeat(curZone) += state.dataDefineEquipment->AirDistUnit(iunit).HeatRate; - ATUCool(curZone) -= state.dataDefineEquipment->AirDistUnit(iunit).CoolRate; + state.dataOutRptTab->curZoneGHGR = state.dataDefineEquipment->AirDistUnit(state.dataOutRptTab->iunitGHGR).ZoneNum; + if ((state.dataOutRptTab->curZoneGHGR > 0) && (state.dataOutRptTab->curZoneGHGR <= state.dataGlobal->NumOfZones)) { + ZonePreDefRep(state.dataOutRptTab->curZoneGHGR).SHGSAnHvacATUHt += state.dataDefineEquipment->AirDistUnit(state.dataOutRptTab->iunitGHGR).HeatGain; + ZonePreDefRep(state.dataOutRptTab->curZoneGHGR).SHGSAnHvacATUCl -= state.dataDefineEquipment->AirDistUnit(state.dataOutRptTab->iunitGHGR).CoolGain; + state.dataOutRptTab->ATUHeat(state.dataOutRptTab->curZoneGHGR) += state.dataDefineEquipment->AirDistUnit(state.dataOutRptTab->iunitGHGR).HeatRate; + state.dataOutRptTab->ATUCool(state.dataOutRptTab->curZoneGHGR) -= state.dataDefineEquipment->AirDistUnit(state.dataOutRptTab->iunitGHGR).CoolRate; } } - timeStepRatio = TimeStepSys / state.dataGlobal->TimeStepZone; // the fraction of the zone time step used by the system timestep - for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - mult = Zone(iZone).Multiplier * Zone(iZone).ListMultiplier; + state.dataOutRptTab->timeStepRatio = TimeStepSys / state.dataGlobal->TimeStepZone; // the fraction of the zone time step used by the system timestep + for (state.dataOutRptTab->iZoneGHGR = 1; state.dataOutRptTab->iZoneGHGR <= state.dataGlobal->NumOfZones; ++state.dataOutRptTab->iZoneGHGR) { + mult = Zone(state.dataOutRptTab->iZoneGHGR).Multiplier * Zone(state.dataOutRptTab->iZoneGHGR).ListMultiplier; // People Sensible Heat Addition - ZonePreDefRep(iZone).SHGSAnPeoplAdd += state.dataHeatBal->ZnRpt(iZone).PeopleSenGain * mult * timeStepRatio; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnPeoplAdd += state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).PeopleSenGain * mult * state.dataOutRptTab->timeStepRatio; // Lights Sensible Heat Addition - ZonePreDefRep(iZone).SHGSAnLiteAdd += state.dataHeatBal->ZnRpt(iZone).LtsTotGain * mult * timeStepRatio; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnLiteAdd += state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).LtsTotGain * mult * state.dataOutRptTab->timeStepRatio; // HVAC Input Sensible Air Heating // HVAC Input Sensible Air Cooling Real64 ZoneEqHeatorCool = - state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult - ATUHeat(iZone) - ATUCool(iZone); + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult - state.dataOutRptTab->ATUHeat(state.dataOutRptTab->iZoneGHGR) - state.dataOutRptTab->ATUCool(state.dataOutRptTab->iZoneGHGR); if (ZoneEqHeatorCool > 0.0) { - ZonePreDefRep(iZone).SHGSAnZoneEqHt += ZoneEqHeatorCool * TimeStepSys * DataGlobalConstants::SecInHour; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnZoneEqHt += ZoneEqHeatorCool * TimeStepSys * DataGlobalConstants::SecInHour; } else { - ZonePreDefRep(iZone).SHGSAnZoneEqCl += ZoneEqHeatorCool * TimeStepSys * DataGlobalConstants::SecInHour; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnZoneEqCl += ZoneEqHeatorCool * TimeStepSys * DataGlobalConstants::SecInHour; } // Interzone Air Transfer Heat Addition // Interzone Air Transfer Heat Removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones > 0.0) { - ZonePreDefRep(iZone).SHGSAnIzaAdd += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult * TimeStepSys * DataGlobalConstants::SecInHour; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones > 0.0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnIzaAdd += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult * TimeStepSys * DataGlobalConstants::SecInHour; } else { - ZonePreDefRep(iZone).SHGSAnIzaRem += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult * TimeStepSys * DataGlobalConstants::SecInHour; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnIzaRem += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult * TimeStepSys * DataGlobalConstants::SecInHour; } // Window Heat Addition // Window Heat Removal - ZonePreDefRep(iZone).SHGSAnWindAdd += state.dataHeatBal->ZoneWinHeatGainRepEnergy(iZone) * mult * timeStepRatio; - ZonePreDefRep(iZone).SHGSAnWindRem -= state.dataHeatBal->ZoneWinHeatLossRepEnergy(iZone) * mult * timeStepRatio; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnWindAdd += state.dataHeatBal->ZoneWinHeatGainRepEnergy(state.dataOutRptTab->iZoneGHGR) * mult * state.dataOutRptTab->timeStepRatio; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnWindRem -= state.dataHeatBal->ZoneWinHeatLossRepEnergy(state.dataOutRptTab->iZoneGHGR) * mult * state.dataOutRptTab->timeStepRatio; // Infiltration Heat Addition // Infiltration Heat Removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil > 0.0) { - ZonePreDefRep(iZone).SHGSAnInfilAdd += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult * TimeStepSys * DataGlobalConstants::SecInHour; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil > 0.0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnInfilAdd += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult * TimeStepSys * DataGlobalConstants::SecInHour; } else { - ZonePreDefRep(iZone).SHGSAnInfilRem += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult * TimeStepSys * DataGlobalConstants::SecInHour; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnInfilRem += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult * TimeStepSys * DataGlobalConstants::SecInHour; } // Equipment Sensible Heat Addition // Equipment Sensible Heat Removal // the following variables are already gains so they do not need to be converted by multiplying by time. - eqpSens = (state.dataHeatBal->ZnRpt(iZone).ElecRadGain + state.dataHeatBal->ZnRpt(iZone).GasRadGain + state.dataHeatBal->ZnRpt(iZone).HWRadGain + state.dataHeatBal->ZnRpt(iZone).SteamRadGain + - state.dataHeatBal->ZnRpt(iZone).OtherRadGain + state.dataHeatBal->ZnRpt(iZone).ElecConGain + state.dataHeatBal->ZnRpt(iZone).GasConGain + state.dataHeatBal->ZnRpt(iZone).HWConGain + - state.dataHeatBal->ZnRpt(iZone).SteamConGain + state.dataHeatBal->ZnRpt(iZone).OtherConGain) * - timeStepRatio; - if (eqpSens > 0.0) { - ZonePreDefRep(iZone).SHGSAnEquipAdd += eqpSens * mult; + state.dataOutRptTab->eqpSensGHGR = (state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecRadGain + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasRadGain + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWRadGain + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamRadGain + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherRadGain + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecConGain + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasConGain + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWConGain + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamConGain + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherConGain) * + state.dataOutRptTab->timeStepRatio; + if (state.dataOutRptTab->eqpSensGHGR > 0.0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnEquipAdd += state.dataOutRptTab->eqpSensGHGR * mult; } else { - ZonePreDefRep(iZone).SHGSAnEquipRem += eqpSens * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnEquipRem += state.dataOutRptTab->eqpSensGHGR * mult; } } - curZone = 0; + state.dataOutRptTab->curZoneGHGR = 0; // HVAC Input Heated Surface Heating // HVAC Input Cooled Surface Cooling - for (iRadiant = 1; iRadiant <= state.dataVentilatedSlab->NumOfVentSlabs; ++iRadiant) { - curZone = state.dataVentilatedSlab->VentSlab(iRadiant).ZonePtr; - mult = Zone(curZone).Multiplier * Zone(curZone).ListMultiplier; - if ((curZone > 0) && (curZone <= state.dataGlobal->NumOfZones)) { - ZonePreDefRep(curZone).SHGSAnSurfHt += state.dataVentilatedSlab->VentSlab(iRadiant).RadHeatingEnergy * mult; - ZonePreDefRep(curZone).SHGSAnSurfCl -= state.dataVentilatedSlab->VentSlab(iRadiant).RadCoolingEnergy * mult; - radiantHeat(curZone) = state.dataVentilatedSlab->VentSlab(iRadiant).RadHeatingPower * mult; - radiantCool(curZone) = -state.dataVentilatedSlab->VentSlab(iRadiant).RadCoolingPower * mult; + for (state.dataOutRptTab->iRadiantGHGR = 1; state.dataOutRptTab->iRadiantGHGR <= state.dataVentilatedSlab->NumOfVentSlabs; ++state.dataOutRptTab->iRadiantGHGR) { + state.dataOutRptTab->curZoneGHGR = state.dataVentilatedSlab->VentSlab(state.dataOutRptTab->iRadiantGHGR).ZonePtr; + mult = Zone(state.dataOutRptTab->curZoneGHGR).Multiplier * Zone(state.dataOutRptTab->curZoneGHGR).ListMultiplier; + if ((state.dataOutRptTab->curZoneGHGR > 0) && (state.dataOutRptTab->curZoneGHGR <= state.dataGlobal->NumOfZones)) { + ZonePreDefRep(state.dataOutRptTab->curZoneGHGR).SHGSAnSurfHt += state.dataVentilatedSlab->VentSlab(state.dataOutRptTab->iRadiantGHGR).RadHeatingEnergy * mult; + ZonePreDefRep(state.dataOutRptTab->curZoneGHGR).SHGSAnSurfCl -= state.dataVentilatedSlab->VentSlab(state.dataOutRptTab->iRadiantGHGR).RadCoolingEnergy * mult; + state.dataOutRptTab->radiantHeat(state.dataOutRptTab->curZoneGHGR) = state.dataVentilatedSlab->VentSlab(state.dataOutRptTab->iRadiantGHGR).RadHeatingPower * mult; + state.dataOutRptTab->radiantCool(state.dataOutRptTab->curZoneGHGR) = -state.dataVentilatedSlab->VentSlab(state.dataOutRptTab->iRadiantGHGR).RadCoolingPower * mult; } } - for (iRadiant = 1; iRadiant <= state.dataLowTempRadSys->NumOfHydrLowTempRadSys; ++iRadiant) { - curZone = state.dataLowTempRadSys->HydrRadSys(iRadiant).ZonePtr; - mult = Zone(curZone).Multiplier * Zone(curZone).ListMultiplier; - if ((curZone > 0) && (curZone <= state.dataGlobal->NumOfZones)) { - ZonePreDefRep(curZone).SHGSAnSurfHt += state.dataLowTempRadSys->HydrRadSys(iRadiant).HeatEnergy * mult; - ZonePreDefRep(curZone).SHGSAnSurfCl -= state.dataLowTempRadSys->HydrRadSys(iRadiant).CoolEnergy * mult; - radiantHeat(curZone) += state.dataLowTempRadSys->HydrRadSys(iRadiant).HeatPower * mult; - radiantCool(curZone) -= state.dataLowTempRadSys->HydrRadSys(iRadiant).CoolPower * mult; + for (state.dataOutRptTab->iRadiantGHGR = 1; state.dataOutRptTab->iRadiantGHGR <= state.dataLowTempRadSys->NumOfHydrLowTempRadSys; ++state.dataOutRptTab->iRadiantGHGR) { + state.dataOutRptTab->curZoneGHGR = state.dataLowTempRadSys->HydrRadSys(state.dataOutRptTab->iRadiantGHGR).ZonePtr; + mult = Zone(state.dataOutRptTab->curZoneGHGR).Multiplier * Zone(state.dataOutRptTab->curZoneGHGR).ListMultiplier; + if ((state.dataOutRptTab->curZoneGHGR > 0) && (state.dataOutRptTab->curZoneGHGR <= state.dataGlobal->NumOfZones)) { + ZonePreDefRep(state.dataOutRptTab->curZoneGHGR).SHGSAnSurfHt += state.dataLowTempRadSys->HydrRadSys(state.dataOutRptTab->iRadiantGHGR).HeatEnergy * mult; + ZonePreDefRep(state.dataOutRptTab->curZoneGHGR).SHGSAnSurfCl -= state.dataLowTempRadSys->HydrRadSys(state.dataOutRptTab->iRadiantGHGR).CoolEnergy * mult; + state.dataOutRptTab->radiantHeat(state.dataOutRptTab->curZoneGHGR) += state.dataLowTempRadSys->HydrRadSys(state.dataOutRptTab->iRadiantGHGR).HeatPower * mult; + state.dataOutRptTab->radiantCool(state.dataOutRptTab->curZoneGHGR) -= state.dataLowTempRadSys->HydrRadSys(state.dataOutRptTab->iRadiantGHGR).CoolPower * mult; } } - for (iRadiant = 1; iRadiant <= state.dataLowTempRadSys->NumOfCFloLowTempRadSys; ++iRadiant) { - curZone = state.dataLowTempRadSys->CFloRadSys(iRadiant).ZonePtr; - mult = Zone(curZone).Multiplier * Zone(curZone).ListMultiplier; - if ((curZone > 0) && (curZone <= state.dataGlobal->NumOfZones)) { - ZonePreDefRep(curZone).SHGSAnSurfHt += state.dataLowTempRadSys->CFloRadSys(iRadiant).HeatEnergy * mult; - ZonePreDefRep(curZone).SHGSAnSurfCl -= state.dataLowTempRadSys->CFloRadSys(iRadiant).CoolEnergy * mult; - radiantHeat(curZone) += state.dataLowTempRadSys->CFloRadSys(iRadiant).HeatPower * mult; - radiantCool(curZone) -= state.dataLowTempRadSys->CFloRadSys(iRadiant).CoolPower * mult; + for (state.dataOutRptTab->iRadiantGHGR = 1; state.dataOutRptTab->iRadiantGHGR <= state.dataLowTempRadSys->NumOfCFloLowTempRadSys; ++state.dataOutRptTab->iRadiantGHGR) { + state.dataOutRptTab->curZoneGHGR = state.dataLowTempRadSys->CFloRadSys(state.dataOutRptTab->iRadiantGHGR).ZonePtr; + mult = Zone(state.dataOutRptTab->curZoneGHGR).Multiplier * Zone(state.dataOutRptTab->curZoneGHGR).ListMultiplier; + if ((state.dataOutRptTab->curZoneGHGR > 0) && (state.dataOutRptTab->curZoneGHGR <= state.dataGlobal->NumOfZones)) { + ZonePreDefRep(state.dataOutRptTab->curZoneGHGR).SHGSAnSurfHt += state.dataLowTempRadSys->CFloRadSys(state.dataOutRptTab->iRadiantGHGR).HeatEnergy * mult; + ZonePreDefRep(state.dataOutRptTab->curZoneGHGR).SHGSAnSurfCl -= state.dataLowTempRadSys->CFloRadSys(state.dataOutRptTab->iRadiantGHGR).CoolEnergy * mult; + state.dataOutRptTab->radiantHeat(state.dataOutRptTab->curZoneGHGR) += state.dataLowTempRadSys->CFloRadSys(state.dataOutRptTab->iRadiantGHGR).HeatPower * mult; + state.dataOutRptTab->radiantCool(state.dataOutRptTab->curZoneGHGR) -= state.dataLowTempRadSys->CFloRadSys(state.dataOutRptTab->iRadiantGHGR).CoolPower * mult; } } - for (iRadiant = 1; iRadiant <= state.dataLowTempRadSys->NumOfElecLowTempRadSys; ++iRadiant) { - curZone = state.dataLowTempRadSys->ElecRadSys(iRadiant).ZonePtr; - mult = Zone(curZone).Multiplier * Zone(curZone).ListMultiplier; - if ((curZone > 0) && (curZone <= state.dataGlobal->NumOfZones)) { - ZonePreDefRep(curZone).SHGSAnSurfHt += state.dataLowTempRadSys->ElecRadSys(iRadiant).HeatEnergy * mult; - radiantHeat(curZone) += state.dataLowTempRadSys->ElecRadSys(iRadiant).HeatPower * mult; + for (state.dataOutRptTab->iRadiantGHGR = 1; state.dataOutRptTab->iRadiantGHGR <= state.dataLowTempRadSys->NumOfElecLowTempRadSys; ++state.dataOutRptTab->iRadiantGHGR) { + state.dataOutRptTab->curZoneGHGR = state.dataLowTempRadSys->ElecRadSys(state.dataOutRptTab->iRadiantGHGR).ZonePtr; + mult = Zone(state.dataOutRptTab->curZoneGHGR).Multiplier * Zone(state.dataOutRptTab->curZoneGHGR).ListMultiplier; + if ((state.dataOutRptTab->curZoneGHGR > 0) && (state.dataOutRptTab->curZoneGHGR <= state.dataGlobal->NumOfZones)) { + ZonePreDefRep(state.dataOutRptTab->curZoneGHGR).SHGSAnSurfHt += state.dataLowTempRadSys->ElecRadSys(state.dataOutRptTab->iRadiantGHGR).HeatEnergy * mult; + state.dataOutRptTab->radiantHeat(state.dataOutRptTab->curZoneGHGR) += state.dataLowTempRadSys->ElecRadSys(state.dataOutRptTab->iRadiantGHGR).HeatPower * mult; } } // Opaque Surface Conduction and Other Heat Addition // Opaque Surface Conduction and Other Heat Removal - for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + for (state.dataOutRptTab->iZoneGHGR = 1; state.dataOutRptTab->iZoneGHGR <= state.dataGlobal->NumOfZones; ++state.dataOutRptTab->iZoneGHGR) { // ZonePreDefRep variables above already inlude zone list and group multipliers - total = ZonePreDefRep(iZone).SHGSAnPeoplAdd + ZonePreDefRep(iZone).SHGSAnLiteAdd + ZonePreDefRep(iZone).SHGSAnZoneEqHt + - ZonePreDefRep(iZone).SHGSAnZoneEqCl + ZonePreDefRep(iZone).SHGSAnHvacATUHt + ZonePreDefRep(iZone).SHGSAnHvacATUCl + - ZonePreDefRep(iZone).SHGSAnIzaAdd + ZonePreDefRep(iZone).SHGSAnIzaRem + - ZonePreDefRep(iZone).SHGSAnWindAdd + ZonePreDefRep(iZone).SHGSAnWindRem + ZonePreDefRep(iZone).SHGSAnInfilAdd + - ZonePreDefRep(iZone).SHGSAnInfilRem + ZonePreDefRep(iZone).SHGSAnEquipAdd + ZonePreDefRep(iZone).SHGSAnEquipRem + - ZonePreDefRep(iZone).SHGSAnSurfHt + ZonePreDefRep(iZone).SHGSAnSurfCl; - total = -total; // want to know the negative value of the sum since the row should add up to zero - if (total > 0) { - ZonePreDefRep(iZone).SHGSAnOtherAdd = total; + state.dataOutRptTab->totalGHGR = ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnPeoplAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnLiteAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnZoneEqHt + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnZoneEqCl + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnHvacATUHt + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnHvacATUCl + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnIzaAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnIzaRem + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnWindAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnWindRem + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnInfilAdd + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnInfilRem + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnEquipAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnEquipRem + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnSurfHt + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnSurfCl; + state.dataOutRptTab->totalGHGR = -state.dataOutRptTab->totalGHGR; // want to know the negative value of the sum since the row should add up to zero + if (state.dataOutRptTab->totalGHGR > 0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnOtherAdd = state.dataOutRptTab->totalGHGR; } else { - ZonePreDefRep(iZone).SHGSAnOtherRem = total; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSAnOtherRem = state.dataOutRptTab->totalGHGR; } } //-------------------------------- // ZONE PEAK COOLING AND HEATING //-------------------------------- - for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - mult = Zone(iZone).Multiplier * Zone(iZone).ListMultiplier; + for (state.dataOutRptTab->iZoneGHGR = 1; state.dataOutRptTab->iZoneGHGR <= state.dataGlobal->NumOfZones; ++state.dataOutRptTab->iZoneGHGR) { + mult = Zone(state.dataOutRptTab->iZoneGHGR).Multiplier * Zone(state.dataOutRptTab->iZoneGHGR).ListMultiplier; // RR I can't get the Infiltration Heat Addition/Removal columns to add up. // THis is the only suspect line, mixing MCpDt terms and a power term looks fishy. - if ((state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + radiantHeat(iZone) + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult) > 0) { - if ((state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + radiantHeat(iZone) + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult) > ZonePreDefRep(iZone).htPeak) { - ZonePreDefRep(iZone).htPeak = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + radiantHeat(iZone) + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult; + if ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataOutRptTab->radiantHeat(state.dataOutRptTab->iZoneGHGR) + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult) > 0) { + if ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataOutRptTab->radiantHeat(state.dataOutRptTab->iZoneGHGR) + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult) > ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).htPeak) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).htPeak = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataOutRptTab->radiantHeat(state.dataOutRptTab->iZoneGHGR) + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult; // determine timestamp // ActualTimeS = CurrentTime-TimeStepZone+SysTimeElapsed // ActualtimeE = ActualTimeS+TimeStepSys // ActualTimeHrS=INT(ActualTimeS) // ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin) ActualTimeMin = DetermineMinuteForReporting(state, t_timeStepType); - EncodeMonDayHrMin(timestepTimeStamp, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, ActualTimeMin); - ZonePreDefRep(iZone).htPtTimeStamp = timestepTimeStamp; + EncodeMonDayHrMin( + state.dataOutRptTab->timestepTimeStampGHGR, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, ActualTimeMin); + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).htPtTimeStamp = state.dataOutRptTab->timestepTimeStampGHGR; // HVAC Input Sensible Air Heating // HVAC Input Sensible Air Cooling // non-HVAC ZnAirRpt variables DO NOT include zone multipliers - ZonePreDefRep(iZone).SHGSHtHvacHt = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult; - ZonePreDefRep(iZone).SHGSHtHvacCl = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtHvacHt = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtHvacCl = 0.0; // HVAC Input Heated Surface Heating // HVAC Input Cooled Surface Cooling - ZonePreDefRep(iZone).SHGSHtSurfHt = radiantHeat(iZone); // multipliers included above - ZonePreDefRep(iZone).SHGSHtSurfCl = radiantCool(iZone); // multipliers included above + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtSurfHt = state.dataOutRptTab->radiantHeat(state.dataOutRptTab->iZoneGHGR); // multipliers included above + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtSurfCl = state.dataOutRptTab->radiantCool(state.dataOutRptTab->iZoneGHGR); // multipliers included above // HVAC ATU Heating at Heat Peak // HVAC ATU Cooling at Heat Peak - ZonePreDefRep(iZone).SHGSHtHvacATUHt = ATUHeat(iZone); // multipliers included above - ZonePreDefRep(iZone).SHGSHtHvacATUCl = ATUCool(iZone); // multipliers included above + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtHvacATUHt = state.dataOutRptTab->ATUHeat(state.dataOutRptTab->iZoneGHGR); // multipliers included above + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtHvacATUCl = state.dataOutRptTab->ATUCool(state.dataOutRptTab->iZoneGHGR); // multipliers included above // People Sensible Heat Addition - ZonePreDefRep(iZone).SHGSHtPeoplAdd = state.dataHeatBal->ZnRpt(iZone).PeopleSenGainRate * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtPeoplAdd = state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).PeopleSenGainRate * mult; // Lights Sensible Heat Addition - ZonePreDefRep(iZone).SHGSHtLiteAdd = state.dataHeatBal->ZnRpt(iZone).LtsTotGainRate * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtLiteAdd = state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).LtsTotGainRate * mult; // Equipment Sensible Heat Addition // Equipment Sensible Heat Removal // non-HVAC ZnAirRpt variables DO NOT include zone multipliers - eqpSens = state.dataHeatBal->ZnRpt(iZone).ElecRadGainRate + state.dataHeatBal->ZnRpt(iZone).GasRadGainRate + state.dataHeatBal->ZnRpt(iZone).HWRadGainRate + - state.dataHeatBal->ZnRpt(iZone).SteamRadGainRate + state.dataHeatBal->ZnRpt(iZone).OtherRadGainRate + state.dataHeatBal->ZnRpt(iZone).ElecConGainRate + - state.dataHeatBal->ZnRpt(iZone).GasConGainRate + state.dataHeatBal->ZnRpt(iZone).HWConGainRate + state.dataHeatBal->ZnRpt(iZone).SteamConGainRate + - state.dataHeatBal->ZnRpt(iZone).OtherConGainRate; - if (eqpSens > 0.0) { - ZonePreDefRep(iZone).SHGSHtEquipAdd = eqpSens * mult; - ZonePreDefRep(iZone).SHGSHtEquipRem = 0.0; + state.dataOutRptTab->eqpSensGHGR = state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWRadGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecConGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamConGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherConGainRate; + if (state.dataOutRptTab->eqpSensGHGR > 0.0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtEquipAdd = state.dataOutRptTab->eqpSensGHGR * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtEquipRem = 0.0; } else { - ZonePreDefRep(iZone).SHGSHtEquipAdd = 0.0; - ZonePreDefRep(iZone).SHGSHtEquipRem = eqpSens * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtEquipAdd = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtEquipRem = state.dataOutRptTab->eqpSensGHGR * mult; } // Window Heat Addition // Window Heat Removal - ZonePreDefRep(iZone).SHGSHtWindAdd = state.dataHeatBal->ZoneWinHeatGainRep(iZone) * mult; - ZonePreDefRep(iZone).SHGSHtWindRem = -state.dataHeatBal->ZoneWinHeatLossRep(iZone) * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtWindAdd = state.dataHeatBal->ZoneWinHeatGainRep(state.dataOutRptTab->iZoneGHGR) * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtWindRem = -state.dataHeatBal->ZoneWinHeatLossRep(state.dataOutRptTab->iZoneGHGR) * mult; // mixing object heat addition and removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones > 0.0) { - ZonePreDefRep(iZone).SHGSHtIzaAdd = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult; - ZonePreDefRep(iZone).SHGSHtIzaRem = 0.0; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones > 0.0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtIzaAdd = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtIzaRem = 0.0; } else { - ZonePreDefRep(iZone).SHGSHtIzaAdd = 0.0; - ZonePreDefRep(iZone).SHGSHtIzaRem = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtIzaAdd = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtIzaRem = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult; } // Infiltration Heat Addition // Infiltration Heat Removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil > 0.0) { - ZonePreDefRep(iZone).SHGSHtInfilAdd = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult; - ZonePreDefRep(iZone).SHGSHtInfilRem = 0.0; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil > 0.0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtInfilAdd = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtInfilRem = 0.0; } else { - ZonePreDefRep(iZone).SHGSHtInfilAdd = 0.0; - ZonePreDefRep(iZone).SHGSHtInfilRem = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtInfilAdd = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtInfilRem = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult; } // Opaque Surface Conduction and Other Heat Addition // Opaque Surface Conduction and Other Heat Removal - total = ZonePreDefRep(iZone).SHGSHtPeoplAdd + ZonePreDefRep(iZone).SHGSHtLiteAdd + ZonePreDefRep(iZone).SHGSHtHvacHt + - ZonePreDefRep(iZone).SHGSHtHvacCl + ZonePreDefRep(iZone).SHGSHtIzaAdd + ZonePreDefRep(iZone).SHGSHtIzaRem + - ZonePreDefRep(iZone).SHGSHtWindAdd + ZonePreDefRep(iZone).SHGSHtWindRem + ZonePreDefRep(iZone).SHGSHtInfilAdd + - ZonePreDefRep(iZone).SHGSHtInfilRem + ZonePreDefRep(iZone).SHGSHtEquipAdd + ZonePreDefRep(iZone).SHGSHtEquipRem + - ZonePreDefRep(iZone).SHGSHtSurfHt + ZonePreDefRep(iZone).SHGSHtSurfCl; - total = -total; // want to know the negative value of the sum since the row should add up to zero - if (total > 0) { - ZonePreDefRep(iZone).SHGSHtOtherAdd = total; - ZonePreDefRep(iZone).SHGSHtOtherRem = 0.0; + state.dataOutRptTab->totalGHGR = ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtPeoplAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtLiteAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtHvacHt + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtHvacCl + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtIzaAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtIzaRem + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtWindAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtWindRem + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtInfilAdd + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtInfilRem + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtEquipAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtEquipRem + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtSurfHt + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtSurfCl; + state.dataOutRptTab->totalGHGR = -state.dataOutRptTab->totalGHGR; // want to know the negative value of the sum since the row should add up to zero + if (state.dataOutRptTab->totalGHGR > 0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtOtherAdd = state.dataOutRptTab->totalGHGR; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtOtherRem = 0.0; } else { - ZonePreDefRep(iZone).SHGSHtOtherAdd = 0.0; - ZonePreDefRep(iZone).SHGSHtOtherRem = total; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtOtherAdd = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSHtOtherRem = state.dataOutRptTab->totalGHGR; } } } else { - if ((state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + radiantCool(iZone) + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult) < ZonePreDefRep(iZone).clPeak) { - ZonePreDefRep(iZone).clPeak = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + radiantCool(iZone) + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult; + if ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataOutRptTab->radiantCool(state.dataOutRptTab->iZoneGHGR) + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult) < ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).clPeak) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).clPeak = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataOutRptTab->radiantCool(state.dataOutRptTab->iZoneGHGR) + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult; // determine timestamp // ActualTimeS = CurrentTime-TimeStepZone+SysTimeElapsed // ActualtimeE = ActualTimeS+TimeStepSys // ActualTimeHrS=INT(ActualTimeS) // ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin) ActualTimeMin = DetermineMinuteForReporting(state, t_timeStepType); - EncodeMonDayHrMin(timestepTimeStamp, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, ActualTimeMin); - ZonePreDefRep(iZone).clPtTimeStamp = timestepTimeStamp; + EncodeMonDayHrMin( + state.dataOutRptTab->timestepTimeStampGHGR, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, ActualTimeMin); + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).clPtTimeStamp = state.dataOutRptTab->timestepTimeStampGHGR; // HVAC Input Sensible Air Heating // HVAC Input Sensible Air Cooling - ZonePreDefRep(iZone).SHGSClHvacHt = 0.0; - ZonePreDefRep(iZone).SHGSClHvacCl = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClHvacHt = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClHvacCl = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult; // HVAC Input Heated Surface Heating // HVAC Input Cooled Surface Cooling - ZonePreDefRep(iZone).SHGSClSurfHt = radiantHeat(iZone); - ZonePreDefRep(iZone).SHGSClSurfCl = radiantCool(iZone); + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClSurfHt = state.dataOutRptTab->radiantHeat(state.dataOutRptTab->iZoneGHGR); + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClSurfCl = state.dataOutRptTab->radiantCool(state.dataOutRptTab->iZoneGHGR); // HVAC heating by ATU at cool peak // HVAC cooling by ATU at cool peak - ZonePreDefRep(iZone).SHGSClHvacATUHt = ATUHeat(iZone); - ZonePreDefRep(iZone).SHGSClHvacATUCl = ATUCool(iZone); + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClHvacATUHt = state.dataOutRptTab->ATUHeat(state.dataOutRptTab->iZoneGHGR); + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClHvacATUCl = state.dataOutRptTab->ATUCool(state.dataOutRptTab->iZoneGHGR); // People Sensible Heat Addition - ZonePreDefRep(iZone).SHGSClPeoplAdd = state.dataHeatBal->ZnRpt(iZone).PeopleSenGainRate * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClPeoplAdd = state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).PeopleSenGainRate * mult; // Lights Sensible Heat Addition - ZonePreDefRep(iZone).SHGSClLiteAdd = state.dataHeatBal->ZnRpt(iZone).LtsTotGainRate * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClLiteAdd = state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).LtsTotGainRate * mult; // Equipment Sensible Heat Addition // Equipment Sensible Heat Removal - eqpSens = state.dataHeatBal->ZnRpt(iZone).ElecRadGainRate + state.dataHeatBal->ZnRpt(iZone).GasRadGainRate + state.dataHeatBal->ZnRpt(iZone).HWRadGainRate + - state.dataHeatBal->ZnRpt(iZone).SteamRadGainRate + state.dataHeatBal->ZnRpt(iZone).OtherRadGainRate + state.dataHeatBal->ZnRpt(iZone).ElecConGainRate + - state.dataHeatBal->ZnRpt(iZone).GasConGainRate + state.dataHeatBal->ZnRpt(iZone).HWConGainRate + state.dataHeatBal->ZnRpt(iZone).SteamConGainRate + - state.dataHeatBal->ZnRpt(iZone).OtherConGainRate; - if (eqpSens > 0.0) { - ZonePreDefRep(iZone).SHGSClEquipAdd = eqpSens * mult; - ZonePreDefRep(iZone).SHGSClEquipRem = 0.0; + state.dataOutRptTab->eqpSensGHGR = state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWRadGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecConGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamConGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherConGainRate; + if (state.dataOutRptTab->eqpSensGHGR > 0.0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClEquipAdd = state.dataOutRptTab->eqpSensGHGR * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClEquipRem = 0.0; } else { - ZonePreDefRep(iZone).SHGSClEquipAdd = 0.0; - ZonePreDefRep(iZone).SHGSClEquipRem = eqpSens * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClEquipAdd = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClEquipRem = state.dataOutRptTab->eqpSensGHGR * mult; } // Window Heat Addition // Window Heat Removal - ZonePreDefRep(iZone).SHGSClWindAdd = state.dataHeatBal->ZoneWinHeatGainRep(iZone) * mult; - ZonePreDefRep(iZone).SHGSClWindRem = -state.dataHeatBal->ZoneWinHeatLossRep(iZone) * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClWindAdd = state.dataHeatBal->ZoneWinHeatGainRep(state.dataOutRptTab->iZoneGHGR) * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClWindRem = -state.dataHeatBal->ZoneWinHeatLossRep(state.dataOutRptTab->iZoneGHGR) * mult; // mixing object cool addition and removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones > 0.0) { - ZonePreDefRep(iZone).SHGSClIzaAdd = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult; - ZonePreDefRep(iZone).SHGSClIzaRem = 0.0; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones > 0.0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClIzaAdd = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClIzaRem = 0.0; } else { - ZonePreDefRep(iZone).SHGSClIzaAdd = 0.0; - ZonePreDefRep(iZone).SHGSClIzaRem = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClIzaAdd = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClIzaRem = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult; } // Infiltration Heat Addition // Infiltration Heat Removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil > 0.0) { - ZonePreDefRep(iZone).SHGSClInfilAdd = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult; - ZonePreDefRep(iZone).SHGSClInfilRem = 0.0; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil > 0.0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClInfilAdd = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClInfilRem = 0.0; } else { - ZonePreDefRep(iZone).SHGSClInfilAdd = 0.0; - ZonePreDefRep(iZone).SHGSClInfilRem = state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClInfilAdd = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClInfilRem = state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult; } // Opaque Surface Conduction and Other Heat Addition // Opaque Surface Conduction and Other Heat Removal - total = ZonePreDefRep(iZone).SHGSClPeoplAdd + ZonePreDefRep(iZone).SHGSClLiteAdd + ZonePreDefRep(iZone).SHGSClHvacHt + - ZonePreDefRep(iZone).SHGSClHvacCl + ZonePreDefRep(iZone).SHGSClIzaAdd + ZonePreDefRep(iZone).SHGSClIzaRem + - ZonePreDefRep(iZone).SHGSClWindAdd + ZonePreDefRep(iZone).SHGSClWindRem + ZonePreDefRep(iZone).SHGSClInfilAdd + - ZonePreDefRep(iZone).SHGSClInfilRem + ZonePreDefRep(iZone).SHGSClEquipAdd + ZonePreDefRep(iZone).SHGSClEquipRem + - ZonePreDefRep(iZone).SHGSClSurfHt + ZonePreDefRep(iZone).SHGSClSurfCl; - total = -total; // want to know the negative value of the sum since the row should add up to zero - if (total > 0) { - ZonePreDefRep(iZone).SHGSClOtherAdd = total; - ZonePreDefRep(iZone).SHGSClOtherRem = 0.0; + state.dataOutRptTab->totalGHGR = ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClPeoplAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClLiteAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClHvacHt + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClHvacCl + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClIzaAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClIzaRem + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClWindAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClWindRem + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClInfilAdd + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClInfilRem + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClEquipAdd + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClEquipRem + + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClSurfHt + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClSurfCl; + state.dataOutRptTab->totalGHGR = -state.dataOutRptTab->totalGHGR; // want to know the negative value of the sum since the row should add up to zero + if (state.dataOutRptTab->totalGHGR > 0) { + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClOtherAdd = state.dataOutRptTab->totalGHGR; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClOtherRem = 0.0; } else { - ZonePreDefRep(iZone).SHGSClOtherAdd = 0.0; - ZonePreDefRep(iZone).SHGSClOtherRem = total; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClOtherAdd = 0.0; + ZonePreDefRep(state.dataOutRptTab->iZoneGHGR).SHGSClOtherRem = state.dataOutRptTab->totalGHGR; } } } @@ -4848,26 +4824,26 @@ namespace EnergyPlus::OutputReportTabular { //------------------------------------ // BUILDING PEAK COOLING AND HEATING //------------------------------------ - bldgHtPk = 0.0; - bldgClPk = 0.0; - for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - mult = Zone(iZone).Multiplier * Zone(iZone).ListMultiplier; - if ((state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + radiantHeat(iZone) + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult) > 0) { - bldgHtPk += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + radiantHeat(iZone) + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult; + state.dataOutRptTab->bldgHtPk = 0.0; + state.dataOutRptTab->bldgClPk = 0.0; + for (state.dataOutRptTab->iZoneGHGR = 1; state.dataOutRptTab->iZoneGHGR <= state.dataGlobal->NumOfZones; ++state.dataOutRptTab->iZoneGHGR) { + mult = Zone(state.dataOutRptTab->iZoneGHGR).Multiplier * Zone(state.dataOutRptTab->iZoneGHGR).ListMultiplier; + if ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataOutRptTab->radiantHeat(state.dataOutRptTab->iZoneGHGR) + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult) > 0) { + state.dataOutRptTab->bldgHtPk += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataOutRptTab->radiantHeat(state.dataOutRptTab->iZoneGHGR) + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult; } else { - bldgClPk += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + radiantCool(iZone) + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult; + state.dataOutRptTab->bldgClPk += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataOutRptTab->radiantCool(state.dataOutRptTab->iZoneGHGR) + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult; } } - if (bldgHtPk > state.dataHeatBal->BuildingPreDefRep.htPeak) { - state.dataHeatBal->BuildingPreDefRep.htPeak = bldgHtPk; + if (state.dataOutRptTab->bldgHtPk > state.dataHeatBal->BuildingPreDefRep.htPeak) { + state.dataHeatBal->BuildingPreDefRep.htPeak = state.dataOutRptTab->bldgHtPk; // determine timestamp // ActualTimeS = CurrentTime-TimeStepZone+SysTimeElapsed // ActualtimeE = ActualTimeS+TimeStepSys // ActualTimeHrS=INT(ActualTimeS) // ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin) ActualTimeMin = DetermineMinuteForReporting(state, t_timeStepType); - EncodeMonDayHrMin(timestepTimeStamp, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, ActualTimeMin); - state.dataHeatBal->BuildingPreDefRep.htPtTimeStamp = timestepTimeStamp; + EncodeMonDayHrMin(state.dataOutRptTab->timestepTimeStampGHGR, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, ActualTimeMin); + state.dataHeatBal->BuildingPreDefRep.htPtTimeStamp = state.dataOutRptTab->timestepTimeStampGHGR; // reset building level results to zero prior to accumulating across zones state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacHt = 0.0; state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacCl = 0.0; @@ -4887,75 +4863,75 @@ namespace EnergyPlus::OutputReportTabular { state.dataHeatBal->BuildingPreDefRep.SHGSHtIzaRem = 0.0; state.dataHeatBal->BuildingPreDefRep.SHGSHtInfilRem = 0.0; state.dataHeatBal->BuildingPreDefRep.SHGSHtOtherRem = 0.0; - for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - mult = Zone(iZone).Multiplier * Zone(iZone).ListMultiplier; + for (state.dataOutRptTab->iZoneGHGR = 1; state.dataOutRptTab->iZoneGHGR <= state.dataGlobal->NumOfZones; ++state.dataOutRptTab->iZoneGHGR) { + mult = Zone(state.dataOutRptTab->iZoneGHGR).Multiplier * Zone(state.dataOutRptTab->iZoneGHGR).ListMultiplier; // HVAC Input Sensible Air Heating // HVAC Input Sensible Air Cooling - state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacHt += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacHt += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult; // HVAC Input Heated Surface Heating // HVAC Input Cooled Surface Cooling - state.dataHeatBal->BuildingPreDefRep.SHGSHtSurfHt += radiantHeat(iZone); - state.dataHeatBal->BuildingPreDefRep.SHGSHtSurfCl += radiantCool(iZone); + state.dataHeatBal->BuildingPreDefRep.SHGSHtSurfHt += state.dataOutRptTab->radiantHeat(state.dataOutRptTab->iZoneGHGR); + state.dataHeatBal->BuildingPreDefRep.SHGSHtSurfCl += state.dataOutRptTab->radiantCool(state.dataOutRptTab->iZoneGHGR); // HVAC ATU Heating // HVAC ATU Cooling - state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacATUHt += ATUHeat(iZone); - state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacATUCl += ATUCool(iZone); + state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacATUHt += state.dataOutRptTab->ATUHeat(state.dataOutRptTab->iZoneGHGR); + state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacATUCl += state.dataOutRptTab->ATUCool(state.dataOutRptTab->iZoneGHGR); // People Sensible Heat Addition - state.dataHeatBal->BuildingPreDefRep.SHGSHtPeoplAdd += state.dataHeatBal->ZnRpt(iZone).PeopleSenGainRate * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSHtPeoplAdd += state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).PeopleSenGainRate * mult; // Lights Sensible Heat Addition - state.dataHeatBal->BuildingPreDefRep.SHGSHtLiteAdd += state.dataHeatBal->ZnRpt(iZone).LtsTotGainRate * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSHtLiteAdd += state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).LtsTotGainRate * mult; // Equipment Sensible Heat Addition // Equipment Sensible Heat Removal - eqpSens = state.dataHeatBal->ZnRpt(iZone).ElecRadGainRate + state.dataHeatBal->ZnRpt(iZone).GasRadGainRate + state.dataHeatBal->ZnRpt(iZone).HWRadGainRate + state.dataHeatBal->ZnRpt(iZone).SteamRadGainRate + - state.dataHeatBal->ZnRpt(iZone).OtherRadGainRate + state.dataHeatBal->ZnRpt(iZone).ElecConGainRate + state.dataHeatBal->ZnRpt(iZone).GasConGainRate + state.dataHeatBal->ZnRpt(iZone).HWConGainRate + - state.dataHeatBal->ZnRpt(iZone).SteamConGainRate + state.dataHeatBal->ZnRpt(iZone).OtherConGainRate; - if (eqpSens > 0.0) { - state.dataHeatBal->BuildingPreDefRep.SHGSHtEquipAdd += eqpSens * mult; + state.dataOutRptTab->eqpSensGHGR = state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamRadGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWConGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherConGainRate; + if (state.dataOutRptTab->eqpSensGHGR > 0.0) { + state.dataHeatBal->BuildingPreDefRep.SHGSHtEquipAdd += state.dataOutRptTab->eqpSensGHGR * mult; } else { - state.dataHeatBal->BuildingPreDefRep.SHGSHtEquipRem += eqpSens * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSHtEquipRem += state.dataOutRptTab->eqpSensGHGR * mult; } // Window Heat Addition // Window Heat Removal - state.dataHeatBal->BuildingPreDefRep.SHGSHtWindAdd += state.dataHeatBal->ZoneWinHeatGainRep(iZone) * mult; - state.dataHeatBal->BuildingPreDefRep.SHGSHtWindRem -= state.dataHeatBal->ZoneWinHeatLossRep(iZone) * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSHtWindAdd += state.dataHeatBal->ZoneWinHeatGainRep(state.dataOutRptTab->iZoneGHGR) * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSHtWindRem -= state.dataHeatBal->ZoneWinHeatLossRep(state.dataOutRptTab->iZoneGHGR) * mult; // mixing object heat addition and removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones > 0.0) { - state.dataHeatBal->BuildingPreDefRep.SHGSHtIzaAdd += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones > 0.0) { + state.dataHeatBal->BuildingPreDefRep.SHGSHtIzaAdd += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult; } else { - state.dataHeatBal->BuildingPreDefRep.SHGSHtIzaRem += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSHtIzaRem += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult; } // Infiltration Heat Addition // Infiltration Heat Removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil > 00) { - state.dataHeatBal->BuildingPreDefRep.SHGSHtInfilAdd += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil > 00) { + state.dataHeatBal->BuildingPreDefRep.SHGSHtInfilAdd += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult; } else { - state.dataHeatBal->BuildingPreDefRep.SHGSHtInfilRem += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSHtInfilRem += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult; } } // Opaque Surface Conduction and Other Heat Addition // Opaque Surface Conduction and Other Heat Removal - total = state.dataHeatBal->BuildingPreDefRep.SHGSHtPeoplAdd + state.dataHeatBal->BuildingPreDefRep.SHGSHtLiteAdd + state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacHt + + state.dataOutRptTab->totalGHGR = state.dataHeatBal->BuildingPreDefRep.SHGSHtPeoplAdd + state.dataHeatBal->BuildingPreDefRep.SHGSHtLiteAdd + state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacHt + state.dataHeatBal->BuildingPreDefRep.SHGSHtHvacCl + state.dataHeatBal->BuildingPreDefRep.SHGSHtIzaAdd + state.dataHeatBal->BuildingPreDefRep.SHGSHtIzaRem + state.dataHeatBal->BuildingPreDefRep.SHGSHtWindAdd + state.dataHeatBal->BuildingPreDefRep.SHGSHtWindRem + state.dataHeatBal->BuildingPreDefRep.SHGSHtInfilAdd + state.dataHeatBal->BuildingPreDefRep.SHGSHtInfilRem + state.dataHeatBal->BuildingPreDefRep.SHGSHtEquipAdd + state.dataHeatBal->BuildingPreDefRep.SHGSHtEquipRem + state.dataHeatBal->BuildingPreDefRep.SHGSHtSurfHt + state.dataHeatBal->BuildingPreDefRep.SHGSHtSurfCl; - total = -total; // want to know the negative value of the sum since the row should add up to zero - if (total > 0) { - state.dataHeatBal->BuildingPreDefRep.SHGSHtOtherAdd += total; + state.dataOutRptTab->totalGHGR = -state.dataOutRptTab->totalGHGR; // want to know the negative value of the sum since the row should add up to zero + if (state.dataOutRptTab->totalGHGR > 0) { + state.dataHeatBal->BuildingPreDefRep.SHGSHtOtherAdd += state.dataOutRptTab->totalGHGR; } else { - state.dataHeatBal->BuildingPreDefRep.SHGSHtOtherRem += total; + state.dataHeatBal->BuildingPreDefRep.SHGSHtOtherRem += state.dataOutRptTab->totalGHGR; } } - if (bldgClPk < state.dataHeatBal->BuildingPreDefRep.clPeak) { - state.dataHeatBal->BuildingPreDefRep.clPeak = bldgClPk; + if (state.dataOutRptTab->bldgClPk < state.dataHeatBal->BuildingPreDefRep.clPeak) { + state.dataHeatBal->BuildingPreDefRep.clPeak = state.dataOutRptTab->bldgClPk; // determine timestamp // ActualTimeS = CurrentTime-TimeStepZone+SysTimeElapsed // ActualtimeE = ActualTimeS+TimeStepSys // ActualTimeHrS=INT(ActualTimeS) // ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin) ActualTimeMin = DetermineMinuteForReporting(state, t_timeStepType); - EncodeMonDayHrMin(timestepTimeStamp, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, ActualTimeMin); - state.dataHeatBal->BuildingPreDefRep.clPtTimeStamp = timestepTimeStamp; + EncodeMonDayHrMin(state.dataOutRptTab->timestepTimeStampGHGR, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, ActualTimeMin); + state.dataHeatBal->BuildingPreDefRep.clPtTimeStamp = state.dataOutRptTab->timestepTimeStampGHGR; // reset building level results to zero prior to accumulating across zones state.dataHeatBal->BuildingPreDefRep.SHGSClHvacHt = 0.0; state.dataHeatBal->BuildingPreDefRep.SHGSClHvacCl = 0.0; @@ -4975,63 +4951,63 @@ namespace EnergyPlus::OutputReportTabular { state.dataHeatBal->BuildingPreDefRep.SHGSClIzaRem = 0.0; state.dataHeatBal->BuildingPreDefRep.SHGSClInfilRem = 0.0; state.dataHeatBal->BuildingPreDefRep.SHGSClOtherRem = 0.0; - for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - mult = Zone(iZone).Multiplier * Zone(iZone).ListMultiplier; + for (state.dataOutRptTab->iZoneGHGR = 1; state.dataOutRptTab->iZoneGHGR <= state.dataGlobal->NumOfZones; ++state.dataOutRptTab->iZoneGHGR) { + mult = Zone(state.dataOutRptTab->iZoneGHGR).Multiplier * Zone(state.dataOutRptTab->iZoneGHGR).ListMultiplier; // HVAC Input Sensible Air Heating // HVAC Input Sensible Air Cooling - state.dataHeatBal->BuildingPreDefRep.SHGSClHvacCl += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(iZone).SumNonAirSystem * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSClHvacCl += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTsystem + state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumNonAirSystem * mult; // HVAC Input Heated Surface Heating // HVAC Input Cooled Surface Cooling - state.dataHeatBal->BuildingPreDefRep.SHGSClSurfHt += radiantHeat(iZone); - state.dataHeatBal->BuildingPreDefRep.SHGSClSurfCl += radiantCool(iZone); + state.dataHeatBal->BuildingPreDefRep.SHGSClSurfHt += state.dataOutRptTab->radiantHeat(state.dataOutRptTab->iZoneGHGR); + state.dataHeatBal->BuildingPreDefRep.SHGSClSurfCl += state.dataOutRptTab->radiantCool(state.dataOutRptTab->iZoneGHGR); // HVAC ATU Heating // HVAC ATU Cooling - state.dataHeatBal->BuildingPreDefRep.SHGSClHvacATUHt += ATUHeat(iZone); - state.dataHeatBal->BuildingPreDefRep.SHGSClHvacATUCl += ATUCool(iZone); + state.dataHeatBal->BuildingPreDefRep.SHGSClHvacATUHt += state.dataOutRptTab->ATUHeat(state.dataOutRptTab->iZoneGHGR); + state.dataHeatBal->BuildingPreDefRep.SHGSClHvacATUCl += state.dataOutRptTab->ATUCool(state.dataOutRptTab->iZoneGHGR); // People Sensible Heat Addition - state.dataHeatBal->BuildingPreDefRep.SHGSClPeoplAdd += state.dataHeatBal->ZnRpt(iZone).PeopleSenGainRate * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSClPeoplAdd += state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).PeopleSenGainRate * mult; // Lights Sensible Heat Addition - state.dataHeatBal->BuildingPreDefRep.SHGSClLiteAdd += state.dataHeatBal->ZnRpt(iZone).LtsTotGainRate * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSClLiteAdd += state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).LtsTotGainRate * mult; // Equipment Sensible Heat Addition // Equipment Sensible Heat Removal - eqpSens = state.dataHeatBal->ZnRpt(iZone).ElecRadGainRate + state.dataHeatBal->ZnRpt(iZone).GasRadGainRate + state.dataHeatBal->ZnRpt(iZone).HWRadGainRate + state.dataHeatBal->ZnRpt(iZone).SteamRadGainRate + - state.dataHeatBal->ZnRpt(iZone).OtherRadGainRate + state.dataHeatBal->ZnRpt(iZone).ElecConGainRate + state.dataHeatBal->ZnRpt(iZone).GasConGainRate + state.dataHeatBal->ZnRpt(iZone).HWConGainRate + - state.dataHeatBal->ZnRpt(iZone).SteamConGainRate + state.dataHeatBal->ZnRpt(iZone).OtherConGainRate; - if (eqpSens > 0.0) { - state.dataHeatBal->BuildingPreDefRep.SHGSClEquipAdd += eqpSens * mult; + state.dataOutRptTab->eqpSensGHGR = state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamRadGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherRadGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).ElecConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).GasConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).HWConGainRate + + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).SteamConGainRate + state.dataHeatBal->ZnRpt(state.dataOutRptTab->iZoneGHGR).OtherConGainRate; + if (state.dataOutRptTab->eqpSensGHGR > 0.0) { + state.dataHeatBal->BuildingPreDefRep.SHGSClEquipAdd += state.dataOutRptTab->eqpSensGHGR * mult; } else { - state.dataHeatBal->BuildingPreDefRep.SHGSClEquipRem += eqpSens * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSClEquipRem += state.dataOutRptTab->eqpSensGHGR * mult; } // Window Heat Addition // Window Heat Removal - state.dataHeatBal->BuildingPreDefRep.SHGSClWindAdd += state.dataHeatBal->ZoneWinHeatGainRep(iZone) * mult; - state.dataHeatBal->BuildingPreDefRep.SHGSClWindRem -= state.dataHeatBal->ZoneWinHeatLossRep(iZone) * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSClWindAdd += state.dataHeatBal->ZoneWinHeatGainRep(state.dataOutRptTab->iZoneGHGR) * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSClWindRem -= state.dataHeatBal->ZoneWinHeatLossRep(state.dataOutRptTab->iZoneGHGR) * mult; // mixing object cool addition and removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones > 0.0) { - state.dataHeatBal->BuildingPreDefRep.SHGSClIzaAdd += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones > 0.0) { + state.dataHeatBal->BuildingPreDefRep.SHGSClIzaAdd += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult; } else { - state.dataHeatBal->BuildingPreDefRep.SHGSClIzaRem += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDTzones * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSClIzaRem += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDTzones * mult; } // Infiltration Heat Addition // Infiltration Heat Removal - if (state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil > 00) { - state.dataHeatBal->BuildingPreDefRep.SHGSClInfilAdd += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult; + if (state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil > 00) { + state.dataHeatBal->BuildingPreDefRep.SHGSClInfilAdd += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult; } else { - state.dataHeatBal->BuildingPreDefRep.SHGSClInfilRem += state.dataHeatBal->ZnAirRpt(iZone).SumMCpDtInfil * mult; + state.dataHeatBal->BuildingPreDefRep.SHGSClInfilRem += state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGHGR).SumMCpDtInfil * mult; } } // Opaque Surface Conduction and Other Heat Addition // Opaque Surface Conduction and Other Heat Removal - total = state.dataHeatBal->BuildingPreDefRep.SHGSClPeoplAdd + state.dataHeatBal->BuildingPreDefRep.SHGSClLiteAdd + state.dataHeatBal->BuildingPreDefRep.SHGSClHvacHt + + state.dataOutRptTab->totalGHGR = state.dataHeatBal->BuildingPreDefRep.SHGSClPeoplAdd + state.dataHeatBal->BuildingPreDefRep.SHGSClLiteAdd + state.dataHeatBal->BuildingPreDefRep.SHGSClHvacHt + state.dataHeatBal->BuildingPreDefRep.SHGSClHvacCl + state.dataHeatBal->BuildingPreDefRep.SHGSClIzaAdd + state.dataHeatBal->BuildingPreDefRep.SHGSClIzaRem + state.dataHeatBal->BuildingPreDefRep.SHGSClWindAdd + state.dataHeatBal->BuildingPreDefRep.SHGSClWindRem + state.dataHeatBal->BuildingPreDefRep.SHGSClInfilAdd + state.dataHeatBal->BuildingPreDefRep.SHGSClInfilRem + state.dataHeatBal->BuildingPreDefRep.SHGSClEquipAdd + state.dataHeatBal->BuildingPreDefRep.SHGSClEquipRem + state.dataHeatBal->BuildingPreDefRep.SHGSClSurfHt + state.dataHeatBal->BuildingPreDefRep.SHGSClSurfCl; - total = -total; // want to know the negative value of the sum since the row should add up to zero - if (total > 0) { - state.dataHeatBal->BuildingPreDefRep.SHGSClOtherAdd += total; + state.dataOutRptTab->totalGHGR = -state.dataOutRptTab->totalGHGR; // want to know the negative value of the sum since the row should add up to zero + if (state.dataOutRptTab->totalGHGR > 0) { + state.dataHeatBal->BuildingPreDefRep.SHGSClOtherAdd += state.dataOutRptTab->totalGHGR; } else { - state.dataHeatBal->BuildingPreDefRep.SHGSClOtherRem += total; + state.dataHeatBal->BuildingPreDefRep.SHGSClOtherRem += state.dataOutRptTab->totalGHGR; } } } @@ -5839,31 +5815,8 @@ namespace EnergyPlus::OutputReportTabular { int zonePt; int iZone; Real64 mult; // zone list and group multipliers - static Real64 totalVolume(0.0); - static int numUncondZones(0); - static int numCondZones(0); int StartOfWeek; - static Real64 HrsPerWeek(0.0); Real64 consumptionTotal; - // sensible heat gain report totals - static Real64 totalZoneEqHt(0.0); - static Real64 totalZoneEqCl(0.0); - static Real64 totalHvacATUHt(0.0); - static Real64 totalHvacATUCl(0.0); - static Real64 totalSurfHt(0.0); - static Real64 totalSurfCl(0.0); - static Real64 totalPeoplAdd(0.0); - static Real64 totalLiteAdd(0.0); - static Real64 totalEquipAdd(0.0); - static Real64 totalWindAdd(0.0); - static Real64 totalIzaAdd(0.0); - static Real64 totalInfilAdd(0.0); - static Real64 totalOtherAdd(0.0); - static Real64 totalEquipRem(0.0); - static Real64 totalWindRem(0.0); - static Real64 totalIzaRem(0.0); - static Real64 totalInfilRem(0.0); - static Real64 totalOtherRem(0.0); auto &Zone(state.dataHeatBal->Zone); auto &ZonePreDefRep(state.dataHeatBal->ZonePreDefRep); @@ -5887,13 +5840,13 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptPredefined->pdchInLtAvgHrSchd, state.dataHeatBal->Lights(iLight).Name, ScheduleAverageHoursPerWeek(state, state.dataHeatBal->Lights(iLight).SchedPtr, StartOfWeek, state.dataEnvrn->CurrentYearIsLeapYear)); // average operating hours per week if (ort->gatherElapsedTimeBEPS > 0) { - HrsPerWeek = 24 * 7 * state.dataHeatBal->Lights(iLight).SumTimeNotZeroCons / ort->gatherElapsedTimeBEPS; - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtAvgHrOper, state.dataHeatBal->Lights(iLight).Name, HrsPerWeek); + state.dataOutRptTab->HrsPerWeek = 24 * 7 * state.dataHeatBal->Lights(iLight).SumTimeNotZeroCons / ort->gatherElapsedTimeBEPS; + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtAvgHrOper, state.dataHeatBal->Lights(iLight).Name, state.dataOutRptTab->HrsPerWeek); } // full load hours per week if ((state.dataHeatBal->Lights(iLight).DesignLevel * ort->gatherElapsedTimeBEPS) > 0) { - HrsPerWeek = 24 * 7 * state.dataHeatBal->Lights(iLight).SumConsumption / (state.dataHeatBal->Lights(iLight).DesignLevel * ort->gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtFullLoadHrs, state.dataHeatBal->Lights(iLight).Name, HrsPerWeek); + state.dataOutRptTab->HrsPerWeek = 24 * 7 * state.dataHeatBal->Lights(iLight).SumConsumption / (state.dataHeatBal->Lights(iLight).DesignLevel * ort->gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtFullLoadHrs, state.dataHeatBal->Lights(iLight).Name, state.dataOutRptTab->HrsPerWeek); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtConsump, state.dataHeatBal->Lights(iLight).Name, state.dataHeatBal->Lights(iLight).SumConsumption * mult / 1000000000.0); consumptionTotal += state.dataHeatBal->Lights(iLight).SumConsumption / 1000000000.0; @@ -5910,14 +5863,14 @@ namespace EnergyPlus::OutputReportTabular { } // average operating hours per week if (ort->gatherElapsedTimeBEPS > 0) { - HrsPerWeek = 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumTimeNotZeroCons / ort->gatherElapsedTimeBEPS; - PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtAvgHrOper, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, HrsPerWeek); + state.dataOutRptTab->HrsPerWeek = 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumTimeNotZeroCons / ort->gatherElapsedTimeBEPS; + PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtAvgHrOper, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, state.dataOutRptTab->HrsPerWeek); } // full load hours per week if ((state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * ort->gatherElapsedTimeBEPS) > 0) { - HrsPerWeek = + state.dataOutRptTab->HrsPerWeek = 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / (state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * ort->gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtFullLoadHrs, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, HrsPerWeek); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtFullLoadHrs, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, state.dataOutRptTab->HrsPerWeek); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtConsump, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / 1000000000.0); consumptionTotal += state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / 1000000000.0; @@ -5986,7 +5939,7 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchOaoZoneVol1, Zone(iZone).Name, Zone(iZone).Volume); PreDefTableEntry(state, state.dataOutRptPredefined->pdchOaoZoneVol2, Zone(iZone).Name, Zone(iZone).Volume); PreDefTableEntry(state, state.dataOutRptPredefined->pdchOaMvZoneVol, Zone(iZone).Name, Zone(iZone).Volume); - totalVolume += Zone(iZone).Volume * zoneMult; + state.dataOutRptTab->totalVolume += Zone(iZone).Volume * zoneMult; PreDefTableEntry(state, state.dataOutRptPredefined->pdchOaMvZoneArea, Zone(iZone).Name, Zone(iZone).FloorArea); totalArea += Zone(iZone).FloorArea * zoneMult; @@ -6295,7 +6248,7 @@ namespace EnergyPlus::OutputReportTabular { OutputReportPredefined::PreDefTableEntry( state, state.dataOutRptPredefined->pdchOaMvDesZnOa, "Total Facility", state.dataOutRptPredefined->TotalVozMax, 4); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchOaMvZoneVol, "Total Facility", totalVolume); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchOaMvZoneVol, "Total Facility", state.dataOutRptTab->totalVolume); PreDefTableEntry(state, state.dataOutRptPredefined->pdchOaMvZoneArea, "Total Facility", totalArea); PreDefTableEntry(state, state.dataOutRptPredefined->pdchOaMvNomNumOcc, "Total Facility", totalOccupants); PreDefTableEntry(state, state.dataOutRptPredefined->pdchOaMvAvgNumOcc, "Total Facility", totalAverageOccupants); @@ -6339,13 +6292,13 @@ namespace EnergyPlus::OutputReportTabular { // Add the number of conditioned and unconditioned zones to the count report for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (Zone(iZone).SystemZoneNodeNumber > 0) { // conditioned zones only - ++numCondZones; + ++state.dataOutRptTab->numCondZones; } else { - ++numUncondZones; + ++state.dataOutRptTab->numUncondZones; } } - PreDefTableEntry(state, state.dataOutRptPredefined->pdchHVACcntVal, "Conditioned Zones", numCondZones); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchHVACcntVal, "Unconditioned Zones", numUncondZones); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchHVACcntVal, "Conditioned Zones", state.dataOutRptTab->numCondZones); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchHVACcntVal, "Unconditioned Zones", state.dataOutRptTab->numUncondZones); // add the number of plenums to the count report PreDefTableEntry(state, state.dataOutRptPredefined->pdchHVACcntVal, "Supply Plenums", state.dataZonePlenum->NumZoneSupplyPlenums); PreDefTableEntry(state, state.dataOutRptPredefined->pdchHVACcntVal, "Return Plenums", state.dataZonePlenum->NumZoneReturnPlenums); @@ -6430,45 +6383,45 @@ namespace EnergyPlus::OutputReportTabular { } // totals for annual report for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - totalZoneEqHt += ZonePreDefRep(iZone).SHGSAnZoneEqHt; - totalZoneEqCl += ZonePreDefRep(iZone).SHGSAnZoneEqCl; - totalHvacATUHt += ZonePreDefRep(iZone).SHGSAnHvacATUHt; - totalHvacATUCl += ZonePreDefRep(iZone).SHGSAnHvacATUCl; - totalSurfHt += ZonePreDefRep(iZone).SHGSAnSurfHt; - totalSurfCl += ZonePreDefRep(iZone).SHGSAnSurfCl; - totalPeoplAdd += ZonePreDefRep(iZone).SHGSAnPeoplAdd; - totalLiteAdd += ZonePreDefRep(iZone).SHGSAnLiteAdd; - totalEquipAdd += ZonePreDefRep(iZone).SHGSAnEquipAdd; - totalWindAdd += ZonePreDefRep(iZone).SHGSAnWindAdd; - totalIzaAdd += ZonePreDefRep(iZone).SHGSAnIzaAdd; - totalInfilAdd += ZonePreDefRep(iZone).SHGSAnInfilAdd; - totalOtherAdd += ZonePreDefRep(iZone).SHGSAnOtherAdd; - totalEquipRem += ZonePreDefRep(iZone).SHGSAnEquipRem; - totalWindRem += ZonePreDefRep(iZone).SHGSAnWindRem; - totalIzaRem += ZonePreDefRep(iZone).SHGSAnIzaRem; - totalInfilRem += ZonePreDefRep(iZone).SHGSAnInfilRem; - totalOtherRem += ZonePreDefRep(iZone).SHGSAnOtherRem; + state.dataOutRptTab->totalZoneEqHt += ZonePreDefRep(iZone).SHGSAnZoneEqHt; + state.dataOutRptTab->totalZoneEqCl += ZonePreDefRep(iZone).SHGSAnZoneEqCl; + state.dataOutRptTab->totalHvacATUHt += ZonePreDefRep(iZone).SHGSAnHvacATUHt; + state.dataOutRptTab->totalHvacATUCl += ZonePreDefRep(iZone).SHGSAnHvacATUCl; + state.dataOutRptTab->totalSurfHt += ZonePreDefRep(iZone).SHGSAnSurfHt; + state.dataOutRptTab->totalSurfCl += ZonePreDefRep(iZone).SHGSAnSurfCl; + state.dataOutRptTab->totalPeoplAdd += ZonePreDefRep(iZone).SHGSAnPeoplAdd; + state.dataOutRptTab->totalLiteAdd += ZonePreDefRep(iZone).SHGSAnLiteAdd; + state.dataOutRptTab->totalEquipAdd += ZonePreDefRep(iZone).SHGSAnEquipAdd; + state.dataOutRptTab->totalWindAdd += ZonePreDefRep(iZone).SHGSAnWindAdd; + state.dataOutRptTab->totalIzaAdd += ZonePreDefRep(iZone).SHGSAnIzaAdd; + state.dataOutRptTab->totalInfilAdd += ZonePreDefRep(iZone).SHGSAnInfilAdd; + state.dataOutRptTab->totalOtherAdd += ZonePreDefRep(iZone).SHGSAnOtherAdd; + state.dataOutRptTab->totalEquipRem += ZonePreDefRep(iZone).SHGSAnEquipRem; + state.dataOutRptTab->totalWindRem += ZonePreDefRep(iZone).SHGSAnWindRem; + state.dataOutRptTab->totalIzaRem += ZonePreDefRep(iZone).SHGSAnIzaRem; + state.dataOutRptTab->totalInfilRem += ZonePreDefRep(iZone).SHGSAnInfilRem; + state.dataOutRptTab->totalOtherRem += ZonePreDefRep(iZone).SHGSAnOtherRem; } // PreDefTableEntry(state, pdchSHGSAnHvacHt, "Total Facility", totalHvacHt * convertJtoGJ, 3 ); // PreDefTableEntry(state, pdchSHGSAnHvacCl, "Total Facility", totalHvacCl * convertJtoGJ, 3 ); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnZoneEqHt, "Total Facility", totalZoneEqHt * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnZoneEqCl, "Total Facility", totalZoneEqCl * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnHvacATUHt, "Total Facility", totalHvacATUHt * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnHvacATUCl, "Total Facility", totalHvacATUCl * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnSurfHt, "Total Facility", totalSurfHt * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnSurfCl, "Total Facility", totalSurfCl * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnPeoplAdd, "Total Facility", totalPeoplAdd * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnLiteAdd, "Total Facility", totalLiteAdd * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnEquipAdd, "Total Facility", totalEquipAdd * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnWindAdd, "Total Facility", totalWindAdd * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnIzaAdd, "Total Facility", totalIzaAdd * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnInfilAdd, "Total Facility", totalInfilAdd * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnOtherAdd, "Total Facility", totalOtherAdd * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnEquipRem, "Total Facility", totalEquipRem * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnWindRem, "Total Facility", totalWindRem * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnIzaRem, "Total Facility", totalIzaRem * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnInfilRem, "Total Facility", totalInfilRem * DataGlobalConstants::convertJtoGJ, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnOtherRem, "Total Facility", totalOtherRem * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnZoneEqHt, "Total Facility", state.dataOutRptTab->totalZoneEqHt * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnZoneEqCl, "Total Facility", state.dataOutRptTab->totalZoneEqCl * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnHvacATUHt, "Total Facility", state.dataOutRptTab->totalHvacATUHt * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnHvacATUCl, "Total Facility", state.dataOutRptTab->totalHvacATUCl * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnSurfHt, "Total Facility", state.dataOutRptTab->totalSurfHt * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnSurfCl, "Total Facility", state.dataOutRptTab->totalSurfCl * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnPeoplAdd, "Total Facility", state.dataOutRptTab->totalPeoplAdd * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnLiteAdd, "Total Facility", state.dataOutRptTab->totalLiteAdd * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnEquipAdd, "Total Facility", state.dataOutRptTab->totalEquipAdd * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnWindAdd, "Total Facility", state.dataOutRptTab->totalWindAdd * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnIzaAdd, "Total Facility", state.dataOutRptTab->totalIzaAdd * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnInfilAdd, "Total Facility", state.dataOutRptTab->totalInfilAdd * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnOtherAdd, "Total Facility", state.dataOutRptTab->totalOtherAdd * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnEquipRem, "Total Facility", state.dataOutRptTab->totalEquipRem * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnWindRem, "Total Facility", state.dataOutRptTab->totalWindRem * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnIzaRem, "Total Facility", state.dataOutRptTab->totalIzaRem * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnInfilRem, "Total Facility", state.dataOutRptTab->totalInfilRem * DataGlobalConstants::convertJtoGJ, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSAnOtherRem, "Total Facility", state.dataOutRptTab->totalOtherRem * DataGlobalConstants::convertJtoGJ, 3); // building level results for peak cooling PreDefTableEntry(state, state.dataOutRptPredefined->pdchSHGSClTimePeak, "Total Facility", DateToString(state.dataHeatBal->BuildingPreDefRep.clPtTimeStamp)); // PreDefTableEntry(state, pdchSHGSClHvacHt, "Total Facility", BuildingPreDefRep.SHGSClHvacHt ); @@ -6575,7 +6528,6 @@ namespace EnergyPlus::OutputReportTabular { int curCol; Real64 curVal; Real64 curConversionFactor; - static Real64 curConversionOffset(0.0); int columnUsedCount; int columnRecount; int digitsShown; @@ -6698,17 +6650,17 @@ namespace EnergyPlus::OutputReportTabular { if (unitsStyle_cur == iUnitsStyle::InchPound) { varNameWithUnits = ort->MonthlyColumns(curCol).varName + unitEnumToStringBrackets(ort->MonthlyColumns(curCol).units); LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); - GetUnitConversion(state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(state, indexUnitConv, curConversionFactor, state.dataOutRptTab->curConversionOffset, curUnits); } else { // just do the Joule conversion // if units is in Joules, convert if specified if (UtilityRoutines::SameString(unitEnumToString(ort->MonthlyColumns(curCol).units), "J")) { curUnits = energyUnitsString; curConversionFactor = energyUnitsConversionFactor; - curConversionOffset = 0.0; + state.dataOutRptTab->curConversionOffset = 0.0; } else { // if not joules don't perform conversion curUnits = unitEnumToString(ort->MonthlyColumns(curCol).units); curConversionFactor = 1.0; - curConversionOffset = 0.0; + state.dataOutRptTab->curConversionOffset = 0.0; } } { @@ -6727,14 +6679,14 @@ namespace EnergyPlus::OutputReportTabular { if (ort->MonthlyColumns(curCol).duration(lMonth) != 0) { curVal = ((ort->MonthlyColumns(curCol).reslt(lMonth) / ort->MonthlyColumns(curCol).duration(lMonth)) * curConversionFactor) + - curConversionOffset; + state.dataOutRptTab->curConversionOffset; } else { curVal = 0.0; } - sumVal += (ort->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; + sumVal += (ort->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + state.dataOutRptTab->curConversionOffset; sumDuration += ort->MonthlyColumns(curCol).duration(lMonth); } else { - curVal = (ort->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; + curVal = (ort->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + state.dataOutRptTab->curConversionOffset; sumVal += curVal; } if (ort->IsMonthGathered(lMonth)) { @@ -6828,7 +6780,7 @@ namespace EnergyPlus::OutputReportTabular { minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { - curVal = ort->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor + curConversionOffset; + curVal = ort->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor + state.dataOutRptTab->curConversionOffset; if (ort->IsMonthGathered(lMonth)) { tableBody(columnRecount, lMonth) = RealToStr(curVal, digitsShown); if (curVal > maxVal) maxVal = curVal; @@ -6891,7 +6843,7 @@ namespace EnergyPlus::OutputReportTabular { // value was very small // restructured the following lines to hide showing HUGE and -HUGE values in output table CR8154 Glazer if ((curVal < veryLarge) && (curVal > verySmall)) { - curVal = curVal * curConversionFactor + curConversionOffset; + curVal = curVal * curConversionFactor + state.dataOutRptTab->curConversionOffset; if (curVal > maxVal) maxVal = curVal; if (curVal < minVal) minVal = curVal; if (curVal < veryLarge && curVal > verySmall) { @@ -7338,13 +7290,6 @@ namespace EnergyPlus::OutputReportTabular { Real64 useValColAddFuel13; std::string subCatName; - static Real64 leedSiteIntLite(0.0); - static Real64 leedSiteSpHeat(0.0); - static Real64 leedSiteSpCool(0.0); - static Real64 leedSiteFanInt(0.0); - static Real64 leedSiteSrvWatr(0.0); - static Real64 leedSiteRecept(0.0); - static Real64 leedSiteTotal(0.0); Real64 unconvert; // Jan 2021: Added temp storage @@ -8292,42 +8237,42 @@ namespace EnergyPlus::OutputReportTabular { state, state.dataOutRptPredefined->pdchLeedEcsProc, "Total", processElecCost + processGasCost + processOthrCost, 2); } // accumulate for percentage table - leedSiteIntLite = 0.0; - leedSiteSpHeat = 0.0; - leedSiteSpCool = 0.0; - leedSiteFanInt = 0.0; - leedSiteSrvWatr = 0.0; - leedSiteRecept = 0.0; - leedSiteTotal = 0.0; + state.dataOutRptTab->leedSiteIntLite = 0.0; + state.dataOutRptTab->leedSiteSpHeat = 0.0; + state.dataOutRptTab->leedSiteSpCool = 0.0; + state.dataOutRptTab->leedSiteFanInt = 0.0; + state.dataOutRptTab->leedSiteSrvWatr = 0.0; + state.dataOutRptTab->leedSiteRecept = 0.0; + state.dataOutRptTab->leedSiteTotal = 0.0; for (iResource = 1; iResource <= 12; ++iResource) { // don't bother with water - leedSiteIntLite += useVal(iResource, 3); - leedSiteSpHeat += useVal(iResource, 1); - leedSiteSpCool += useVal(iResource, 2); - leedSiteFanInt += useVal(iResource, 7); - leedSiteSrvWatr += useVal(iResource, 12); - leedSiteRecept += useVal(iResource, 5); - leedSiteTotal += useVal(iResource, 15); - } - if (leedSiteTotal != 0) { + state.dataOutRptTab->leedSiteIntLite += useVal(iResource, 3); + state.dataOutRptTab->leedSiteSpHeat += useVal(iResource, 1); + state.dataOutRptTab->leedSiteSpCool += useVal(iResource, 2); + state.dataOutRptTab->leedSiteFanInt += useVal(iResource, 7); + state.dataOutRptTab->leedSiteSrvWatr += useVal(iResource, 12); + state.dataOutRptTab->leedSiteRecept += useVal(iResource, 5); + state.dataOutRptTab->leedSiteTotal += useVal(iResource, 15); + } + if (state.dataOutRptTab->leedSiteTotal != 0) { if (produceTabular) { PreDefTableEntry( - state, state.dataOutRptPredefined->pdchLeedEupPerc, "Interior Lighting (All)", 100 * leedSiteIntLite / leedSiteTotal, 2); + state, state.dataOutRptPredefined->pdchLeedEupPerc, "Interior Lighting (All)", 100 * state.dataOutRptTab->leedSiteIntLite / state.dataOutRptTab->leedSiteTotal, 2); PreDefTableEntry( - state, state.dataOutRptPredefined->pdchLeedEupPerc, "Space Heating", 100 * leedSiteSpHeat / leedSiteTotal, 2); + state, state.dataOutRptPredefined->pdchLeedEupPerc, "Space Heating", 100 * state.dataOutRptTab->leedSiteSpHeat / state.dataOutRptTab->leedSiteTotal, 2); PreDefTableEntry( - state, state.dataOutRptPredefined->pdchLeedEupPerc, "Space Cooling", 100 * leedSiteSpCool / leedSiteTotal, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEupPerc, "Fans (All)", 100 * leedSiteFanInt / leedSiteTotal, 2); + state, state.dataOutRptPredefined->pdchLeedEupPerc, "Space Cooling", 100 * state.dataOutRptTab->leedSiteSpCool / state.dataOutRptTab->leedSiteTotal, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEupPerc, "Fans (All)", 100 * state.dataOutRptTab->leedSiteFanInt / state.dataOutRptTab->leedSiteTotal, 2); PreDefTableEntry( - state, state.dataOutRptPredefined->pdchLeedEupPerc, "Service Water Heating", 100 * leedSiteSrvWatr / leedSiteTotal, 2); + state, state.dataOutRptPredefined->pdchLeedEupPerc, "Service Water Heating", 100 * state.dataOutRptTab->leedSiteSrvWatr / state.dataOutRptTab->leedSiteTotal, 2); PreDefTableEntry( - state, state.dataOutRptPredefined->pdchLeedEupPerc, "Receptacle Equipment", 100 * leedSiteRecept / leedSiteTotal, 2); + state, state.dataOutRptPredefined->pdchLeedEupPerc, "Receptacle Equipment", 100 * state.dataOutRptTab->leedSiteRecept / state.dataOutRptTab->leedSiteTotal, 2); PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEupPerc, "Miscellaneous", 100 * - (leedSiteTotal - (leedSiteIntLite + leedSiteSpHeat + leedSiteSpCool + leedSiteFanInt + leedSiteSrvWatr + - leedSiteRecept)) / - leedSiteTotal, + (state.dataOutRptTab->leedSiteTotal - (state.dataOutRptTab->leedSiteIntLite + state.dataOutRptTab->leedSiteSpHeat + state.dataOutRptTab->leedSiteSpCool + state.dataOutRptTab->leedSiteFanInt + state.dataOutRptTab->leedSiteSrvWatr + + state.dataOutRptTab->leedSiteRecept)) / + state.dataOutRptTab->leedSiteTotal, 2); } } @@ -10208,8 +10153,6 @@ namespace EnergyPlus::OutputReportTabular { int NumCols; // number of columns in report table static std::string SIunit; static std::string m2_unitName; - static Real64 m2_unitConv(0.0); - static int unitConvIndex(0); static std::string IPunitName; Real64 IPqty; Real64 IPsingleValue; @@ -10254,12 +10197,12 @@ namespace EnergyPlus::OutputReportTabular { rowHead(9) = "Cost Estimate Total (~~$~~)"; if (unitsStyle_cur == iUnitsStyle::InchPound) { SIunit = "[m2]"; - LookupSItoIP(state, SIunit, unitConvIndex, m2_unitName); - m2_unitConv = ConvertIP(state, unitConvIndex, 1.0); + LookupSItoIP(state, SIunit, state.dataOutRptTab->unitConvIndexWCCT, m2_unitName); + state.dataOutRptTab->m2_unitConv = ConvertIP(state, state.dataOutRptTab->unitConvIndexWCCT, 1.0); rowHead(10) = "Cost Per Conditioned Building Area (~~$~~/ft2)"; } else { rowHead(10) = "Cost Per Conditioned Building Area (~~$~~/m2)"; - m2_unitConv = 1.0; + state.dataOutRptTab->m2_unitConv = 1.0; } TableBodyData = 0.0; tableBody = ""; @@ -10294,7 +10237,7 @@ namespace EnergyPlus::OutputReportTabular { TableBodyData(1, 9) = state.dataCostEstimateManager->RefrncBldg.GrandTotal; tableBody(1, 9) = RealToStr(TableBodyData(1, 9), 2); if (ort->buildingConditionedFloorArea > 0.0) { - TableBodyData(1, 10) = TableBodyData(1, 9) / (ort->buildingConditionedFloorArea * m2_unitConv); + TableBodyData(1, 10) = TableBodyData(1, 9) / (ort->buildingConditionedFloorArea * state.dataOutRptTab->m2_unitConv); } tableBody(1, 10) = RealToStr(TableBodyData(1, 10), 2); @@ -10329,7 +10272,7 @@ namespace EnergyPlus::OutputReportTabular { TableBodyData(2, 9) = state.dataCostEstimateManager->CurntBldg.GrandTotal; tableBody(2, 9) = RealToStr(TableBodyData(2, 9), 2); if (ort->buildingConditionedFloorArea > 0) { - TableBodyData(2, 10) = TableBodyData(2, 9) / (ort->buildingConditionedFloorArea * m2_unitConv); + TableBodyData(2, 10) = TableBodyData(2, 9) / (ort->buildingConditionedFloorArea * state.dataOutRptTab->m2_unitConv); } tableBody(2, 10) = RealToStr(TableBodyData(2, 10), 2); @@ -10393,12 +10336,12 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, item) = fmt::to_string(state.dataCostEstimateManager->CostLineItem(item).LineNumber); tableBody(2, item) = state.dataCostEstimateManager->CostLineItem(item).LineName; if (unitsStyle_cur == iUnitsStyle::InchPound) { - LookupSItoIP(state, state.dataCostEstimateManager->CostLineItem(item).Units, unitConvIndex, IPunitName); - if (unitConvIndex != 0) { - IPqty = ConvertIP(state, unitConvIndex, state.dataCostEstimateManager->CostLineItem(item).Qty); + LookupSItoIP(state, state.dataCostEstimateManager->CostLineItem(item).Units, state.dataOutRptTab->unitConvIndexWCCT, IPunitName); + if (state.dataOutRptTab->unitConvIndexWCCT != 0) { + IPqty = ConvertIP(state, state.dataOutRptTab->unitConvIndexWCCT, state.dataCostEstimateManager->CostLineItem(item).Qty); tableBody(3, item) = RealToStr(IPqty, 2); tableBody(4, item) = IPunitName; - IPsingleValue = ConvertIP(state, unitConvIndex, 1.0); + IPsingleValue = ConvertIP(state, state.dataOutRptTab->unitConvIndexWCCT, 1.0); if (IPsingleValue != 0.0) { IPvaluePer = state.dataCostEstimateManager->CostLineItem(item).ValuePer / IPsingleValue; tableBody(5, item) = RealToStr(IPvaluePer, 2); @@ -10534,32 +10477,14 @@ namespace EnergyPlus::OutputReportTabular { bool zoneIsCond; bool usezoneFloorArea; - static int grandTotal(1); - static int condTotal(2); - static int uncondTotal(3); - static int notpartTotal(4); int iTotal; static std::string SIunit; - static int unitConvIndex(0); - static Real64 m_unitConv(0.0); - static Real64 m2_unitConv(0.0); - static Real64 m3_unitConv(0.0); - static Real64 Wm2_unitConv(0.0); static std::string m_unitName; static std::string m2_unitName; static std::string m3_unitName; static std::string Wm2_unitName; // zone summary total - static Array1D zstArea(4); - static Array1D zstVolume(4); - static Array1D zstWallArea(4); - static Array1D zstUndWallArea(4); - static Array1D zstWindowArea(4); - static Array1D zstOpeningArea(4); - static Array1D zstLight(4); - static Array1D zstPeople(4); - static Array1D zstPlug(4); //zstArea = 0.0; //zstVolume = 0.0; @@ -10568,7 +10493,7 @@ namespace EnergyPlus::OutputReportTabular { //zstWindowArea = 0.0; //zstOpeningArea = 0.0; //zstLight = 0.0; - //zstPeople = 0.0; + //state.dataOutRptTab->zstPeople = 0.0; //zstPlug = 0.0; // misc @@ -10603,15 +10528,15 @@ namespace EnergyPlus::OutputReportTabular { } // Moved these initializations into the loop - zstArea = 0.0; - zstVolume = 0.0; - zstWallArea = 0.0; - zstUndWallArea = 0.0; - zstWindowArea = 0.0; - zstOpeningArea = 0.0; - zstLight = 0.0; - zstPeople = 0.0; - zstPlug = 0.0; + state.dataOutRptTab->zstArea = 0.0; + state.dataOutRptTab->zstVolume = 0.0; + state.dataOutRptTab->zstWallArea = 0.0; + state.dataOutRptTab->zstUndWallArea = 0.0; + state.dataOutRptTab->zstWindowArea = 0.0; + state.dataOutRptTab->zstOpeningArea = 0.0; + state.dataOutRptTab->zstLight = 0.0; + state.dataOutRptTab->zstPeople = 0.0; + state.dataOutRptTab->zstPlug = 0.0; zoneOpeningArea = 0.0; @@ -10620,26 +10545,26 @@ namespace EnergyPlus::OutputReportTabular { // do unit conversions if necessary if (unitsStyle_cur == iUnitsStyle::InchPound) { SIunit = "[m]"; - LookupSItoIP(state, SIunit, unitConvIndex, m_unitName); - m_unitConv = ConvertIP(state, unitConvIndex, 1.0); + LookupSItoIP(state, SIunit, state.dataOutRptTab->unitConvIndexWVST, m_unitName); + state.dataOutRptTab->m_unitConv = ConvertIP(state, state.dataOutRptTab->unitConvIndexWVST, 1.0); SIunit = "[m2]"; - LookupSItoIP(state, SIunit, unitConvIndex, m2_unitName); - m2_unitConv = ConvertIP(state, unitConvIndex, 1.0); + LookupSItoIP(state, SIunit, state.dataOutRptTab->unitConvIndexWVST, m2_unitName); + state.dataOutRptTab->m2_unitConvWVST = ConvertIP(state, state.dataOutRptTab->unitConvIndexWVST, 1.0); SIunit = "[m3]"; - LookupSItoIP(state, SIunit, unitConvIndex, m3_unitName); - m3_unitConv = ConvertIP(state, unitConvIndex, 1.0); + LookupSItoIP(state, SIunit, state.dataOutRptTab->unitConvIndexWVST, m3_unitName); + state.dataOutRptTab->m3_unitConv = ConvertIP(state, state.dataOutRptTab->unitConvIndexWVST, 1.0); SIunit = "[W/m2]"; - LookupSItoIP(state, SIunit, unitConvIndex, Wm2_unitName); - Wm2_unitConv = ConvertIP(state, unitConvIndex, 1.0); + LookupSItoIP(state, SIunit, state.dataOutRptTab->unitConvIndexWVST, Wm2_unitName); + state.dataOutRptTab->m3_unitConv = ConvertIP(state, state.dataOutRptTab->unitConvIndexWVST, 1.0); } else { m_unitName = "[m]"; - m_unitConv = 1.0; + state.dataOutRptTab->m_unitConv = 1.0; m2_unitName = "[m2]"; - m2_unitConv = 1.0; + state.dataOutRptTab->m2_unitConvWVST = 1.0; m3_unitName = "[m3]"; - m3_unitConv = 1.0; + state.dataOutRptTab->m3_unitConv = 1.0; Wm2_unitName = "[W/m2]"; - Wm2_unitConv = 1.0; + state.dataOutRptTab->m3_unitConv = 1.0; } //---- General Sub-Table @@ -10671,7 +10596,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 3) = state.dataEnvrn->WeatherFileLocationTitle; // weather tableBody(1, 4) = RealToStr(state.dataEnvrn->Latitude, 2); // latitude tableBody(1, 5) = RealToStr(state.dataEnvrn->Longitude, 2); // longitude - tableBody(1, 6) = RealToStr(state.dataEnvrn->Elevation * m_unitConv, 2); // Elevation + tableBody(1, 6) = RealToStr(state.dataEnvrn->Elevation * state.dataOutRptTab->m_unitConv, 2); // Elevation tableBody(1, 7) = RealToStr(state.dataEnvrn->TimeZoneNumber, 2); // Time Zone tableBody(1, 8) = RealToStr(state.dataHeatBal->BuildingAzimuth, 2); // north axis angle tableBody(1, 9) = RealToStr(state.dataHeatBal->BuildingRotationAppendixG, 2); // Rotation for Appendix G @@ -10911,23 +10836,23 @@ namespace EnergyPlus::OutputReportTabular { tableBody = ""; - tableBody(wwrcNorth, wwrrWall) = RealToStr(wallAreaN * m2_unitConv, 2); - tableBody(wwrcSouth, wwrrWall) = RealToStr(wallAreaS * m2_unitConv, 2); - tableBody(wwrcEast, wwrrWall) = RealToStr(wallAreaE * m2_unitConv, 2); - tableBody(wwrcWest, wwrrWall) = RealToStr(wallAreaW * m2_unitConv, 2); - tableBody(wwrcTotal, wwrrWall) = RealToStr(TotalWallArea * m2_unitConv, 2); + tableBody(wwrcNorth, wwrrWall) = RealToStr(wallAreaN * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcSouth, wwrrWall) = RealToStr(wallAreaS * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcEast, wwrrWall) = RealToStr(wallAreaE * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcWest, wwrrWall) = RealToStr(wallAreaW * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcTotal, wwrrWall) = RealToStr(TotalWallArea * state.dataOutRptTab->m2_unitConvWVST, 2); - tableBody(wwrcNorth, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaN * m2_unitConv, 2); - tableBody(wwrcSouth, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaS * m2_unitConv, 2); - tableBody(wwrcEast, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaE * m2_unitConv, 2); - tableBody(wwrcWest, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaW * m2_unitConv, 2); - tableBody(wwrcTotal, wwrrAbvGndWall) = RealToStr(TotalAboveGroundWallArea * m2_unitConv, 2); + tableBody(wwrcNorth, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaN * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcSouth, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaS * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcEast, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaE * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcWest, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaW * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcTotal, wwrrAbvGndWall) = RealToStr(TotalAboveGroundWallArea * state.dataOutRptTab->m2_unitConvWVST, 2); - tableBody(wwrcNorth, wwrrWindow) = RealToStr(windowAreaN * m2_unitConv, 2); - tableBody(wwrcSouth, wwrrWindow) = RealToStr(windowAreaS * m2_unitConv, 2); - tableBody(wwrcEast, wwrrWindow) = RealToStr(windowAreaE * m2_unitConv, 2); - tableBody(wwrcWest, wwrrWindow) = RealToStr(windowAreaW * m2_unitConv, 2); - tableBody(wwrcTotal, wwrrWindow) = RealToStr(TotalWindowArea * m2_unitConv, 2); + tableBody(wwrcNorth, wwrrWindow) = RealToStr(windowAreaN * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcSouth, wwrrWindow) = RealToStr(windowAreaS * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcEast, wwrrWindow) = RealToStr(windowAreaE * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcWest, wwrrWindow) = RealToStr(windowAreaW * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcTotal, wwrrWindow) = RealToStr(TotalWindowArea * state.dataOutRptTab->m2_unitConvWVST, 2); tableBody(wwrcNorth, wwrrWWR) = RealToStr(100.0 * SafeDivide(windowAreaN, wallAreaN), 2); tableBody(wwrcSouth, wwrrWWR) = RealToStr(100.0 * SafeDivide(windowAreaS, wallAreaS), 2); @@ -10985,23 +10910,23 @@ namespace EnergyPlus::OutputReportTabular { tableBody = ""; - tableBody(wwrcNorth, wwrrWall) = RealToStr(wallAreaNcond * m2_unitConv, 2); - tableBody(wwrcSouth, wwrrWall) = RealToStr(wallAreaScond * m2_unitConv, 2); - tableBody(wwrcEast, wwrrWall) = RealToStr(wallAreaEcond * m2_unitConv, 2); - tableBody(wwrcWest, wwrrWall) = RealToStr(wallAreaWcond * m2_unitConv, 2); - tableBody(wwrcTotal, wwrrWall) = RealToStr(TotalWallArea * m2_unitConv, 2); + tableBody(wwrcNorth, wwrrWall) = RealToStr(wallAreaNcond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcSouth, wwrrWall) = RealToStr(wallAreaScond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcEast, wwrrWall) = RealToStr(wallAreaEcond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcWest, wwrrWall) = RealToStr(wallAreaWcond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcTotal, wwrrWall) = RealToStr(TotalWallArea * state.dataOutRptTab->m2_unitConvWVST, 2); - tableBody(wwrcNorth, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaNcond * m2_unitConv, 2); - tableBody(wwrcSouth, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaScond * m2_unitConv, 2); - tableBody(wwrcEast, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaEcond * m2_unitConv, 2); - tableBody(wwrcWest, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaWcond * m2_unitConv, 2); - tableBody(wwrcTotal, wwrrAbvGndWall) = RealToStr(TotalAboveGroundWallArea * m2_unitConv, 2); + tableBody(wwrcNorth, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaNcond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcSouth, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaScond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcEast, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaEcond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcWest, wwrrAbvGndWall) = RealToStr(aboveGroundWallAreaWcond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcTotal, wwrrAbvGndWall) = RealToStr(TotalAboveGroundWallArea * state.dataOutRptTab->m2_unitConvWVST, 2); - tableBody(wwrcNorth, wwrrWindow) = RealToStr(windowAreaNcond * m2_unitConv, 2); - tableBody(wwrcSouth, wwrrWindow) = RealToStr(windowAreaScond * m2_unitConv, 2); - tableBody(wwrcEast, wwrrWindow) = RealToStr(windowAreaEcond * m2_unitConv, 2); - tableBody(wwrcWest, wwrrWindow) = RealToStr(windowAreaWcond * m2_unitConv, 2); - tableBody(wwrcTotal, wwrrWindow) = RealToStr(TotalWindowArea * m2_unitConv, 2); + tableBody(wwrcNorth, wwrrWindow) = RealToStr(windowAreaNcond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcSouth, wwrrWindow) = RealToStr(windowAreaScond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcEast, wwrrWindow) = RealToStr(windowAreaEcond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcWest, wwrrWindow) = RealToStr(windowAreaWcond * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(wwrcTotal, wwrrWindow) = RealToStr(TotalWindowArea * state.dataOutRptTab->m2_unitConvWVST, 2); tableBody(wwrcNorth, wwrrWWR) = RealToStr(100.0 * SafeDivide(windowAreaNcond, wallAreaNcond), 2); tableBody(wwrcSouth, wwrrWWR) = RealToStr(100.0 * SafeDivide(windowAreaScond, wallAreaScond), 2); @@ -11057,8 +10982,8 @@ namespace EnergyPlus::OutputReportTabular { } } - tableBody(1, 1) = RealToStr(roofArea * m2_unitConv, 2); - tableBody(1, 2) = RealToStr(skylightArea * m2_unitConv, 2); + tableBody(1, 1) = RealToStr(roofArea * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(1, 2) = RealToStr(skylightArea * state.dataOutRptTab->m2_unitConvWVST, 2); tableBody(1, 3) = RealToStr(100.0 * SafeDivide(skylightArea, roofArea), 2); if (produceTabular) { @@ -11177,10 +11102,10 @@ namespace EnergyPlus::OutputReportTabular { columnHead(12) = "Plug and Process " + Wm2_unitName; rowHead = ""; - rowHead(state.dataGlobal->NumOfZones + grandTotal) = "Total"; - rowHead(state.dataGlobal->NumOfZones + condTotal) = "Conditioned Total"; - rowHead(state.dataGlobal->NumOfZones + uncondTotal) = "Unconditioned Total"; - rowHead(state.dataGlobal->NumOfZones + notpartTotal) = "Not Part of Total"; + rowHead(state.dataGlobal->NumOfZones + state.dataOutRptTab->grandTotal) = "Total"; + rowHead(state.dataGlobal->NumOfZones + state.dataOutRptTab->condTotal) = "Conditioned Total"; + rowHead(state.dataGlobal->NumOfZones + state.dataOutRptTab->uncondTotal) = "Unconditioned Total"; + rowHead(state.dataGlobal->NumOfZones + state.dataOutRptTab->notpartTotal) = "Not Part of Total"; tableBody = ""; @@ -11203,8 +11128,8 @@ namespace EnergyPlus::OutputReportTabular { tableBody(3, iZone) = "No"; usezoneFloorArea = false; } - tableBody(1, iZone) = RealToStr(Zone(iZone).FloorArea * m2_unitConv, 2); - tableBody(4, iZone) = RealToStr(Zone(iZone).Volume * m3_unitConv, 2); + tableBody(1, iZone) = RealToStr(Zone(iZone).FloorArea * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(4, iZone) = RealToStr(Zone(iZone).Volume * state.dataOutRptTab->m3_unitConv, 2); // no unit conversion necessary since done automatically if (produceTabular) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedSutSpArea, Zone(iZone).Name, Zone(iZone).FloorArea, 2); @@ -11221,10 +11146,10 @@ namespace EnergyPlus::OutputReportTabular { } } tableBody(5, iZone) = RealToStr(mult, 2); - tableBody(6, iZone) = RealToStr(Zone(iZone).ExtGrossWallArea * m2_unitConv, 2); - tableBody(7, iZone) = RealToStr(Zone(iZone).ExtGrossGroundWallArea * m2_unitConv, 2); - tableBody(8, iZone) = RealToStr(zoneGlassArea(iZone) * m2_unitConv, 2); - tableBody(9, iZone) = RealToStr(zoneOpeningArea(iZone) * m2_unitConv, 2); + tableBody(6, iZone) = RealToStr(Zone(iZone).ExtGrossWallArea * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(7, iZone) = RealToStr(Zone(iZone).ExtGrossGroundWallArea * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(8, iZone) = RealToStr(zoneGlassArea(iZone) * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(9, iZone) = RealToStr(zoneOpeningArea(iZone) * state.dataOutRptTab->m2_unitConvWVST, 2); // lighting density totLightPower = 0.0; for (iLight = 1; iLight <= state.dataHeatBal->TotLights; ++iLight) { @@ -11233,7 +11158,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (Zone(iZone).FloorArea > 0) { - tableBody(10, iZone) = RealToStr(Wm2_unitConv * totLightPower / Zone(iZone).FloorArea, 4); + tableBody(10, iZone) = RealToStr(state.dataOutRptTab->m3_unitConv * totLightPower / Zone(iZone).FloorArea, 4); } // people density totNumPeople = 0.0; @@ -11243,7 +11168,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (totNumPeople > 0) { - tableBody(11, iZone) = RealToStr(Zone(iZone).FloorArea * m2_unitConv / totNumPeople, 2); + tableBody(11, iZone) = RealToStr(Zone(iZone).FloorArea * state.dataOutRptTab->m2_unitConvWVST / totNumPeople, 2); } // plug and process density totPlugProcess = 0.0; @@ -11268,7 +11193,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (Zone(iZone).FloorArea > 0) { - tableBody(12, iZone) = RealToStr(totPlugProcess * Wm2_unitConv / Zone(iZone).FloorArea, 4); + tableBody(12, iZone) = RealToStr(totPlugProcess * state.dataOutRptTab->m3_unitConv / Zone(iZone).FloorArea, 4); } // total rows for Total / Not Part of Total @@ -11276,70 +11201,70 @@ namespace EnergyPlus::OutputReportTabular { // If not part of total, goes directly to this row if (!usezoneFloorArea) { - zstArea(notpartTotal) += mult * Zone(iZone).FloorArea; - zstVolume(notpartTotal) += mult * Zone(iZone).Volume; - zstWallArea(notpartTotal) += mult * Zone(iZone).ExtGrossWallArea; - zstUndWallArea(notpartTotal) += mult * Zone(iZone).ExtGrossGroundWallArea; - zstWindowArea(notpartTotal) += mult * zoneGlassArea(iZone); - zstOpeningArea(notpartTotal) += mult * zoneOpeningArea(iZone); - zstLight(notpartTotal) += mult * totLightPower; - zstPeople(notpartTotal) += mult * totNumPeople; - zstPlug(notpartTotal) += mult * totPlugProcess; + state.dataOutRptTab->zstArea(state.dataOutRptTab->notpartTotal) += mult * Zone(iZone).FloorArea; + state.dataOutRptTab->zstVolume(state.dataOutRptTab->notpartTotal) += mult * Zone(iZone).Volume; + state.dataOutRptTab->zstWallArea(state.dataOutRptTab->notpartTotal) += mult * Zone(iZone).ExtGrossWallArea; + state.dataOutRptTab->zstUndWallArea(state.dataOutRptTab->notpartTotal) += mult * Zone(iZone).ExtGrossGroundWallArea; + state.dataOutRptTab->zstWindowArea(state.dataOutRptTab->notpartTotal) += mult * zoneGlassArea(iZone); + state.dataOutRptTab->zstOpeningArea(state.dataOutRptTab->notpartTotal) += mult * zoneOpeningArea(iZone); + state.dataOutRptTab->zstLight(state.dataOutRptTab->notpartTotal) += mult * totLightPower; + state.dataOutRptTab->zstPeople(state.dataOutRptTab->notpartTotal) += mult * totNumPeople; + state.dataOutRptTab->zstPlug(state.dataOutRptTab->notpartTotal) += mult * totPlugProcess; } else { // Add it to the 'Total' - zstArea(grandTotal) += mult * Zone(iZone).FloorArea; - zstVolume(grandTotal) += mult * Zone(iZone).Volume; - zstWallArea(grandTotal) += mult * Zone(iZone).ExtGrossWallArea; - zstUndWallArea(grandTotal) += mult * Zone(iZone).ExtGrossGroundWallArea; - zstWindowArea(grandTotal) += mult * zoneGlassArea(iZone); - zstOpeningArea(grandTotal) += mult * zoneOpeningArea(iZone); - zstLight(grandTotal) += mult * totLightPower; - zstPeople(grandTotal) += mult * totNumPeople; - zstPlug(grandTotal) += mult * totPlugProcess; + state.dataOutRptTab->zstArea(state.dataOutRptTab->grandTotal) += mult * Zone(iZone).FloorArea; + state.dataOutRptTab->zstVolume(state.dataOutRptTab->grandTotal) += mult * Zone(iZone).Volume; + state.dataOutRptTab->zstWallArea(state.dataOutRptTab->grandTotal) += mult * Zone(iZone).ExtGrossWallArea; + state.dataOutRptTab->zstUndWallArea(state.dataOutRptTab->grandTotal) += mult * Zone(iZone).ExtGrossGroundWallArea; + state.dataOutRptTab->zstWindowArea(state.dataOutRptTab->grandTotal) += mult * zoneGlassArea(iZone); + state.dataOutRptTab->zstOpeningArea(state.dataOutRptTab->grandTotal) += mult * zoneOpeningArea(iZone); + state.dataOutRptTab->zstLight(state.dataOutRptTab->grandTotal) += mult * totLightPower; + state.dataOutRptTab->zstPeople(state.dataOutRptTab->grandTotal) += mult * totNumPeople; + state.dataOutRptTab->zstPlug(state.dataOutRptTab->grandTotal) += mult * totPlugProcess; // Subtotal between cond/unconditioned if (zoneIsCond) { - zstArea(condTotal) += mult * Zone(iZone).FloorArea; - zstVolume(condTotal) += mult * Zone(iZone).Volume; - zstWallArea(condTotal) += mult * Zone(iZone).ExtGrossWallArea; - zstUndWallArea(condTotal) += mult * Zone(iZone).ExtGrossGroundWallArea; - zstWindowArea(condTotal) += mult * zoneGlassArea(iZone); - zstOpeningArea(condTotal) += mult * zoneOpeningArea(iZone); - zstLight(condTotal) += mult * totLightPower; - zstPeople(condTotal) += mult * totNumPeople; - zstPlug(condTotal) += mult * totPlugProcess; + state.dataOutRptTab->zstArea(state.dataOutRptTab->condTotal) += mult * Zone(iZone).FloorArea; + state.dataOutRptTab->zstVolume(state.dataOutRptTab->condTotal) += mult * Zone(iZone).Volume; + state.dataOutRptTab->zstWallArea(state.dataOutRptTab->condTotal) += mult * Zone(iZone).ExtGrossWallArea; + state.dataOutRptTab->zstUndWallArea(state.dataOutRptTab->condTotal) += mult * Zone(iZone).ExtGrossGroundWallArea; + state.dataOutRptTab->zstWindowArea(state.dataOutRptTab->condTotal) += mult * zoneGlassArea(iZone); + state.dataOutRptTab->zstOpeningArea(state.dataOutRptTab->condTotal) += mult * zoneOpeningArea(iZone); + state.dataOutRptTab->zstLight(state.dataOutRptTab->condTotal) += mult * totLightPower; + state.dataOutRptTab->zstPeople(state.dataOutRptTab->condTotal) += mult * totNumPeople; + state.dataOutRptTab->zstPlug(state.dataOutRptTab->condTotal) += mult * totPlugProcess; } else if (!zoneIsCond) { - zstArea(uncondTotal) += mult * Zone(iZone).FloorArea; - zstVolume(uncondTotal) += mult * Zone(iZone).Volume; - zstWallArea(uncondTotal) += mult * Zone(iZone).ExtGrossWallArea; - zstUndWallArea(uncondTotal) += mult * Zone(iZone).ExtGrossGroundWallArea; - zstWindowArea(uncondTotal) += mult * zoneGlassArea(iZone); - zstOpeningArea(uncondTotal) += mult * zoneOpeningArea(iZone); - zstLight(uncondTotal) += mult * totLightPower; - zstPeople(uncondTotal) += mult * totNumPeople; - zstPlug(uncondTotal) += mult * totPlugProcess; + state.dataOutRptTab->zstArea(state.dataOutRptTab->uncondTotal) += mult * Zone(iZone).FloorArea; + state.dataOutRptTab->zstVolume(state.dataOutRptTab->uncondTotal) += mult * Zone(iZone).Volume; + state.dataOutRptTab->zstWallArea(state.dataOutRptTab->uncondTotal) += mult * Zone(iZone).ExtGrossWallArea; + state.dataOutRptTab->zstUndWallArea(state.dataOutRptTab->uncondTotal) += mult * Zone(iZone).ExtGrossGroundWallArea; + state.dataOutRptTab->zstWindowArea(state.dataOutRptTab->uncondTotal) += mult * zoneGlassArea(iZone); + state.dataOutRptTab->zstOpeningArea(state.dataOutRptTab->uncondTotal) += mult * zoneOpeningArea(iZone); + state.dataOutRptTab->zstLight(state.dataOutRptTab->uncondTotal) += mult * totLightPower; + state.dataOutRptTab->zstPeople(state.dataOutRptTab->uncondTotal) += mult * totNumPeople; + state.dataOutRptTab->zstPlug(state.dataOutRptTab->uncondTotal) += mult * totPlugProcess; } } } for (iTotal = 1; iTotal <= 4; ++iTotal) { - tableBody(1, state.dataGlobal->NumOfZones + iTotal) = RealToStr(zstArea(iTotal) * m2_unitConv, 2); - tableBody(4, state.dataGlobal->NumOfZones + iTotal) = RealToStr(zstVolume(iTotal) * m3_unitConv, 2); - tableBody(6, state.dataGlobal->NumOfZones + iTotal) = RealToStr(zstWallArea(iTotal) * m2_unitConv, 2); - tableBody(7, state.dataGlobal->NumOfZones + iTotal) = RealToStr(zstUndWallArea(iTotal) * m2_unitConv, 2); - tableBody(8, state.dataGlobal->NumOfZones + iTotal) = RealToStr(zstWindowArea(iTotal) * m2_unitConv, 2); - tableBody(9, state.dataGlobal->NumOfZones + iTotal) = RealToStr(zstOpeningArea(iTotal) * m2_unitConv, 2); - if (zstArea(iTotal) != 0) { - tableBody(10, state.dataGlobal->NumOfZones + iTotal) = RealToStr(zstLight(iTotal) * Wm2_unitConv / zstArea(iTotal), 4); - tableBody(12, state.dataGlobal->NumOfZones + iTotal) = RealToStr(zstPlug(iTotal) * Wm2_unitConv / zstArea(iTotal), 4); + tableBody(1, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstArea(iTotal) * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(4, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstVolume(iTotal) * state.dataOutRptTab->m3_unitConv, 2); + tableBody(6, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstWallArea(iTotal) * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(7, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstUndWallArea(iTotal) * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(8, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstWindowArea(iTotal) * state.dataOutRptTab->m2_unitConvWVST, 2); + tableBody(9, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstOpeningArea(iTotal) * state.dataOutRptTab->m2_unitConvWVST, 2); + if (state.dataOutRptTab->zstArea(iTotal) != 0) { + tableBody(10, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstLight(iTotal) * state.dataOutRptTab->m3_unitConv / state.dataOutRptTab->zstArea(iTotal), 4); + tableBody(12, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstPlug(iTotal) * state.dataOutRptTab->m3_unitConv / state.dataOutRptTab->zstArea(iTotal), 4); } - if (zstPeople(iTotal) != 0) { - tableBody(11, state.dataGlobal->NumOfZones + iTotal) = RealToStr(zstArea(iTotal) * m2_unitConv / zstPeople(iTotal), 2); + if (state.dataOutRptTab->zstPeople(iTotal) != 0) { + tableBody(11, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstArea(iTotal) * state.dataOutRptTab->m2_unitConvWVST / state.dataOutRptTab->zstPeople(iTotal), 2); } } if (produceTabular) { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedSutSpArea, "Totals", zstArea(grandTotal), 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedSutOcArea, "Totals", zstArea(condTotal), 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedSutUnArea, "Totals", zstArea(uncondTotal), 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedSutSpArea, "Totals", state.dataOutRptTab->zstArea(state.dataOutRptTab->grandTotal), 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedSutOcArea, "Totals", state.dataOutRptTab->zstArea(state.dataOutRptTab->condTotal), 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedSutUnArea, "Totals", state.dataOutRptTab->zstArea(state.dataOutRptTab->uncondTotal), 2); } if (produceTabular) { @@ -12002,9 +11927,6 @@ namespace EnergyPlus::OutputReportTabular { int jUnique; static std::string curColHeadWithSI; static std::string curColHead; - static int indexUnitConv(0); - static Real64 curValueSI(0.0); - static Real64 curValue(0.0); auto &ort(state.dataOutRptTab); if (ort->displayComponentSizing) { @@ -12107,8 +12029,8 @@ namespace EnergyPlus::OutputReportTabular { // do the unit conversions curColHeadWithSI = uniqueDesc(jUnique); if (unitsStyle_cur == iUnitsStyle::InchPound) { - LookupSItoIP(state, curColHeadWithSI, indexUnitConv, curColHead); - colUnitConv(jUnique) = indexUnitConv; + LookupSItoIP(state, curColHeadWithSI, state.dataOutRptTab->indexUnitConvWCS, curColHead); + colUnitConv(jUnique) = state.dataOutRptTab->indexUnitConvWCS; } else { curColHead = curColHeadWithSI; colUnitConv(jUnique) = 0; @@ -12139,20 +12061,20 @@ namespace EnergyPlus::OutputReportTabular { } } if ((foundDesc >= 1) && (foundObj >= 1)) { - curValueSI = state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).valField; + state.dataOutRptTab->curValueSIWCS = state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).valField; if (unitsStyle_cur == iUnitsStyle::InchPound) { if (colUnitConv(foundDesc) != 0) { - curValue = ConvertIP(state, colUnitConv(foundDesc), curValueSI); + state.dataOutRptTab->curValueWCS = ConvertIP(state, colUnitConv(foundDesc), state.dataOutRptTab->curValueSIWCS); } else { - curValue = curValueSI; + state.dataOutRptTab->curValueWCS = state.dataOutRptTab->curValueSIWCS; } } else { - curValue = curValueSI; + state.dataOutRptTab->curValueWCS = state.dataOutRptTab->curValueSIWCS; } - if (std::abs(curValue) >= 1.0) { - tableBody(foundDesc, foundObj) = RealToStr(curValue, 2); + if (std::abs(state.dataOutRptTab->curValueWCS) >= 1.0) { + tableBody(foundDesc, foundObj) = RealToStr(state.dataOutRptTab->curValueWCS, 2); } else { - tableBody(foundDesc, foundObj) = RealToStr(curValue, 6); + tableBody(foundDesc, foundObj) = RealToStr(state.dataOutRptTab->curValueWCS, 6); } state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).written = true; } @@ -12710,61 +12632,55 @@ namespace EnergyPlus::OutputReportTabular { // absorbed by the surface. // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static int ZoneNum(0); - static int SurfNum(0); - static int TimeStep(0); - static int TimeOfPulse(0); - static int CoolDesSelected(0); // design day selected for cooling - static int HeatDesSelected(0); // design day selected for heating int i; Real64 diff; auto &ort(state.dataOutRptTab); auto &Zone(state.dataHeatBal->Zone); - for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - ZoneNum = state.dataSurface->Surface(SurfNum).Zone; - if (ZoneNum == 0) continue; - if (!state.dataZoneEquip->ZoneEquipConfig(ZoneNum).IsControlled) continue; - CoolDesSelected = state.dataSize->CalcFinalZoneSizing(ZoneNum).CoolDDNum; + for (state.dataOutRptTab->SurfNumCLCDC = 1; state.dataOutRptTab->SurfNumCLCDC <= state.dataSurface->TotSurfaces; ++state.dataOutRptTab->SurfNumCLCDC) { + state.dataOutRptTab->ZoneNumCLCDC = state.dataSurface->Surface(state.dataOutRptTab->SurfNumCLCDC).Zone; + if (state.dataOutRptTab->ZoneNumCLCDC == 0) continue; + if (!state.dataZoneEquip->ZoneEquipConfig(state.dataOutRptTab->ZoneNumCLCDC).IsControlled) continue; + state.dataOutRptTab->CoolDesSelectedCLCDC = state.dataSize->CalcFinalZoneSizing(state.dataOutRptTab->ZoneNumCLCDC).CoolDDNum; // loop over timesteps after pulse occurred - if (CoolDesSelected != 0) { - TimeOfPulse = ort->radiantPulseTimestep(CoolDesSelected, ZoneNum); + if (state.dataOutRptTab->CoolDesSelectedCLCDC != 0) { + state.dataOutRptTab->TimeOfPulseCLCDC = ort->radiantPulseTimestep(state.dataOutRptTab->CoolDesSelectedCLCDC, state.dataOutRptTab->ZoneNumCLCDC); // if the CoolDesSelected time is on a different day than // when the pulse occurred, need to scan back and find when // the pulse occurred. - if (TimeOfPulse == 0) { - for (i = CoolDesSelected; i >= 1; --i) { - TimeOfPulse = ort->radiantPulseTimestep(i, ZoneNum); - if (TimeOfPulse != 0) break; + if (state.dataOutRptTab->TimeOfPulseCLCDC == 0) { + for (i = state.dataOutRptTab->CoolDesSelectedCLCDC; i >= 1; --i) { + state.dataOutRptTab->TimeOfPulseCLCDC = ort->radiantPulseTimestep(i, state.dataOutRptTab->ZoneNumCLCDC); + if (state.dataOutRptTab->TimeOfPulseCLCDC != 0) break; } } - if (TimeOfPulse == 0) TimeOfPulse = 1; - for (TimeStep = TimeOfPulse; TimeStep <= state.dataGlobal->NumOfTimeStepInHour * 24; ++TimeStep) { - if (ort->radiantPulseReceived(CoolDesSelected, SurfNum) != 0.0) { - diff = ort->loadConvectedWithPulse(CoolDesSelected, TimeStep, SurfNum) - ort->loadConvectedNormal(CoolDesSelected, TimeStep, SurfNum); - ort->decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / ort->radiantPulseReceived(CoolDesSelected, SurfNum); + if (state.dataOutRptTab->TimeOfPulseCLCDC == 0) state.dataOutRptTab->TimeOfPulseCLCDC = 1; + for (state.dataOutRptTab->TimeStepCLCDC = state.dataOutRptTab->TimeOfPulseCLCDC; state.dataOutRptTab->TimeStepCLCDC <= state.dataGlobal->NumOfTimeStepInHour * 24; ++state.dataOutRptTab->TimeStepCLCDC) { + if (ort->radiantPulseReceived(state.dataOutRptTab->CoolDesSelectedCLCDC, state.dataOutRptTab->SurfNumCLCDC) != 0.0) { + diff = ort->loadConvectedWithPulse(state.dataOutRptTab->CoolDesSelectedCLCDC, state.dataOutRptTab->TimeStepCLCDC, state.dataOutRptTab->SurfNumCLCDC) - ort->loadConvectedNormal(state.dataOutRptTab->CoolDesSelectedCLCDC, state.dataOutRptTab->TimeStepCLCDC, state.dataOutRptTab->SurfNumCLCDC); + ort->decayCurveCool(state.dataOutRptTab->TimeStepCLCDC - state.dataOutRptTab->TimeOfPulseCLCDC + 1, state.dataOutRptTab->SurfNumCLCDC) = -diff / ort->radiantPulseReceived(state.dataOutRptTab->CoolDesSelectedCLCDC, state.dataOutRptTab->SurfNumCLCDC); } else { - ort->decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; + ort->decayCurveCool(state.dataOutRptTab->TimeStepCLCDC - state.dataOutRptTab->TimeOfPulseCLCDC + 1, state.dataOutRptTab->SurfNumCLCDC) = 0.0; } } } - HeatDesSelected = state.dataSize->CalcFinalZoneSizing(ZoneNum).HeatDDNum; - if (HeatDesSelected != 0) { - TimeOfPulse = ort->radiantPulseTimestep(HeatDesSelected, ZoneNum); + state.dataOutRptTab->HeatDesSelectedCLCDC = state.dataSize->CalcFinalZoneSizing(state.dataOutRptTab->ZoneNumCLCDC).HeatDDNum; + if (state.dataOutRptTab->HeatDesSelectedCLCDC != 0) { + state.dataOutRptTab->TimeOfPulseCLCDC = ort->radiantPulseTimestep(state.dataOutRptTab->HeatDesSelectedCLCDC, state.dataOutRptTab->ZoneNumCLCDC); // scan back to the day that the heating pulse occurs, if necessary - if (TimeOfPulse == 0) { - for (i = HeatDesSelected; i >= 1; --i) { - TimeOfPulse = ort->radiantPulseTimestep(i, ZoneNum); - if (TimeOfPulse != 0) break; + if (state.dataOutRptTab->TimeOfPulseCLCDC == 0) { + for (i = state.dataOutRptTab->HeatDesSelectedCLCDC; i >= 1; --i) { + state.dataOutRptTab->TimeOfPulseCLCDC = ort->radiantPulseTimestep(i, state.dataOutRptTab->ZoneNumCLCDC); + if (state.dataOutRptTab->TimeOfPulseCLCDC != 0) break; } } - if (TimeOfPulse == 0) TimeOfPulse = 1; - for (TimeStep = TimeOfPulse; TimeStep <= state.dataGlobal->NumOfTimeStepInHour * 24; ++TimeStep) { - if (ort->radiantPulseReceived(HeatDesSelected, SurfNum) != 0.0) { - diff = ort->loadConvectedWithPulse(HeatDesSelected, TimeStep, SurfNum) - ort->loadConvectedNormal(HeatDesSelected, TimeStep, SurfNum); - ort->decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / ort->radiantPulseReceived(HeatDesSelected, SurfNum); + if (state.dataOutRptTab->TimeOfPulseCLCDC == 0) state.dataOutRptTab->TimeOfPulseCLCDC = 1; + for (state.dataOutRptTab->TimeStepCLCDC = state.dataOutRptTab->TimeOfPulseCLCDC; state.dataOutRptTab->TimeStepCLCDC <= state.dataGlobal->NumOfTimeStepInHour * 24; ++state.dataOutRptTab->TimeStepCLCDC) { + if (ort->radiantPulseReceived(state.dataOutRptTab->HeatDesSelectedCLCDC, state.dataOutRptTab->SurfNumCLCDC) != 0.0) { + diff = ort->loadConvectedWithPulse(state.dataOutRptTab->HeatDesSelectedCLCDC, state.dataOutRptTab->TimeStepCLCDC, state.dataOutRptTab->SurfNumCLCDC) - ort->loadConvectedNormal(state.dataOutRptTab->HeatDesSelectedCLCDC, state.dataOutRptTab->TimeStepCLCDC, state.dataOutRptTab->SurfNumCLCDC); + ort->decayCurveHeat(state.dataOutRptTab->TimeStepCLCDC - state.dataOutRptTab->TimeOfPulseCLCDC + 1, state.dataOutRptTab->SurfNumCLCDC) = -diff / ort->radiantPulseReceived(state.dataOutRptTab->HeatDesSelectedCLCDC, state.dataOutRptTab->SurfNumCLCDC); } else { - ort->decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; + ort->decayCurveHeat(state.dataOutRptTab->TimeStepCLCDC - state.dataOutRptTab->TimeOfPulseCLCDC + 1, state.dataOutRptTab->SurfNumCLCDC) = 0.0; } } } @@ -12818,23 +12734,19 @@ namespace EnergyPlus::OutputReportTabular { // Save sequence of values for report during sizing. // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static int iSurf(0); - static int ZoneNum(0); - static int TimeStepInDay(0); - static Array1D_int IntGainTypesTubular(1, {IntGainTypeOf_DaylightingDeviceTubular}); auto &ort(state.dataOutRptTab); if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { - TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - ort->feneCondInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, _) = 0.0; - for (iSurf = 1; iSurf <= state.dataSurface->TotSurfaces; ++iSurf) { - ZoneNum = state.dataSurface->Surface(iSurf).Zone; - if (ZoneNum == 0) continue; - if (state.dataSurface->Surface(iSurf).Class != DataSurfaces::SurfaceClass::Window) continue; + state.dataOutRptTab->TimeStepInDayGCLS = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; + ort->feneCondInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLS, _) = 0.0; + for (state.dataOutRptTab->iSurfGCLS = 1; state.dataOutRptTab->iSurfGCLS <= state.dataSurface->TotSurfaces; ++state.dataOutRptTab->iSurfGCLS) { + state.dataOutRptTab->ZoneNumGCLS = state.dataSurface->Surface(state.dataOutRptTab->iSurfGCLS).Zone; + if (state.dataOutRptTab->ZoneNumGCLS == 0) continue; + if (state.dataSurface->Surface(state.dataOutRptTab->iSurfGCLS).Class != DataSurfaces::SurfaceClass::Window) continue; // IF (.not. ZoneEquipConfig(ZoneNum)%IsControlled) CYCLE - ort->feneCondInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, ZoneNum) += - state.dataSurface->SurfWinGainConvGlazToZoneRep(iSurf) + state.dataSurface->SurfWinGainConvGlazShadGapToZoneRep(iSurf) + state.dataSurface->SurfWinGainConvShadeToZoneRep(iSurf) + - state.dataSurface->SurfWinGainFrameDividerToZoneRep(iSurf); + ort->feneCondInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLS, state.dataOutRptTab->ZoneNumGCLS) += + state.dataSurface->SurfWinGainConvGlazToZoneRep(state.dataOutRptTab->iSurfGCLS) + state.dataSurface->SurfWinGainConvGlazShadGapToZoneRep(state.dataOutRptTab->iSurfGCLS) + state.dataSurface->SurfWinGainConvShadeToZoneRep(state.dataOutRptTab->iSurfGCLS) + + state.dataSurface->SurfWinGainFrameDividerToZoneRep(state.dataOutRptTab->iSurfGCLS); // for now assume zero instant solar - may change related // to how blinds and shades absorb solar radiation and // convect that heat that timestep. @@ -12842,8 +12754,8 @@ namespace EnergyPlus::OutputReportTabular { } for (int izone = 1; izone <= state.dataGlobal->NumOfZones; ++izone) { Real64 tubularGain = 0.0; - InternalHeatGains::SumInternalConvectionGainsByTypes(state, izone, IntGainTypesTubular, tubularGain); - ort->feneCondInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, izone) += tubularGain; + InternalHeatGains::SumInternalConvectionGainsByTypes(state, izone, state.dataOutRptTab->IntGainTypesTubularGCLS, tubularGain); + ort->feneCondInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLS, izone) += tubularGain; } } } @@ -12866,56 +12778,54 @@ namespace EnergyPlus::OutputReportTabular { auto & TimeStepSys = state.dataHVACGlobal->TimeStepSys; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static int iZone(0); - static int TimeStepInDay(0); auto &ort(state.dataOutRptTab); if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { - TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - ort->infilInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) = - ((state.dataHeatBal->ZnAirRpt(iZone).InfilHeatGain - state.dataHeatBal->ZnAirRpt(iZone).InfilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone infiltration + state.dataOutRptTab->TimeStepInDayGCLH = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; + for (state.dataOutRptTab->iZoneGCLH = 1; state.dataOutRptTab->iZoneGCLH <= state.dataGlobal->NumOfZones; ++state.dataOutRptTab->iZoneGCLH) { + ort->infilInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) = + ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).InfilHeatGain - state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).InfilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone infiltration if (state.dataAirflowNetwork->SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - ort->infilInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) += - (state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneInfiSenGainW - - state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneInfiSenLossW); // air flow network + ort->infilInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) += + (state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneInfiSenGainW - + state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneInfiSenLossW); // air flow network } - ort->infilLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) = - ((state.dataHeatBal->ZnAirRpt(iZone).InfilLatentGain - state.dataHeatBal->ZnAirRpt(iZone).InfilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone infiltration + ort->infilLatentSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) = + ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).InfilLatentGain - state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).InfilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone infiltration if (state.dataAirflowNetwork->SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - ort->infilLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) += - (state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneInfiLatGainW - - state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneInfiLatLossW); // air flow network + ort->infilLatentSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) += + (state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneInfiLatGainW - + state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneInfiLatLossW); // air flow network } - ort->zoneVentInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) = - ((state.dataHeatBal->ZnAirRpt(iZone).VentilHeatGain - state.dataHeatBal->ZnAirRpt(iZone).VentilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone ventilation + ort->zoneVentInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) = + ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).VentilHeatGain - state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).VentilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone ventilation if (state.dataAirflowNetwork->SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - ort->zoneVentInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) += - (state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneVentSenGainW - - state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneVentSenLossW); // air flow network + ort->zoneVentInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) += + (state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneVentSenGainW - + state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneVentSenLossW); // air flow network } - ort->zoneVentLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) = - ((state.dataHeatBal->ZnAirRpt(iZone).VentilLatentGain - state.dataHeatBal->ZnAirRpt(iZone).VentilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone ventilation + ort->zoneVentLatentSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) = + ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).VentilLatentGain - state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).VentilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone ventilation if (state.dataAirflowNetwork->SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - ort->zoneVentInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) += - (state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneVentLatGainW - - state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneVentLatLossW); // air flow network + ort->zoneVentInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) += + (state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneVentLatGainW - + state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneVentLatLossW); // air flow network } - ort->interZoneMixInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) = - ((state.dataHeatBal->ZnAirRpt(iZone).MixHeatGain - state.dataHeatBal->ZnAirRpt(iZone).MixHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone mixing + ort->interZoneMixInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) = + ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).MixHeatGain - state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).MixHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone mixing if (state.dataAirflowNetwork->SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - ort->interZoneMixInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) += - (state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneMixSenGainW - - state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneMixSenLossW); // air flow network + ort->interZoneMixInstantSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) += + (state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneMixSenGainW - + state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneMixSenLossW); // air flow network } - ort->interZoneMixLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) = - ((state.dataHeatBal->ZnAirRpt(iZone).MixLatentGain - state.dataHeatBal->ZnAirRpt(iZone).MixLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone mixing + ort->interZoneMixLatentSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) = + ((state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).MixLatentGain - state.dataHeatBal->ZnAirRpt(state.dataOutRptTab->iZoneGCLH).MixLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone mixing if (state.dataAirflowNetwork->SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - ort->interZoneMixLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) += - (state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneMixLatGainW - - state.dataAirflowNetwork->AirflowNetworkReportData(iZone).MultiZoneMixLatLossW); // air flow network + ort->interZoneMixLatentSeq(state.dataSize->CurOverallSimDay, state.dataOutRptTab->TimeStepInDayGCLH, state.dataOutRptTab->iZoneGCLH) += + (state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneMixLatGainW - + state.dataAirflowNetwork->AirflowNetworkReportData(state.dataOutRptTab->iZoneGCLH).MultiZoneMixLatLossW); // air flow network } } } @@ -13579,13 +13489,12 @@ namespace EnergyPlus::OutputReportTabular { { // static bool initAdjFenDone(false); moved to anonymous namespace for unit testing - static Array3D_bool adjFenDone; auto &ort(state.dataOutRptTab); auto &Zone(state.dataHeatBal->Zone); if (!ort->initAdjFenDone) { - adjFenDone.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - adjFenDone = false; + state.dataOutRptTab->adjFenDone.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->adjFenDone = false; ort->initAdjFenDone = true; } @@ -13666,9 +13575,9 @@ namespace EnergyPlus::OutputReportTabular { lightDelaySeq(kTimeStep) = lightLWConvIntoZone + lightSWConvIntoZone; feneSolarDelaySeq(kTimeStep) = feneSolarConvIntoZone; // also remove the net radiant component on the instanteous conduction for fenestration - if (!adjFenDone(desDaySelected, kTimeStep, zoneIndex)) { + if (!state.dataOutRptTab->adjFenDone(desDaySelected, kTimeStep, zoneIndex)) { feneCondInstantSeq(desDaySelected, kTimeStep, zoneIndex) -= adjFeneSurfNetRadSeq; - adjFenDone(desDaySelected, kTimeStep, zoneIndex) = true; + state.dataOutRptTab->adjFenDone(desDaySelected, kTimeStep, zoneIndex) = true; } } // for kTimeStep @@ -15693,7 +15602,6 @@ namespace EnergyPlus::OutputReportTabular { int kColumn; int curTable; int curCol; - static Real64 BigNum(0.0); auto &ort(state.dataOutRptTab); for (iInput = 1; iInput <= ort->MonthlyInputCount; ++iInput) { @@ -15704,9 +15612,9 @@ namespace EnergyPlus::OutputReportTabular { ort->MonthlyColumns(curCol).timeStamp = 0; ort->MonthlyColumns(curCol).duration = 0.0; if (ort->MonthlyColumns(curCol).aggType == iAggType::Maximum || ort->MonthlyColumns(curCol).aggType == iAggType::MaximumDuringHoursShown) { - ort->MonthlyColumns(curCol).reslt = -HUGE_(BigNum); + ort->MonthlyColumns(curCol).reslt = -HUGE_(state.dataOutRptTab->BigNumRMG); } else if (ort->MonthlyColumns(curCol).aggType == iAggType::Minimum || ort->MonthlyColumns(curCol).aggType == iAggType::MinimumDuringHoursShown) { - ort->MonthlyColumns(curCol).reslt = HUGE_(BigNum); + ort->MonthlyColumns(curCol).reslt = HUGE_(state.dataOutRptTab->BigNumRMG); } else { ort->MonthlyColumns(curCol).reslt = 0.0; } @@ -17179,20 +17087,18 @@ namespace EnergyPlus::OutputReportTabular { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static int found(0); - static int iUnit(0); auto &ort(state.dataOutRptTab); - for (iUnit = 1; iUnit <= ort->UnitConvSize; ++iUnit) { - if (UtilityRoutines::SameString(ort->UnitConv(iUnit).siName, SIunit)) { - if (UtilityRoutines::SameString(ort->UnitConv(iUnit).ipName, IPunit)) { - found = iUnit; + for (state.dataOutRptTab->iUnitGsum = 1; state.dataOutRptTab->iUnitGsum <= ort->UnitConvSize; ++state.dataOutRptTab->iUnitGsum) { + if (UtilityRoutines::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsum).siName, SIunit)) { + if (UtilityRoutines::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsum).ipName, IPunit)) { + state.dataOutRptTab->foundGsum = state.dataOutRptTab->iUnitGsum; break; } } } - if (found != 0) { - getSpecificUnitMultiplier = ort->UnitConv(found).mult; + if (state.dataOutRptTab->foundGsum != 0) { + getSpecificUnitMultiplier = ort->UnitConv(state.dataOutRptTab->foundGsum).mult; } else { ShowWarningError(state, "Unable to find a unit conversion from " + SIunit + " to " + IPunit); ShowContinueError(state, "Applying default conversion factor of 1.0"); @@ -17295,20 +17201,18 @@ namespace EnergyPlus::OutputReportTabular { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static int found(0); - static int iUnit(0); auto &ort(state.dataOutRptTab); - for (iUnit = 1; iUnit <= ort->UnitConvSize; ++iUnit) { - if (UtilityRoutines::SameString(ort->UnitConv(iUnit).siName, SIunit)) { - if (UtilityRoutines::SameString(ort->UnitConv(iUnit).ipName, IPunit)) { - found = iUnit; + for (state.dataOutRptTab->iUnitGsui = 1; state.dataOutRptTab->iUnitGsui <= ort->UnitConvSize; ++state.dataOutRptTab->iUnitGsui) { + if (UtilityRoutines::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsui).siName, SIunit)) { + if (UtilityRoutines::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsui).ipName, IPunit)) { + state.dataOutRptTab->foundGsui = state.dataOutRptTab->iUnitGsui; break; } } } - if (found != 0) { - getSpecificUnitIndex = found; + if (state.dataOutRptTab->foundGsui != 0) { + getSpecificUnitIndex = state.dataOutRptTab->foundGsui; } else { getSpecificUnitIndex = 0.0; } diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 46e8bf1735c..1bc584a0e62 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -63,6 +63,7 @@ // EnergyPlus Headers #include #include +#include #include #include @@ -1078,6 +1079,101 @@ struct OutputReportTabularData : BaseGlobalStruct { bool initAdjFenDone = false; int numPeopleAdaptive = 0; + Real64 BigNum = 0.0; + bool VarWarning = true; + int ErrCount1 = 0; + Array1D_int MonthlyColumnsTypeOfVar; + Array1D MonthlyColumnsStepType; + Array1D MonthlyColumnsAggType; + Array1D_int MonthlyColumnsVarNum; + Array1D_int MonthlyTablesNumColumns; + int curFirstColumn = 0; + int iZoneGHGR = 0; + int iRadiantGHGR = 0; + int iunitGHGR = 0; + int curZoneGHGR = 0; + Real64 eqpSensGHGR = 0.0; + Real64 totalGHGR = 0.0; // the following arrays store the radiant total for each timestep + Array1D radiantHeat; + Array1D radiantCool; + Array1D ATUHeat; + Array1D ATUCool; + int timestepTimeStampGHGR = 0; + Real64 bldgHtPk = 0.0; + Real64 bldgClPk = 0.0; + Real64 timeStepRatio = 0.0; + Real64 totalVolume = 0.0; + int numUncondZones = 0; + int numCondZones = 0; + Real64 HrsPerWeek = 0.0; // sensible heat gain report totals + Real64 totalZoneEqHt = 0.0; + Real64 totalZoneEqCl = 0.0; + Real64 totalHvacATUHt = 0.0; + Real64 totalHvacATUCl = 0.0; + Real64 totalSurfHt = 0.0; + Real64 totalSurfCl = 0.0; + Real64 totalPeoplAdd = 0.0; + Real64 totalLiteAdd = 0.0; + Real64 totalEquipAdd = 0.0; + Real64 totalWindAdd = 0.0; + Real64 totalIzaAdd = 0.0; + Real64 totalInfilAdd = 0.0; + Real64 totalOtherAdd = 0.0; + Real64 totalEquipRem = 0.0; + Real64 totalWindRem = 0.0; + Real64 totalIzaRem = 0.0; + Real64 totalInfilRem = 0.0; + Real64 totalOtherRem = 0.0; + Real64 curConversionOffset = 0.0; + Real64 leedSiteIntLite = 0.0; + Real64 leedSiteSpHeat = 0.0; + Real64 leedSiteSpCool = 0.0; + Real64 leedSiteFanInt = 0.0; + Real64 leedSiteSrvWatr = 0.0; + Real64 leedSiteRecept = 0.0; + Real64 leedSiteTotal = 0.0; + Real64 m2_unitConv = 0.0; + int unitConvIndexWCCT = 0; + int grandTotal = 1; + int condTotal = 2; + int uncondTotal = 3; + int notpartTotal = 4; + int unitConvIndexWVST = 0; + Real64 m_unitConv = 0.0; + Real64 m2_unitConvWVST = 0.0; + Real64 m3_unitConv = 0.0; + Real64 Wm2_unitConv = 0.0; + Array1D zstArea = Array1D(4); + Array1D zstVolume = Array1D(4); + Array1D zstWallArea = Array1D(4); + Array1D zstUndWallArea = Array1D(4); + Array1D zstWindowArea = Array1D(4); + Array1D zstOpeningArea = Array1D(4); + Array1D zstLight = Array1D(4); + Array1D zstPeople = Array1D(4); + Array1D zstPlug = Array1D(4); + int indexUnitConvWCS = 0; + Real64 curValueSIWCS = 0.0; + Real64 curValueWCS = 0.0; + int ZoneNumCLCDC = 0; + int SurfNumCLCDC = 0; + int TimeStepCLCDC = 0; + int TimeOfPulseCLCDC = 0; + int CoolDesSelectedCLCDC = 0; // design day selected for cooling + int HeatDesSelectedCLCDC = 0; // design day selected for heating + int iSurfGCLS = 0; + int ZoneNumGCLS = 0; + int TimeStepInDayGCLS = 0; + int iZoneGCLH = 0; + int TimeStepInDayGCLH = 0; + Array1D_int IntGainTypesTubularGCLS = Array1D_int(1, {DataHeatBalance::IntGainTypeOf_DaylightingDeviceTubular}); + Array3D_bool adjFenDone; + Real64 BigNumRMG = 0.0; + int foundGsui = 0; + int iUnitGsui = 0; + int foundGsum = 0; + int iUnitGsum = 0; + void clear_state() override { this->unitsStyle = OutputReportTabular::iUnitsStyle::None; @@ -1274,6 +1370,103 @@ struct OutputReportTabularData : BaseGlobalStruct { this->AllocateLoadComponentArraysDoAllocate = true; this->initAdjFenDone = false; this->numPeopleAdaptive = 0; + + this->BigNum = 0.0; + this->VarWarning = true; + this->ErrCount1 = 0; + this->MonthlyColumnsTypeOfVar.clear(); + this->MonthlyColumnsStepType.clear(); + this->MonthlyColumnsAggType.clear(); + this->MonthlyColumnsVarNum.clear(); + this->MonthlyTablesNumColumns.clear(); + this->curFirstColumn = 0; + this->iZoneGHGR = 0; + this->iRadiantGHGR = 0; + this->iunitGHGR = 0; + this->curZoneGHGR = 0; + this->eqpSensGHGR = 0.0; + this->totalGHGR = 0.0; + // the following arrays store the radiant total for each timestep + this->radiantHeat.clear(); + this->radiantCool.clear(); + this->ATUHeat.clear(); + this->ATUCool.clear(); + this->timestepTimeStampGHGR = 0; + this->bldgHtPk = 0.0; + this->bldgClPk = 0.0; + this->timeStepRatio = 0.0; + this->totalVolume = 0.0; + this->numUncondZones = 0; + this->numCondZones = 0; + this->HrsPerWeek = 0.0; + // sensible heat gain report totals + this->totalZoneEqHt = 0.0; + this->totalZoneEqCl = 0.0; + this->totalHvacATUHt = 0.0; + this->totalHvacATUCl = 0.0; + this->totalSurfHt = 0.0; + this->totalSurfCl = 0.0; + this->totalPeoplAdd = 0.0; + this->totalLiteAdd = 0.0; + this->totalEquipAdd = 0.0; + this->totalWindAdd = 0.0; + this->totalIzaAdd = 0.0; + this->totalInfilAdd = 0.0; + this->totalOtherAdd = 0.0; + this->totalEquipRem = 0.0; + this->totalWindRem = 0.0; + this->totalIzaRem = 0.0; + this->totalInfilRem = 0.0; + this->totalOtherRem = 0.0; + this->curConversionOffset = 0.0; + this->leedSiteIntLite = 0.0; + this->leedSiteSpHeat = 0.0; + this->leedSiteSpCool = 0.0; + this->leedSiteFanInt = 0.0; + this->leedSiteSrvWatr = 0.0; + this->leedSiteRecept = 0.0; + this->leedSiteTotal = 0.0; + this->m2_unitConv = 0.0; + this->unitConvIndexWCCT = 0; + this->grandTotal = 1; + this->condTotal = 2; + this->uncondTotal = 3; + this->notpartTotal = 4; + this->unitConvIndexWVST = 0; + this->m_unitConv = 0.0; + this->m2_unitConvWVST = 0.0; + this->m3_unitConv = 0.0; + this->Wm2_unitConv = 0.0; + this->zstArea.clear(); + this->zstVolume.clear(); + this->zstWallArea.clear(); + this->zstUndWallArea.clear(); + this->zstWindowArea.clear(); + this->zstOpeningArea.clear(); + this->zstLight.clear(); + this->zstPeople.clear(); + this->zstPlug.clear(); + this->indexUnitConvWCS = 0; + this->curValueSIWCS = 0.0; + this->curValueWCS = 0.0; + this->ZoneNumCLCDC = 0; + this->SurfNumCLCDC = 0; + this->TimeStepCLCDC = 0; + this->TimeOfPulseCLCDC = 0; + this->CoolDesSelectedCLCDC = 0; // design day selected for cooling + this->HeatDesSelectedCLCDC = 0; // design day selected for heating + this->iSurfGCLS = 0; + this->ZoneNumGCLS = 0; + this->TimeStepInDayGCLS = 0; + this->iZoneGCLH = 0; + this->TimeStepInDayGCLH = 0; + this->IntGainTypesTubularGCLS.clear(); + this->adjFenDone.clear(); + this->BigNumRMG = 0.0; + this->foundGsui = 0; + this->iUnitGsui = 0; + this->foundGsum = 0; + this->iUnitGsum = 0; } }; From 58c2ce94a6764e6dd82237322c315ca42bb00606 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Wed, 24 Mar 2021 12:47:47 -0600 Subject: [PATCH 04/21] broken build --- src/EnergyPlus/Data/CommonIncludes.hh | 1 + src/EnergyPlus/Data/EnergyPlusData.cc | 1 + src/EnergyPlus/Data/EnergyPlusData.hh | 2 + src/EnergyPlus/ThermalISO15099Calc.cc | 728 ++++++++++++-------------- src/EnergyPlus/ThermalISO15099Calc.hh | 181 ++++++- 5 files changed, 487 insertions(+), 426 deletions(-) diff --git a/src/EnergyPlus/Data/CommonIncludes.hh b/src/EnergyPlus/Data/CommonIncludes.hh index a3179d8b886..2fbd7a9bdba 100644 --- a/src/EnergyPlus/Data/CommonIncludes.hh +++ b/src/EnergyPlus/Data/CommonIncludes.hh @@ -269,6 +269,7 @@ #include #include #include +#include #include #include #include diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index 6f70893632a..eadd6c5b19c 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -264,6 +264,7 @@ namespace EnergyPlus { this->dataTARCOGOutputs = std::make_unique(); this->dataThermalChimneys = std::make_unique(); this->dataThermalComforts = std::make_unique(); + this->dataThermalISO15099Calc = std::make_unique(); this->dataTimingsData = std::make_unique(); this->dataTranspiredCollector = std::make_unique(); this->dataUCSDShared = std::make_unique(); diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index de823138984..08c40a38af1 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -274,6 +274,7 @@ struct SystemVarsData; struct TARCOGOutputData; struct ThermalChimneysData; struct ThermalComfortsData; +struct ThermalISO15099CalcData; struct TranspiredCollectorData; struct UCSDSharedData; struct UFADManagerData; @@ -523,6 +524,7 @@ struct EnergyPlusData : BaseGlobalStruct { std::unique_ptr dataTARCOGOutputs; std::unique_ptr dataThermalChimneys; std::unique_ptr dataThermalComforts; + std::unique_ptr dataThermalISO15099Calc; std::unique_ptr dataTranspiredCollector; std::unique_ptr dataUCSDShared; std::unique_ptr dataUFADManager; diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index 53c9677bd5c..702b37d9e49 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -52,6 +52,7 @@ #include // EnergyPlus Headers +#include #include #include #include @@ -94,7 +95,7 @@ namespace EnergyPlus::ThermalISO15099Calc { using namespace TARCOGGasses90; using namespace TarcogShading; - void film(Real64 const tex, Real64 const tw, Real64 const ws, int const iwd, Real64 &hcout, int const ibc) + void film(EnergyPlusData &state, Real64 const tex, Real64 const tw, Real64 const ws, int const iwd, Real64 &hcout, int const ibc) { //*********************************************************************** // purpose - to find outdoor film coeff @@ -299,18 +300,6 @@ namespace EnergyPlus::ThermalISO15099Calc { EP_SIZE_CHECK(Keff, maxlay); EP_SIZE_CHECK(ShadeGapKeffConv, MaxGap); - static Array1D thetas(maxlay2); - static Array1D rir(maxlay2); - static Array1D hcgass(maxlay1); - static Array1D hrgass(maxlay1); - static Array1D rs(maxlay3, 0.0); - - // REAL(r64) :: grho(maxgas,3) - static Array1D qs(maxlay3); - static Array1D qvs(maxlay1); - static Array1D LaminateAU(maxlay); - static Array1D sumsolU(maxlay); - static Array1D sol0(maxlay); Real64 shgct_NOSD; Real64 trmout; @@ -325,10 +314,6 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 qc1; Real64 qc2; Real64 qcgg; - static Array1D qcgas(maxlay1); - static Array1D qcgaps(maxlay1); - static Array1D qrgas(maxlay1); - static Array1D qrgaps(maxlay1); Real64 ShadeHcModifiedOut; Real64 ShadeHcModifiedIn; @@ -339,22 +324,6 @@ namespace EnergyPlus::ThermalISO15099Calc { int nlayer_NOSD; Real64 AchievedErrorTolerance_NOSD; int NumOfIter_NOSD; - static Array1D Atop_NOSD(maxlay); - static Array1D Abot_NOSD(maxlay); - static Array1D Al_NOSD(maxlay); - static Array1D Ar_NOSD(maxlay); - static Array1D Ah_NOSD(maxlay); - static Array1D EffectiveOpenness_NOSD(maxlay); - static Array1D SlatThick_NOSD(maxlay); - static Array1D SlatWidth_NOSD(maxlay); - static Array1D SlatAngle_NOSD(maxlay); - static Array1D SlatCond_NOSD(maxlay); - static Array1D SlatSpacing_NOSD(maxlay); - static Array1D SlatCurve_NOSD(maxlay); - static Array1D vvent_NOSD(maxlay1); - static Array1D tvent_NOSD(maxlay1); - static Array1D qv_NOSD(maxlay1); - static Array1D q_NOSD(maxlay3); Real64 hin_NOSD; Real64 flux_NOSD; Real64 hcin_NOSD; @@ -363,61 +332,22 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 hrout_NOSD; Real64 tamb_NOSD; Real64 troom_NOSD; - static Array1D_int LayerType_NOSD(maxlay); Real64 ufactor_NOSD; Real64 sc_NOSD; Real64 hflux_NOSD; Real64 shgc_NOSD; Real64 hout_NOSD; - static Array1D gap_NOSD(maxlay); - static Array1D thick_NOSD(maxlay); - static Array1D scon_NOSD(maxlay); - static Array1D emis_NOSD(maxlay2); - static Array1D rir_NOSD(maxlay2); - static Array1D tir_NOSD(maxlay2); - static Array1D theta_NOSD(maxlay2); - static Array2D frct_NOSD(maxgas, maxlay1); - static Array2D_int iprop_NOSD(maxgas, maxlay1); - static Array1D_int nmix_NOSD(maxlay1); - static Array1D presure_NOSD(maxlay1); - static Array1D hcgas_NOSD(maxlay1); - static Array1D hrgas_NOSD(maxlay1); // REAL(r64) :: rs_NOSD(maxlay3)!,sol(maxlay) - static Array1D LaminateA_NOSD(maxlay); - static Array1D LaminateB_NOSD(maxlay); - static Array1D sumsol_NOSD(maxlay); - static Array1D Ra_NOSD(maxlay); - static Array1D Nu_NOSD(maxlay); Real64 ShadeEmisRatioOut_NOSD; Real64 ShadeEmisRatioIn_NOSD; Real64 ShadeHcRatioOut_NOSD; Real64 ShadeHcRatioIn_NOSD; Real64 ShadeHcModifiedOut_NOSD; Real64 ShadeHcModifiedIn_NOSD; - static Array1D Ebb(maxlay); - static Array1D Ebf(maxlay); - static Array1D Rb(maxlay); - static Array1D Rf(maxlay); - static Array1D Ebbs(maxlay); - static Array1D Ebfs(maxlay); - static Array1D Rbs(maxlay); - static Array1D Rfs(maxlay); - static Array1D Ebb_NOSD(maxlay); - static Array1D Ebf_NOSD(maxlay); - static Array1D Rb_NOSD(maxlay); - static Array1D Rf_NOSD(maxlay); - - static Array1D ShadeGapKeffConv_NOSD(MaxGap); - static Array1D qcgas_NOSD(maxlay1); - static Array1D Keff_NOSD(maxlay1); - static Array1D qrgas_NOSD(maxlay1); - static Array1D_int nslice_NOSD(maxlay); - static Array1D vfreevent_NOSD(maxlay1); int FirstSpecularLayer; int LastSpecularLayer; - static Array1D vfreevent(maxlay1); // cbi...Other variables: Real64 flux; @@ -429,25 +359,6 @@ namespace EnergyPlus::ThermalISO15099Calc { int j; int OriginalIndex; int UnshadedDebug; - static Real64 rtot(0.0); - static Real64 sft(0.0); - static Real64 hcins(0.0); - static Real64 hrins(0.0); - static Real64 hins(0.0); - static Real64 hcouts(0.0); - static Real64 hrouts(0.0); - static Real64 houts(0.0); - static Real64 ufactors(0.0); - static Real64 fluxs(0.0); - static Real64 qeff(0.0); - static Real64 flux_nonsolar(0.0); - - static Array1D Atop_eff(maxlay, 0.0); - static Array1D Abot_eff(maxlay, 0.0); - static Array1D Al_eff(maxlay, 0.0); - static Array1D Ar_eff(maxlay, 0.0); - static Array1D Ah_eff(maxlay, 0.0); - static Array1D EffectiveOpenness(maxlay, 0.0); // Autodesk:Uninit Initialize variables used uninitialized shgc_NOSD = 0.0; // Autodesk:Uninit Force default initialization @@ -495,9 +406,9 @@ namespace EnergyPlus::ThermalISO15099Calc { shgc, ufactor, flux, - LaminateAU, - sumsolU, - sol0, + state.dataThermalISO15099Calc->LaminateAU, + state.dataThermalISO15099Calc->sumsolU, + state.dataThermalISO15099Calc->sol0, hint, houtt, trmout, @@ -505,16 +416,30 @@ namespace EnergyPlus::ThermalISO15099Calc { ebroom, Gout, Gin, - rir, - vfreevent, + state.dataThermalISO15099Calc->rir, + state.dataThermalISO15099Calc->vfreevent, nperr, ErrorMessage ); for (int i = 1; i <= nlayer; ++i) { - EffectiveOpenness(i) = Ah(i) / (width * height); + state.dataThermalISO15099Calc->EffectiveOpenness(i) = Ah(i) / (width * height); } - updateEffectiveMultipliers(nlayer, width, height, Atop, Abot, Al, Ar, Ah, Atop_eff, Abot_eff, Al_eff, Ar_eff, Ah_eff, LayerType, SlatAngle); + updateEffectiveMultipliers(nlayer, + width, + height, + Atop, + Abot, + Al, + Ar, + Ah, + state.dataThermalISO15099Calc->Atop_eff, + state.dataThermalISO15099Calc->Abot_eff, + state.dataThermalISO15099Calc->Al_eff, + state.dataThermalISO15099Calc->Ar_eff, + state.dataThermalISO15099Calc->Ah_eff, + LayerType, + SlatAngle); // No option to take hardcoded variables. All gas coefficients are now passed from outside. // if (GoAhead(nperr)) call propcon90(ISO15099,mgas,xgcon,xgvis,xgcp,xgrho,xwght,nperr) @@ -554,7 +479,8 @@ namespace EnergyPlus::ThermalISO15099Calc { if ((dir > 0.0) || (SHGCCalc == 0)) { // call therm1d to calculate heat flux with solar radiation - therm1d(files, + therm1d(state, + files, nlayer, iwd, tout, @@ -571,7 +497,7 @@ namespace EnergyPlus::ThermalISO15099Calc { ebroom, Gin, tir, - rir, + state.dataThermalISO15099Calc->rir, emis, gap, thick, @@ -611,24 +537,24 @@ namespace EnergyPlus::ThermalISO15099Calc { tamb, troom, ibc, - Atop_eff, - Abot_eff, - Al_eff, - Ar_eff, - Ah_eff, - EffectiveOpenness, + state.dataThermalISO15099Calc->Atop_eff, + state.dataThermalISO15099Calc->Abot_eff, + state.dataThermalISO15099Calc->Al_eff, + state.dataThermalISO15099Calc->Ar_eff, + state.dataThermalISO15099Calc->Ah_eff, + state.dataThermalISO15099Calc->EffectiveOpenness, vvent, tvent, LayerType, Ra, Nu, - vfreevent, - qcgas, - qrgas, - Ebf, - Ebb, - Rf, - Rb, + state.dataThermalISO15099Calc->vfreevent, + state.dataThermalISO15099Calc->qcgas, + state.dataThermalISO15099Calc->qrgas, + state.dataThermalISO15099Calc->Ebf, + state.dataThermalISO15099Calc->Ebb, + state.dataThermalISO15099Calc->Rf, + state.dataThermalISO15099Calc->Rb, ShadeEmisRatioOut, ShadeEmisRatioIn, ShadeHcModifiedOut, @@ -658,37 +584,37 @@ namespace EnergyPlus::ThermalISO15099Calc { // No need to store results in case of non-ufactor run if ((SHGCCalc > 0) && (dir > 0.0)) { - solarISO15099(totsol, rtot, rs, nlayer, asol, sft); - shgct = sft; + solarISO15099(state, totsol, state.dataThermalISO15099Calc->rtot, state.dataThermalISO15099Calc->rs, nlayer, asol, state.dataThermalISO15099Calc->sft); + shgct = state.dataThermalISO15099Calc->sft; shgct_NOSD = 0.0; - hcins = hcin; - hrins = hrin; - hins = hin; - hcouts = hcout; - hrouts = hrout; - houts = hout; - ufactors = ufactor; - fluxs = flux; + state.dataThermalISO15099Calc->hcins = hcin; + state.dataThermalISO15099Calc->hrins = hrin; + state.dataThermalISO15099Calc->hins = hin; + state.dataThermalISO15099Calc->hcouts = hcout; + state.dataThermalISO15099Calc->hrouts = hrout; + state.dataThermalISO15099Calc->houts = hout; + state.dataThermalISO15099Calc->ufactors = ufactor; + state.dataThermalISO15099Calc->fluxs = flux; for (i = 1; i <= nlayer; ++i) { - thetas(2 * i - 1) = theta(2 * i - 1); - thetas(2 * i) = theta(2 * i); - Ebbs(i) = Ebb(i); - Ebfs(i) = Ebf(i); - Rbs(i) = Rb(i); - Rfs(i) = Rf(i); - qs(2 * i - 1) = q(2 * i - 1); - qs(2 * i) = q(2 * i); + state.dataThermalISO15099Calc->thetas(2 * i - 1) = theta(2 * i - 1); + state.dataThermalISO15099Calc->thetas(2 * i) = theta(2 * i); + state.dataThermalISO15099Calc->Ebbs(i) = state.dataThermalISO15099Calc->Ebb(i); + state.dataThermalISO15099Calc->Ebfs(i) = state.dataThermalISO15099Calc->Ebf(i); + state.dataThermalISO15099Calc->Rbs(i) = state.dataThermalISO15099Calc->Rb(i); + state.dataThermalISO15099Calc->Rfs(i) = state.dataThermalISO15099Calc->Rf(i); + state.dataThermalISO15099Calc->qs(2 * i - 1) = q(2 * i - 1); + state.dataThermalISO15099Calc->qs(2 * i) = q(2 * i); // qprims(2*i - 1) = qprim(2*i - 1) // qprims(2*i) = qprim(2*i) - qvs(2 * i - 1) = qv(2 * i - 1); - qvs(2 * i) = qv(2 * i); - hcgass(i) = hcgas(i); - hrgass(i) = hrgas(i); - qrgaps(i) = qrgas(i); - qcgaps(i) = qcgas(i); + state.dataThermalISO15099Calc->qvs(2 * i - 1) = qv(2 * i - 1); + state.dataThermalISO15099Calc->qvs(2 * i) = qv(2 * i); + state.dataThermalISO15099Calc->hcgass(i) = hcgas(i); + state.dataThermalISO15099Calc->hrgass(i) = hrgas(i); + state.dataThermalISO15099Calc->qrgaps(i) = state.dataThermalISO15099Calc->qrgas(i); + state.dataThermalISO15099Calc->qcgaps(i) = state.dataThermalISO15099Calc->qcgas(i); } // CHECK THIS! - qs(2 * nlayer + 1) = q(2 * nlayer + 1); + state.dataThermalISO15099Calc->qs(2 * nlayer + 1) = q(2 * nlayer + 1); } // if (UFactorCalc.gt.0) then } @@ -721,7 +647,7 @@ namespace EnergyPlus::ThermalISO15099Calc { ebroom, Gin, tir, - rir, + state.dataThermalISO15099Calc->rir, emis, gap, thick, @@ -761,24 +687,24 @@ namespace EnergyPlus::ThermalISO15099Calc { tamb, troom, ibc, - Atop_eff, - Abot_eff, - Al_eff, - Ar_eff, - Ah_eff, - EffectiveOpenness, + state.dataThermalISO15099Calc->Atop_eff, + state.dataThermalISO15099Calc->Abot_eff, + state.dataThermalISO15099Calc->Al_eff, + state.dataThermalISO15099Calc->Ar_eff, + state.dataThermalISO15099Calc->Ah_eff, + state.dataThermalISO15099Calc->EffectiveOpenness, vvent, tvent, LayerType, Ra, Nu, - vfreevent, - qcgas, - qrgas, - Ebf, - Ebb, - Rf, - Rb, + state.dataThermalISO15099Calc->vfreevent, + state.dataThermalISO15099Calc->qcgas, + state.dataThermalISO15099Calc->qrgas, + state.dataThermalISO15099Calc->Ebf, + state.dataThermalISO15099Calc->Ebb, + state.dataThermalISO15099Calc->Rf, + state.dataThermalISO15099Calc->Rb, ShadeEmisRatioOut, ShadeEmisRatioIn, ShadeHcModifiedOut, @@ -822,28 +748,28 @@ namespace EnergyPlus::ThermalISO15099Calc { NeedUnshadedRun = false; // bi...Set outdoor & indoor gas properties: if (NeedUnshadedRun) { - nmix_NOSD(1) = nmix(1); - presure_NOSD(1) = presure(1); - nmix_NOSD(nlayer_NOSD + 1) = nmix(nlayer + 1); - presure_NOSD(nlayer_NOSD + 1) = presure(nlayer + 1); + state.dataThermalISO15099Calc->state.dataThermalISO15099Calc->nmix_NOSD(1) = nmix(1); + state.dataThermalISO15099Calc->presure_NOSD(1) = presure(1); + state.dataThermalISO15099Calc->nmix_NOSD(nlayer_NOSD + 1) = nmix(nlayer + 1); + state.dataThermalISO15099Calc->presure_NOSD(nlayer_NOSD + 1) = presure(nlayer + 1); for (j = 1; j <= nmix(1); ++j) { - iprop_NOSD(j, 1) = iprop(j, 1); - frct_NOSD(j, 1) = frct(j, 1); + state.dataThermalISO15099Calc->iprop_NOSD(j, 1) = iprop(j, 1); + state.dataThermalISO15099Calc->frct_NOSD(j, 1) = frct(j, 1); } for (j = 1; j <= nmix(nlayer_NOSD + 1); ++j) { - iprop_NOSD(j, nlayer_NOSD + 1) = iprop(j, nlayer + 1); - frct_NOSD(j, nlayer_NOSD + 1) = frct(j, nlayer + 1); + state.dataThermalISO15099Calc->iprop_NOSD(j, nlayer_NOSD + 1) = iprop(j, nlayer + 1); + state.dataThermalISO15099Calc->frct_NOSD(j, nlayer_NOSD + 1) = frct(j, nlayer + 1); } for (i = 1; i <= nlayer_NOSD; ++i) { OriginalIndex = FirstSpecularLayer + i - 1; - Atop_NOSD(i) = Atop_eff(OriginalIndex); - Abot_NOSD(i) = Abot_eff(OriginalIndex); - Al_NOSD(i) = Al_eff(OriginalIndex); - Ar_NOSD(i) = Ar_eff(OriginalIndex); - Ah_NOSD(i) = Ah_eff(OriginalIndex); - - SlatThick_NOSD(i) = SlatThick(OriginalIndex); - SlatWidth_NOSD(i) = SlatWidth(OriginalIndex); + state.dataThermalISO15099Calc->Atop_NOSD(i) = state.dataThermalISO15099Calc->Atop_eff(OriginalIndex); + state.dataThermalISO15099Calc->Abot_NOSD(i) = state.dataThermalISO15099Calc->Abot_eff(OriginalIndex); + Al_NOSD(i) = state.dataThermalISO15099Calc->Al_eff(OriginalIndex); + Ar_NOSD(i) = state.dataThermalISO15099Calc->Ar_eff(OriginalIndex); + state.dataThermalISO15099Calc->Ah_NOSD(i) = state.dataThermalISO15099Calc->Ah_eff(OriginalIndex); + + state.dataThermalISO15099Calc->SlatThick_NOSD(i) = SlatThick(OriginalIndex); + state.dataThermalISO15099Calc->SlatWidth_NOSD(i) = SlatWidth(OriginalIndex); SlatAngle_NOSD(i) = SlatAngle(OriginalIndex); SlatCond_NOSD(i) = SlatCond(OriginalIndex); SlatSpacing_NOSD(i) = SlatSpacing(OriginalIndex); @@ -853,32 +779,32 @@ namespace EnergyPlus::ThermalISO15099Calc { // vvent_NOSD // tvent_NOSD - LayerType_NOSD(i) = LayerType(OriginalIndex); + state.dataThermalISO15099Calc->LayerType_NOSD(i) = LayerType(OriginalIndex); - thick_NOSD(i) = thick(OriginalIndex); - scon_NOSD(i) = scon(OriginalIndex); - tir_NOSD(2 * i - 1) = tir(2 * OriginalIndex - 1); - emis_NOSD(2 * i - 1) = emis(2 * OriginalIndex - 1); - emis_NOSD(2 * i) = emis(2 * OriginalIndex); - rir_NOSD(2 * i - 1) = rir(2 * OriginalIndex - 1); - rir_NOSD(2 * i) = rir(2 * OriginalIndex); + state.dataThermalISO15099Calc->thick_NOSD(i) = thick(OriginalIndex); + state.dataThermalISO15099Calc->scon_NOSD(i) = scon(OriginalIndex); + state.dataThermalISO15099Calc->tir_NOSD(2 * i - 1) = tir(2 * OriginalIndex - 1); + state.dataThermalISO15099Calc->emis_NOSD(2 * i - 1) = emis(2 * OriginalIndex - 1); + state.dataThermalISO15099Calc->emis_NOSD(2 * i) = emis(2 * OriginalIndex); + state.dataThermalISO15099Calc->rir_NOSD(2 * i - 1) = state.dataThermalISO15099Calc->rir(2 * OriginalIndex - 1); + state.dataThermalISO15099Calc->rir_NOSD(2 * i) = state.dataThermalISO15099Calc->rir(2 * OriginalIndex); - gap_NOSD(i) = gap(OriginalIndex); + state.dataThermalISO15099Calc->gap_NOSD(i) = gap(OriginalIndex); if (i < nlayer_NOSD) { - nmix_NOSD(i + 1) = nmix(OriginalIndex + 1); - presure_NOSD(i + 1) = presure(OriginalIndex + 1); - for (j = 1; j <= nmix_NOSD(i + 1); ++j) { - iprop_NOSD(j, i + 1) = iprop(j, OriginalIndex + 1); - frct_NOSD(j, i + 1) = frct(j, OriginalIndex + 1); + state.dataThermalISO15099Calc->nmix_NOSD(i + 1) = nmix(OriginalIndex + 1); + state.dataThermalISO15099Calc->presure_NOSD(i + 1) = presure(OriginalIndex + 1); + for (j = 1; j <= state.dataThermalISO15099Calc->nmix_NOSD(i + 1); ++j) { + state.dataThermalISO15099Calc->iprop_NOSD(j, i + 1) = iprop(j, OriginalIndex + 1); + state.dataThermalISO15099Calc->frct_NOSD(j, i + 1) = frct(j, OriginalIndex + 1); } } - LaminateA_NOSD(i) = LaminateA(OriginalIndex); - LaminateB_NOSD(i) = LaminateB(OriginalIndex); - sumsol_NOSD(i) = sumsol(OriginalIndex); + state.dataThermalISO15099Calc->LaminateA_NOSD(i) = LaminateA(OriginalIndex); + state.dataThermalISO15099Calc->LaminateB_NOSD(i) = LaminateB(OriginalIndex); + state.dataThermalISO15099Calc->sumsol_NOSD(i) = sumsol(OriginalIndex); - nslice_NOSD(i) = nslice(OriginalIndex); + state.dataThermalISO15099Calc->nslice_NOSD(i) = nslice(OriginalIndex); } // This is UNSHADED pass - no solar radiation: @@ -920,34 +846,34 @@ namespace EnergyPlus::ThermalISO15099Calc { tilt, totsol, nlayer_NOSD, - LayerType_NOSD, - thick_NOSD, - scon_NOSD, + state.dataThermalISO15099Calc->LayerType_NOSD, + state.dataThermalISO15099Calc->thick_NOSD, + state.dataThermalISO15099Calc->scon_NOSD, asol, - tir_NOSD, - emis_NOSD, - Atop_NOSD, - Abot_NOSD, + state.dataThermalISO15099Calc->tir_NOSD, + state.dataThermalISO15099Calc->emis_NOSD, + state.dataThermalISO15099Calc->Atop_NOSD, + state.dataThermalISO15099Calc->Abot_NOSD, Al_NOSD, Ar_NOSD, - Ah_NOSD, - SlatThick_NOSD, - SlatWidth_NOSD, + state.dataThermalISO15099Calc->Ah_NOSD, + state.dataThermalISO15099Calc->SlatThick_NOSD, + state.dataThermalISO15099Calc->SlatWidth_NOSD, SlatAngle_NOSD, SlatCond_NOSD, SlatSpacing_NOSD, SlatCurve_NOSD, - nslice_NOSD, - LaminateA_NOSD, - LaminateB_NOSD, - sumsol_NOSD, - gap_NOSD, - vvent_NOSD, - tvent_NOSD, - presure_NOSD, - nmix_NOSD, - iprop_NOSD, - frct_NOSD, + state.dataThermalISO15099Calc->nslice_NOSD, + state.dataThermalISO15099Calc->LaminateA_NOSD, + state.dataThermalISO15099Calc->LaminateB_NOSD, + state.dataThermalISO15099Calc->sumsol_NOSD, + state.dataThermalISO15099Calc->gap_NOSD, + state.dataThermalISO15099Calc->vvent_NOSD, + state.dataThermalISO15099Calc->tvent_NOSD, + state.dataThermalISO15099Calc->presure_NOSD, + state.dataThermalISO15099Calc->nmix_NOSD, + state.dataThermalISO15099Calc->iprop_NOSD, + state.dataThermalISO15099Calc->frct_NOSD, xgcon, xgvis, xgcp, @@ -975,21 +901,21 @@ namespace EnergyPlus::ThermalISO15099Calc { trmin, ebroom, Gin, - tir_NOSD, - rir_NOSD, - emis_NOSD, - gap_NOSD, - thick_NOSD, - scon_NOSD, + state.dataThermalISO15099Calc->tir_NOSD, + state.dataThermalISO15099Calc->rir_NOSD, + state.dataThermalISO15099Calc->emis_NOSD, + state.dataThermalISO15099Calc->gap_NOSD, + state.dataThermalISO15099Calc->thick_NOSD, + state.dataThermalISO15099Calc->scon_NOSD, tilt, sol0, height, heightt, width, - iprop_NOSD, - frct_NOSD, - presure_NOSD, - nmix_NOSD, + state.dataThermalISO15099Calc->iprop_NOSD, + state.dataThermalISO15099Calc->frct_NOSD, + state.dataThermalISO15099Calc->presure_NOSD, + state.dataThermalISO15099Calc->nmix_NOSD, xwght, xgcon, xgvis, @@ -1016,20 +942,20 @@ namespace EnergyPlus::ThermalISO15099Calc { tamb_NOSD, troom_NOSD, ibc, - Atop_NOSD, - Abot_NOSD, + state.dataThermalISO15099Calc->Atop_NOSD, + state.dataThermalISO15099Calc->Abot_NOSD, Al_NOSD, Ar_NOSD, - Ah_NOSD, - EffectiveOpenness_NOSD, - vvent_NOSD, - tvent_NOSD, - LayerType_NOSD, + state.dataThermalISO15099Calc->Ah_NOSD, + state.dataThermalISO15099Calc->EffectiveOpenness_NOSD, + state.dataThermalISO15099Calc->vvent_NOSD, + state.dataThermalISO15099Calc->tvent_NOSD, + state.dataThermalISO15099Calc->LayerType_NOSD, Ra_NOSD, Nu_NOSD, - vfreevent_NOSD, + state.dataThermalISO15099Calc->vfreevent_NOSD, qcgas_NOSD, - qrgas_NOSD, + state.dataThermalISO15099Calc->qrgas_NOSD, Ebf_NOSD, Ebb_NOSD, Rf_NOSD, @@ -1064,11 +990,11 @@ namespace EnergyPlus::ThermalISO15099Calc { q_NOSD, qv_NOSD, qcgas_NOSD, - qrgas_NOSD, + state.dataThermalISO15099Calc->qrgas_NOSD, theta_NOSD, - vfreevent_NOSD, - vvent_NOSD, - Keff_NOSD, + state.dataThermalISO15099Calc->vfreevent_NOSD, + state.dataThermalISO15099Calc->vvent_NOSD, + state.dataThermalISO15099Calc->Keff_NOSD, ShadeGapKeffConv_NOSD, troom_NOSD, ufactor_NOSD, @@ -1082,7 +1008,7 @@ namespace EnergyPlus::ThermalISO15099Calc { hrout_NOSD, Ra_NOSD, Nu_NOSD, - LayerType_NOSD, + state.dataThermalISO15099Calc->LayerType_NOSD, Ebf_NOSD, Ebb_NOSD, Rf_NOSD, @@ -1120,8 +1046,8 @@ namespace EnergyPlus::ThermalISO15099Calc { // Keff(i) = gap(i) * qprim(2*i+1) / (theta(2*i+1) - theta(2*i)) if ((i > 1) && (i < nlayer)) { tgg = gap(i - 1) + gap(i) + thick(i); - qc1 = qcgas(i - 1); - qc2 = qcgas(i); + qc1 = state.dataThermalISO15099Calc->qcgas(i - 1); + qc2 = state.dataThermalISO15099Calc->qcgas(i); qcgg = (qc1 + qc2) / 2.0; ShadeGapKeffConv(i) = tgg * qcgg / (theta(2 * i + 1) - theta(2 * i - 2)); } @@ -1136,38 +1062,38 @@ namespace EnergyPlus::ThermalISO15099Calc { flux_nonsolar = flux; if ((SHGCCalc > 0) && (dir > 0.0)) { - shgc = totsol - (fluxs - flux) / dir; + shgc = totsol - (state.dataThermalISO15099Calc->fluxs - flux) / dir; sc = shgc / 0.87; - hcin = hcins; - hrin = hrins; - hin = hins; - hcout = hcouts; - hrout = hrouts; - hout = houts; - flux = fluxs; // <--- ??? + hcin = state.dataThermalISO15099Calc->hcins; + hrin = state.dataThermalISO15099Calc->hrins; + hin = state.dataThermalISO15099Calc->hins; + hcout = state.dataThermalISO15099Calc->hcouts; + hrout = state.dataThermalISO15099Calc->hrouts; + hout = state.dataThermalISO15099Calc->houts; + flux = state.dataThermalISO15099Calc->fluxs; // <--- ??? for (i = 1; i <= nlayer; ++i) { - theta(2 * i - 1) = thetas(2 * i - 1); - theta(2 * i) = thetas(2 * i); - Ebb(i) = Ebbs(i); - Ebf(i) = Ebfs(i); - Rb(i) = Rbs(i); - Rf(i) = Rfs(i); - q(2 * i - 1) = qs(2 * i - 1); - q(2 * i) = qs(2 * i); + theta(2 * i - 1) = state.dataThermalISO15099Calc->thetas(2 * i - 1); + theta(2 * i) = state.dataThermalISO15099Calc->thetas(2 * i); + state.dataThermalISO15099Calc->Ebb(i) = state.dataThermalISO15099Calc->Ebbs(i); + state.dataThermalISO15099Calc->Ebf(i) = state.dataThermalISO15099Calc->Ebfs(i); + state.dataThermalISO15099Calc->Rb(i) = state.dataThermalISO15099Calc->Rbs(i); + state.dataThermalISO15099Calc->Rf(i) = state.dataThermalISO15099Calc->Rfs(i); + q(2 * i - 1) = state.dataThermalISO15099Calc->qs(2 * i - 1); + q(2 * i) = state.dataThermalISO15099Calc->qs(2 * i); // qprim(2*i - 1) = qprims(2*i - 1) // qprim(2*i) = qprims(2*i) - qv(2 * i - 1) = qvs(2 * i - 1); - qv(2 * i) = qvs(2 * i); - hcgas(i) = hcgass(i); - hrgas(i) = hrgass(i); - qcgas(i) = qcgaps(i); - qrgas(i) = qrgaps(i); + qv(2 * i - 1) = state.dataThermalISO15099Calc->qvs(2 * i - 1); + qv(2 * i) = state.dataThermalISO15099Calc->qvs(2 * i); + hcgas(i) = state.dataThermalISO15099Calc->hcgass(i); + hrgas(i) = state.dataThermalISO15099Calc->hrgass(i); + state.dataThermalISO15099Calc->qcgas(i) = state.dataThermalISO15099Calc->qcgaps(i); + state.dataThermalISO15099Calc->qrgas(i) = state.dataThermalISO15099Calc->qrgaps(i); AchievedErrorTolerance = AchievedErrorToleranceSolar; NumOfIter = NumOfIterSolar; } // bi CHECK THIS! - q(2 * nlayer + 1) = qs(2 * nlayer + 1); + q(2 * nlayer + 1) = state.dataThermalISO15099Calc->qs(2 * nlayer + 1); } hflux = flux; // save flux value for output table @@ -1180,10 +1106,10 @@ namespace EnergyPlus::ThermalISO15099Calc { tamb, q, qv, - qcgas, - qrgas, + state.dataThermalISO15099Calc->qcgas, + state.dataThermalISO15099Calc->qrgas, theta, - vfreevent, + state.dataThermalISO15099Calc->vfreevent, vvent, Keff, ShadeGapKeffConv, @@ -1200,10 +1126,10 @@ namespace EnergyPlus::ThermalISO15099Calc { Ra, Nu, LayerType, - Ebf, - Ebb, - Rf, - Rb, + state.dataThermalISO15099Calc->Ebf, + state.dataThermalISO15099Calc->Ebb, + state.dataThermalISO15099Calc->Rf, + state.dataThermalISO15099Calc->Rb, ebsky, Gout, ebroom, @@ -1221,7 +1147,8 @@ namespace EnergyPlus::ThermalISO15099Calc { } // if WriteDebugOutput.eq.true - writing output file } - void therm1d(Files &files, + void therm1d(EnergyPlusData &state, + Files &files, int const nlayer, int const iwd, Real64 &tout, @@ -1238,7 +1165,7 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 &ebroom, Real64 const Gin, const Array1D &tir, - const Array1D &rir, + const Array1D &state.dataThermalISO15099Calc->rir, const Array1D &emis, const Array1D &gap, const Array1D &thick, @@ -1283,19 +1210,19 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D &Al, const Array1D &Ar, const Array1D &Ah, - const Array1D &EffectiveOpenness, + const Array1D &state.dataThermalISO15099Calc->EffectiveOpenness, const Array1D &vvent, const Array1D &tvent, const Array1D_int &LayerType, Array1D &Ra, Array1D &Nu, - Array1D &vfreevent, - Array1D &qcgas, - Array1D &qrgas, - Array1D &Ebf, - Array1D &Ebb, - Array1D &Rf, - Array1D &Rb, + Array1D &state.dataThermalISO15099Calc->vfreevent, + Array1D &state.dataThermalISO15099Calc->qcgas, + Array1D &state.dataThermalISO15099Calc->qrgas, + Array1D &state.dataThermalISO15099Calc->Ebf, + Array1D &state.dataThermalISO15099Calc->Ebb, + Array1D &state.dataThermalISO15099Calc->Rf, + Array1D &state.dataThermalISO15099Calc->Rb, Real64 &ShadeEmisRatioOut, Real64 &ShadeEmisRatioIn, Real64 &ShadeHcModifiedOut, @@ -1355,7 +1282,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // nperr // *Inactives** // wa - window azimuth (degrees, clockwise from south) - // hgas matrix of gap film coefficients + // state.dataThermalISO15099Calc->hgas matrix of gap film coefficients // Locals // Ebb Vector // Ebf Vector @@ -1377,11 +1304,6 @@ namespace EnergyPlus::ThermalISO15099Calc { Array2D a(4 * nlayer, 4 * nlayer); Array1D b(4 * nlayer); - static Array1D hgas(maxlay1); - // REAL(r64) :: hhatv(maxlay3),hcv(maxlay3), Ebgap(maxlay3), Tgap(maxlay1) - static Array1D Tgap(maxlay1); - static Array1D hcgapMod(maxlay1); - static Array1D hcv(maxlay1); // REAL(r64) :: alpha int maxiter; @@ -1449,10 +1371,10 @@ namespace EnergyPlus::ThermalISO15099Calc { TotalIndex = 0; iterationsFinished = false; qv = 0.0; - Ebb = 0.0; - Ebf = 0.0; - Rb = 0.0; - Rf = 0.0; + state.dataThermalISO15099Calc->Ebb = 0.0; + state.dataThermalISO15099Calc->Ebf = 0.0; + state.dataThermalISO15099Calc->Rb = 0.0; + state.dataThermalISO15099Calc->Rf = 0.0; a = 0.0; b = 0.0; @@ -1468,8 +1390,8 @@ namespace EnergyPlus::ThermalISO15099Calc { for (i = 1; i <= nlayer; ++i) { k = 2 * i; - Radiation(k) = Ebb(i); - Radiation(k - 1) = Ebf(i); + Radiation(k) = state.dataThermalISO15099Calc->Ebb(i); + Radiation(k - 1) = state.dataThermalISO15099Calc->Ebf(i); told(k - 1) = 0.0; told(k) = 0.0; } @@ -1489,13 +1411,13 @@ namespace EnergyPlus::ThermalISO15099Calc { // first store results before iterations begin if (saveIterationResults) { storeIterationResults( - files, nlayer, index, theta, trmout, tamb, trmin, troom, ebsky, ebroom, hcin, hcout, hrin, hrout, hin, hout, Ebb, Ebf, Rb, Rf, nperr); + files, nlayer, index, theta, trmout, tamb, trmin, troom, ebsky, ebroom, hcin, hcout, hrin, hrout, hin, hout, state.dataThermalISO15099Calc->Ebb, state.dataThermalISO15099Calc->Ebf, state.dataThermalISO15099Calc->Rb, state.dataThermalISO15099Calc->Rf, nperr); } - Tgap(1) = tout; - Tgap(nlayer + 1) = tind; + state.dataThermalISO15099Calc->Tgap(1) = tout; + state.dataThermalISO15099Calc->Tgap(nlayer + 1) = tind; for (i = 2; i <= nlayer; ++i) { - Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; + state.dataThermalISO15099Calc->Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!! MAIN ITERATION LOOP @@ -1510,11 +1432,11 @@ namespace EnergyPlus::ThermalISO15099Calc { // do i=1,nlayer+1 // if (i == 1) then - // Tgap(i) = tout + // state.dataThermalISO15099Calc->Tgap(i) = tout // else if (i == nlayer+1) then - // Tgap(i) = tind + // state.dataThermalISO15099Calc->Tgap(i) = tind // else - // Tgap(i) = (theta(2*i-2) + theta(2*i-1)) / 2.0d0 + // state.dataThermalISO15099Calc->Tgap(i) = (theta(2*i-2) + theta(2*i-1)) / 2.0d0 // end if // end do @@ -1526,7 +1448,7 @@ namespace EnergyPlus::ThermalISO15099Calc { updateGapTemperature = true; } if (updateGapTemperature) { - Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; + state.dataThermalISO15099Calc->Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; } } @@ -1549,7 +1471,7 @@ namespace EnergyPlus::ThermalISO15099Calc { scon, tilt, theta, - Tgap, + state.dataThermalISO15099Calc->Tgap, Radiation, trmout, trmin, @@ -1565,7 +1487,7 @@ namespace EnergyPlus::ThermalISO15099Calc { SupportPillar, PillarSpacing, PillarRadius, - hgas, + state.dataThermalISO15099Calc->hgas, hcgas, hrgas, hcin, @@ -1593,7 +1515,7 @@ namespace EnergyPlus::ThermalISO15099Calc { gcon, gvis, gcp, - EffectiveOpenness, + state.dataThermalISO15099Calc->EffectiveOpenness, theta, sconScaled, nperr, @@ -1607,19 +1529,19 @@ namespace EnergyPlus::ThermalISO15099Calc { // adjust hhat values // call adjusthhat(SDLayerIndex, ibc, tout, tind, nlayer, theta, wso, wsi, iwd, height, heightt, tilt, & // & thick, gap, hout, hrout, hin, hrin, iprop, frct, presure, nmix, wght, gcon, gvis, gcp, & - // index, SDScalar, Ebf, Ebb, hgas, hhat, nperr, ErrorMessage) + // index, SDScalar, Ebf, Ebb, state.dataThermalISO15099Calc->hgas, hhat, nperr, ErrorMessage) // do i = 1, maxlay3 // hhatv(i) = 0.0d0 // Ebgap(i) = 0.0d0 // qv(i) = 0.0d0 - // hcv(i) = 0.0d0 + // state.dataThermalISO15099Calc->hcv(i) = 0.0d0 // end do - matrixQBalance(nlayer, a, b, sconScaled, hcgas, hcgapMod, asol, qv, hcv, tind, tout, Gin, Gout, theta, tir, rir, emis, edgeGlCorrFac); + matrixQBalance(nlayer, a, b, sconScaled, hcgas, state.dataThermalISO15099Calc->hcgapMod, asol, qv, state.dataThermalISO15099Calc->hcv, tind, tout, Gin, Gout, theta, tir, state.dataThermalISO15099Calc->rir, emis, edgeGlCorrFac); } else { // bi...There are no Venetian layers, or ThermalMod is not CSM, so carry on as usual: shading(theta, gap, - hgas, + state.dataThermalISO15099Calc->hgas, hcgas, hrgas, frct, @@ -1644,17 +1566,17 @@ namespace EnergyPlus::ThermalISO15099Calc { vvent, tvent, LayerType, - Tgap, + state.dataThermalISO15099Calc->Tgap, qv, - hcv, + state.dataThermalISO15099Calc->hcv, nperr, ErrorMessage, - vfreevent); + state.dataThermalISO15099Calc->vfreevent); // exit on error if (!(GoAhead(nperr))) return; - matrixQBalance(nlayer, a, b, sconScaled, hcgas, hcgapMod, asol, qv, hcv, tind, tout, Gin, Gout, theta, tir, rir, emis, edgeGlCorrFac); + matrixQBalance(nlayer, a, b, sconScaled, hcgas, state.dataThermalISO15099Calc->hcgapMod, asol, qv, state.dataThermalISO15099Calc->hcv, tind, tout, Gin, Gout, theta, tir, state.dataThermalISO15099Calc->rir, emis, edgeGlCorrFac); } // end if @@ -1734,11 +1656,11 @@ namespace EnergyPlus::ThermalISO15099Calc { j = 2 * (i - 1); if (updateGapTemperature) { if (i == 1) { - Tgap(1) = tout; + state.dataThermalISO15099Calc->Tgap(1) = tout; } else if (i == (nlayer + 1)) { - Tgap(i) = tind; + state.dataThermalISO15099Calc->Tgap(i) = tind; } else { - Tgap(i) = (theta(j) + theta(j + 1)) / 2; + state.dataThermalISO15099Calc->Tgap(i) = (theta(j) + theta(j + 1)) / 2; } } } @@ -1761,10 +1683,10 @@ namespace EnergyPlus::ThermalISO15099Calc { hrout, hin, hout, - Ebb, - Ebf, - Rb, - Rf, + state.dataThermalISO15099Calc->Ebb, + state.dataThermalISO15099Calc->Ebf, + state.dataThermalISO15099Calc->Rb, + state.dataThermalISO15099Calc->Rf, nperr); } @@ -1843,7 +1765,7 @@ namespace EnergyPlus::ThermalISO15099Calc { } if (updateGapTemperature) { - Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; + state.dataThermalISO15099Calc->Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; } } @@ -1866,7 +1788,7 @@ namespace EnergyPlus::ThermalISO15099Calc { scon, tilt, theta, - Tgap, + state.dataThermalISO15099Calc->Tgap, Radiation, trmout, trmin, @@ -1882,7 +1804,7 @@ namespace EnergyPlus::ThermalISO15099Calc { SupportPillar, PillarSpacing, PillarRadius, - hgas, + state.dataThermalISO15099Calc->hgas, hcgas, hrgas, hcin, @@ -1900,7 +1822,7 @@ namespace EnergyPlus::ThermalISO15099Calc { shading(theta, gap, - hgas, + state.dataThermalISO15099Calc->hgas, hcgas, hrgas, frct, @@ -1925,12 +1847,12 @@ namespace EnergyPlus::ThermalISO15099Calc { vvent, tvent, LayerType, - Tgap, + state.dataThermalISO15099Calc->Tgap, qv, - hcv, + state.dataThermalISO15099Calc->hcv, nperr, ErrorMessage, - vfreevent); + state.dataThermalISO15099Calc->vfreevent); } if (CalcOutcome == CalculationOutcome::Unknown) { @@ -1942,22 +1864,22 @@ namespace EnergyPlus::ThermalISO15099Calc { // if (curEquationsApproach.eq.eaQBalance) then for (i = 1; i <= nlayer; ++i) { k = 2 * i - 1; - Rf(i) = Radiation(k); - Rb(i) = Radiation(k + 1); - Ebf(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(k)); - Ebb(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(k + 1)); + state.dataThermalISO15099Calc->Rf(i) = Radiation(k); + state.dataThermalISO15099Calc->Rb(i) = Radiation(k + 1); + state.dataThermalISO15099Calc->Ebf(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(k)); + state.dataThermalISO15099Calc->Ebb(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(k + 1)); } // end if // Finishing calcs: - resist(nlayer, trmout, tout, trmin, tind, hcgas, hrgas, theta, q, qv, LayerType, thick, scon, ufactor, flux, qcgas, qrgas); + resist(nlayer, trmout, tout, trmin, tind, hcgas, hrgas, theta, q, qv, LayerType, thick, scon, ufactor, flux, state.dataThermalISO15099Calc->qcgas, state.dataThermalISO15099Calc->qrgas); // bi... Set T6-related quantities - ratios for modified epsilon, hc for modelling external SDs: // (using non-solar pass results) if ((dir == 0.0) && (nlayer > 1)) { - qr_gap_out = Rf(2) - Rb(1); - qr_gap_in = Rf(nlayer) - Rb(nlayer - 1); + qr_gap_out = state.dataThermalISO15099Calc->Rf(2) - state.dataThermalISO15099Calc->Rb(1); + qr_gap_in = state.dataThermalISO15099Calc->Rf(nlayer) - state.dataThermalISO15099Calc->Rb(nlayer - 1); if (IsShadingLayer(LayerType(1))) { ShadeEmisRatioOut = qr_gap_out / (emis(3) * DataGlobalConstants::StefanBoltzmann * (pow_4(theta(3)) - pow_4(trmout))); @@ -1977,15 +1899,16 @@ namespace EnergyPlus::ThermalISO15099Calc { } - void guess(Real64 const tout, + void guess(EnergyPlusData &state, + Real64 const tout, Real64 const tind, int const nlayer, const Array1D &gap, const Array1D &thick, Real64 &width, Array1D &theta, - Array1D &Ebb, - Array1D &Ebf, + Array1D &state.dataThermalISO15099Calc->Ebb, + Array1D &state.dataThermalISO15099Calc->Ebf, Array1D &Tgap) { //*********************************************************************** @@ -2012,9 +1935,9 @@ namespace EnergyPlus::ThermalISO15099Calc { EP_SIZE_CHECK(gap, MaxGap); EP_SIZE_CHECK(thick, maxlay); EP_SIZE_CHECK(theta, maxlay2); - EP_SIZE_CHECK(Ebb, maxlay); - EP_SIZE_CHECK(Ebf, maxlay); - EP_SIZE_CHECK(Tgap, maxlay1); + EP_SIZE_CHECK(state.dataThermalISO15099Calc->Ebb, maxlay); + EP_SIZE_CHECK(state.dataThermalISO15099Calc->Ebf, maxlay); + EP_SIZE_CHECK(state.dataThermalISO15099Calc->Tgap, maxlay1); // Locals Array1D x(maxlay2); @@ -2044,22 +1967,23 @@ namespace EnergyPlus::ThermalISO15099Calc { j = 2 * i; theta(j - 1) = tout + x(j - 1) * delta; theta(j) = tout + x(j) * delta; - Ebf(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(j - 1)); - Ebb(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(j)); + state.dataThermalISO15099Calc->Ebf(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(j - 1)); + state.dataThermalISO15099Calc->Ebb(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(j)); } for (i = 1; i <= nlayer + 1; ++i) { if (i == 1) { - Tgap(1) = tout; + state.dataThermalISO15099Calc->Tgap(1) = tout; } else if (i == (nlayer + 1)) { - Tgap(nlayer + 1) = tind; + state.dataThermalISO15099Calc->Tgap(nlayer + 1) = tind; } else { - Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; + state.dataThermalISO15099Calc->Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; } } } - void solarISO15099(Real64 const totsol, Real64 const rtot, const Array1D &rs, int const nlayer, const Array1D &absol, Real64 &sf) + void solarISO15099(EnergyPlusData &state, + Real64 const totsol, Real64 const state.dataThermalISO15099Calc->rtot, const Array1D &state.dataThermalISO15099Calc->rs, int const nlayer, const Array1D &absol, Real64 &sf) { //*********************************************************************** // This subroutine calculates the shading coefficient for a window. @@ -2075,7 +1999,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // sf solar gain of space // Argument array dimensioning - EP_SIZE_CHECK(rs, maxlay3); + EP_SIZE_CHECK(state.dataThermalISO15099Calc->rs, maxlay3); EP_SIZE_CHECK(absol, maxlay); // Locals @@ -2088,23 +2012,24 @@ namespace EnergyPlus::ThermalISO15099Calc { flowin = 0.0; sf = 0.0; - if (rtot == 0.0) { + if (state.dataThermalISO15099Calc->rtot == 0.0) { return; } // evaluate inward flowing fraction of absorbed radiation: - flowin = (rs(1) + 0.5 * rs(2)) / rtot; + flowin = (state.dataThermalISO15099Calc->rs(1) + 0.5 * state.dataThermalISO15099Calc->rs(2)) / state.dataThermalISO15099Calc->rtot; fract = absol(1) * flowin; for (i = 2; i <= nlayer; ++i) { j = 2 * i; - flowin += (0.5 * (rs(j - 2) + rs(j)) + rs(j - 1)) / rtot; + flowin += (0.5 * (state.dataThermalISO15099Calc->rs(j - 2) + state.dataThermalISO15099Calc->rs(j)) + state.dataThermalISO15099Calc->rs(j - 1)) / state.dataThermalISO15099Calc->rtot; fract += absol(i) * flowin; } sf = totsol + fract; // add inward fraction to directly transmitted fraction } - void resist(int const nlayer, + void resist(EnergyPlusData &state, + int const nlayer, Real64 const trmout, Real64 const Tout, Real64 const trmin, @@ -2119,8 +2044,8 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D &scon, Real64 &ufactor, Real64 &flux, - Array1D &qcgas, - Array1D &qrgas) + Array1D &state.dataThermalISO15099Calc->qcgas, + Array1D &state.dataThermalISO15099Calc->qrgas) { //*********************************************************************** // subroutine to calculate total thermal resistance of the glazing system @@ -2136,20 +2061,20 @@ namespace EnergyPlus::ThermalISO15099Calc { // calculate heat flow for external and internal environments and gaps for (i = 1; i <= nlayer + 1; ++i) { if (i == 1) { - qcgas(i) = hcgas(i) * (Theta(2 * i - 1) - Tout); - qrgas(i) = hrgas(i) * (Theta(2 * i - 1) - trmout); - qlayer(2 * i - 1) = qcgas(i) + qrgas(i); - // rs(2*i-1) = 1/hgas(i) + state.dataThermalISO15099Calc->qcgas(i) = hcgas(i) * (Theta(2 * i - 1) - Tout); + state.dataThermalISO15099Calc->qrgas(i) = hrgas(i) * (Theta(2 * i - 1) - trmout); + qlayer(2 * i - 1) = state.dataThermalISO15099Calc->qcgas(i) + state.dataThermalISO15099Calc->qrgas(i); + // rs(2*i-1) = 1/state.dataThermalISO15099Calc->hgas(i) } else if (i == (nlayer + 1)) { - qcgas(i) = hcgas(i) * (tind - Theta(2 * i - 2)); - qrgas(i) = hrgas(i) * (trmin - Theta(2 * i - 2)); - qlayer(2 * i - 1) = qcgas(i) + qrgas(i); - // rs(2*i-1) = 1/hgas(i) + state.dataThermalISO15099Calc->qcgas(i) = hcgas(i) * (tind - Theta(2 * i - 2)); + state.dataThermalISO15099Calc->qrgas(i) = hrgas(i) * (trmin - Theta(2 * i - 2)); + qlayer(2 * i - 1) = state.dataThermalISO15099Calc->qcgas(i) + state.dataThermalISO15099Calc->qrgas(i); + // rs(2*i-1) = 1/state.dataThermalISO15099Calc->hgas(i) } else { - qcgas(i) = hcgas(i) * (Theta(2 * i - 1) - Theta(2 * i - 2)); - qrgas(i) = hrgas(i) * (Theta(2 * i - 1) - Theta(2 * i - 2)); - qlayer(2 * i - 1) = qcgas(i) + qrgas(i); - // rs(2*i-1) = 1/hgas(i) + state.dataThermalISO15099Calc->qcgas(i) = hcgas(i) * (Theta(2 * i - 1) - Theta(2 * i - 2)); + state.dataThermalISO15099Calc->qrgas(i) = hrgas(i) * (Theta(2 * i - 1) - Theta(2 * i - 2)); + qlayer(2 * i - 1) = state.dataThermalISO15099Calc->qcgas(i) + state.dataThermalISO15099Calc->qrgas(i); + // rs(2*i-1) = 1/state.dataThermalISO15099Calc->hgas(i) } } @@ -2170,7 +2095,8 @@ namespace EnergyPlus::ThermalISO15099Calc { } } - void hatter(int const nlayer, + void hatter(EnergyPlusData &state, + int const nlayer, int const iwd, Real64 const tout, Real64 const tind, @@ -2188,7 +2114,7 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D &scon, Real64 const tilt, Array1D &theta, - const Array1D &Tgap, + const Array1D &state.dataThermalISO15099Calc->Tgap, Array1D &Radiation, Real64 const trmout, Real64 const trmin, @@ -2204,7 +2130,7 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D_int &SupportPillar, const Array1D &PillarSpacing, const Array1D &PillarRadius, - Array1D &hgas, + Array1D &state.dataThermalISO15099Calc->hgas, Array1D &hcgas, Array1D &hrgas, Real64 &hcin, @@ -2253,7 +2179,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // nmix vector of number of gasses in a mixture for each gap // Ouputs // hhat vector of all film coefficients (maxlay3) - // hgas vector of gap 'film' coeff. + // state.dataThermalISO15099Calc->hgas vector of gap 'film' coeff. // hcin Indoor convective surface heat transfer coefficient // hcout Outdoor convective heat transfer coeff // hrin Indoor radiative surface heat transfer coefficient @@ -2275,7 +2201,7 @@ namespace EnergyPlus::ThermalISO15099Calc { filmg(tilt, theta, - Tgap, + state.dataThermalISO15099Calc->Tgap, nlayer, height, gap, @@ -2299,7 +2225,7 @@ namespace EnergyPlus::ThermalISO15099Calc { return; } - // this is adding influence of pillar to hgas + // this is adding influence of pillar to state.dataThermalISO15099Calc->hgas filmPillar(SupportPillar, scon, PillarSpacing, PillarRadius, nlayer, gap, hcgas, VacuumMaxGapThickness, nperr, ErrorMessage); if (!(GoAhead(nperr))) { @@ -2317,7 +2243,7 @@ namespace EnergyPlus::ThermalISO15099Calc { hrgas(i) = (Radiation(k) - Radiation(k - 1)) / (theta(k) - theta(k - 1)); } - hgas(i) = hcgas(i) + hrgas(i); + state.dataThermalISO15099Calc->hgas(i) = hcgas(i) + hrgas(i); } // convective indoor film coeff: @@ -2347,7 +2273,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // hrin = sigma * emis(2*nlayer) * (Theta(2*nlayer)**4 - Trmin**4)/(Theta(2*nlayer) - Trmin) // end if hrgas(nlayer + 1) = hrin; - // hgas(nlayer+1) = hcgas(nlayer+1) + hrgas(nlayer+1) + // state.dataThermalISO15099Calc->hgas(nlayer+1) = hcgas(nlayer+1) + hrgas(nlayer+1) troom = (hcin * tind + hrin * trmin) / (hcin + hrin); // convective outdoor film coeff: @@ -2375,11 +2301,12 @@ namespace EnergyPlus::ThermalISO15099Calc { // hrout = sigma * emis(1) * (Theta(1)**4 - Trmout**4)/(Theta(1) - Trmout) // end if hrgas(1) = hrout; - // hgas(1) = hrout + hcout + // state.dataThermalISO15099Calc->hgas(1) = hrout + hcout tamb = (hcout * tout + hrout * trmout) / (hcout + hrout); } - void effectiveLayerCond(int const nlayer, + void effectiveLayerCond(EnergyPlusData &state, + int const nlayer, const Array1D_int &LayerType, // Layer type const Array1D &scon, // Layer thermal conductivity const Array1D &thick, // Layer thickness @@ -2391,15 +2318,14 @@ namespace EnergyPlus::ThermalISO15099Calc { Array2A const gcon, // Gas specific conductivity Array2A const gvis, // Gas specific viscosity Array2A const gcp, // Gas specific heat - const Array1D &EffectiveOpenness, // Layer effective openneess [m2] + const Array1D &state.dataThermalISO15099Calc->EffectiveOpenness, // Layer effective openneess [m2] Array1D &theta, // Layer surface tempeartures [K] Array1D &sconScaled, // Layer conductivity divided by thickness int &nperr, // Error message flag std::string &ErrorMessage // Error message ) { - static Array1D_int iprop1(maxgas); - static Array1D frct1(maxgas); + for (auto i = 1; i <= nlayer; ++i) { if (LayerType(i) != SPECULAR) { @@ -2407,8 +2333,8 @@ namespace EnergyPlus::ThermalISO15099Calc { auto nmix1 = nmix(i); auto press1 = (pressure(i) + pressure(i + 1)) / 2.0; for (auto j = 1; j <= maxgas; ++j) { - iprop1(j) = iprop(j, i); - frct1(j) = frct(j, i); + state.dataThermalISO15099Calc->iprop1(j) = iprop(j, i); + state.dataThermalISO15099Calc->frct1(j) = frct(j, i); } Real64 con; @@ -2416,15 +2342,16 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 dens; Real64 cp; Real64 pr; - GASSES90(tLayer, iprop1, frct1, press1, nmix1, wght, gcon, gvis, gcp, con, visc, dens, cp, pr, 1, nperr, ErrorMessage); - sconScaled(i) = (EffectiveOpenness(i) * con + (1 - EffectiveOpenness(i)) * scon(i)) / thick(i); + GASSES90(tLayer, state.dataThermalISO15099Calc->iprop1, state.dataThermalISO15099Calc->frct1, press1, nmix1, wght, gcon, gvis, gcp, con, visc, dens, cp, pr, 1, nperr, ErrorMessage); + sconScaled(i) = (state.dataThermalISO15099Calc->EffectiveOpenness(i) * con + (1 - state.dataThermalISO15099Calc->EffectiveOpenness(i)) * scon(i)) / thick(i); } else { sconScaled(i) = scon(i) / thick(i); } } } - void filmi(Real64 const tair, + void filmi(EnergyPlusData &state, + Real64 const tair, Real64 const t, int const nlayer, Real64 const tilt, @@ -2475,9 +2402,7 @@ namespace EnergyPlus::ThermalISO15099Calc { gcp.dim(3, maxgas); // Locals - static Array1D frcti(maxgas); int j; - static Array1D_int ipropi(maxgas); Real64 tiltr; Real64 tmean; Real64 delt; @@ -2565,9 +2490,10 @@ namespace EnergyPlus::ThermalISO15099Calc { } // end main IF } - void filmg(Real64 const tilt, + void filmg(EnergyPlusData &state, + Real64 const tilt, const Array1D &theta, - const Array1D &Tgap, + const Array1D &state.dataThermalISO15099Calc->Tgap, int const nlayer, Real64 const height, const Array1D &gap, @@ -2601,7 +2527,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // presure // nmix vector of number of gasses in a mixture for each gap // Output: - // hgas vector of gap coefficients + // state.dataThermalISO15099Calc->hgas vector of gap coefficients // nperr error code // Locals: // gr gap grashof number @@ -2616,7 +2542,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // Using // Argument array dimensioning EP_SIZE_CHECK(theta, maxlay2); - EP_SIZE_CHECK(Tgap, maxlay1); + EP_SIZE_CHECK(state.dataThermalISO15099Calc->Tgap, maxlay1); EP_SIZE_CHECK(gap, MaxGap); iprop.dim(maxgas, maxlay1); frct.dim(maxgas, maxlay1); @@ -2642,8 +2568,6 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 ra; Real64 asp; Real64 gnu; - static Array1D frctg(maxgas); - static Array1D_int ipropg(maxgas); int i; int j; int k; @@ -2656,7 +2580,7 @@ namespace EnergyPlus::ThermalISO15099Calc { k = j + 1; // determine the gas properties of each gap: // tmean = (theta(j)+theta(k))/2.0d0 - tmean = Tgap(i + 1); // Tgap(1) is exterior environment + tmean = state.dataThermalISO15099Calc->Tgap(i + 1); // state.dataThermalISO15099Calc->Tgap(1) is exterior environment delt = std::abs(theta(j) - theta(k)); // Temperatures should not be equal. This can happen in initial temperature guess before iterations started if (delt == 0.0) delt = 1.0e-6; @@ -2686,8 +2610,8 @@ namespace EnergyPlus::ThermalISO15099Calc { hcgas(i + 1) = con / gap(i) * gnu; // write(*,*)'theta(j),theta(k),j,k',j,theta(j),k,theta(k) - // write(*,*)'Nusselt,Rayleigh,Prandtl,hgas(k),k' - // write(*,*) gnu,gr*pr,pr,hgas(k),k + // write(*,*)'Nusselt,Rayleigh,Prandtl,state.dataThermalISO15099Calc->hgas(k),k' + // write(*,*) gnu,gr*pr,pr,state.dataThermalISO15099Calc->hgas(k),k } else { // low pressure calculations GassesLow(tmean, wght(iprop(1, i + 1)), presure(i + 1), gama(iprop(1, i + 1)), con, nperr, ErrorMessage); hcgas(i + 1) = con; @@ -2695,7 +2619,8 @@ namespace EnergyPlus::ThermalISO15099Calc { } } - void filmPillar(const Array1D_int &SupportPillar, // Shows whether or not gap have support pillar + void filmPillar(EnergyPlusData &state, + const Array1D_int &SupportPillar, // Shows whether or not gap have support pillar const Array1D &scon, // Conductivity of glass layers const Array1D &PillarSpacing, // Pillar spacing for each gap (used in case there is support pillar) const Array1D &PillarRadius, // Pillar radius for each gap (used in case there is support pillar) @@ -2723,27 +2648,23 @@ namespace EnergyPlus::ThermalISO15099Calc { // 0 - does not have support pillar // 1 - have support pillar - static Real64 cpa(0.0); - static Real64 aveGlassConductivity(0.0); - static int i(0); - static int k(0); - for (i = 1; i <= nlayer - 1; ++i) { - k = 2 * i + 1; - if (SupportPillar(i) == YES_SupportPillar) { + for (state.dataThermalISO15099Calc->iFP = 1; state.dataThermalISO15099Calc->iFP <= nlayer - 1; ++state.dataThermalISO15099Calc->iFP) { + kFP = 2 * state.dataThermalISO15099Calc->iFP + 1; + if (SupportPillar(state.dataThermalISO15099Calc->iFP) == YES_SupportPillar) { // Average glass conductivity is taken as average from both glass surrounding gap - aveGlassConductivity = (scon(i) + scon(i + 1)) / 2; + state.dataThermalISO15099Calc->aveGlassConductivity = (scon(state.dataThermalISO15099Calc->iFP) + scon(state.dataThermalISO15099Calc->iFP + 1)) / 2; - cpa = 2.0 * aveGlassConductivity * PillarRadius(i) / (pow_2(PillarSpacing(i)) * (1.0 + 2.0 * gap(i) / (DataGlobalConstants::Pi * PillarRadius(i)))); + state.dataThermalISO15099Calc->cpa = 2.0 * state.dataThermalISO15099Calc->aveGlassConductivity * PillarRadius(state.dataThermalISO15099Calc->iFP) / (pow_2(PillarSpacing(state.dataThermalISO15099Calc->iFP)) * (1.0 + 2.0 * gap(state.dataThermalISO15099Calc->iFP) / (DataGlobalConstants::Pi * PillarRadius(state.dataThermalISO15099Calc->iFP)))); // It is important to add on prevoius values caluculated for gas - hcgas(i + 1) += cpa; + hcgas(state.dataThermalISO15099Calc->iFP + 1) += state.dataThermalISO15099Calc->cpa; } // if (SupportPillar(i).eq.YES_SupportPillar) then } } - void nusselt(Real64 const tilt, Real64 const ra, Real64 const asp, Real64 &gnu, int &nperr, std::string &ErrorMessage) + void nusselt(EnergyPlusData &state, Real64 const tilt, Real64 const ra, Real64 const asp, Real64 &gnu, int &nperr, std::string &ErrorMessage) { //*********************************************************************** // purpose to calculate nusselt modulus for air gaps (ISO15099) @@ -2876,7 +2797,8 @@ namespace EnergyPlus::ThermalISO15099Calc { } } - void storeIterationResults(Files &files, + void storeIterationResults(EnergyPlusData &state, + Files &files, int const nlayer, int const index, const Array1D &theta, @@ -2939,9 +2861,9 @@ namespace EnergyPlus::ThermalISO15099Calc { print(files.TarcogIterationsFile, "\n"); // write Ebb and Ebf - print(files.TarcogIterationsFile, "{:16.8F} {:16.8F}", Ebf(1), Ebb(1)); + print(files.TarcogIterationsFile, "{:16.8F} {:16.8F}", state.dataThermalISO15099Calc->Ebf(1), state.dataThermalISO15099Calc->Ebb(1)); for (i = 2; i <= nlayer; ++i) { - print(files.TarcogIterationsFile, " {:16.8F} {:16.8F}", Ebf(i), Ebb(i)); + print(files.TarcogIterationsFile, " {:16.8F} {:16.8F}", state.dataThermalISO15099Calc->Ebf(i), state.dataThermalISO15099Calc->Ebb(i)); } print(files.TarcogIterationsFile, "\n"); @@ -2963,9 +2885,9 @@ namespace EnergyPlus::ThermalISO15099Calc { print(files.TarcogIterationsFile, dynFormat); print(files.TarcogIterationsFile, "\n"); // write Rb and Rf - print(files.TarcogIterationsFile, "{:16.8F} {:16.8F}", Rf(1), Rb(1)); + print(files.TarcogIterationsFile, "{:16.8F} {:16.8F}", state.dataThermalISO15099Calc->Rf(1), state.dataThermalISO15099Calc->Rb(1)); for (i = 1; i <= nlayer; ++i) { - print(files.TarcogIterationsFile, " {:16.8F} {:16.8F}", Rf(i), Rb(i)); + print(files.TarcogIterationsFile, " {:16.8F} {:16.8F}", state.dataThermalISO15099Calc->Rf(i), state.dataThermalISO15099Calc->Rb(i)); } print(files.TarcogIterationsFile, "\n"); @@ -3015,7 +2937,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // close(IterationCSVFileNumber) } - void CalculateFuncResults(int const nlayer, Array2 const &a, const Array1D &b, const Array1D &x, Array1D &FRes) + void CalculateFuncResults(EnergyPlusData &state, int const nlayer, Array2 const &a, const Array1D &b, const Array1D &x, Array1D &FRes) { // Tuned Rewritten to traverse a in unit stride order int const nlayer4(4 * nlayer); diff --git a/src/EnergyPlus/ThermalISO15099Calc.hh b/src/EnergyPlus/ThermalISO15099Calc.hh index 4f3c4e9ef60..ac4997efbf7 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.hh +++ b/src/EnergyPlus/ThermalISO15099Calc.hh @@ -52,13 +52,29 @@ #include // EnergyPlus Headers +#include +#include #include +#include +#include -namespace EnergyPlus::ThermalISO15099Calc { +namespace EnergyPlus { - void film(Real64 tex, Real64 tw, Real64 ws, int iwd, Real64 &hcout, int ibc); +// Forward declarations +struct EnergyPlusData; - void Calc_ISO15099(EnergyPlusData &state, TARCOGOutput::Files &files, +// Using/Aliasing +using namespace TARCOGGassesParams; +using namespace TARCOGParams; + +namespace ThermalISO15099Calc { + + + + void film(EnergyPlusData &state, Real64 tex, Real64 tw, Real64 ws, int iwd, Real64 &hcout, int ibc); + + void Calc_ISO15099(EnergyPlusData &state, + TARCOGOutput::Files &files, int nlayer, int iwd, Real64 &tout, @@ -153,7 +169,8 @@ namespace EnergyPlus::ThermalISO15099Calc { int &NumOfIterations, Real64 egdeGlCorrFac); - void therm1d(TARCOGOutput::Files &files, + void therm1d(EnergyPlusData &state, + TARCOGOutput::Files &files, int nlayer, int iwd, Real64 &tout, @@ -238,7 +255,8 @@ namespace EnergyPlus::ThermalISO15099Calc { int &TotalIndex, Real64 edgeGlCorrFac); - void guess(Real64 tout, + void guess(EnergyPlusData &state, + Real64 tout, Real64 tind, int nlayer, const Array1D &gap, @@ -249,9 +267,11 @@ namespace EnergyPlus::ThermalISO15099Calc { Array1D &Ebf, Array1D &Tgap); - void solarISO15099(Real64 totsol, Real64 rtot, const Array1D &rs, int nlayer, const Array1D &absol, Real64 &sf); + void solarISO15099(EnergyPlusData &state, + Real64 totsol, Real64 rtot, const Array1D &rs, int nlayer, const Array1D &absol, Real64 &sf); - void resist(int nlayer, + void resist(EnergyPlusData &state, + int nlayer, Real64 trmout, Real64 Tout, Real64 trmin, @@ -269,7 +289,8 @@ namespace EnergyPlus::ThermalISO15099Calc { Array1D &qcgas, Array1D &qrgas); - void hatter(int nlayer, + void hatter(EnergyPlusData &state, + int nlayer, int iwd, Real64 tout, Real64 tind, @@ -319,26 +340,28 @@ namespace EnergyPlus::ThermalISO15099Calc { Array1D &Ra, Array1D &Nu); - void effectiveLayerCond(int nlayer, + void effectiveLayerCond(EnergyPlusData &state, + int nlayer, const Array1D_int &LayerType, // Layer type const Array1D &scon, // Layer thermal conductivity const Array1D &thick, // Layer thickness - Array2A_int iprop, // Gas type in gaps - Array2A frct, // Fraction of gas + Array2A_int iprop, // Gas type in gaps + Array2A frct, // Fraction of gas const Array1D_int &nmix, // Gas mixture const Array1D &pressure, // Gas pressure [Pa] const Array1D &wght, // Molecular weight - Array2A gcon, // Gas specific conductivity - Array2A gvis, // Gas specific viscosity - Array2A gcp, // Gas specific heat + Array2A gcon, // Gas specific conductivity + Array2A gvis, // Gas specific viscosity + Array2A gcp, // Gas specific heat const Array1D &EffectiveOpenness, // Layer effective openneess [m2] Array1D &theta, // Layer surface tempeartures [K] - Array1D &sconScaled, // Layer conductivity divided by thickness - int &nperr, // Error message flag - std::string &ErrorMessage // Error message + Array1D &sconScaled, // Layer conductivity divided by thickness + int &nperr, // Error message flag + std::string &ErrorMessage // Error message ); - void filmi(Real64 tair, + void filmi(EnergyPlusData &state, + Real64 tair, Real64 t, int nlayer, Real64 tilt, @@ -357,7 +380,8 @@ namespace EnergyPlus::ThermalISO15099Calc { int &nperr, std::string &ErrorMessage); - void filmg(Real64 tilt, + void filmg(EnergyPlusData &state, + Real64 tilt, const Array1D &theta, const Array1D &Tgap, int nlayer, @@ -379,7 +403,8 @@ namespace EnergyPlus::ThermalISO15099Calc { int &nperr, std::string &ErrorMessage); - void filmPillar(const Array1D_int &SupportPillar, // Shows whether or not gap have support pillar + void filmPillar(EnergyPlusData &state, + const Array1D_int &SupportPillar, // Shows whether or not gap have support pillar const Array1D &scon, // Conductivity of glass layers const Array1D &PillarSpacing, // Pillar spacing for each gap (used in case there is support pillar) const Array1D &PillarRadius, // Pillar radius for each gap (used in case there is support pillar) @@ -390,9 +415,9 @@ namespace EnergyPlus::ThermalISO15099Calc { int &nperr, std::string &ErrorMessage); - void nusselt(Real64 tilt, Real64 ra, Real64 asp, Real64 &gnu, int &nperr, std::string &ErrorMessage); + void nusselt(EnergyPlusData &state,Real64 tilt, Real64 ra, Real64 asp, Real64 &gnu, int &nperr, std::string &ErrorMessage); - void storeIterationResults(TARCOGOutput::Files &files, + void storeIterationResults(EnergyPlusData &state, TARCOGOutput::Files &files, int nlayer, int index, const Array1D &theta, @@ -414,7 +439,117 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D &Rf, int &); - void CalculateFuncResults(int nlayer, Array2 const &a, const Array1D &b, const Array1D &x, Array1D &FRes); + void CalculateFuncResults(EnergyPlusData &state, int nlayer, Array2 const &a, const Array1D &b, const Array1D &x, Array1D &FRes); +} + struct ThermalISO15099CalcData : BaseGlobalStruct + { + Array1D thetas = Array1D(maxlay2); + Array1D rir = Array1D(maxlay2); + Array1D hcgass = Array1D(maxlay1); + Array1D hrgass = Array1D(maxlay1); + Array1D rs = Array1D(maxlay3, 0.0); + Array1D qs = Array1D(maxlay3); + Array1D qvs = Array1D(maxlay1); + Array1D LaminateAU = Array1D(maxlay); + Array1D sumsolU = Array1D(maxlay); + Array1D sol0 = Array1D(maxlay); + Array1D qcgas = Array1D(maxlay1); + Array1D qcgaps = Array1D(maxlay1); + Array1D qrgas = Array1D(maxlay1); + Array1D qrgaps = Array1D(maxlay1); + Array1D Atop_NOSD = Array1D(maxlay); + Array1D Abot_NOSD = Array1D(maxlay); + Array1D Al_NOSD = Array1D(maxlay); + Array1D Ar_NOSD = Array1D(maxlay); + Array1D Ah_NOSD = Array1D(maxlay); + Array1D EffectiveOpenness_NOSD = Array1D(maxlay); + Array1D SlatThick_NOSD = Array1D(maxlay); + Array1D SlatWidth_NOSD = Array1D(maxlay); + Array1D SlatAngle_NOSD = Array1D(maxlay); + Array1D SlatCond_NOSD = Array1D(maxlay); + Array1D SlatSpacing_NOSD = Array1D(maxlay); + Array1D SlatCurve_NOSD = Array1D(maxlay); + Array1D vvent_NOSD = Array1D(maxlay1); + Array1D tvent_NOSD = Array1D(maxlay1); + Array1D qv_NOSD = Array1D(maxlay1); + Array1D q_NOSD = Array1D(maxlay3); + Array1D_int LayerType_NOSD = Array1D_int(maxlay); + Array1D gap_NOSD = Array1D(maxlay); + Array1D thick_NOSD = Array1D(maxlay); + Array1D scon_NOSD = Array1D(maxlay); + Array1D emis_NOSD = Array1D(maxlay2); + Array1D rir_NOSD = Array1D(maxlay2); + Array1D tir_NOSD = Array1D(maxlay2); + Array1D theta_NOSD = Array1D(maxlay2); + Array2D frct_NOSD = Array2D(maxgas, maxlay1); + Array2D_int iprop_NOSD = Array2D_int(maxgas, maxlay1); + Array1D_int nmix_NOSD = Array1D_int(maxlay1); + Array1D presure_NOSD = Array1D(maxlay1); + Array1D hcgas_NOSD = Array1D(maxlay1); + Array1D hrgas_NOSD = Array1D(maxlay1); + Array1D LaminateA_NOSD = Array1D(maxlay); + Array1D LaminateB_NOSD = Array1D(maxlay); + Array1D sumsol_NOSD = Array1D(maxlay); + Array1D Ra_NOSD = Array1D(maxlay); + Array1D Nu_NOSD = Array1D(maxlay); + Array1D Ebb = Array1D(maxlay); + Array1D Ebf = Array1D(maxlay); + Array1D Rb = Array1D(maxlay); + Array1D Rf = Array1D(maxlay); + Array1D Ebbs = Array1D(maxlay); + Array1D Ebfs = Array1D(maxlay); + Array1D Rbs = Array1D(maxlay); + Array1D Rfs = Array1D(maxlay); + Array1D Ebb_NOSD = Array1D(maxlay); + Array1D Ebf_NOSD = Array1D(maxlay); + Array1D Rb_NOSD = Array1D(maxlay); + Array1D Rf_NOSD = Array1D(maxlay); + Array1D ShadeGapKeffConv_NOSD = Array1D(MaxGap); + Array1D qcgas_NOSD = Array1D(maxlay1); + Array1D Keff_NOSD = Array1D(maxlay1); + Array1D qrgas_NOSD = Array1D(maxlay1); + Array1D_int nslice_NOSD = Array1D_int(maxlay); + Array1D vfreevent_NOSD = Array1D(maxlay1); + Array1D vfreevent = Array1D(maxlay1); + Array1D Atop_eff = Array1D(maxlay, 0.0); + Array1D Abot_eff = Array1D(maxlay, 0.0); + Array1D Al_eff = Array1D(maxlay, 0.0); + Array1D Ar_eff = Array1D(maxlay, 0.0); + Array1D Ah_eff = Array1D(maxlay, 0.0); + Array1D EffectiveOpenness = Array1D(maxlay, 0.0); + Array1D hgas = Array1D(maxlay1); + Array1D Tgap = Array1D(maxlay1); + Array1D hcgapMod = Array1D(maxlay1); + Array1D hcv = Array1D(maxlay1); + Array1D_int iprop1 = Array1D_int(maxgas); + Array1D frct1 = Array1D(maxgas); + Array1D frcti = Array1D(maxgas); + Array1D_int ipropi = Array1D_int(maxgas); + Array1D frctg = Array1D(maxgas); + Array1D_int ipropg = Array1D_int(maxgas); + + Real64 cpa = 0.0; + Real64 aveGlassConductivity = 0.0; + + Real64 rtot = 0.0; + Real64 sft = 0.0; + Real64 hcins = 0.0; + Real64 hrins = 0.0; + Real64 hins = 0.0; + Real64 hcouts = 0.0; + Real64 hrouts = 0.0; + Real64 houts = 0.0; + Real64 ufactors = 0.0; + Real64 fluxs = 0.0; + Real64 qeff = 0.0; + Real64 flux_nonsolar = 0.0; + int iFP = 0; + int kFP = 0; + + void clear_state() override + { + } + }; } // namespace EnergyPlus From f19a466283555454456062fe37926a959fb2c681 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Wed, 24 Mar 2021 15:10:00 -0600 Subject: [PATCH 05/21] building 15099 intermediate checkpoint --- src/EnergyPlus/ThermalISO15099Calc.cc | 512 +++++++++++++++----------- 1 file changed, 287 insertions(+), 225 deletions(-) diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index 702b37d9e49..23ef09613af 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -52,8 +52,8 @@ #include // EnergyPlus Headers -#include #include +#include #include #include #include @@ -95,7 +95,7 @@ namespace EnergyPlus::ThermalISO15099Calc { using namespace TARCOGGasses90; using namespace TarcogShading; - void film(EnergyPlusData &state, Real64 const tex, Real64 const tw, Real64 const ws, int const iwd, Real64 &hcout, int const ibc) + void film(Real64 const tex, Real64 const tw, Real64 const ws, int const iwd, Real64 &hcout, int const ibc) { //*********************************************************************** // purpose - to find outdoor film coeff @@ -299,7 +299,8 @@ namespace EnergyPlus::ThermalISO15099Calc { EP_SIZE_CHECK(Nu, maxlay); EP_SIZE_CHECK(Keff, maxlay); EP_SIZE_CHECK(ShadeGapKeffConv, MaxGap); - + + // REAL(r64) :: grho(maxgas,3) Real64 shgct_NOSD; Real64 trmout; @@ -314,6 +315,10 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 qc1; Real64 qc2; Real64 qcgg; + static Array1D qcgas(maxlay1); + static Array1D qcgaps(maxlay1); + static Array1D qrgas(maxlay1); + static Array1D qrgaps(maxlay1); Real64 ShadeHcModifiedOut; Real64 ShadeHcModifiedIn; @@ -332,22 +337,61 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 hrout_NOSD; Real64 tamb_NOSD; Real64 troom_NOSD; + static Array1D_int LayerType_NOSD(maxlay); Real64 ufactor_NOSD; Real64 sc_NOSD; Real64 hflux_NOSD; Real64 shgc_NOSD; - Real64 hout_NOSD; +// Real64 hout_NOSD; +// static Array1D gap_NOSD(maxlay); +// static Array1D thick_NOSD(maxlay); +// static Array1D scon_NOSD(maxlay); +// static Array1D emis_NOSD(maxlay2); +// static Array1D rir_NOSD(maxlay2); +// static Array1D tir_NOSD(maxlay2); +// static Array1D theta_NOSD(maxlay2); +// static Array2D frct_NOSD(maxgas, maxlay1); +// static Array2D_int iprop_NOSD(maxgas, maxlay1); +// static Array1D_int nmix_NOSD(maxlay1); +// static Array1D presure_NOSD(maxlay1); +// static Array1D hcgas_NOSD(maxlay1); +// static Array1D hrgas_NOSD(maxlay1); // REAL(r64) :: rs_NOSD(maxlay3)!,sol(maxlay) + static Array1D LaminateA_NOSD(maxlay); + static Array1D LaminateB_NOSD(maxlay); + static Array1D sumsol_NOSD(maxlay); + static Array1D Ra_NOSD(maxlay); + static Array1D Nu_NOSD(maxlay); Real64 ShadeEmisRatioOut_NOSD; Real64 ShadeEmisRatioIn_NOSD; Real64 ShadeHcRatioOut_NOSD; Real64 ShadeHcRatioIn_NOSD; Real64 ShadeHcModifiedOut_NOSD; Real64 ShadeHcModifiedIn_NOSD; + static Array1D Ebb(maxlay); + static Array1D Ebf(maxlay); + static Array1D Rb(maxlay); + static Array1D Rf(maxlay); + static Array1D Ebbs(maxlay); + static Array1D Ebfs(maxlay); + static Array1D Rbs(maxlay); + static Array1D Rfs(maxlay); + static Array1D Ebb_NOSD(maxlay); + static Array1D Ebf_NOSD(maxlay); + static Array1D Rb_NOSD(maxlay); + static Array1D Rf_NOSD(maxlay); + + static Array1D ShadeGapKeffConv_NOSD(MaxGap); + static Array1D qcgas_NOSD(maxlay1); + static Array1D Keff_NOSD(maxlay1); + static Array1D qrgas_NOSD(maxlay1); + static Array1D_int nslice_NOSD(maxlay); + static Array1D vfreevent_NOSD(maxlay1); int FirstSpecularLayer; int LastSpecularLayer; + static Array1D vfreevent(maxlay1); // cbi...Other variables: Real64 flux; @@ -359,6 +403,18 @@ namespace EnergyPlus::ThermalISO15099Calc { int j; int OriginalIndex; int UnshadedDebug; + static Real64 rtot(0.0); + static Real64 sft(0.0); + static Real64 hcins(0.0); + static Real64 hrins(0.0); + static Real64 hins(0.0); + static Real64 hcouts(0.0); + static Real64 hrouts(0.0); + static Real64 houts(0.0); + static Real64 ufactors(0.0); + static Real64 fluxs(0.0); + static Real64 qeff(0.0); + static Real64 flux_nonsolar(0.0); // Autodesk:Uninit Initialize variables used uninitialized shgc_NOSD = 0.0; // Autodesk:Uninit Force default initialization @@ -417,7 +473,7 @@ namespace EnergyPlus::ThermalISO15099Calc { Gout, Gin, state.dataThermalISO15099Calc->rir, - state.dataThermalISO15099Calc->vfreevent, + vfreevent, nperr, ErrorMessage ); @@ -548,13 +604,13 @@ namespace EnergyPlus::ThermalISO15099Calc { LayerType, Ra, Nu, - state.dataThermalISO15099Calc->vfreevent, - state.dataThermalISO15099Calc->qcgas, - state.dataThermalISO15099Calc->qrgas, - state.dataThermalISO15099Calc->Ebf, - state.dataThermalISO15099Calc->Ebb, - state.dataThermalISO15099Calc->Rf, - state.dataThermalISO15099Calc->Rb, + vfreevent, + qcgas, + qrgas, + Ebf, + Ebb, + Rf, + Rb, ShadeEmisRatioOut, ShadeEmisRatioIn, ShadeHcModifiedOut, @@ -584,24 +640,24 @@ namespace EnergyPlus::ThermalISO15099Calc { // No need to store results in case of non-ufactor run if ((SHGCCalc > 0) && (dir > 0.0)) { - solarISO15099(state, totsol, state.dataThermalISO15099Calc->rtot, state.dataThermalISO15099Calc->rs, nlayer, asol, state.dataThermalISO15099Calc->sft); - shgct = state.dataThermalISO15099Calc->sft; + solarISO15099(state, totsol, rtot, state.dataThermalISO15099Calc->rs, nlayer, asol, sft); + shgct = sft; shgct_NOSD = 0.0; - state.dataThermalISO15099Calc->hcins = hcin; - state.dataThermalISO15099Calc->hrins = hrin; - state.dataThermalISO15099Calc->hins = hin; - state.dataThermalISO15099Calc->hcouts = hcout; - state.dataThermalISO15099Calc->hrouts = hrout; - state.dataThermalISO15099Calc->houts = hout; - state.dataThermalISO15099Calc->ufactors = ufactor; - state.dataThermalISO15099Calc->fluxs = flux; + hcins = hcin; + hrins = hrin; + hins = hin; + hcouts = hcout; + hrouts = hrout; + houts = hout; + ufactors = ufactor; + fluxs = flux; for (i = 1; i <= nlayer; ++i) { state.dataThermalISO15099Calc->thetas(2 * i - 1) = theta(2 * i - 1); state.dataThermalISO15099Calc->thetas(2 * i) = theta(2 * i); - state.dataThermalISO15099Calc->Ebbs(i) = state.dataThermalISO15099Calc->Ebb(i); - state.dataThermalISO15099Calc->Ebfs(i) = state.dataThermalISO15099Calc->Ebf(i); - state.dataThermalISO15099Calc->Rbs(i) = state.dataThermalISO15099Calc->Rb(i); - state.dataThermalISO15099Calc->Rfs(i) = state.dataThermalISO15099Calc->Rf(i); + Ebbs(i) = Ebb(i); + Ebfs(i) = Ebf(i); + Rbs(i) = Rb(i); + Rfs(i) = Rf(i); state.dataThermalISO15099Calc->qs(2 * i - 1) = q(2 * i - 1); state.dataThermalISO15099Calc->qs(2 * i) = q(2 * i); // qprims(2*i - 1) = qprim(2*i - 1) @@ -610,8 +666,8 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->qvs(2 * i) = qv(2 * i); state.dataThermalISO15099Calc->hcgass(i) = hcgas(i); state.dataThermalISO15099Calc->hrgass(i) = hrgas(i); - state.dataThermalISO15099Calc->qrgaps(i) = state.dataThermalISO15099Calc->qrgas(i); - state.dataThermalISO15099Calc->qcgaps(i) = state.dataThermalISO15099Calc->qcgas(i); + qrgaps(i) = qrgas(i); + qcgaps(i) = qcgas(i); } // CHECK THIS! state.dataThermalISO15099Calc->qs(2 * nlayer + 1) = q(2 * nlayer + 1); @@ -630,7 +686,8 @@ namespace EnergyPlus::ThermalISO15099Calc { hout = houtt; // call therm1d to calculate heat flux without solar radiation - therm1d(files, + therm1d(state, + files, nlayer, iwd, tout, @@ -653,7 +710,7 @@ namespace EnergyPlus::ThermalISO15099Calc { thick, scon, tilt, - sol0, + state.dataThermalISO15099Calc->sol0, height, heightt, width, @@ -698,13 +755,13 @@ namespace EnergyPlus::ThermalISO15099Calc { LayerType, Ra, Nu, - state.dataThermalISO15099Calc->vfreevent, - state.dataThermalISO15099Calc->qcgas, - state.dataThermalISO15099Calc->qrgas, - state.dataThermalISO15099Calc->Ebf, - state.dataThermalISO15099Calc->Ebb, - state.dataThermalISO15099Calc->Rf, - state.dataThermalISO15099Calc->Rb, + vfreevent, + qcgas, + qrgas, + Ebf, + Ebb, + Rf, + Rb, ShadeEmisRatioOut, ShadeEmisRatioIn, ShadeHcModifiedOut, @@ -748,38 +805,38 @@ namespace EnergyPlus::ThermalISO15099Calc { NeedUnshadedRun = false; // bi...Set outdoor & indoor gas properties: if (NeedUnshadedRun) { - state.dataThermalISO15099Calc->state.dataThermalISO15099Calc->nmix_NOSD(1) = nmix(1); + state.dataThermalISO15099Calc->nmix_NOSD(1) = nmix(1); state.dataThermalISO15099Calc->presure_NOSD(1) = presure(1); state.dataThermalISO15099Calc->nmix_NOSD(nlayer_NOSD + 1) = nmix(nlayer + 1); state.dataThermalISO15099Calc->presure_NOSD(nlayer_NOSD + 1) = presure(nlayer + 1); for (j = 1; j <= nmix(1); ++j) { - state.dataThermalISO15099Calc->iprop_NOSD(j, 1) = iprop(j, 1); + state.dataThermalISO15099Calc->frct_NOSD(j, 1) = iprop(j, 1); state.dataThermalISO15099Calc->frct_NOSD(j, 1) = frct(j, 1); } for (j = 1; j <= nmix(nlayer_NOSD + 1); ++j) { - state.dataThermalISO15099Calc->iprop_NOSD(j, nlayer_NOSD + 1) = iprop(j, nlayer + 1); + state.dataThermalISO15099Calc->frct_NOSD(j, nlayer_NOSD + 1) = iprop(j, nlayer + 1); state.dataThermalISO15099Calc->frct_NOSD(j, nlayer_NOSD + 1) = frct(j, nlayer + 1); } for (i = 1; i <= nlayer_NOSD; ++i) { OriginalIndex = FirstSpecularLayer + i - 1; state.dataThermalISO15099Calc->Atop_NOSD(i) = state.dataThermalISO15099Calc->Atop_eff(OriginalIndex); state.dataThermalISO15099Calc->Abot_NOSD(i) = state.dataThermalISO15099Calc->Abot_eff(OriginalIndex); - Al_NOSD(i) = state.dataThermalISO15099Calc->Al_eff(OriginalIndex); - Ar_NOSD(i) = state.dataThermalISO15099Calc->Ar_eff(OriginalIndex); + state.dataThermalISO15099Calc->Al_NOSD(i) = state.dataThermalISO15099Calc->Al_eff(OriginalIndex); + state.dataThermalISO15099Calc->Ar_NOSD(i) = state.dataThermalISO15099Calc->Ar_eff(OriginalIndex); state.dataThermalISO15099Calc->Ah_NOSD(i) = state.dataThermalISO15099Calc->Ah_eff(OriginalIndex); state.dataThermalISO15099Calc->SlatThick_NOSD(i) = SlatThick(OriginalIndex); state.dataThermalISO15099Calc->SlatWidth_NOSD(i) = SlatWidth(OriginalIndex); - SlatAngle_NOSD(i) = SlatAngle(OriginalIndex); - SlatCond_NOSD(i) = SlatCond(OriginalIndex); - SlatSpacing_NOSD(i) = SlatSpacing(OriginalIndex); - SlatCurve_NOSD(i) = SlatCurve(OriginalIndex); + state.dataThermalISO15099Calc->SlatAngle_NOSD(i) = SlatAngle(OriginalIndex); + state.dataThermalISO15099Calc->SlatCond_NOSD(i) = SlatCond(OriginalIndex); + state.dataThermalISO15099Calc->SlatSpacing_NOSD(i) = SlatSpacing(OriginalIndex); + state.dataThermalISO15099Calc->SlatCurve_NOSD(i) = SlatCurve(OriginalIndex); // cbi... TO do when Forced Ventilation is implemented: take care of appropriate arguments!!! // vvent_NOSD // tvent_NOSD - state.dataThermalISO15099Calc->LayerType_NOSD(i) = LayerType(OriginalIndex); + LayerType_NOSD(i) = LayerType(OriginalIndex); state.dataThermalISO15099Calc->thick_NOSD(i) = thick(OriginalIndex); state.dataThermalISO15099Calc->scon_NOSD(i) = scon(OriginalIndex); @@ -795,16 +852,16 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->nmix_NOSD(i + 1) = nmix(OriginalIndex + 1); state.dataThermalISO15099Calc->presure_NOSD(i + 1) = presure(OriginalIndex + 1); for (j = 1; j <= state.dataThermalISO15099Calc->nmix_NOSD(i + 1); ++j) { - state.dataThermalISO15099Calc->iprop_NOSD(j, i + 1) = iprop(j, OriginalIndex + 1); + state.dataThermalISO15099Calc->frct_NOSD(j, i + 1) = iprop(j, OriginalIndex + 1); state.dataThermalISO15099Calc->frct_NOSD(j, i + 1) = frct(j, OriginalIndex + 1); } } - state.dataThermalISO15099Calc->LaminateA_NOSD(i) = LaminateA(OriginalIndex); - state.dataThermalISO15099Calc->LaminateB_NOSD(i) = LaminateB(OriginalIndex); - state.dataThermalISO15099Calc->sumsol_NOSD(i) = sumsol(OriginalIndex); + LaminateA_NOSD(i) = LaminateA(OriginalIndex); + LaminateB_NOSD(i) = LaminateB(OriginalIndex); + sumsol_NOSD(i) = sumsol(OriginalIndex); - state.dataThermalISO15099Calc->nslice_NOSD(i) = nslice(OriginalIndex); + nslice_NOSD(i) = nslice(OriginalIndex); } // This is UNSHADED pass - no solar radiation: @@ -846,7 +903,7 @@ namespace EnergyPlus::ThermalISO15099Calc { tilt, totsol, nlayer_NOSD, - state.dataThermalISO15099Calc->LayerType_NOSD, + LayerType_NOSD, state.dataThermalISO15099Calc->thick_NOSD, state.dataThermalISO15099Calc->scon_NOSD, asol, @@ -854,25 +911,25 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->emis_NOSD, state.dataThermalISO15099Calc->Atop_NOSD, state.dataThermalISO15099Calc->Abot_NOSD, - Al_NOSD, - Ar_NOSD, + state.dataThermalISO15099Calc->Al_NOSD, + state.dataThermalISO15099Calc->Ar_NOSD, state.dataThermalISO15099Calc->Ah_NOSD, state.dataThermalISO15099Calc->SlatThick_NOSD, state.dataThermalISO15099Calc->SlatWidth_NOSD, - SlatAngle_NOSD, - SlatCond_NOSD, - SlatSpacing_NOSD, - SlatCurve_NOSD, - state.dataThermalISO15099Calc->nslice_NOSD, - state.dataThermalISO15099Calc->LaminateA_NOSD, - state.dataThermalISO15099Calc->LaminateB_NOSD, - state.dataThermalISO15099Calc->sumsol_NOSD, + state.dataThermalISO15099Calc->SlatAngle_NOSD, + state.dataThermalISO15099Calc->SlatCond_NOSD, + state.dataThermalISO15099Calc->SlatSpacing_NOSD, + state.dataThermalISO15099Calc->SlatCurve_NOSD, + nslice_NOSD, + LaminateA_NOSD, + LaminateB_NOSD, + sumsol_NOSD, state.dataThermalISO15099Calc->gap_NOSD, state.dataThermalISO15099Calc->vvent_NOSD, state.dataThermalISO15099Calc->tvent_NOSD, state.dataThermalISO15099Calc->presure_NOSD, state.dataThermalISO15099Calc->nmix_NOSD, - state.dataThermalISO15099Calc->iprop_NOSD, + state.dataThermalISO15099Calc->frct_NOSD, state.dataThermalISO15099Calc->frct_NOSD, xgcon, xgvis, @@ -885,7 +942,8 @@ namespace EnergyPlus::ThermalISO15099Calc { // This is "Unshaded, No solar radiation" pass // cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc // call therm1d to calculate heat flux with solar radiation - therm1d(files, + therm1d(state, + files, nlayer_NOSD, iwd, tout, @@ -908,11 +966,11 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->thick_NOSD, state.dataThermalISO15099Calc->scon_NOSD, tilt, - sol0, + state.dataThermalISO15099Calc->sol0, height, heightt, width, - state.dataThermalISO15099Calc->iprop_NOSD, + state.dataThermalISO15099Calc->frct_NOSD, state.dataThermalISO15099Calc->frct_NOSD, state.dataThermalISO15099Calc->presure_NOSD, state.dataThermalISO15099Calc->nmix_NOSD, @@ -924,9 +982,9 @@ namespace EnergyPlus::ThermalISO15099Calc { SupportPillar, PillarSpacing, PillarRadius, - theta_NOSD, - q_NOSD, - qv_NOSD, + state.dataThermalISO15099Calc->theta_NOSD, + state.dataThermalISO15099Calc->q_NOSD, + state.dataThermalISO15099Calc->qv_NOSD, flux_NOSD, hcin_NOSD, hrin_NOSD, @@ -934,8 +992,8 @@ namespace EnergyPlus::ThermalISO15099Calc { hrout_NOSD, hin_NOSD, hout_NOSD, - hcgas_NOSD, - hrgas_NOSD, + state.dataThermalISO15099Calc->hcgas_NOSD, + state.dataThermalISO15099Calc->hrgas_NOSD, ufactor_NOSD, nperr, ErrorMessage, @@ -944,18 +1002,18 @@ namespace EnergyPlus::ThermalISO15099Calc { ibc, state.dataThermalISO15099Calc->Atop_NOSD, state.dataThermalISO15099Calc->Abot_NOSD, - Al_NOSD, - Ar_NOSD, + state.dataThermalISO15099Calc->Al_NOSD, + state.dataThermalISO15099Calc->Ar_NOSD, state.dataThermalISO15099Calc->Ah_NOSD, state.dataThermalISO15099Calc->EffectiveOpenness_NOSD, state.dataThermalISO15099Calc->vvent_NOSD, state.dataThermalISO15099Calc->tvent_NOSD, - state.dataThermalISO15099Calc->LayerType_NOSD, + LayerType_NOSD, Ra_NOSD, Nu_NOSD, - state.dataThermalISO15099Calc->vfreevent_NOSD, + vfreevent_NOSD, qcgas_NOSD, - state.dataThermalISO15099Calc->qrgas_NOSD, + qrgas_NOSD, Ebf_NOSD, Ebb_NOSD, Rf_NOSD, @@ -987,14 +1045,14 @@ namespace EnergyPlus::ThermalISO15099Calc { files.DBGD, nlayer_NOSD, tamb, - q_NOSD, - qv_NOSD, + state.dataThermalISO15099Calc->q_NOSD, + state.dataThermalISO15099Calc->qv_NOSD, qcgas_NOSD, - state.dataThermalISO15099Calc->qrgas_NOSD, - theta_NOSD, - state.dataThermalISO15099Calc->vfreevent_NOSD, + qrgas_NOSD, + state.dataThermalISO15099Calc->theta_NOSD, + vfreevent_NOSD, state.dataThermalISO15099Calc->vvent_NOSD, - state.dataThermalISO15099Calc->Keff_NOSD, + Keff_NOSD, ShadeGapKeffConv_NOSD, troom_NOSD, ufactor_NOSD, @@ -1008,7 +1066,7 @@ namespace EnergyPlus::ThermalISO15099Calc { hrout_NOSD, Ra_NOSD, Nu_NOSD, - state.dataThermalISO15099Calc->LayerType_NOSD, + LayerType_NOSD, Ebf_NOSD, Ebb_NOSD, Rf_NOSD, @@ -1023,8 +1081,8 @@ namespace EnergyPlus::ThermalISO15099Calc { ShadeHcRatioOut_NOSD, hcin_NOSD, hcout_NOSD, - hcgas_NOSD, - hrgas_NOSD, + state.dataThermalISO15099Calc->hcgas_NOSD, + state.dataThermalISO15099Calc->hrgas_NOSD, AchievedErrorTolerance_NOSD, NumOfIter_NOSD); // Autodesk:Uninit shgc_NOSD, sc_NOSD, hflux_NOSD, // ShadeHcRatioIn_NOSD, ShadeHcRatioOut_NOSD were @@ -1046,8 +1104,8 @@ namespace EnergyPlus::ThermalISO15099Calc { // Keff(i) = gap(i) * qprim(2*i+1) / (theta(2*i+1) - theta(2*i)) if ((i > 1) && (i < nlayer)) { tgg = gap(i - 1) + gap(i) + thick(i); - qc1 = state.dataThermalISO15099Calc->qcgas(i - 1); - qc2 = state.dataThermalISO15099Calc->qcgas(i); + qc1 = qcgas(i - 1); + qc2 = qcgas(i); qcgg = (qc1 + qc2) / 2.0; ShadeGapKeffConv(i) = tgg * qcgg / (theta(2 * i + 1) - theta(2 * i - 2)); } @@ -1062,22 +1120,22 @@ namespace EnergyPlus::ThermalISO15099Calc { flux_nonsolar = flux; if ((SHGCCalc > 0) && (dir > 0.0)) { - shgc = totsol - (state.dataThermalISO15099Calc->fluxs - flux) / dir; + shgc = totsol - (fluxs - flux) / dir; sc = shgc / 0.87; - hcin = state.dataThermalISO15099Calc->hcins; - hrin = state.dataThermalISO15099Calc->hrins; - hin = state.dataThermalISO15099Calc->hins; - hcout = state.dataThermalISO15099Calc->hcouts; - hrout = state.dataThermalISO15099Calc->hrouts; - hout = state.dataThermalISO15099Calc->houts; - flux = state.dataThermalISO15099Calc->fluxs; // <--- ??? + hcin = hcins; + hrin = hrins; + hin = hins; + hcout = hcouts; + hrout = hrouts; + hout = houts; + flux = fluxs; // <--- ??? for (i = 1; i <= nlayer; ++i) { theta(2 * i - 1) = state.dataThermalISO15099Calc->thetas(2 * i - 1); theta(2 * i) = state.dataThermalISO15099Calc->thetas(2 * i); - state.dataThermalISO15099Calc->Ebb(i) = state.dataThermalISO15099Calc->Ebbs(i); - state.dataThermalISO15099Calc->Ebf(i) = state.dataThermalISO15099Calc->Ebfs(i); - state.dataThermalISO15099Calc->Rb(i) = state.dataThermalISO15099Calc->Rbs(i); - state.dataThermalISO15099Calc->Rf(i) = state.dataThermalISO15099Calc->Rfs(i); + Ebb(i) = Ebbs(i); + Ebf(i) = Ebfs(i); + Rb(i) = Rbs(i); + Rf(i) = Rfs(i); q(2 * i - 1) = state.dataThermalISO15099Calc->qs(2 * i - 1); q(2 * i) = state.dataThermalISO15099Calc->qs(2 * i); // qprim(2*i - 1) = qprims(2*i - 1) @@ -1086,8 +1144,8 @@ namespace EnergyPlus::ThermalISO15099Calc { qv(2 * i) = state.dataThermalISO15099Calc->qvs(2 * i); hcgas(i) = state.dataThermalISO15099Calc->hcgass(i); hrgas(i) = state.dataThermalISO15099Calc->hrgass(i); - state.dataThermalISO15099Calc->qcgas(i) = state.dataThermalISO15099Calc->qcgaps(i); - state.dataThermalISO15099Calc->qrgas(i) = state.dataThermalISO15099Calc->qrgaps(i); + qcgas(i) = qcgaps(i); + qrgas(i) = qrgaps(i); AchievedErrorTolerance = AchievedErrorToleranceSolar; NumOfIter = NumOfIterSolar; } @@ -1106,10 +1164,10 @@ namespace EnergyPlus::ThermalISO15099Calc { tamb, q, qv, - state.dataThermalISO15099Calc->qcgas, - state.dataThermalISO15099Calc->qrgas, + qcgas, + qrgas, theta, - state.dataThermalISO15099Calc->vfreevent, + vfreevent, vvent, Keff, ShadeGapKeffConv, @@ -1126,10 +1184,10 @@ namespace EnergyPlus::ThermalISO15099Calc { Ra, Nu, LayerType, - state.dataThermalISO15099Calc->Ebf, - state.dataThermalISO15099Calc->Ebb, - state.dataThermalISO15099Calc->Rf, - state.dataThermalISO15099Calc->Rb, + Ebf, + Ebb, + Rf, + Rb, ebsky, Gout, ebroom, @@ -1165,7 +1223,7 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 &ebroom, Real64 const Gin, const Array1D &tir, - const Array1D &state.dataThermalISO15099Calc->rir, + const Array1D &rir, const Array1D &emis, const Array1D &gap, const Array1D &thick, @@ -1210,19 +1268,19 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D &Al, const Array1D &Ar, const Array1D &Ah, - const Array1D &state.dataThermalISO15099Calc->EffectiveOpenness, + const Array1D &EffectiveOpenness, const Array1D &vvent, const Array1D &tvent, const Array1D_int &LayerType, Array1D &Ra, Array1D &Nu, - Array1D &state.dataThermalISO15099Calc->vfreevent, - Array1D &state.dataThermalISO15099Calc->qcgas, - Array1D &state.dataThermalISO15099Calc->qrgas, - Array1D &state.dataThermalISO15099Calc->Ebf, - Array1D &state.dataThermalISO15099Calc->Ebb, - Array1D &state.dataThermalISO15099Calc->Rf, - Array1D &state.dataThermalISO15099Calc->Rb, + Array1D &vfreevent, + Array1D &qcgas, + Array1D &qrgas, + Array1D &Ebf, + Array1D &Ebb, + Array1D &Rf, + Array1D &Rb, Real64 &ShadeEmisRatioOut, Real64 &ShadeEmisRatioIn, Real64 &ShadeHcModifiedOut, @@ -1282,7 +1340,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // nperr // *Inactives** // wa - window azimuth (degrees, clockwise from south) - // state.dataThermalISO15099Calc->hgas matrix of gap film coefficients + // hgas matrix of gap film coefficients // Locals // Ebb Vector // Ebf Vector @@ -1304,6 +1362,7 @@ namespace EnergyPlus::ThermalISO15099Calc { Array2D a(4 * nlayer, 4 * nlayer); Array1D b(4 * nlayer); + // REAL(r64) :: hhatv(maxlay3),hcv(maxlay3), Ebgap(maxlay3), Tgap(maxlay1) // REAL(r64) :: alpha int maxiter; @@ -1371,10 +1430,10 @@ namespace EnergyPlus::ThermalISO15099Calc { TotalIndex = 0; iterationsFinished = false; qv = 0.0; - state.dataThermalISO15099Calc->Ebb = 0.0; - state.dataThermalISO15099Calc->Ebf = 0.0; - state.dataThermalISO15099Calc->Rb = 0.0; - state.dataThermalISO15099Calc->Rf = 0.0; + Ebb = 0.0; + Ebf = 0.0; + Rb = 0.0; + Rf = 0.0; a = 0.0; b = 0.0; @@ -1390,8 +1449,8 @@ namespace EnergyPlus::ThermalISO15099Calc { for (i = 1; i <= nlayer; ++i) { k = 2 * i; - Radiation(k) = state.dataThermalISO15099Calc->Ebb(i); - Radiation(k - 1) = state.dataThermalISO15099Calc->Ebf(i); + Radiation(k) = Ebb(i); + Radiation(k - 1) = Ebf(i); told(k - 1) = 0.0; told(k) = 0.0; } @@ -1410,8 +1469,8 @@ namespace EnergyPlus::ThermalISO15099Calc { // first store results before iterations begin if (saveIterationResults) { - storeIterationResults( - files, nlayer, index, theta, trmout, tamb, trmin, troom, ebsky, ebroom, hcin, hcout, hrin, hrout, hin, hout, state.dataThermalISO15099Calc->Ebb, state.dataThermalISO15099Calc->Ebf, state.dataThermalISO15099Calc->Rb, state.dataThermalISO15099Calc->Rf, nperr); + storeIterationResults(state, + files, nlayer, index, theta, trmout, tamb, trmin, troom, ebsky, ebroom, hcin, hcout, hrin, hrout, hin, hout, Ebb, Ebf, Rb, Rf, nperr); } state.dataThermalISO15099Calc->Tgap(1) = tout; @@ -1432,11 +1491,11 @@ namespace EnergyPlus::ThermalISO15099Calc { // do i=1,nlayer+1 // if (i == 1) then - // state.dataThermalISO15099Calc->Tgap(i) = tout + // Tgap(i) = tout // else if (i == nlayer+1) then - // state.dataThermalISO15099Calc->Tgap(i) = tind + // Tgap(i) = tind // else - // state.dataThermalISO15099Calc->Tgap(i) = (theta(2*i-2) + theta(2*i-1)) / 2.0d0 + // Tgap(i) = (theta(2*i-2) + theta(2*i-1)) / 2.0d0 // end if // end do @@ -1453,7 +1512,8 @@ namespace EnergyPlus::ThermalISO15099Calc { } // evaluate convective/conductive components of gap - hatter(nlayer, + hatter(state, + nlayer, iwd, tout, tind, @@ -1503,7 +1563,8 @@ namespace EnergyPlus::ThermalISO15099Calc { Ra, Nu); - effectiveLayerCond(nlayer, + effectiveLayerCond(state, + nlayer, LayerType, scon, thick, @@ -1515,7 +1576,7 @@ namespace EnergyPlus::ThermalISO15099Calc { gcon, gvis, gcp, - state.dataThermalISO15099Calc->EffectiveOpenness, + EffectiveOpenness, theta, sconScaled, nperr, @@ -1529,14 +1590,14 @@ namespace EnergyPlus::ThermalISO15099Calc { // adjust hhat values // call adjusthhat(SDLayerIndex, ibc, tout, tind, nlayer, theta, wso, wsi, iwd, height, heightt, tilt, & // & thick, gap, hout, hrout, hin, hrin, iprop, frct, presure, nmix, wght, gcon, gvis, gcp, & - // index, SDScalar, Ebf, Ebb, state.dataThermalISO15099Calc->hgas, hhat, nperr, ErrorMessage) + // index, SDScalar, Ebf, Ebb, hgas, hhat, nperr, ErrorMessage) // do i = 1, maxlay3 // hhatv(i) = 0.0d0 // Ebgap(i) = 0.0d0 // qv(i) = 0.0d0 - // state.dataThermalISO15099Calc->hcv(i) = 0.0d0 + // hcv(i) = 0.0d0 // end do - matrixQBalance(nlayer, a, b, sconScaled, hcgas, state.dataThermalISO15099Calc->hcgapMod, asol, qv, state.dataThermalISO15099Calc->hcv, tind, tout, Gin, Gout, theta, tir, state.dataThermalISO15099Calc->rir, emis, edgeGlCorrFac); + matrixQBalance(nlayer, a, b, sconScaled, hcgas, state.dataThermalISO15099Calc->hcgapMod, asol, qv, state.dataThermalISO15099Calc->hcv, tind, tout, Gin, Gout, theta, tir, rir, emis, edgeGlCorrFac); } else { // bi...There are no Venetian layers, or ThermalMod is not CSM, so carry on as usual: shading(theta, @@ -1571,12 +1632,12 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->hcv, nperr, ErrorMessage, - state.dataThermalISO15099Calc->vfreevent); + vfreevent); // exit on error if (!(GoAhead(nperr))) return; - matrixQBalance(nlayer, a, b, sconScaled, hcgas, state.dataThermalISO15099Calc->hcgapMod, asol, qv, state.dataThermalISO15099Calc->hcv, tind, tout, Gin, Gout, theta, tir, state.dataThermalISO15099Calc->rir, emis, edgeGlCorrFac); + matrixQBalance(nlayer, a, b, sconScaled, hcgas, state.dataThermalISO15099Calc->hcgapMod, asol, qv, state.dataThermalISO15099Calc->hcv, tind, tout, Gin, Gout, theta, tir, rir, emis, edgeGlCorrFac); } // end if @@ -1593,7 +1654,8 @@ namespace EnergyPlus::ThermalISO15099Calc { x(k + 3) = theta(j + 1); } - CalculateFuncResults(nlayer, a, b, x, FRes); + CalculateFuncResults(state, + nlayer, a, b, x, FRes); FResDiff = FRes - FResOld; @@ -1667,7 +1729,8 @@ namespace EnergyPlus::ThermalISO15099Calc { // and store results during iterations if (saveIterationResults) { - storeIterationResults(files, + storeIterationResults(state, + files, nlayer, index + 1, theta, @@ -1683,10 +1746,10 @@ namespace EnergyPlus::ThermalISO15099Calc { hrout, hin, hout, - state.dataThermalISO15099Calc->Ebb, - state.dataThermalISO15099Calc->Ebf, - state.dataThermalISO15099Calc->Rb, - state.dataThermalISO15099Calc->Rf, + Ebb, + Ebf, + Rb, + Rf, nperr); } @@ -1770,7 +1833,8 @@ namespace EnergyPlus::ThermalISO15099Calc { } // Simon: It is important to recalculate coefficients from most accurate run - hatter(nlayer, + hatter(state, + nlayer, iwd, tout, tind, @@ -1852,7 +1916,7 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->hcv, nperr, ErrorMessage, - state.dataThermalISO15099Calc->vfreevent); + vfreevent); } if (CalcOutcome == CalculationOutcome::Unknown) { @@ -1864,22 +1928,23 @@ namespace EnergyPlus::ThermalISO15099Calc { // if (curEquationsApproach.eq.eaQBalance) then for (i = 1; i <= nlayer; ++i) { k = 2 * i - 1; - state.dataThermalISO15099Calc->Rf(i) = Radiation(k); - state.dataThermalISO15099Calc->Rb(i) = Radiation(k + 1); - state.dataThermalISO15099Calc->Ebf(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(k)); - state.dataThermalISO15099Calc->Ebb(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(k + 1)); + Rf(i) = Radiation(k); + Rb(i) = Radiation(k + 1); + Ebf(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(k)); + Ebb(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(k + 1)); } // end if // Finishing calcs: - resist(nlayer, trmout, tout, trmin, tind, hcgas, hrgas, theta, q, qv, LayerType, thick, scon, ufactor, flux, state.dataThermalISO15099Calc->qcgas, state.dataThermalISO15099Calc->qrgas); + resist(state, + nlayer, trmout, tout, trmin, tind, hcgas, hrgas, theta, q, qv, LayerType, thick, scon, ufactor, flux, qcgas, qrgas); // bi... Set T6-related quantities - ratios for modified epsilon, hc for modelling external SDs: // (using non-solar pass results) if ((dir == 0.0) && (nlayer > 1)) { - qr_gap_out = state.dataThermalISO15099Calc->Rf(2) - state.dataThermalISO15099Calc->Rb(1); - qr_gap_in = state.dataThermalISO15099Calc->Rf(nlayer) - state.dataThermalISO15099Calc->Rb(nlayer - 1); + qr_gap_out = Rf(2) - Rb(1); + qr_gap_in = Rf(nlayer) - Rb(nlayer - 1); if (IsShadingLayer(LayerType(1))) { ShadeEmisRatioOut = qr_gap_out / (emis(3) * DataGlobalConstants::StefanBoltzmann * (pow_4(theta(3)) - pow_4(trmout))); @@ -1899,16 +1964,15 @@ namespace EnergyPlus::ThermalISO15099Calc { } - void guess(EnergyPlusData &state, - Real64 const tout, + void guess(Real64 const tout, Real64 const tind, int const nlayer, const Array1D &gap, const Array1D &thick, Real64 &width, Array1D &theta, - Array1D &state.dataThermalISO15099Calc->Ebb, - Array1D &state.dataThermalISO15099Calc->Ebf, + Array1D &Ebb, + Array1D &Ebf, Array1D &Tgap) { //*********************************************************************** @@ -1935,9 +1999,9 @@ namespace EnergyPlus::ThermalISO15099Calc { EP_SIZE_CHECK(gap, MaxGap); EP_SIZE_CHECK(thick, maxlay); EP_SIZE_CHECK(theta, maxlay2); - EP_SIZE_CHECK(state.dataThermalISO15099Calc->Ebb, maxlay); - EP_SIZE_CHECK(state.dataThermalISO15099Calc->Ebf, maxlay); - EP_SIZE_CHECK(state.dataThermalISO15099Calc->Tgap, maxlay1); + EP_SIZE_CHECK(Ebb, maxlay); + EP_SIZE_CHECK(Ebf, maxlay); + EP_SIZE_CHECK(Tgap, maxlay1); // Locals Array1D x(maxlay2); @@ -1967,23 +2031,22 @@ namespace EnergyPlus::ThermalISO15099Calc { j = 2 * i; theta(j - 1) = tout + x(j - 1) * delta; theta(j) = tout + x(j) * delta; - state.dataThermalISO15099Calc->Ebf(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(j - 1)); - state.dataThermalISO15099Calc->Ebb(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(j)); + Ebf(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(j - 1)); + Ebb(i) = DataGlobalConstants::StefanBoltzmann * pow_4(theta(j)); } for (i = 1; i <= nlayer + 1; ++i) { if (i == 1) { - state.dataThermalISO15099Calc->Tgap(1) = tout; + Tgap(1) = tout; } else if (i == (nlayer + 1)) { - state.dataThermalISO15099Calc->Tgap(nlayer + 1) = tind; + Tgap(nlayer + 1) = tind; } else { - state.dataThermalISO15099Calc->Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; + Tgap(i) = (theta(2 * i - 1) + theta(2 * i - 2)) / 2; } } } - void solarISO15099(EnergyPlusData &state, - Real64 const totsol, Real64 const state.dataThermalISO15099Calc->rtot, const Array1D &state.dataThermalISO15099Calc->rs, int const nlayer, const Array1D &absol, Real64 &sf) + void solarISO15099(Real64 const totsol, Real64 const rtot, const Array1D &rs, int const nlayer, const Array1D &absol, Real64 &sf) { //*********************************************************************** // This subroutine calculates the shading coefficient for a window. @@ -1999,7 +2062,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // sf solar gain of space // Argument array dimensioning - EP_SIZE_CHECK(state.dataThermalISO15099Calc->rs, maxlay3); + EP_SIZE_CHECK(rs, maxlay3); EP_SIZE_CHECK(absol, maxlay); // Locals @@ -2012,24 +2075,23 @@ namespace EnergyPlus::ThermalISO15099Calc { flowin = 0.0; sf = 0.0; - if (state.dataThermalISO15099Calc->rtot == 0.0) { + if (rtot == 0.0) { return; } // evaluate inward flowing fraction of absorbed radiation: - flowin = (state.dataThermalISO15099Calc->rs(1) + 0.5 * state.dataThermalISO15099Calc->rs(2)) / state.dataThermalISO15099Calc->rtot; + flowin = (rs(1) + 0.5 * rs(2)) / rtot; fract = absol(1) * flowin; for (i = 2; i <= nlayer; ++i) { j = 2 * i; - flowin += (0.5 * (state.dataThermalISO15099Calc->rs(j - 2) + state.dataThermalISO15099Calc->rs(j)) + state.dataThermalISO15099Calc->rs(j - 1)) / state.dataThermalISO15099Calc->rtot; + flowin += (0.5 * (rs(j - 2) + rs(j)) + rs(j - 1)) / rtot; fract += absol(i) * flowin; } sf = totsol + fract; // add inward fraction to directly transmitted fraction } - void resist(EnergyPlusData &state, - int const nlayer, + void resist(int const nlayer, Real64 const trmout, Real64 const Tout, Real64 const trmin, @@ -2044,8 +2106,8 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D &scon, Real64 &ufactor, Real64 &flux, - Array1D &state.dataThermalISO15099Calc->qcgas, - Array1D &state.dataThermalISO15099Calc->qrgas) + Array1D &qcgas, + Array1D &qrgas) { //*********************************************************************** // subroutine to calculate total thermal resistance of the glazing system @@ -2061,20 +2123,20 @@ namespace EnergyPlus::ThermalISO15099Calc { // calculate heat flow for external and internal environments and gaps for (i = 1; i <= nlayer + 1; ++i) { if (i == 1) { - state.dataThermalISO15099Calc->qcgas(i) = hcgas(i) * (Theta(2 * i - 1) - Tout); - state.dataThermalISO15099Calc->qrgas(i) = hrgas(i) * (Theta(2 * i - 1) - trmout); - qlayer(2 * i - 1) = state.dataThermalISO15099Calc->qcgas(i) + state.dataThermalISO15099Calc->qrgas(i); - // rs(2*i-1) = 1/state.dataThermalISO15099Calc->hgas(i) + qcgas(i) = hcgas(i) * (Theta(2 * i - 1) - Tout); + qrgas(i) = hrgas(i) * (Theta(2 * i - 1) - trmout); + qlayer(2 * i - 1) = qcgas(i) + qrgas(i); + // rs(2*i-1) = 1/hgas(i) } else if (i == (nlayer + 1)) { - state.dataThermalISO15099Calc->qcgas(i) = hcgas(i) * (tind - Theta(2 * i - 2)); - state.dataThermalISO15099Calc->qrgas(i) = hrgas(i) * (trmin - Theta(2 * i - 2)); - qlayer(2 * i - 1) = state.dataThermalISO15099Calc->qcgas(i) + state.dataThermalISO15099Calc->qrgas(i); - // rs(2*i-1) = 1/state.dataThermalISO15099Calc->hgas(i) + qcgas(i) = hcgas(i) * (tind - Theta(2 * i - 2)); + qrgas(i) = hrgas(i) * (trmin - Theta(2 * i - 2)); + qlayer(2 * i - 1) = qcgas(i) + qrgas(i); + // rs(2*i-1) = 1/hgas(i) } else { - state.dataThermalISO15099Calc->qcgas(i) = hcgas(i) * (Theta(2 * i - 1) - Theta(2 * i - 2)); - state.dataThermalISO15099Calc->qrgas(i) = hrgas(i) * (Theta(2 * i - 1) - Theta(2 * i - 2)); - qlayer(2 * i - 1) = state.dataThermalISO15099Calc->qcgas(i) + state.dataThermalISO15099Calc->qrgas(i); - // rs(2*i-1) = 1/state.dataThermalISO15099Calc->hgas(i) + qcgas(i) = hcgas(i) * (Theta(2 * i - 1) - Theta(2 * i - 2)); + qrgas(i) = hrgas(i) * (Theta(2 * i - 1) - Theta(2 * i - 2)); + qlayer(2 * i - 1) = qcgas(i) + qrgas(i); + // rs(2*i-1) = 1/hgas(i) } } @@ -2114,7 +2176,7 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D &scon, Real64 const tilt, Array1D &theta, - const Array1D &state.dataThermalISO15099Calc->Tgap, + const Array1D &Tgap, Array1D &Radiation, Real64 const trmout, Real64 const trmin, @@ -2130,7 +2192,7 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D_int &SupportPillar, const Array1D &PillarSpacing, const Array1D &PillarRadius, - Array1D &state.dataThermalISO15099Calc->hgas, + Array1D &hgas, Array1D &hcgas, Array1D &hrgas, Real64 &hcin, @@ -2179,7 +2241,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // nmix vector of number of gasses in a mixture for each gap // Ouputs // hhat vector of all film coefficients (maxlay3) - // state.dataThermalISO15099Calc->hgas vector of gap 'film' coeff. + // hgas vector of gap 'film' coeff. // hcin Indoor convective surface heat transfer coefficient // hcout Outdoor convective heat transfer coeff // hrin Indoor radiative surface heat transfer coefficient @@ -2199,9 +2261,10 @@ namespace EnergyPlus::ThermalISO15099Calc { // evaluate convective/conductive components of gap grashof number, thermal conductivity and their derivatives: nface = 2 * nlayer; - filmg(tilt, + filmg(state, + tilt, theta, - state.dataThermalISO15099Calc->Tgap, + Tgap, nlayer, height, gap, @@ -2225,8 +2288,9 @@ namespace EnergyPlus::ThermalISO15099Calc { return; } - // this is adding influence of pillar to state.dataThermalISO15099Calc->hgas - filmPillar(SupportPillar, scon, PillarSpacing, PillarRadius, nlayer, gap, hcgas, VacuumMaxGapThickness, nperr, ErrorMessage); + // this is adding influence of pillar to hgas + filmPillar(state, + SupportPillar, scon, PillarSpacing, PillarRadius, nlayer, gap, hcgas, VacuumMaxGapThickness, nperr, ErrorMessage); if (!(GoAhead(nperr))) { return; @@ -2243,12 +2307,13 @@ namespace EnergyPlus::ThermalISO15099Calc { hrgas(i) = (Radiation(k) - Radiation(k - 1)) / (theta(k) - theta(k - 1)); } - state.dataThermalISO15099Calc->hgas(i) = hcgas(i) + hrgas(i); + hgas(i) = hcgas(i) + hrgas(i); } // convective indoor film coeff: if (ibc(2) <= 0) { filmi( + state, tind, theta(nface), nlayer, tilt, wsi, heightt, iprop, frct, presure, nmix, wght, gcon, gvis, gcp, hcin, ibc(2), nperr, ErrorMessage); } else if (ibc(2) == 1) { hcin = hin - hrin; @@ -2273,7 +2338,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // hrin = sigma * emis(2*nlayer) * (Theta(2*nlayer)**4 - Trmin**4)/(Theta(2*nlayer) - Trmin) // end if hrgas(nlayer + 1) = hrin; - // state.dataThermalISO15099Calc->hgas(nlayer+1) = hcgas(nlayer+1) + hrgas(nlayer+1) + // hgas(nlayer+1) = hcgas(nlayer+1) + hrgas(nlayer+1) troom = (hcin * tind + hrin * trmin) / (hcin + hrin); // convective outdoor film coeff: @@ -2301,7 +2366,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // hrout = sigma * emis(1) * (Theta(1)**4 - Trmout**4)/(Theta(1) - Trmout) // end if hrgas(1) = hrout; - // state.dataThermalISO15099Calc->hgas(1) = hrout + hcout + // hgas(1) = hrout + hcout tamb = (hcout * tout + hrout * trmout) / (hcout + hrout); } @@ -2318,15 +2383,13 @@ namespace EnergyPlus::ThermalISO15099Calc { Array2A const gcon, // Gas specific conductivity Array2A const gvis, // Gas specific viscosity Array2A const gcp, // Gas specific heat - const Array1D &state.dataThermalISO15099Calc->EffectiveOpenness, // Layer effective openneess [m2] + const Array1D &EffectiveOpenness, // Layer effective openneess [m2] Array1D &theta, // Layer surface tempeartures [K] Array1D &sconScaled, // Layer conductivity divided by thickness int &nperr, // Error message flag std::string &ErrorMessage // Error message ) { - - for (auto i = 1; i <= nlayer; ++i) { if (LayerType(i) != SPECULAR) { auto tLayer = (theta(2 * i - 1) + theta(2 * i)) / 2; @@ -2343,7 +2406,7 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 cp; Real64 pr; GASSES90(tLayer, state.dataThermalISO15099Calc->iprop1, state.dataThermalISO15099Calc->frct1, press1, nmix1, wght, gcon, gvis, gcp, con, visc, dens, cp, pr, 1, nperr, ErrorMessage); - sconScaled(i) = (state.dataThermalISO15099Calc->EffectiveOpenness(i) * con + (1 - state.dataThermalISO15099Calc->EffectiveOpenness(i)) * scon(i)) / thick(i); + sconScaled(i) = (EffectiveOpenness(i) * con + (1 - EffectiveOpenness(i)) * scon(i)) / thick(i); } else { sconScaled(i) = scon(i) / thick(i); } @@ -2432,13 +2495,13 @@ namespace EnergyPlus::ThermalISO15099Calc { delt = std::abs(tair - t); for (j = 1; j <= nmix(nlayer + 1); ++j) { - ipropi(j) = iprop(j, nlayer + 1); - frcti(j) = frct(j, nlayer + 1); + state.dataThermalISO15099Calc->ipropi(j) = iprop(j, nlayer + 1); + state.dataThermalISO15099Calc->frcti(j) = frct(j, nlayer + 1); } GASSES90(tmean, - ipropi, - frcti, + state.dataThermalISO15099Calc->ipropi, + state.dataThermalISO15099Calc->frcti, presure(nlayer + 1), nmix(nlayer + 1), wght, @@ -2493,7 +2556,7 @@ namespace EnergyPlus::ThermalISO15099Calc { void filmg(EnergyPlusData &state, Real64 const tilt, const Array1D &theta, - const Array1D &state.dataThermalISO15099Calc->Tgap, + const Array1D &Tgap, int const nlayer, Real64 const height, const Array1D &gap, @@ -2527,7 +2590,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // presure // nmix vector of number of gasses in a mixture for each gap // Output: - // state.dataThermalISO15099Calc->hgas vector of gap coefficients + // hgas vector of gap coefficients // nperr error code // Locals: // gr gap grashof number @@ -2542,7 +2605,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // Using // Argument array dimensioning EP_SIZE_CHECK(theta, maxlay2); - EP_SIZE_CHECK(state.dataThermalISO15099Calc->Tgap, maxlay1); + EP_SIZE_CHECK(Tgap, maxlay1); EP_SIZE_CHECK(gap, MaxGap); iprop.dim(maxgas, maxlay1); frct.dim(maxgas, maxlay1); @@ -2580,18 +2643,18 @@ namespace EnergyPlus::ThermalISO15099Calc { k = j + 1; // determine the gas properties of each gap: // tmean = (theta(j)+theta(k))/2.0d0 - tmean = state.dataThermalISO15099Calc->Tgap(i + 1); // state.dataThermalISO15099Calc->Tgap(1) is exterior environment + tmean = Tgap(i + 1); // Tgap(1) is exterior environment delt = std::abs(theta(j) - theta(k)); // Temperatures should not be equal. This can happen in initial temperature guess before iterations started if (delt == 0.0) delt = 1.0e-6; for (l = 1; l <= nmix(i + 1); ++l) { - ipropg(l) = iprop(l, i + 1); - frctg(l) = frct(l, i + 1); + state.dataThermalISO15099Calc->ipropg(l) = iprop(l, i + 1); + state.dataThermalISO15099Calc->ipropg(l) = frct(l, i + 1); } if (presure(i + 1) > VacuumPressure) { GASSES90( - tmean, ipropg, frctg, presure(i + 1), nmix(i + 1), wght, gcon, gvis, gcp, con, visc, dens, cp, pr, ISO15099, nperr, ErrorMessage); + tmean, state.dataThermalISO15099Calc->ipropg, state.dataThermalISO15099Calc->frctg, presure(i + 1), nmix(i + 1), wght, gcon, gvis, gcp, con, visc, dens, cp, pr, ISO15099, nperr, ErrorMessage); // Calculate grashoff number: // The grashoff number is the Rayleigh Number (equation 5.29) in SPC142 divided by the Prandtl Number (prand): @@ -2603,15 +2666,16 @@ namespace EnergyPlus::ThermalISO15099Calc { asp = height / gap(i); // end if // determine the Nusselt number: - nusselt(tilt, ra, asp, gnu, nperr, ErrorMessage); + nusselt(state, + tilt, ra, asp, gnu, nperr, ErrorMessage); Nu(i) = gnu; // calculate effective conductance of the gap hcgas(i + 1) = con / gap(i) * gnu; // write(*,*)'theta(j),theta(k),j,k',j,theta(j),k,theta(k) - // write(*,*)'Nusselt,Rayleigh,Prandtl,state.dataThermalISO15099Calc->hgas(k),k' - // write(*,*) gnu,gr*pr,pr,state.dataThermalISO15099Calc->hgas(k),k + // write(*,*)'Nusselt,Rayleigh,Prandtl,hgas(k),k' + // write(*,*) gnu,gr*pr,pr,hgas(k),k } else { // low pressure calculations GassesLow(tmean, wght(iprop(1, i + 1)), presure(i + 1), gama(iprop(1, i + 1)), con, nperr, ErrorMessage); hcgas(i + 1) = con; @@ -2648,9 +2712,8 @@ namespace EnergyPlus::ThermalISO15099Calc { // 0 - does not have support pillar // 1 - have support pillar - for (state.dataThermalISO15099Calc->iFP = 1; state.dataThermalISO15099Calc->iFP <= nlayer - 1; ++state.dataThermalISO15099Calc->iFP) { - kFP = 2 * state.dataThermalISO15099Calc->iFP + 1; + state.dataThermalISO15099Calc->kFP = 2 * state.dataThermalISO15099Calc->iFP + 1; if (SupportPillar(state.dataThermalISO15099Calc->iFP) == YES_SupportPillar) { // Average glass conductivity is taken as average from both glass surrounding gap @@ -2664,7 +2727,7 @@ namespace EnergyPlus::ThermalISO15099Calc { } } - void nusselt(EnergyPlusData &state, Real64 const tilt, Real64 const ra, Real64 const asp, Real64 &gnu, int &nperr, std::string &ErrorMessage) + void nusselt(Real64 const tilt, Real64 const ra, Real64 const asp, Real64 &gnu, int &nperr, std::string &ErrorMessage) { //*********************************************************************** // purpose to calculate nusselt modulus for air gaps (ISO15099) @@ -2797,7 +2860,7 @@ namespace EnergyPlus::ThermalISO15099Calc { } } - void storeIterationResults(EnergyPlusData &state, + void storeIterationResults(EnergyPlusData &state, Files &files, int const nlayer, int const index, @@ -2820,7 +2883,6 @@ namespace EnergyPlus::ThermalISO15099Calc { const Array1D &Rf, int &) { - static std::string dynFormat; int i; @@ -2861,9 +2923,9 @@ namespace EnergyPlus::ThermalISO15099Calc { print(files.TarcogIterationsFile, "\n"); // write Ebb and Ebf - print(files.TarcogIterationsFile, "{:16.8F} {:16.8F}", state.dataThermalISO15099Calc->Ebf(1), state.dataThermalISO15099Calc->Ebb(1)); + print(files.TarcogIterationsFile, "{:16.8F} {:16.8F}", Ebf(1), Ebb(1)); for (i = 2; i <= nlayer; ++i) { - print(files.TarcogIterationsFile, " {:16.8F} {:16.8F}", state.dataThermalISO15099Calc->Ebf(i), state.dataThermalISO15099Calc->Ebb(i)); + print(files.TarcogIterationsFile, " {:16.8F} {:16.8F}", Ebf(i), Ebb(i)); } print(files.TarcogIterationsFile, "\n"); @@ -2885,9 +2947,9 @@ namespace EnergyPlus::ThermalISO15099Calc { print(files.TarcogIterationsFile, dynFormat); print(files.TarcogIterationsFile, "\n"); // write Rb and Rf - print(files.TarcogIterationsFile, "{:16.8F} {:16.8F}", state.dataThermalISO15099Calc->Rf(1), state.dataThermalISO15099Calc->Rb(1)); + print(files.TarcogIterationsFile, "{:16.8F} {:16.8F}", Rf(1), Rb(1)); for (i = 1; i <= nlayer; ++i) { - print(files.TarcogIterationsFile, " {:16.8F} {:16.8F}", state.dataThermalISO15099Calc->Rf(i), state.dataThermalISO15099Calc->Rb(i)); + print(files.TarcogIterationsFile, " {:16.8F} {:16.8F}", Rf(i), Rb(i)); } print(files.TarcogIterationsFile, "\n"); @@ -2937,7 +2999,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // close(IterationCSVFileNumber) } - void CalculateFuncResults(EnergyPlusData &state, int const nlayer, Array2 const &a, const Array1D &b, const Array1D &x, Array1D &FRes) + void CalculateFuncResults(int const nlayer, Array2 const &a, const Array1D &b, const Array1D &x, Array1D &FRes) { // Tuned Rewritten to traverse a in unit stride order int const nlayer4(4 * nlayer); From 4e29c07a685bc5330dffb0418c0d8fb248d165b5 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Wed, 24 Mar 2021 15:21:24 -0600 Subject: [PATCH 06/21] building 15099 inter fixed --- src/EnergyPlus/TARCOGOutput.cc | 3 ++- src/EnergyPlus/ThermalISO15099Calc.cc | 28 ++++++++------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/EnergyPlus/TARCOGOutput.cc b/src/EnergyPlus/TARCOGOutput.cc index a83301dca06..39321b55866 100644 --- a/src/EnergyPlus/TARCOGOutput.cc +++ b/src/EnergyPlus/TARCOGOutput.cc @@ -76,7 +76,8 @@ namespace EnergyPlus::TARCOGOutput { using namespace TARCOGGassesParams; using namespace TARCOGParams; - void WriteInputArguments(EnergyPlusData &state, InputOutputFile &InArgumentsFile, + void WriteInputArguments(EnergyPlusData &state, + InputOutputFile &InArgumentsFile, const std::string &DBGD, Real64 const tout, Real64 const tind, diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index 23ef09613af..1eed3b3cd1f 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -342,20 +342,7 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 sc_NOSD; Real64 hflux_NOSD; Real64 shgc_NOSD; -// Real64 hout_NOSD; -// static Array1D gap_NOSD(maxlay); -// static Array1D thick_NOSD(maxlay); -// static Array1D scon_NOSD(maxlay); -// static Array1D emis_NOSD(maxlay2); -// static Array1D rir_NOSD(maxlay2); -// static Array1D tir_NOSD(maxlay2); -// static Array1D theta_NOSD(maxlay2); -// static Array2D frct_NOSD(maxgas, maxlay1); -// static Array2D_int iprop_NOSD(maxgas, maxlay1); -// static Array1D_int nmix_NOSD(maxlay1); -// static Array1D presure_NOSD(maxlay1); -// static Array1D hcgas_NOSD(maxlay1); -// static Array1D hrgas_NOSD(maxlay1); + Real64 hout_NOSD; // REAL(r64) :: rs_NOSD(maxlay3)!,sol(maxlay) static Array1D LaminateA_NOSD(maxlay); static Array1D LaminateB_NOSD(maxlay); @@ -810,11 +797,11 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->nmix_NOSD(nlayer_NOSD + 1) = nmix(nlayer + 1); state.dataThermalISO15099Calc->presure_NOSD(nlayer_NOSD + 1) = presure(nlayer + 1); for (j = 1; j <= nmix(1); ++j) { - state.dataThermalISO15099Calc->frct_NOSD(j, 1) = iprop(j, 1); + state.dataThermalISO15099Calc->iprop_NOSD(j, 1) = iprop(j, 1); state.dataThermalISO15099Calc->frct_NOSD(j, 1) = frct(j, 1); } for (j = 1; j <= nmix(nlayer_NOSD + 1); ++j) { - state.dataThermalISO15099Calc->frct_NOSD(j, nlayer_NOSD + 1) = iprop(j, nlayer + 1); + state.dataThermalISO15099Calc->iprop_NOSD(j, nlayer_NOSD + 1) = iprop(j, nlayer + 1); state.dataThermalISO15099Calc->frct_NOSD(j, nlayer_NOSD + 1) = frct(j, nlayer + 1); } for (i = 1; i <= nlayer_NOSD; ++i) { @@ -852,7 +839,7 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->nmix_NOSD(i + 1) = nmix(OriginalIndex + 1); state.dataThermalISO15099Calc->presure_NOSD(i + 1) = presure(OriginalIndex + 1); for (j = 1; j <= state.dataThermalISO15099Calc->nmix_NOSD(i + 1); ++j) { - state.dataThermalISO15099Calc->frct_NOSD(j, i + 1) = iprop(j, OriginalIndex + 1); + state.dataThermalISO15099Calc->iprop_NOSD(j, i + 1) = iprop(j, OriginalIndex + 1); state.dataThermalISO15099Calc->frct_NOSD(j, i + 1) = frct(j, OriginalIndex + 1); } } @@ -875,7 +862,8 @@ namespace EnergyPlus::ThermalISO15099Calc { print(files.DebugOutputFile, "UNSHADED RUN:\n"); print(files.DebugOutputFile, "\n"); - WriteInputArguments(state, files.DebugOutputFile, + WriteInputArguments(state, + files.DebugOutputFile, files.DBGD, tout, tind, @@ -929,7 +917,7 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->tvent_NOSD, state.dataThermalISO15099Calc->presure_NOSD, state.dataThermalISO15099Calc->nmix_NOSD, - state.dataThermalISO15099Calc->frct_NOSD, + state.dataThermalISO15099Calc->iprop_NOSD, state.dataThermalISO15099Calc->frct_NOSD, xgcon, xgvis, @@ -970,7 +958,7 @@ namespace EnergyPlus::ThermalISO15099Calc { height, heightt, width, - state.dataThermalISO15099Calc->frct_NOSD, + state.dataThermalISO15099Calc->iprop_NOSD, state.dataThermalISO15099Calc->frct_NOSD, state.dataThermalISO15099Calc->presure_NOSD, state.dataThermalISO15099Calc->nmix_NOSD, From 99b4788438fd9cda56d815e2c4be1f7a8813bd36 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Wed, 24 Mar 2021 15:52:03 -0600 Subject: [PATCH 07/21] 15099 done --- src/EnergyPlus/ThermalISO15099Calc.cc | 236 ++++++++++---------------- src/EnergyPlus/ThermalISO15099Calc.hh | 12 +- 2 files changed, 99 insertions(+), 149 deletions(-) diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index 1eed3b3cd1f..13c3b6ee664 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -315,10 +315,6 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 qc1; Real64 qc2; Real64 qcgg; - static Array1D qcgas(maxlay1); - static Array1D qcgaps(maxlay1); - static Array1D qrgas(maxlay1); - static Array1D qrgaps(maxlay1); Real64 ShadeHcModifiedOut; Real64 ShadeHcModifiedIn; @@ -337,49 +333,22 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 hrout_NOSD; Real64 tamb_NOSD; Real64 troom_NOSD; - static Array1D_int LayerType_NOSD(maxlay); Real64 ufactor_NOSD; Real64 sc_NOSD; Real64 hflux_NOSD; Real64 shgc_NOSD; Real64 hout_NOSD; // REAL(r64) :: rs_NOSD(maxlay3)!,sol(maxlay) - static Array1D LaminateA_NOSD(maxlay); - static Array1D LaminateB_NOSD(maxlay); - static Array1D sumsol_NOSD(maxlay); - static Array1D Ra_NOSD(maxlay); - static Array1D Nu_NOSD(maxlay); Real64 ShadeEmisRatioOut_NOSD; Real64 ShadeEmisRatioIn_NOSD; Real64 ShadeHcRatioOut_NOSD; Real64 ShadeHcRatioIn_NOSD; Real64 ShadeHcModifiedOut_NOSD; Real64 ShadeHcModifiedIn_NOSD; - static Array1D Ebb(maxlay); - static Array1D Ebf(maxlay); - static Array1D Rb(maxlay); - static Array1D Rf(maxlay); - static Array1D Ebbs(maxlay); - static Array1D Ebfs(maxlay); - static Array1D Rbs(maxlay); - static Array1D Rfs(maxlay); - static Array1D Ebb_NOSD(maxlay); - static Array1D Ebf_NOSD(maxlay); - static Array1D Rb_NOSD(maxlay); - static Array1D Rf_NOSD(maxlay); - - static Array1D ShadeGapKeffConv_NOSD(MaxGap); - static Array1D qcgas_NOSD(maxlay1); - static Array1D Keff_NOSD(maxlay1); - static Array1D qrgas_NOSD(maxlay1); - static Array1D_int nslice_NOSD(maxlay); - static Array1D vfreevent_NOSD(maxlay1); int FirstSpecularLayer; int LastSpecularLayer; - static Array1D vfreevent(maxlay1); - // cbi...Other variables: Real64 flux; Real64 hint; @@ -390,18 +359,6 @@ namespace EnergyPlus::ThermalISO15099Calc { int j; int OriginalIndex; int UnshadedDebug; - static Real64 rtot(0.0); - static Real64 sft(0.0); - static Real64 hcins(0.0); - static Real64 hrins(0.0); - static Real64 hins(0.0); - static Real64 hcouts(0.0); - static Real64 hrouts(0.0); - static Real64 houts(0.0); - static Real64 ufactors(0.0); - static Real64 fluxs(0.0); - static Real64 qeff(0.0); - static Real64 flux_nonsolar(0.0); // Autodesk:Uninit Initialize variables used uninitialized shgc_NOSD = 0.0; // Autodesk:Uninit Force default initialization @@ -460,7 +417,7 @@ namespace EnergyPlus::ThermalISO15099Calc { Gout, Gin, state.dataThermalISO15099Calc->rir, - vfreevent, + state.dataThermalISO15099Calc->vfreevent, nperr, ErrorMessage ); @@ -591,13 +548,13 @@ namespace EnergyPlus::ThermalISO15099Calc { LayerType, Ra, Nu, - vfreevent, - qcgas, - qrgas, - Ebf, - Ebb, - Rf, - Rb, + state.dataThermalISO15099Calc->vfreevent, + state.dataThermalISO15099Calc->qcgas, + state.dataThermalISO15099Calc->qrgas, + state.dataThermalISO15099Calc->Ebf, + state.dataThermalISO15099Calc->Ebb, + state.dataThermalISO15099Calc->Rf, + state.dataThermalISO15099Calc->Rb, ShadeEmisRatioOut, ShadeEmisRatioIn, ShadeHcModifiedOut, @@ -627,24 +584,24 @@ namespace EnergyPlus::ThermalISO15099Calc { // No need to store results in case of non-ufactor run if ((SHGCCalc > 0) && (dir > 0.0)) { - solarISO15099(state, totsol, rtot, state.dataThermalISO15099Calc->rs, nlayer, asol, sft); - shgct = sft; + solarISO15099(totsol, state.dataThermalISO15099Calc->rtot, state.dataThermalISO15099Calc->rs, nlayer, asol, state.dataThermalISO15099Calc->sft); + shgct = state.dataThermalISO15099Calc->sft; shgct_NOSD = 0.0; - hcins = hcin; - hrins = hrin; - hins = hin; - hcouts = hcout; - hrouts = hrout; - houts = hout; - ufactors = ufactor; - fluxs = flux; + state.dataThermalISO15099Calc->hcins = hcin; + state.dataThermalISO15099Calc->hrins = hrin; + state.dataThermalISO15099Calc->hins = hin; + state.dataThermalISO15099Calc->hcouts = hcout; + state.dataThermalISO15099Calc->hrouts = hrout; + state.dataThermalISO15099Calc->houts = hout; + state.dataThermalISO15099Calc->ufactors = ufactor; + state.dataThermalISO15099Calc->fluxs = flux; for (i = 1; i <= nlayer; ++i) { state.dataThermalISO15099Calc->thetas(2 * i - 1) = theta(2 * i - 1); state.dataThermalISO15099Calc->thetas(2 * i) = theta(2 * i); - Ebbs(i) = Ebb(i); - Ebfs(i) = Ebf(i); - Rbs(i) = Rb(i); - Rfs(i) = Rf(i); + state.dataThermalISO15099Calc->Ebbs(i) = state.dataThermalISO15099Calc->Ebb(i); + state.dataThermalISO15099Calc->Ebfs(i) = state.dataThermalISO15099Calc->Ebf(i); + state.dataThermalISO15099Calc->Rbs(i) = state.dataThermalISO15099Calc->Rb(i); + state.dataThermalISO15099Calc->Rfs(i) = state.dataThermalISO15099Calc->Rf(i); state.dataThermalISO15099Calc->qs(2 * i - 1) = q(2 * i - 1); state.dataThermalISO15099Calc->qs(2 * i) = q(2 * i); // qprims(2*i - 1) = qprim(2*i - 1) @@ -653,8 +610,8 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->qvs(2 * i) = qv(2 * i); state.dataThermalISO15099Calc->hcgass(i) = hcgas(i); state.dataThermalISO15099Calc->hrgass(i) = hrgas(i); - qrgaps(i) = qrgas(i); - qcgaps(i) = qcgas(i); + state.dataThermalISO15099Calc->qrgaps(i) = state.dataThermalISO15099Calc->qrgas(i); + state.dataThermalISO15099Calc->qcgaps(i) = state.dataThermalISO15099Calc->qcgas(i); } // CHECK THIS! state.dataThermalISO15099Calc->qs(2 * nlayer + 1) = q(2 * nlayer + 1); @@ -742,13 +699,13 @@ namespace EnergyPlus::ThermalISO15099Calc { LayerType, Ra, Nu, - vfreevent, - qcgas, - qrgas, - Ebf, - Ebb, - Rf, - Rb, + state.dataThermalISO15099Calc->vfreevent, + state.dataThermalISO15099Calc->qcgas, + state.dataThermalISO15099Calc->qrgas, + state.dataThermalISO15099Calc->Ebf, + state.dataThermalISO15099Calc->Ebb, + state.dataThermalISO15099Calc->Rf, + state.dataThermalISO15099Calc->Rb, ShadeEmisRatioOut, ShadeEmisRatioIn, ShadeHcModifiedOut, @@ -823,7 +780,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // vvent_NOSD // tvent_NOSD - LayerType_NOSD(i) = LayerType(OriginalIndex); + state.dataThermalISO15099Calc->LayerType_NOSD(i) = LayerType(OriginalIndex); state.dataThermalISO15099Calc->thick_NOSD(i) = thick(OriginalIndex); state.dataThermalISO15099Calc->scon_NOSD(i) = scon(OriginalIndex); @@ -844,11 +801,11 @@ namespace EnergyPlus::ThermalISO15099Calc { } } - LaminateA_NOSD(i) = LaminateA(OriginalIndex); - LaminateB_NOSD(i) = LaminateB(OriginalIndex); - sumsol_NOSD(i) = sumsol(OriginalIndex); + state.dataThermalISO15099Calc->LaminateA_NOSD(i) = LaminateA(OriginalIndex); + state.dataThermalISO15099Calc->LaminateB_NOSD(i) = LaminateB(OriginalIndex); + state.dataThermalISO15099Calc->sumsol_NOSD(i) = sumsol(OriginalIndex); - nslice_NOSD(i) = nslice(OriginalIndex); + state.dataThermalISO15099Calc->nslice_NOSD(i) = nslice(OriginalIndex); } // This is UNSHADED pass - no solar radiation: @@ -891,7 +848,7 @@ namespace EnergyPlus::ThermalISO15099Calc { tilt, totsol, nlayer_NOSD, - LayerType_NOSD, + state.dataThermalISO15099Calc->LayerType_NOSD, state.dataThermalISO15099Calc->thick_NOSD, state.dataThermalISO15099Calc->scon_NOSD, asol, @@ -908,10 +865,10 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->SlatCond_NOSD, state.dataThermalISO15099Calc->SlatSpacing_NOSD, state.dataThermalISO15099Calc->SlatCurve_NOSD, - nslice_NOSD, - LaminateA_NOSD, - LaminateB_NOSD, - sumsol_NOSD, + state.dataThermalISO15099Calc->nslice_NOSD, + state.dataThermalISO15099Calc->LaminateA_NOSD, + state.dataThermalISO15099Calc->LaminateB_NOSD, + state.dataThermalISO15099Calc->sumsol_NOSD, state.dataThermalISO15099Calc->gap_NOSD, state.dataThermalISO15099Calc->vvent_NOSD, state.dataThermalISO15099Calc->tvent_NOSD, @@ -996,16 +953,16 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->EffectiveOpenness_NOSD, state.dataThermalISO15099Calc->vvent_NOSD, state.dataThermalISO15099Calc->tvent_NOSD, - LayerType_NOSD, - Ra_NOSD, - Nu_NOSD, - vfreevent_NOSD, - qcgas_NOSD, - qrgas_NOSD, - Ebf_NOSD, - Ebb_NOSD, - Rf_NOSD, - Rb_NOSD, + state.dataThermalISO15099Calc->LayerType_NOSD, + state.dataThermalISO15099Calc->Ra_NOSD, + state.dataThermalISO15099Calc->Nu_NOSD, + state.dataThermalISO15099Calc->vfreevent_NOSD, + state.dataThermalISO15099Calc->qcgas_NOSD, + state.dataThermalISO15099Calc->qrgas_NOSD, + state.dataThermalISO15099Calc->Ebf_NOSD, + state.dataThermalISO15099Calc->Ebb_NOSD, + state.dataThermalISO15099Calc->Rf_NOSD, + state.dataThermalISO15099Calc->Rb_NOSD, ShadeEmisRatioOut_NOSD, ShadeEmisRatioIn_NOSD, ShadeHcModifiedOut_NOSD, @@ -1035,13 +992,13 @@ namespace EnergyPlus::ThermalISO15099Calc { tamb, state.dataThermalISO15099Calc->q_NOSD, state.dataThermalISO15099Calc->qv_NOSD, - qcgas_NOSD, - qrgas_NOSD, + state.dataThermalISO15099Calc->qcgas_NOSD, + state.dataThermalISO15099Calc->qrgas_NOSD, state.dataThermalISO15099Calc->theta_NOSD, - vfreevent_NOSD, + state.dataThermalISO15099Calc->vfreevent_NOSD, state.dataThermalISO15099Calc->vvent_NOSD, - Keff_NOSD, - ShadeGapKeffConv_NOSD, + state.dataThermalISO15099Calc->Keff_NOSD, + state.dataThermalISO15099Calc->ShadeGapKeffConv_NOSD, troom_NOSD, ufactor_NOSD, shgc_NOSD, @@ -1052,13 +1009,13 @@ namespace EnergyPlus::ThermalISO15099Calc { hrin_NOSD, hcout_NOSD, hrout_NOSD, - Ra_NOSD, - Nu_NOSD, - LayerType_NOSD, - Ebf_NOSD, - Ebb_NOSD, - Rf_NOSD, - Rb_NOSD, + state.dataThermalISO15099Calc->Ra_NOSD, + state.dataThermalISO15099Calc->Nu_NOSD, + state.dataThermalISO15099Calc->LayerType_NOSD, + state.dataThermalISO15099Calc->Ebf_NOSD, + state.dataThermalISO15099Calc->Ebb_NOSD, + state.dataThermalISO15099Calc->Rf_NOSD, + state.dataThermalISO15099Calc->Rb_NOSD, ebsky, Gout, ebroom, @@ -1092,8 +1049,8 @@ namespace EnergyPlus::ThermalISO15099Calc { // Keff(i) = gap(i) * qprim(2*i+1) / (theta(2*i+1) - theta(2*i)) if ((i > 1) && (i < nlayer)) { tgg = gap(i - 1) + gap(i) + thick(i); - qc1 = qcgas(i - 1); - qc2 = qcgas(i); + qc1 = state.dataThermalISO15099Calc->qcgas(i - 1); + qc2 = state.dataThermalISO15099Calc->qcgas(i); qcgg = (qc1 + qc2) / 2.0; ShadeGapKeffConv(i) = tgg * qcgg / (theta(2 * i + 1) - theta(2 * i - 2)); } @@ -1104,26 +1061,26 @@ namespace EnergyPlus::ThermalISO15099Calc { } // if (UFactorCalc.ne.0) then // bi... For debugging purposes: - qeff = ufactor * std::abs(tout - tind); - flux_nonsolar = flux; + state.dataThermalISO15099Calc->qeff = ufactor * std::abs(tout - tind); + state.dataThermalISO15099Calc->flux_nonsolar = flux; if ((SHGCCalc > 0) && (dir > 0.0)) { - shgc = totsol - (fluxs - flux) / dir; + shgc = totsol - (state.dataThermalISO15099Calc->fluxs - flux) / dir; sc = shgc / 0.87; - hcin = hcins; - hrin = hrins; - hin = hins; - hcout = hcouts; - hrout = hrouts; - hout = houts; - flux = fluxs; // <--- ??? + hcin = state.dataThermalISO15099Calc->hcins; + hrin = state.dataThermalISO15099Calc->hrins; + hin = state.dataThermalISO15099Calc->hins; + hcout = state.dataThermalISO15099Calc->hcouts; + hrout = state.dataThermalISO15099Calc->hrouts; + hout = state.dataThermalISO15099Calc->houts; + flux = state.dataThermalISO15099Calc->fluxs; // <--- ??? for (i = 1; i <= nlayer; ++i) { theta(2 * i - 1) = state.dataThermalISO15099Calc->thetas(2 * i - 1); theta(2 * i) = state.dataThermalISO15099Calc->thetas(2 * i); - Ebb(i) = Ebbs(i); - Ebf(i) = Ebfs(i); - Rb(i) = Rbs(i); - Rf(i) = Rfs(i); + state.dataThermalISO15099Calc->Ebb(i) = state.dataThermalISO15099Calc->Ebbs(i); + state.dataThermalISO15099Calc->Ebf(i) = state.dataThermalISO15099Calc->Ebfs(i); + state.dataThermalISO15099Calc->Rb(i) = state.dataThermalISO15099Calc->Rbs(i); + state.dataThermalISO15099Calc->Rf(i) = state.dataThermalISO15099Calc->Rfs(i); q(2 * i - 1) = state.dataThermalISO15099Calc->qs(2 * i - 1); q(2 * i) = state.dataThermalISO15099Calc->qs(2 * i); // qprim(2*i - 1) = qprims(2*i - 1) @@ -1132,8 +1089,8 @@ namespace EnergyPlus::ThermalISO15099Calc { qv(2 * i) = state.dataThermalISO15099Calc->qvs(2 * i); hcgas(i) = state.dataThermalISO15099Calc->hcgass(i); hrgas(i) = state.dataThermalISO15099Calc->hrgass(i); - qcgas(i) = qcgaps(i); - qrgas(i) = qrgaps(i); + state.dataThermalISO15099Calc->qcgas(i) = state.dataThermalISO15099Calc->qcgaps(i); + state.dataThermalISO15099Calc->qrgas(i) = state.dataThermalISO15099Calc->qrgaps(i); AchievedErrorTolerance = AchievedErrorToleranceSolar; NumOfIter = NumOfIterSolar; } @@ -1152,10 +1109,10 @@ namespace EnergyPlus::ThermalISO15099Calc { tamb, q, qv, - qcgas, - qrgas, + state.dataThermalISO15099Calc->qcgas, + state.dataThermalISO15099Calc->qrgas, theta, - vfreevent, + state.dataThermalISO15099Calc->vfreevent, vvent, Keff, ShadeGapKeffConv, @@ -1172,10 +1129,10 @@ namespace EnergyPlus::ThermalISO15099Calc { Ra, Nu, LayerType, - Ebf, - Ebb, - Rf, - Rb, + state.dataThermalISO15099Calc->Ebf, + state.dataThermalISO15099Calc->Ebb, + state.dataThermalISO15099Calc->Rf, + state.dataThermalISO15099Calc->Rb, ebsky, Gout, ebroom, @@ -1457,7 +1414,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // first store results before iterations begin if (saveIterationResults) { - storeIterationResults(state, + storeIterationResults( files, nlayer, index, theta, trmout, tamb, trmin, troom, ebsky, ebroom, hcin, hcout, hrin, hrout, hin, hout, Ebb, Ebf, Rb, Rf, nperr); } @@ -1642,8 +1599,7 @@ namespace EnergyPlus::ThermalISO15099Calc { x(k + 3) = theta(j + 1); } - CalculateFuncResults(state, - nlayer, a, b, x, FRes); + CalculateFuncResults(nlayer, a, b, x, FRes); FResDiff = FRes - FResOld; @@ -1717,8 +1673,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // and store results during iterations if (saveIterationResults) { - storeIterationResults(state, - files, + storeIterationResults(files, nlayer, index + 1, theta, @@ -1924,8 +1879,7 @@ namespace EnergyPlus::ThermalISO15099Calc { // end if // Finishing calcs: - resist(state, - nlayer, trmout, tout, trmin, tind, hcgas, hrgas, theta, q, qv, LayerType, thick, scon, ufactor, flux, qcgas, qrgas); + resist(nlayer, trmout, tout, trmin, tind, hcgas, hrgas, theta, q, qv, LayerType, thick, scon, ufactor, flux, qcgas, qrgas); // bi... Set T6-related quantities - ratios for modified epsilon, hc for modelling external SDs: // (using non-solar pass results) @@ -2654,8 +2608,7 @@ namespace EnergyPlus::ThermalISO15099Calc { asp = height / gap(i); // end if // determine the Nusselt number: - nusselt(state, - tilt, ra, asp, gnu, nperr, ErrorMessage); + nusselt(tilt, ra, asp, gnu, nperr, ErrorMessage); Nu(i) = gnu; // calculate effective conductance of the gap @@ -2848,8 +2801,7 @@ namespace EnergyPlus::ThermalISO15099Calc { } } - void storeIterationResults(EnergyPlusData &state, - Files &files, + void storeIterationResults(Files &files, int const nlayer, int const index, const Array1D &theta, diff --git a/src/EnergyPlus/ThermalISO15099Calc.hh b/src/EnergyPlus/ThermalISO15099Calc.hh index ac4997efbf7..478819f35ac 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.hh +++ b/src/EnergyPlus/ThermalISO15099Calc.hh @@ -267,11 +267,9 @@ namespace ThermalISO15099Calc { Array1D &Ebf, Array1D &Tgap); - void solarISO15099(EnergyPlusData &state, - Real64 totsol, Real64 rtot, const Array1D &rs, int nlayer, const Array1D &absol, Real64 &sf); + void solarISO15099(Real64 totsol, Real64 rtot, const Array1D &rs, int nlayer, const Array1D &absol, Real64 &sf); - void resist(EnergyPlusData &state, - int nlayer, + void resist(int nlayer, Real64 trmout, Real64 Tout, Real64 trmin, @@ -415,9 +413,9 @@ namespace ThermalISO15099Calc { int &nperr, std::string &ErrorMessage); - void nusselt(EnergyPlusData &state,Real64 tilt, Real64 ra, Real64 asp, Real64 &gnu, int &nperr, std::string &ErrorMessage); + void nusselt(Real64 tilt, Real64 ra, Real64 asp, Real64 &gnu, int &nperr, std::string &ErrorMessage); - void storeIterationResults(EnergyPlusData &state, TARCOGOutput::Files &files, + void storeIterationResults(TARCOGOutput::Files &files, int nlayer, int index, const Array1D &theta, @@ -439,7 +437,7 @@ namespace ThermalISO15099Calc { const Array1D &Rf, int &); - void CalculateFuncResults(EnergyPlusData &state, int nlayer, Array2 const &a, const Array1D &b, const Array1D &x, Array1D &FRes); + void CalculateFuncResults(int nlayer, Array2 const &a, const Array1D &b, const Array1D &x, Array1D &FRes); } struct ThermalISO15099CalcData : BaseGlobalStruct { From 30e4fdad37671830020861e067fc21936c22a9dd Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Wed, 24 Mar 2021 19:55:33 -0600 Subject: [PATCH 08/21] fixed clear_state --- src/EnergyPlus/ThermalISO15099Calc.hh | 109 +++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 3 deletions(-) diff --git a/src/EnergyPlus/ThermalISO15099Calc.hh b/src/EnergyPlus/ThermalISO15099Calc.hh index 478819f35ac..0903224f853 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.hh +++ b/src/EnergyPlus/ThermalISO15099Calc.hh @@ -526,9 +526,6 @@ namespace ThermalISO15099Calc { Array1D frctg = Array1D(maxgas); Array1D_int ipropg = Array1D_int(maxgas); - Real64 cpa = 0.0; - Real64 aveGlassConductivity = 0.0; - Real64 rtot = 0.0; Real64 sft = 0.0; Real64 hcins = 0.0; @@ -541,11 +538,117 @@ namespace ThermalISO15099Calc { Real64 fluxs = 0.0; Real64 qeff = 0.0; Real64 flux_nonsolar = 0.0; + Real64 cpa = 0.0; + Real64 aveGlassConductivity = 0.0; + int iFP = 0; int kFP = 0; void clear_state() override { + this->thetas.clear(); + this->rir.clear(); + this->hcgass.clear(); + this->hrgass.clear(); + this->rs.clear(); + this->qs.clear(); + this->qvs.clear(); + this->LaminateAU.clear(); + this->sumsolU.clear(); + this->sol0.clear(); + this->qcgas.clear(); + this->qcgaps.clear(); + this->qrgas.clear(); + this->qrgaps.clear(); + this->Atop_NOSD.clear(); + this->Abot_NOSD.clear(); + this->Al_NOSD.clear(); + this->Ar_NOSD.clear(); + this->Ah_NOSD.clear(); + this->EffectiveOpenness_NOSD.clear(); + this->SlatThick_NOSD.clear(); + this->SlatWidth_NOSD.clear(); + this->SlatAngle_NOSD.clear(); + this->SlatCond_NOSD.clear(); + this->SlatSpacing_NOSD.clear(); + this->SlatCurve_NOSD.clear(); + this->vvent_NOSD.clear(); + this->tvent_NOSD.clear(); + this->qv_NOSD.clear(); + this->q_NOSD.clear(); + this->LayerType_NOSD.clear(); + this->gap_NOSD.clear(); + this->thick_NOSD.clear(); + this->scon_NOSD.clear(); + this->emis_NOSD.clear(); + this->rir_NOSD.clear(); + this->tir_NOSD.clear(); + this->theta_NOSD.clear(); + this->frct_NOSD.clear(); + this->iprop_NOSD.clear(); + this->nmix_NOSD.clear(); + this->presure_NOSD.clear(); + this->hcgas_NOSD.clear(); + this->hrgas_NOSD.clear(); + this->LaminateA_NOSD.clear(); + this->LaminateB_NOSD.clear(); + this->sumsol_NOSD.clear(); + this->Ra_NOSD.clear(); + this->Nu_NOSD.clear(); + this->Ebb.clear(); + this->Ebf.clear(); + this->Rb.clear(); + this->Rf.clear(); + this->Ebbs.clear(); + this->Ebfs.clear(); + this->Rbs.clear(); + this->Rfs.clear(); + this->Ebb_NOSD.clear(); + this->Ebf_NOSD.clear(); + this->Rb_NOSD.clear(); + this->Rf_NOSD.clear(); + this->ShadeGapKeffConv_NOSD.clear(); + this->qcgas_NOSD.clear(); + this->Keff_NOSD.clear(); + this->qrgas_NOSD.clear(); + this->nslice_NOSD.clear(); + this->vfreevent_NOSD.clear(); + this->vfreevent.clear(); + this->Atop_eff.clear(); + this->Abot_eff.clear(); + this->Al_eff.clear(); + this->Ar_eff.clear(); + this->Ah_eff.clear(); + this->EffectiveOpenness.clear(); + this->hgas.clear(); + this->Tgap.clear(); + this->hcgapMod.clear(); + this->hcv.clear(); + this->iprop1.clear(); + this->frct1.clear(); + this->frcti.clear(); + this->ipropi.clear(); + this->frctg.clear(); + this->ipropg.clear(); + + this->rtot = 0.0; + this->sft = 0.0; + this->hcins = 0.0; + this->hrins = 0.0; + this->hins = 0.0; + this->hcouts = 0.0; + this->hrouts = 0.0; + this->houts = 0.0; + this->ufactors = 0.0; + this->fluxs = 0.0; + this->qeff = 0.0; + this->flux_nonsolar = 0.0; + this->cpa = 0.0; + this->aveGlassConductivity = 0.0; + + this->iFP = 0; + this->kFP = 0; + } }; From d2173cfc3b3e39765eea27b3c4e4295e507f22cb Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Wed, 24 Mar 2021 22:12:48 -0600 Subject: [PATCH 09/21] fix frctg --- src/EnergyPlus/ThermalISO15099Calc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index 13c3b6ee664..8e172e5153a 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -2591,7 +2591,7 @@ namespace EnergyPlus::ThermalISO15099Calc { if (delt == 0.0) delt = 1.0e-6; for (l = 1; l <= nmix(i + 1); ++l) { state.dataThermalISO15099Calc->ipropg(l) = iprop(l, i + 1); - state.dataThermalISO15099Calc->ipropg(l) = frct(l, i + 1); + state.dataThermalISO15099Calc->frctg(l) = frct(l, i + 1); } if (presure(i + 1) > VacuumPressure) { From 6d9b1f2e396a41a3a3b9c625b65a2d09d2816c72 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Wed, 24 Mar 2021 22:56:38 -0600 Subject: [PATCH 10/21] ThermalComfort --- src/EnergyPlus/ThermalComfort.cc | 153 ++++++------ src/EnergyPlus/ThermalComfort.hh | 219 ++++++++++-------- .../ObjexxFCL/src/ObjexxFCL/Array1D.hh | 2 +- 3 files changed, 194 insertions(+), 180 deletions(-) diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index 15236e3a959..264811de687 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -1250,9 +1250,6 @@ namespace ThermalComfort { Real64 const CloEmiss(0.8); // Clothing Emissivity // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static Array1D Coeff(2); // Coefficients used in Range-Kutta's Method - static Array1D Temp(2); // Temperature - static Array1D TempChange(2); // Change of temperature Real64 BodyWt; // Weight of body, kg Real64 DayNum; // Number of days of acclimation int NumDay; // Loop counter for DayNum @@ -1372,9 +1369,9 @@ namespace ThermalComfort { state.dataThermalComforts->Time = 0.0; state.dataThermalComforts->TimeChange = 0.01; SweatSuppFac = 1.0; - Temp(1) = state.dataThermalComforts->CoreTemp; - Temp(2) = state.dataThermalComforts->SkinTemp; - Coeff(1) = Coeff(2) = 0.0; + state.dataThermalComforts->Temp(1) = state.dataThermalComforts->CoreTemp; + state.dataThermalComforts->Temp(2) = state.dataThermalComforts->SkinTemp; + state.dataThermalComforts->Coeff(1) = state.dataThermalComforts->Coeff(2) = 0.0; // PHYSIOLOGICAL ADJUSTMENTS IN HEAT ACCLIMATION. state.dataThermalComforts->AcclPattern = 1.0 - std::exp(-0.12 * (DayNum - 1.0)); state.dataThermalComforts->CoreTempNeut = 36.9 - 0.6 * state.dataThermalComforts->AcclPattern; @@ -1382,7 +1379,7 @@ namespace ThermalComfort { state.dataThermalComforts->ActLevel -= 0.07 * state.dataThermalComforts->ActLevel * state.dataThermalComforts->AcclPattern; Real64 const SkinTempNeut_fac(1.0 / (1.0 - SkinWetNeut)); // CALCULATION OF CoreTempChange/TempChange & SkinTempChange/TempChange - DERIV(state, TempIndiceNum, Temp, TempChange); + DERIV(state, TempIndiceNum, state.dataThermalComforts->Temp, state.dataThermalComforts->TempChange); while (true) { // CALCULATION OF THERMAL SENSATION VOTE (TSV). // THE TSV MODEL CAN BE APPLIED TO UNACCLIMATED MAN ONLY. @@ -1403,11 +1400,11 @@ namespace ThermalComfort { state.dataThermalComforts->ThermalComfortData(state.dataThermalComforts->PeopleNum).ThermalComfortMRT = state.dataThermalComforts->RadTemp; state.dataThermalComforts->ThermalComfortData(state.dataThermalComforts->PeopleNum).ThermalComfortOpTemp = (state.dataThermalComforts->RadTemp + state.dataThermalComforts->AirTemp) / 2.0; - state.dataThermalComforts->CoreTemp = Temp(1); - state.dataThermalComforts->SkinTemp = Temp(2); + state.dataThermalComforts->CoreTemp = state.dataThermalComforts->Temp(1); + state.dataThermalComforts->SkinTemp = state.dataThermalComforts->Temp(2); state.dataThermalComforts->EvapHeatLossSweatPrev = state.dataThermalComforts->EvapHeatLossSweat; - RKG(state, TempIndiceNum, state.dataThermalComforts->TimeChange, state.dataThermalComforts->Time, Temp, TempChange, Coeff); + RKG(state, TempIndiceNum, state.dataThermalComforts->TimeChange, state.dataThermalComforts->Time, state.dataThermalComforts->Temp, state.dataThermalComforts->TempChange, state.dataThermalComforts->Coeff); if (state.dataThermalComforts->Time > TimeExpos) break; } @@ -1865,25 +1862,22 @@ namespace ThermalComfort { int SurfNum2; // surface number used in "for" loop int ZoneNum2; // zone number index Real64 SumAET; // Intermediate calculational variable (area*emissivity*T) sum - static Array1D SurfaceAE; // Product of area and emissivity for each surface - static Array1D ZoneAESum; // Sum of area times emissivity for all zone surfaces - static bool FirstTimeError; // Only report the error message one time // Initialize ZoneAESum for all zones and SurfaceAE for all surfaces at the start of the simulation if (state.dataThermalComforts->FirstTimeSurfaceWeightedFlag) { - FirstTimeError = true; + state.dataThermalComforts->FirstTimeError = true; state.dataThermalComforts->FirstTimeSurfaceWeightedFlag = false; - SurfaceAE.allocate(state.dataSurface->TotSurfaces); - ZoneAESum.allocate(state.dataGlobal->NumOfZones); - SurfaceAE = 0.0; - ZoneAESum = 0.0; + state.dataThermalComforts->SurfaceAE.allocate(state.dataSurface->TotSurfaces); + state.dataThermalComforts->ZoneAESum.allocate(state.dataGlobal->NumOfZones); + state.dataThermalComforts->SurfaceAE = 0.0; + state.dataThermalComforts->ZoneAESum = 0.0; for (SurfNum2 = 1; SurfNum2 <= state.dataSurface->TotSurfaces; ++SurfNum2) { if (state.dataSurface->Surface(SurfNum2).HeatTransSurf) { - SurfaceAE(SurfNum2) = state.dataSurface->Surface(SurfNum2).Area * state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum2).Construction).InsideAbsorpThermal; + state.dataThermalComforts->SurfaceAE(SurfNum2) = state.dataSurface->Surface(SurfNum2).Area * state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum2).Construction).InsideAbsorpThermal; ZoneNum2 = state.dataSurface->Surface(SurfNum2).Zone; // Do NOT include the contribution of the Surface that is being surface weighted in this calculation since it will already be // accounted for - if ((ZoneNum2 > 0) && (SurfNum2 != SurfNum)) ZoneAESum(ZoneNum2) += SurfaceAE(SurfNum2); + if ((ZoneNum2 > 0) && (SurfNum2 != SurfNum)) state.dataThermalComforts->ZoneAESum(ZoneNum2) += state.dataThermalComforts->SurfaceAE(SurfNum2); } } } @@ -1891,23 +1885,23 @@ namespace ThermalComfort { // Calculate the sum of area*emissivity and area*emissivity*temperature for all surfaces in the zone EXCEPT the surface being weighted // Note that area*emissivity needs to be recalculated because of the possibility of changes to the emissivity via the EMS SumAET = 0.0; - ZoneAESum(ZoneNum) = 0.0; + state.dataThermalComforts->ZoneAESum(ZoneNum) = 0.0; for (SurfNum2 = state.dataHeatBal->Zone(ZoneNum).HTSurfaceFirst; SurfNum2 <= state.dataHeatBal->Zone(ZoneNum).HTSurfaceLast; ++SurfNum2) { if (SurfNum2 != SurfNum) { - SurfaceAE(SurfNum2) = state.dataSurface->Surface(SurfNum2).Area * state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum2).Construction).InsideAbsorpThermal; - SumAET += SurfaceAE(SurfNum2) * state.dataHeatBalSurf->TH(2, 1, SurfNum2); - ZoneAESum(ZoneNum) += SurfaceAE(SurfNum2); + state.dataThermalComforts->SurfaceAE(SurfNum2) = state.dataSurface->Surface(SurfNum2).Area * state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum2).Construction).InsideAbsorpThermal; + SumAET += state.dataThermalComforts->SurfaceAE(SurfNum2) * state.dataHeatBalSurf->TH(2, 1, SurfNum2); + state.dataThermalComforts->ZoneAESum(ZoneNum) += state.dataThermalComforts->SurfaceAE(SurfNum2); } } // Now weight the MRT--half comes from the surface used for weighting (SurfNum) and the rest from the adjusted MRT that excludes this surface - if (ZoneAESum(ZoneNum) > 0.01) { - CalcSurfaceWeightedMRT = 0.5 * (state.dataHeatBalSurf->TH(2, 1, SurfNum) + (SumAET / ZoneAESum(ZoneNum))); + if (state.dataThermalComforts->ZoneAESum(ZoneNum) > 0.01) { + CalcSurfaceWeightedMRT = 0.5 * (state.dataHeatBalSurf->TH(2, 1, SurfNum) + (SumAET / state.dataThermalComforts->ZoneAESum(ZoneNum))); } else { - if (FirstTimeError) { + if (state.dataThermalComforts->FirstTimeError) { ShowWarningError(state, "Zone areas*inside surface emissivities are summing to zero, for Zone=\"" + state.dataHeatBal->Zone(ZoneNum).Name + "\""); ShowContinueError(state, "As a result, MAT will be used for MRT when calculating a surface weighted MRT for this zone."); - FirstTimeError = false; + state.dataThermalComforts->FirstTimeError = false; CalcSurfaceWeightedMRT = 0.5 * (state.dataHeatBalSurf->TH(2, 1, SurfNum) + state.dataHeatBalFanSys->MAT(ZoneNum)); } } @@ -2434,12 +2428,9 @@ namespace ThermalComfort { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: std::string lineAvg; std::string epwLine; - static Real64 avgDryBulbASH(0.0); Real64 dryBulb; - static Array1D monthlyTemp(12, 0.0); Real64 tComf; Real64 numOccupants; - static bool useStatData(false); int readStat; int jStartDay; int calcStartDay; @@ -2455,9 +2446,9 @@ namespace ThermalComfort { if (initiate) { // not optional on initiate=true. would otherwise check for presence weathersimulation = wthrsim; - avgDryBulbASH = 0.0; + state.dataThermalComforts->avgDryBulbASH = 0.0; state.dataThermalComforts->runningAverageASH = 0.0; - monthlyTemp = 0.0; + state.dataThermalComforts->monthlyTemp = 0.0; inavgdrybulb = avgdrybulb; } else { weathersimulation = false; @@ -2483,9 +2474,9 @@ namespace ThermalComfort { } } for (i = 1; i <= 12; ++i) { - monthlyTemp(i) = StrToReal(GetColumnUsingTabs(lineAvg, i + 2)); + state.dataThermalComforts->monthlyTemp(i) = StrToReal(GetColumnUsingTabs(lineAvg, i + 2)); } - useStatData = true; + state.dataThermalComforts->useStatData = true; } else if (epwFileExists) { // determine number of days in year int DaysInYear; @@ -2508,7 +2499,7 @@ namespace ThermalComfort { epwFile.readLine(); } for (i = 1; i <= 30; ++i) { - avgDryBulbASH = 0.0; + state.dataThermalComforts->avgDryBulbASH = 0.0; for (j = 1; j <= 24; ++j) { epwLine = epwFile.readLine().data; for (ind = 1; ind <= 6; ++ind) { @@ -2517,9 +2508,9 @@ namespace ThermalComfort { } pos = index(epwLine, ','); dryBulb = StrToReal(epwLine.substr(0, pos)); - avgDryBulbASH += (dryBulb / 24.0); + state.dataThermalComforts->avgDryBulbASH += (dryBulb / 24.0); } - state.dataThermalComforts->DailyAveOutTemp(i) = avgDryBulbASH; + state.dataThermalComforts->DailyAveOutTemp(i) = state.dataThermalComforts->avgDryBulbASH; } } else { // Do special things for wrapping the epw calcEndDay = jStartDay; @@ -2527,7 +2518,7 @@ namespace ThermalComfort { calcEndHr = 24 * calcEndDay; calcStartHr = 24 * calcStartDay + 1; for (i = 1; i <= calcEndDay; ++i) { - avgDryBulbASH = 0.0; + state.dataThermalComforts->avgDryBulbASH = 0.0; for (j = 1; j <= 24; ++j) { epwLine = epwFile.readLine().data; for (ind = 1; ind <= 6; ++ind) { @@ -2536,15 +2527,15 @@ namespace ThermalComfort { } pos = index(epwLine, ','); dryBulb = StrToReal(epwLine.substr(0, pos)); - avgDryBulbASH += (dryBulb / 24.0); + state.dataThermalComforts->avgDryBulbASH += (dryBulb / 24.0); } - state.dataThermalComforts->DailyAveOutTemp(i + 30 - calcEndDay) = avgDryBulbASH; + state.dataThermalComforts->DailyAveOutTemp(i + 30 - calcEndDay) = state.dataThermalComforts->avgDryBulbASH; } for (i = calcEndHr + 1; i <= calcStartHr - 1; ++i) { epwLine = epwFile.readLine().data; } for (i = 1; i <= 30 - calcEndDay; ++i) { - avgDryBulbASH = 0.0; + state.dataThermalComforts->avgDryBulbASH = 0.0; for (j = 1; j <= 24; ++j) { epwLine = epwFile.readLine().data; for (ind = 1; ind <= 6; ++ind) { @@ -2553,46 +2544,46 @@ namespace ThermalComfort { } pos = index(epwLine, ','); dryBulb = StrToReal(epwLine.substr(0, pos)); - avgDryBulbASH += (dryBulb / 24.0); + state.dataThermalComforts->avgDryBulbASH += (dryBulb / 24.0); } - state.dataThermalComforts->DailyAveOutTemp(i) = avgDryBulbASH; + state.dataThermalComforts->DailyAveOutTemp(i) = state.dataThermalComforts->avgDryBulbASH; } } state.dataThermalComforts->useEpwData = true; } } else if (initiate && !weathersimulation) { state.dataThermalComforts->runningAverageASH = inavgdrybulb; - monthlyTemp = inavgdrybulb; - avgDryBulbASH = 0.0; + state.dataThermalComforts->monthlyTemp = inavgdrybulb; + state.dataThermalComforts->avgDryBulbASH = 0.0; } if (initiate) return; if (state.dataGlobal->BeginDayFlag && state.dataThermalComforts->useEpwData) { // Update the running average, reset the daily avg - state.dataThermalComforts->DailyAveOutTemp(30) = avgDryBulbASH; + state.dataThermalComforts->DailyAveOutTemp(30) = state.dataThermalComforts->avgDryBulbASH; Real64 sum = 0.0; for (i = 1; i <= 29; i++) { sum += state.dataThermalComforts->DailyAveOutTemp(i); } - state.dataThermalComforts->runningAverageASH = (sum + avgDryBulbASH) / 30.0; + state.dataThermalComforts->runningAverageASH = (sum + state.dataThermalComforts->avgDryBulbASH) / 30.0; for (i = 1; i <= 29; i++) { state.dataThermalComforts->DailyAveOutTemp(i) = state.dataThermalComforts->DailyAveOutTemp(i + 1); } - avgDryBulbASH = 0.0; + state.dataThermalComforts->avgDryBulbASH = 0.0; } // If exists BeginMonthFlag we can use it to call InvJulianDay once per month. - if (state.dataGlobal->BeginDayFlag && useStatData) { + if (state.dataGlobal->BeginDayFlag && state.dataThermalComforts->useStatData) { // CALL InvJulianDay(DayOfYear,pMonth,pDay,0) // runningAverageASH = monthlyTemp(pMonth) - state.dataThermalComforts->runningAverageASH = monthlyTemp(state.dataEnvrn->Month); + state.dataThermalComforts->runningAverageASH = state.dataThermalComforts->monthlyTemp(state.dataEnvrn->Month); } // Update the daily average // IF (BeginHourFlag .and. useEpwData) THEN if (state.dataGlobal->BeginHourFlag) { - avgDryBulbASH += (state.dataEnvrn->OutDryBulbTemp / 24.0); + state.dataThermalComforts->avgDryBulbASH += (state.dataEnvrn->OutDryBulbTemp / 24.0); } for (state.dataThermalComforts->PeopleNum = 1; state.dataThermalComforts->PeopleNum <= state.dataHeatBal->TotPeople; ++state.dataThermalComforts->PeopleNum) { @@ -2672,14 +2663,10 @@ namespace ThermalComfort { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: std::string epwLine; - static Real64 avgDryBulbCEN(0.0); Real64 dryBulb; Real64 tComf; Real64 tComfLow; - static Real64 runningAverageCEN(0.0); Real64 numOccupants; - static bool useEpwData(false); - static bool firstDaySet(false); // first day is set with initiate -- so do not update int readStat; int jStartDay; int calcStartDay; @@ -2696,8 +2683,8 @@ namespace ThermalComfort { if (initiate) { // not optional on initiate=true. would otherwise check for presence weathersimulation = wthrsim; inavgdrybulb = avgdrybulb; - avgDryBulbCEN = 0.0; - runningAverageCEN = 0.0; + state.dataThermalComforts->avgDryBulbCEN = 0.0; + state.dataThermalComforts->runningAverageCEN = 0.0; } else { weathersimulation = false; inavgdrybulb = 0.0; @@ -2718,9 +2705,9 @@ namespace ThermalComfort { for (i = 1; i <= calcStartHr - 1; ++i) { epwFile.readLine(); } - runningAverageCEN = 0.0; + state.dataThermalComforts->runningAverageCEN = 0.0; for (i = 1; i <= 7; ++i) { - avgDryBulbCEN = 0.0; + state.dataThermalComforts->avgDryBulbCEN = 0.0; for (j = 1; j <= 24; ++j) { epwLine = epwFile.readLine().data; for (ind = 1; ind <= 6; ++ind) { @@ -2729,9 +2716,9 @@ namespace ThermalComfort { } pos = index(epwLine, ','); dryBulb = StrToReal(epwLine.substr(0, pos)); - avgDryBulbCEN += (dryBulb / 24.0); + state.dataThermalComforts->avgDryBulbCEN += (dryBulb / 24.0); } - runningAverageCEN += alpha_pow(i) * avgDryBulbCEN; + state.dataThermalComforts->runningAverageCEN += alpha_pow(i) * state.dataThermalComforts->avgDryBulbCEN; } } else { // Do special things for wrapping the epw calcEndDay = jStartDay; @@ -2739,7 +2726,7 @@ namespace ThermalComfort { calcEndHr = 24 * calcEndDay; calcStartHr = 24 * (calcStartDay - 1) + 1; for (i = 1; i <= calcEndDay; ++i) { - avgDryBulbCEN = 0.0; + state.dataThermalComforts->avgDryBulbCEN = 0.0; for (j = 1; j <= 24; ++j) { epwLine = epwFile.readLine().data; for (ind = 1; ind <= 6; ++ind) { @@ -2748,15 +2735,15 @@ namespace ThermalComfort { } pos = index(epwLine, ','); dryBulb = StrToReal(epwLine.substr(0, pos)); - avgDryBulbCEN += (dryBulb / 24.0); + state.dataThermalComforts->avgDryBulbCEN += (dryBulb / 24.0); } - runningAverageCEN += std::pow(alpha, calcEndDay - i) * avgDryBulbCEN; + state.dataThermalComforts->runningAverageCEN += std::pow(alpha, calcEndDay - i) * state.dataThermalComforts->avgDryBulbCEN; } for (i = calcEndHr + 1; i <= calcStartHr - 1; ++i) { epwFile.readLine(); } for (i = 1; i <= 7 - calcEndDay; ++i) { - avgDryBulbCEN = 0.0; + state.dataThermalComforts->avgDryBulbCEN = 0.0; for (j = 1; j <= 24; ++j) { epwLine = epwFile.readLine().data; for (ind = 1; ind <= 6; ++ind) { @@ -2765,33 +2752,33 @@ namespace ThermalComfort { } pos = index(epwLine, ','); dryBulb = StrToReal(epwLine.substr(0, pos)); - avgDryBulbCEN += (dryBulb / 24.0); + state.dataThermalComforts->avgDryBulbCEN += (dryBulb / 24.0); } - runningAverageCEN += alpha_pow(i) * avgDryBulbCEN; + state.dataThermalComforts->runningAverageCEN += alpha_pow(i) * state.dataThermalComforts->avgDryBulbCEN; } } - runningAverageCEN *= (1.0 - alpha); - avgDryBulbCEN = 0.0; - useEpwData = true; - firstDaySet = true; + state.dataThermalComforts->runningAverageCEN *= (1.0 - alpha); + state.dataThermalComforts->avgDryBulbCEN = 0.0; + state.dataThermalComforts->useEpwDataCEN = true; + state.dataThermalComforts->firstDaySet = true; } } else if (initiate && !weathersimulation) { - runningAverageCEN = inavgdrybulb; - avgDryBulbCEN = 0.0; + state.dataThermalComforts->runningAverageCEN = inavgdrybulb; + state.dataThermalComforts->avgDryBulbCEN = 0.0; } if (initiate) return; - if (state.dataGlobal->BeginDayFlag && !firstDaySet) { + if (state.dataGlobal->BeginDayFlag && !state.dataThermalComforts->firstDaySet) { // Update the running average, reset the daily avg - runningAverageCEN = 0.2 * runningAverageCEN + 0.8 * avgDryBulbCEN; - avgDryBulbCEN = 0.0; + state.dataThermalComforts->runningAverageCEN = 0.2 * state.dataThermalComforts->runningAverageCEN + 0.8 * state.dataThermalComforts->avgDryBulbCEN; + state.dataThermalComforts->avgDryBulbCEN = 0.0; } - firstDaySet = false; + state.dataThermalComforts->firstDaySet = false; // Update the daily average if (state.dataGlobal->BeginHourFlag) { - avgDryBulbCEN += (state.dataEnvrn->OutDryBulbTemp / 24.0); + state.dataThermalComforts->avgDryBulbCEN += (state.dataEnvrn->OutDryBulbTemp / 24.0); } for (state.dataThermalComforts->PeopleNum = 1; state.dataThermalComforts->PeopleNum <= state.dataHeatBal->TotPeople; ++state.dataThermalComforts->PeopleNum) { @@ -2805,14 +2792,14 @@ namespace ThermalComfort { state.dataThermalComforts->RadTemp = CalcRadTemp(state, state.dataThermalComforts->PeopleNum); state.dataThermalComforts->OpTemp = (state.dataThermalComforts->AirTemp + state.dataThermalComforts->RadTemp) / 2.0; state.dataThermalComforts->ThermalComfortData(state.dataThermalComforts->PeopleNum).ThermalComfortOpTemp = state.dataThermalComforts->OpTemp; - state.dataThermalComforts->ThermalComfortData(state.dataThermalComforts->PeopleNum).CEN15251RunningMeanOutdoorTemp = runningAverageCEN; - if (runningAverageCEN >= 10.0 && runningAverageCEN <= 30.0) { + state.dataThermalComforts->ThermalComfortData(state.dataThermalComforts->PeopleNum).CEN15251RunningMeanOutdoorTemp = state.dataThermalComforts->runningAverageCEN; + if (state.dataThermalComforts->runningAverageCEN >= 10.0 && state.dataThermalComforts->runningAverageCEN <= 30.0) { // Calculate the comfort here (people/output handling loop) numOccupants = state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).NumberOfPeople * GetCurrentScheduleValue(state, state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).NumberOfPeoplePtr); - tComf = 0.33 * runningAverageCEN + 18.8; + tComf = 0.33 * state.dataThermalComforts->runningAverageCEN + 18.8; state.dataThermalComforts->ThermalComfortData(state.dataThermalComforts->PeopleNum).TComfCEN15251 = tComf; if (numOccupants > 0) { - if (runningAverageCEN < 15) { + if (state.dataThermalComforts->runningAverageCEN < 15) { tComfLow = 23.75; // Lower limit is constant in this region } else { tComfLow = tComf; diff --git a/src/EnergyPlus/ThermalComfort.hh b/src/EnergyPlus/ThermalComfort.hh index e70965ad6f0..2db60632abe 100644 --- a/src/EnergyPlus/ThermalComfort.hh +++ b/src/EnergyPlus/ThermalComfort.hh @@ -385,104 +385,131 @@ struct ThermalComfortsData : BaseGlobalStruct { Real64 runningAverageASH = 0.0; + Array1D Coeff = Array1D(2); // Coefficients used in Range-Kutta's Method + Array1D Temp = Array1D(2); // Temperature + Array1D TempChange = Array1D(2); // Change of temperature + Array1D SurfaceAE; // Product of area and emissivity for each surface + Array1D ZoneAESum; // Sum of area times emissivity for all zone surfaces + bool FirstTimeError; // Only report the error message one time + Real64 avgDryBulbASH = 0.0; + Array1D monthlyTemp = Array1D(12, 0.0); + bool useStatData = false; + Real64 avgDryBulbCEN = 0.0; + Real64 runningAverageCEN = 0.0; + bool useEpwDataCEN = false; + bool firstDaySet = false; // first day is set with initiate -- so do not update + void clear_state() override { - FirstTimeFlag = true; - FirstTimeSurfaceWeightedFlag = true; - runningAverageASH = 0.0; - AbsAirTemp = 0.0; - AbsCloSurfTemp = 0.0; - AbsRadTemp = 0.0; - AcclPattern = 0.0; - ActLevel = 0.0; - ActMet = 0.0; - AirVel = 0.0; - AirTemp = 0.0; - CloBodyRat = 0.0; - CloInsul = 0.0; - CloPermeatEff = 0.0; - CloSurfTemp = 0.0; - CloThermEff = 0.0; - CloUnit = 0.0; - ConvHeatLoss = 0.0; - CoreTempChange = 0.0; - CoreTemp = 0.0; - CoreTempNeut = 0.0; - CoreThermCap = 0.0; - DryHeatLoss = 0.0; - DryHeatLossET = 0.0; - DryHeatLossSET = 0.0; - DryRespHeatLoss = 0.0; - EvapHeatLoss = 0.0; - EvapHeatLossDiff = 0.0; - EvapHeatLossMax = 0.0; - EvapHeatLossRegComf = 0.0; - EvapHeatLossRegSweat = 0.0; - EvapHeatLossSweat = 0.0; - EvapHeatLossSweatPrev = 0.0; - H = 0.0; - Hc = 0.0; - HcFor = 0.0; - HcNat = 0.0; - HeatFlow = 0.0; - Hr = 0.0; - IntHeatProd = 0.0; - IterNum = 0; - LatRespHeatLoss = 0.0; - MaxZoneNum = 0; - MRTCalcType = 0; - OpTemp = 0.0; - EffTemp = 0.0; - PeopleNum = 0; - RadHeatLoss = 0.0; - RadTemp = 0.0; - RelHum = 0.0; - RespHeatLoss = 0.0; - SatSkinVapPress = 0.0; - ShivResponse = 0.0; - SkinComfTemp = 0.0; - SkinComfVPress = 0.0; - SkinTemp = 0.0; - SkinTempChange = 0.0; - SkinTempNeut = 0.0; - SkinThermCap = 0.0; - SkinWetDiff = 0.0; - SkinWetSweat = 0.0; - SkinWetTot = 0.0; - SkinVapPress = 0.0; - SurfaceTemp = 0.0; - AvgBodyTemp = 0.0; - ThermCndct = 0.0; - ThermSensTransCoef = 0.0; - Time = 0.0; - TimeChange = 0.0; - VapPress = 0.0; - VasoconstrictFac = 0.0; - VasodilationFac = 0.0; - WorkEff = 0.0; - ZoneNum = 0; - TemporarySixAMTemperature = 0.0; - AnyZoneTimeNotSimpleASH55Summer = 0.0; - AnyZoneTimeNotSimpleASH55Winter = 0.0; - AnyZoneTimeNotSimpleASH55Either = 0.0; - AnyZoneNotMetHeating = 0.0; - AnyZoneNotMetCooling = 0.0; - AnyZoneNotMetHeatingOccupied = 0.0; - AnyZoneNotMetCoolingOccupied = 0.0; - AnyZoneNotMetOccupied = 0.0; - TotalAnyZoneTimeNotSimpleASH55Summer = 0.0; - TotalAnyZoneTimeNotSimpleASH55Winter = 0.0; - TotalAnyZoneTimeNotSimpleASH55Either = 0.0; - TotalAnyZoneNotMetHeating = 0.0; - TotalAnyZoneNotMetCooling = 0.0; - TotalAnyZoneNotMetHeatingOccupied = 0.0; - TotalAnyZoneNotMetCoolingOccupied = 0.0; - TotalAnyZoneNotMetOccupied = 0.0; - ZoneOccHrs.deallocate(); - ThermalComfortInASH55.deallocate(); - ThermalComfortSetPoint.deallocate(); - ThermalComfortData.deallocate(); - AngleFactorList.deallocate(); + this->FirstTimeFlag = true; + this->FirstTimeSurfaceWeightedFlag = true; + this->runningAverageASH = 0.0; + this->AbsAirTemp = 0.0; + this->AbsCloSurfTemp = 0.0; + this->AbsRadTemp = 0.0; + this->AcclPattern = 0.0; + this->ActLevel = 0.0; + this->ActMet = 0.0; + this->AirVel = 0.0; + this->AirTemp = 0.0; + this->CloBodyRat = 0.0; + this->CloInsul = 0.0; + this->CloPermeatEff = 0.0; + this->CloSurfTemp = 0.0; + this->CloThermEff = 0.0; + this->CloUnit = 0.0; + this->ConvHeatLoss = 0.0; + this->CoreTempChange = 0.0; + this->CoreTemp = 0.0; + this->CoreTempNeut = 0.0; + this->CoreThermCap = 0.0; + this->DryHeatLoss = 0.0; + this->DryHeatLossET = 0.0; + this->DryHeatLossSET = 0.0; + this->DryRespHeatLoss = 0.0; + this->EvapHeatLoss = 0.0; + this->EvapHeatLossDiff = 0.0; + this->EvapHeatLossMax = 0.0; + this->EvapHeatLossRegComf = 0.0; + this->EvapHeatLossRegSweat = 0.0; + this->EvapHeatLossSweat = 0.0; + this->EvapHeatLossSweatPrev = 0.0; + this->H = 0.0; + this->Hc = 0.0; + this->HcFor = 0.0; + this->HcNat = 0.0; + this->HeatFlow = 0.0; + this->Hr = 0.0; + this->IntHeatProd = 0.0; + this->IterNum = 0; + this->LatRespHeatLoss = 0.0; + this->MaxZoneNum = 0; + this->MRTCalcType = 0; + this->OpTemp = 0.0; + this->EffTemp = 0.0; + this->PeopleNum = 0; + this->RadHeatLoss = 0.0; + this->RadTemp = 0.0; + this->RelHum = 0.0; + this->RespHeatLoss = 0.0; + this->SatSkinVapPress = 0.0; + this->ShivResponse = 0.0; + this->SkinComfTemp = 0.0; + this->SkinComfVPress = 0.0; + this->SkinTemp = 0.0; + this->SkinTempChange = 0.0; + this->SkinTempNeut = 0.0; + this->SkinThermCap = 0.0; + this->SkinWetDiff = 0.0; + this->SkinWetSweat = 0.0; + this->SkinWetTot = 0.0; + this->SkinVapPress = 0.0; + this->SurfaceTemp = 0.0; + this->AvgBodyTemp = 0.0; + this->ThermCndct = 0.0; + this->ThermSensTransCoef = 0.0; + this->Time = 0.0; + this->TimeChange = 0.0; + this->VapPress = 0.0; + this->VasoconstrictFac = 0.0; + this->VasodilationFac = 0.0; + this->WorkEff = 0.0; + this->ZoneNum = 0; + this->TemporarySixAMTemperature = 0.0; + this->AnyZoneTimeNotSimpleASH55Summer = 0.0; + this->AnyZoneTimeNotSimpleASH55Winter = 0.0; + this->AnyZoneTimeNotSimpleASH55Either = 0.0; + this->AnyZoneNotMetHeating = 0.0; + this->AnyZoneNotMetCooling = 0.0; + this->AnyZoneNotMetHeatingOccupied = 0.0; + this->AnyZoneNotMetCoolingOccupied = 0.0; + this->AnyZoneNotMetOccupied = 0.0; + this->TotalAnyZoneTimeNotSimpleASH55Summer = 0.0; + this->TotalAnyZoneTimeNotSimpleASH55Winter = 0.0; + this->TotalAnyZoneTimeNotSimpleASH55Either = 0.0; + this->TotalAnyZoneNotMetHeating = 0.0; + this->TotalAnyZoneNotMetCooling = 0.0; + this->TotalAnyZoneNotMetHeatingOccupied = 0.0; + this->TotalAnyZoneNotMetCoolingOccupied = 0.0; + this->TotalAnyZoneNotMetOccupied = 0.0; + this->ZoneOccHrs.deallocate(); + this->ThermalComfortInASH55.deallocate(); + this->ThermalComfortSetPoint.deallocate(); + this->ThermalComfortData.deallocate(); + this->AngleFactorList.deallocate(); + + this->Coeff.clear(); + this->Temp.clear(); + this->TempChange.clear(); + this->SurfaceAE.clear(); // Product of area and emissivity for each surface + this->ZoneAESum.clear(); // Sum of area times emissivity for all zone surfaces + this->avgDryBulbASH = 0.0; + this->monthlyTemp.clear(); + this->useStatData = false; + this->avgDryBulbCEN = 0.0; + this->runningAverageCEN = 0.0; + this->useEpwDataCEN = false; + this->firstDaySet = false; // first day is set with initiate -- so do not update } // Default Constructor diff --git a/third_party/ObjexxFCL/src/ObjexxFCL/Array1D.hh b/third_party/ObjexxFCL/src/ObjexxFCL/Array1D.hh index ff31efd3411..e636e1f5827 100644 --- a/third_party/ObjexxFCL/src/ObjexxFCL/Array1D.hh +++ b/third_party/ObjexxFCL/src/ObjexxFCL/Array1D.hh @@ -167,7 +167,7 @@ public: // Creation } } - // Sticky Initializer Value Constructor + // Sticky CoeffInitializer Value Constructor template< typename S, class = typename std::enable_if< std::is_constructible< T, S >::value >::type > explicit Array1D( Sticky< S > const & s ) : From b47186543c2d1e99e1f563a928a2a66ca4567fef Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Wed, 24 Mar 2021 23:31:39 -0600 Subject: [PATCH 11/21] OutputProcessor i --- src/EnergyPlus/OutputProcessor.cc | 108 +++++++++++++----------------- src/EnergyPlus/OutputProcessor.hh | 34 +++++++++- 2 files changed, 80 insertions(+), 62 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 5a381794ed9..cb06a207247 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -2850,10 +2850,6 @@ namespace OutputProcessor { int Loop; // Loop Control bool PrintTimeStamp; int CurDayType; - static Real64 rDummy1(0.0); - static Real64 rDummy2(0.0); - static int iDummy1(0); - static int iDummy2(0); auto &op(state.dataOutputProcessor); if (!state.dataResultsFramework->resultsFramework->TSMeters.rDataFrameEnabled()) { @@ -2918,10 +2914,10 @@ namespace OutputProcessor { op->EnergyMeters(Loop).TSRptNumChr, op->EnergyMeters(Loop).TSValue, ReportingFrequency::TimeStep, - rDummy1, - iDummy1, - rDummy2, - iDummy2, + state.dataOutputProcessor->rDummy1TS, + state.dataOutputProcessor->iDummy1TS, + state.dataOutputProcessor->rDummy2TS, + state.dataOutputProcessor->iDummy2TS, op->EnergyMeters(Loop).RptTSFO); state.dataResultsFramework->resultsFramework->TSMeters.pushVariableValue(op->EnergyMeters(Loop).TSRptNum, op->EnergyMeters(Loop).TSValue); } @@ -2979,10 +2975,6 @@ namespace OutputProcessor { int Loop; // Loop Control bool PrintTimeStamp; int CurDayType; - static Real64 rDummy1(0.0); - static Real64 rDummy2(0.0); - static int iDummy1(0); - static int iDummy2(0); auto &op(state.dataOutputProcessor); if (!state.dataResultsFramework->resultsFramework->HRMeters.rDataFrameEnabled()) { @@ -3024,10 +3016,10 @@ namespace OutputProcessor { op->EnergyMeters(Loop).HRRptNumChr, op->EnergyMeters(Loop).HRValue, ReportingFrequency::Hourly, - rDummy1, - iDummy1, - rDummy2, - iDummy2, + state.dataOutputProcessor->rDummy1, + state.dataOutputProcessor->iDummy1, + state.dataOutputProcessor->rDummy2, + state.dataOutputProcessor->iDummy2, op->EnergyMeters(Loop).RptHRFO); // EnergyMeters(Loop)%HRMinVal, EnergyMeters(Loop)%HRMinValDate, & | // EnergyMeters(Loop)%HRMaxVal, EnergyMeters(Loop)%HRMaxValDate, & state.dataResultsFramework->resultsFramework->HRMeters.pushVariableValue(op->EnergyMeters(Loop).HRRptNum, op->EnergyMeters(Loop).HRValue); @@ -4727,7 +4719,7 @@ namespace OutputProcessor { } } - int DetermineIndexGroupKeyFromMeterName(std::string const &meterName) // the meter name + int DetermineIndexGroupKeyFromMeterName(EnergyPlusData &state, std::string const &meterName) // the meter name { // FUNCTION INFORMATION: @@ -4757,44 +4749,43 @@ namespace OutputProcessor { // FUNCTION ARGUMENT DEFINITIONS: // FUNCTION LOCAL VARIABLE DECLARATIONS: - static int indexGroupKey(-1); // Facility indices are in the 100s if (has(meterName, "Electricity:Facility")) { - indexGroupKey = 100; + state.dataOutputProcessor->indexGroupKey = 100; } else if (has(meterName, "NaturalGas:Facility")) { - indexGroupKey = 101; + state.dataOutputProcessor->indexGroupKey = 101; } else if (has(meterName, "DistricHeating:Facility")) { - indexGroupKey = 102; + state.dataOutputProcessor->indexGroupKey = 102; } else if (has(meterName, "DistricCooling:Facility")) { - indexGroupKey = 103; + state.dataOutputProcessor->indexGroupKey = 103; } else if (has(meterName, "ElectricityNet:Facility")) { - indexGroupKey = 104; + state.dataOutputProcessor->indexGroupKey = 104; // Building indices are in the 200s } else if (has(meterName, "Electricity:Building")) { - indexGroupKey = 201; + state.dataOutputProcessor->indexGroupKey = 201; } else if (has(meterName, "NaturalGas:Building")) { - indexGroupKey = 202; + state.dataOutputProcessor->indexGroupKey = 202; // HVAC indices are in the 300s } else if (has(meterName, "Electricity:HVAC")) { - indexGroupKey = 301; + state.dataOutputProcessor->indexGroupKey = 301; // InteriorLights:Electricity:Zone indices are in the 500s } else if (has(meterName, "InteriorLights:Electricity:Zone")) { - indexGroupKey = 501; + state.dataOutputProcessor->indexGroupKey = 501; // InteriorLights:Electricity indices are in the 400s } else if (has(meterName, "InteriorLights:Electricity")) { - indexGroupKey = 401; + state.dataOutputProcessor->indexGroupKey = 401; // Unknown items have negative indices } else { - indexGroupKey = -11; + state.dataOutputProcessor->indexGroupKey = -11; } - DetermineIndexGroupKeyFromMeterName = indexGroupKey; + DetermineIndexGroupKeyFromMeterName = state.dataOutputProcessor->indexGroupKey; return DetermineIndexGroupKeyFromMeterName; } @@ -6472,25 +6463,23 @@ void GenOutputVariablesAuditReport(EnergyPlusData &state) // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static bool Rept(false); int Loop; - static bool OpaqSurfWarned(false); auto &op(state.dataOutputProcessor); for (Loop = 1; Loop <= op->NumOfReqVariables; ++Loop) { if (op->ReqRepVars(Loop).Used) continue; if (op->ReqRepVars(Loop).Key.empty()) op->ReqRepVars(Loop).Key = "*"; - if (has(op->ReqRepVars(Loop).VarName, "OPAQUE SURFACE INSIDE FACE CONDUCTION") && !state.dataGlobal->DisplayAdvancedReportVariables && !OpaqSurfWarned) { + if (has(op->ReqRepVars(Loop).VarName, "OPAQUE SURFACE INSIDE FACE CONDUCTION") && !state.dataGlobal->DisplayAdvancedReportVariables && !state.dataOutputProcessor->OpaqSurfWarned) { ShowWarningError(state, "Variables containing \"Opaque Surface Inside Face Conduction\" are now \"advanced\" variables."); ShowContinueError(state, "You must enter the \"Output:Diagnostics,DisplayAdvancedReportVariables;\" statement to view."); ShowContinueError(state, "First, though, read cautionary statements in the \"InputOutputReference\" document."); - OpaqSurfWarned = true; + state.dataOutputProcessor->OpaqSurfWarned = true; } - if (!Rept) { + if (!state.dataOutputProcessor->Rept) { ShowWarningError(state, "The following Report Variables were requested but not generated -- check.rdd file"); ShowContinueError(state, "Either the IDF did not contain these elements, the variable name is misspelled,"); ShowContinueError(state, "or the requested variable is an advanced output which requires Output : Diagnostics, DisplayAdvancedReportVariables;"); - Rept = true; + state.dataOutputProcessor->Rept = true; } ShowMessage(state, "Key=" + op->ReqRepVars(Loop).Key + ", VarName=" + op->ReqRepVars(Loop).VarName + ", Frequency=" + reportFrequency[op->ReqRepVars(Loop).frequency]); @@ -6791,7 +6780,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, if (!op->EnergyMeters(WhichMeter).RptTS) { op->EnergyMeters(WhichMeter).RptTS = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptTSFO = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -6816,7 +6805,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, if (!op->EnergyMeters(WhichMeter).RptAccTS) { op->EnergyMeters(WhichMeter).RptAccTS = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptAccTSFO = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -6844,7 +6833,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptHR = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptHRFO = true; if (!MeterFileOnlyIndicator) op->TrackingHourlyVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -6870,7 +6859,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptAccHR = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptAccHRFO = true; if (!MeterFileOnlyIndicator) op->TrackingHourlyVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -6898,7 +6887,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptDY = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptDYFO = true; if (!MeterFileOnlyIndicator) op->TrackingDailyVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -6924,7 +6913,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptAccDY = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptAccDYFO = true; if (!MeterFileOnlyIndicator) op->TrackingDailyVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -6952,7 +6941,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptMN = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptMNFO = true; if (!MeterFileOnlyIndicator) op->TrackingMonthlyVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -6978,7 +6967,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptAccMN = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptAccMNFO = true; if (!MeterFileOnlyIndicator) op->TrackingMonthlyVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -7006,7 +6995,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptYR = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptYRFO = true; if (!MeterFileOnlyIndicator) op->TrackingYearlyVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -7032,7 +7021,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptAccYR = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptAccYRFO = true; if (!MeterFileOnlyIndicator) op->TrackingYearlyVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -7060,7 +7049,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptSM = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptSMFO = true; if (!MeterFileOnlyIndicator) op->TrackingRunPeriodVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -7086,7 +7075,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, op->EnergyMeters(WhichMeter).RptAccSM = true; if (MeterFileOnlyIndicator) op->EnergyMeters(WhichMeter).RptAccSMFO = true; if (!MeterFileOnlyIndicator) op->TrackingRunPeriodVariables = true; - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(WhichMeter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(WhichMeter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(WhichMeter)); WriteMeterDictionaryItem(state, FrequencyIndicator, @@ -7128,28 +7117,25 @@ int GetMeterIndex(EnergyPlusData &state, std::string const &MeterName) // FUNCTION LOCAL VARIABLE DECLARATIONS: // Valid Meter names because matching case insensitive - static Array1D_string ValidMeterNames; - static Array1D_int iValidMeterNames; - static int NumValidMeters(0); //////////// hoisted into namespace changed to GetMeterIndexFirstCall//////////// // static bool FirstCall( true ); //////////////////////////////////////////////// int Found; auto &op(state.dataOutputProcessor); - if (op->GetMeterIndexFirstCall || (NumValidMeters != op->NumEnergyMeters)) { - NumValidMeters = op->NumEnergyMeters; - ValidMeterNames.allocate(NumValidMeters); - for (Found = 1; Found <= NumValidMeters; ++Found) { - ValidMeterNames(Found) = UtilityRoutines::MakeUPPERCase(op->EnergyMeters(Found).Name); + if (op->GetMeterIndexFirstCall || (state.dataOutputProcessor->NumValidMeters != op->NumEnergyMeters)) { + state.dataOutputProcessor->NumValidMeters = op->NumEnergyMeters; + state.dataOutputProcessor->ValidMeterNames.allocate(state.dataOutputProcessor->NumValidMeters); + for (Found = 1; Found <= state.dataOutputProcessor->NumValidMeters; ++Found) { + state.dataOutputProcessor->ValidMeterNames(Found) = UtilityRoutines::MakeUPPERCase(op->EnergyMeters(Found).Name); } - iValidMeterNames.allocate(NumValidMeters); - SetupAndSort(ValidMeterNames, iValidMeterNames); + state.dataOutputProcessor->iValidMeterNames.allocate(state.dataOutputProcessor->NumValidMeters); + SetupAndSort(state.dataOutputProcessor->ValidMeterNames, state.dataOutputProcessor->iValidMeterNames); op->GetMeterIndexFirstCall = false; } - MeterIndex = UtilityRoutines::FindItemInSortedList(MeterName, ValidMeterNames, NumValidMeters); - if (MeterIndex != 0) MeterIndex = iValidMeterNames(MeterIndex); + MeterIndex = UtilityRoutines::FindItemInSortedList(MeterName, state.dataOutputProcessor->ValidMeterNames, state.dataOutputProcessor->NumValidMeters); + if (MeterIndex != 0) MeterIndex = state.dataOutputProcessor->iValidMeterNames(MeterIndex); return MeterIndex; } @@ -8276,7 +8262,7 @@ void InitPollutionMeterReporting(EnergyPlusData &state, std::string const &Repor Meter = UtilityRoutines::FindItem(PollutionMeters(Loop), op->EnergyMeters); if (Meter > 0) { // All the active meters for this run are set, but all are still searched for. - indexGroupKey = DetermineIndexGroupKeyFromMeterName(op->EnergyMeters(Meter).Name); + indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(Meter).Name); indexGroup = DetermineIndexGroupFromMeterGroup(op->EnergyMeters(Meter)); // All of the specified meters are checked and the headers printed to the meter file if this // has not been done previously diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index 5d15de60bd4..9591f364ac7 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -851,7 +851,7 @@ namespace OutputProcessor { int const maxValueDate // The date the maximum value occurred ); - int DetermineIndexGroupKeyFromMeterName(std::string const &meterName); // the meter name + int DetermineIndexGroupKeyFromMeterName(EnergyPlusData &state, std::string const &meterName); // the meter name std::string DetermineIndexGroupFromMeterGroup(MeterType const &meter); // the meter @@ -1110,6 +1110,23 @@ struct OutputProcessorData : BaseGlobalStruct { Array1D EndUseCategory; std::unordered_map UniqueMeterNames; + // statics + + Real64 rDummy1TS = 0.0; + Real64 rDummy2TS = 0.0; + int iDummy1TS = 0; + int iDummy2TS = 0; + Real64 rDummy1 = 0.0; + Real64 rDummy2 = 0.0; + int iDummy1 = 0; + int iDummy2 = 0; + int indexGroupKey = -1; + bool Rept = false; + bool OpaqSurfWarned = false; + Array1D_string ValidMeterNames; + Array1D_int iValidMeterNames; + int NumValidMeters = 0; + void clear_state() override { this->InstMeterCacheSize = 1000; @@ -1183,6 +1200,21 @@ struct OutputProcessorData : BaseGlobalStruct { this->EnergyMeters.deallocate(); this->EndUseCategory.deallocate(); this->UniqueMeterNames.clear(); + + this->rDummy1TS = 0.0; + this->rDummy2TS = 0.0; + this->iDummy1TS = 0; + this->iDummy2TS = 0; + this->rDummy1 = 0.0; + this->rDummy2 = 0.0; + this->iDummy1 = 0; + this->iDummy2 = 0; + this->indexGroupKey = -1; + this->Rept = false; + this->OpaqSurfWarned = false; + this->ValidMeterNames.clear(); + this->iValidMeterNames.clear(); + this->NumValidMeters = 0; } }; From fd6c4884c028efdd3a4e48caec813c8aa78533ad Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 00:25:02 -0600 Subject: [PATCH 12/21] TARCOGGasses90 --- src/EnergyPlus/Data/CommonIncludes.hh | 1 + src/EnergyPlus/Data/EnergyPlusData.hh | 2 + src/EnergyPlus/TARCOGGasses90.cc | 89 ++++++++++----------- src/EnergyPlus/TARCOGGasses90.hh | 33 +++++++- src/EnergyPlus/TARCOGMain.cc | 6 +- src/EnergyPlus/TarcogShading.cc | 38 +++++---- src/EnergyPlus/TarcogShading.hh | 12 ++- src/EnergyPlus/ThermalEN673Calc.cc | 15 ++-- src/EnergyPlus/ThermalEN673Calc.hh | 6 +- src/EnergyPlus/ThermalISO15099Calc.cc | 13 +-- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 2 +- 11 files changed, 131 insertions(+), 86 deletions(-) diff --git a/src/EnergyPlus/Data/CommonIncludes.hh b/src/EnergyPlus/Data/CommonIncludes.hh index 39227e885af..b988a1b9f6a 100644 --- a/src/EnergyPlus/Data/CommonIncludes.hh +++ b/src/EnergyPlus/Data/CommonIncludes.hh @@ -266,6 +266,7 @@ #include #include #include +#include #include #include #include diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index b7f44ba0f76..31e7a712d8c 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -274,6 +274,7 @@ struct TARCOGOutputData; struct ThermalChimneysData; struct ThermalComfortsData; struct ThermalISO15099CalcData; +struct TARCOGGasses90Data; struct TranspiredCollectorData; struct UCSDSharedData; struct UFADManagerData; @@ -524,6 +525,7 @@ struct EnergyPlusData : BaseGlobalStruct { std::unique_ptr dataThermalChimneys; std::unique_ptr dataThermalComforts; std::unique_ptr dataThermalISO15099Calc; + std::unique_ptr dataTARCOGGasses90; std::unique_ptr dataTranspiredCollector; std::unique_ptr dataUCSDShared; std::unique_ptr dataUFADManager; diff --git a/src/EnergyPlus/TARCOGGasses90.cc b/src/EnergyPlus/TARCOGGasses90.cc index a78481ce7b7..1b0a27dde8c 100644 --- a/src/EnergyPlus/TARCOGGasses90.cc +++ b/src/EnergyPlus/TARCOGGasses90.cc @@ -55,6 +55,7 @@ // EnergyPlus Headers #include +#include #include #include @@ -79,7 +80,8 @@ namespace EnergyPlus::TARCOGGasses90 { // Using/Aliasing using namespace TARCOGGassesParams; - void GASSES90(Real64 const tmean, + void GASSES90(EnergyPlusData &state, + Real64 const tmean, const Array1D_int &iprop, const Array1D &frct, Real64 const pres, @@ -99,15 +101,6 @@ namespace EnergyPlus::TARCOGGasses90 { { static Real64 const two_sqrt_2(2.0 * std::sqrt(2.0)); - static Array1D fvis(maxgas); - static Array1D fcon(maxgas); - static Array1D fdens(maxgas); - static Array1D fcp(maxgas); - static Array1D kprime(maxgas); - static Array1D kdblprm(maxgas); - static Array1D mukpdwn(maxgas); - static Array1D kpdown(maxgas); - static Array1D kdpdown(maxgas); Real64 molmix; Real64 cpmixm; Real64 phimup; @@ -126,35 +119,35 @@ namespace EnergyPlus::TARCOGGasses90 { // xgrho = 0.0d0 //Autodesk:Uninit Force default initialization Real64 const tmean_2(pow_2(tmean)); - fcon(1) = xgcon(1, iprop(1)) + xgcon(2, iprop(1)) * tmean + xgcon(3, iprop(1)) * tmean_2; - fvis(1) = xgvis(1, iprop(1)) + xgvis(2, iprop(1)) * tmean + xgvis(3, iprop(1)) * tmean_2; - fcp(1) = xgcp(1, iprop(1)) + xgcp(2, iprop(1)) * tmean + xgcp(3, iprop(1)) * tmean_2; + state.dataTARCOGGasses90->fcon(1) = xgcon(1, iprop(1)) + xgcon(2, iprop(1)) * tmean + xgcon(3, iprop(1)) * tmean_2; + state.dataTARCOGGasses90->fvis(1) = xgvis(1, iprop(1)) + xgvis(2, iprop(1)) * tmean + xgvis(3, iprop(1)) * tmean_2; + state.dataTARCOGGasses90->fcp(1) = xgcp(1, iprop(1)) + xgcp(2, iprop(1)) * tmean + xgcp(3, iprop(1)) * tmean_2; // Density using ideal gas law: rho=(presure*mol. weight)/(gas const*Tmean) - fdens(1) = pres * xwght(iprop(1)) / (DataGlobalConstants::UniversalGasConst * tmean); + state.dataTARCOGGasses90->fdens(1) = pres * xwght(iprop(1)) / (DataGlobalConstants::UniversalGasConst * tmean); // Mollecular weights in kg/kmol if ((standard == EN673) || (standard == EN673Design)) { // fdens( 1 ) = xgrho( iprop( 1 ), 1 ) + xgrho( iprop( 1 ), 2 ) * tmean + xgrho( iprop( 1 ), 3 ) * pow_2( tmean ); //Autodesk:Uninit xgrho // was uninitialized - fdens(1) = ENpressure * xwght(iprop(1)) / (gaslaw * tmean); + state.dataTARCOGGasses90->fdens(1) = ENpressure * xwght(iprop(1)) / (gaslaw * tmean); } if (frct(1) == 1.0) { // Single gas properties - visc = fvis(1); // viscosity in kg/(m*s) - con = fcon(1); // conductivity in W/(m*K) - cp = fcp(1); // SpecIFic heat in J/(kg*K) - dens = fdens(1); // density in kg/m^3 + visc = state.dataTARCOGGasses90->fvis(1); // viscosity in kg/(m*s) + con = state.dataTARCOGGasses90->fcon(1); // conductivity in W/(m*K) + cp = state.dataTARCOGGasses90->fcp(1); // SpecIFic heat in J/(kg*K) + dens = state.dataTARCOGGasses90->fdens(1); // density in kg/m^3 } else { // Mixture properties bool const stdISO15099(standard == ISO15099); bool const stdEN673((standard == EN673) || (standard == EN673Design)); if (stdISO15099) { molmix = frct(1) * xwght(iprop(1)); // initialize equation 56 - cpmixm = molmix * fcp(1); // initialize equation 58 - kprime(1) = 3.75 * DataGlobalConstants::UniversalGasConst / xwght(iprop(1)) * fvis(1); // equation 67 - kdblprm(1) = fcon(1) - kprime(1); // equation 67 + cpmixm = molmix * state.dataTARCOGGasses90->fcp(1); // initialize equation 58 + state.dataTARCOGGasses90->kprime(1) = 3.75 * DataGlobalConstants::UniversalGasConst / xwght(iprop(1)) * state.dataTARCOGGasses90->fvis(1); // equation 67 + state.dataTARCOGGasses90->kdblprm(1) = state.dataTARCOGGasses90->fcon(1) - state.dataTARCOGGasses90->kprime(1); // equation 67 // initialize sumations for eqns 60-66: - mukpdwn(1) = 1.0; - kpdown(1) = 1.0; - kdpdown(1) = 1.0; + state.dataTARCOGGasses90->mukpdwn(1) = 1.0; + state.dataTARCOGGasses90->kpdown(1) = 1.0; + state.dataTARCOGGasses90->kdpdown(1) = 1.0; } for (int i = 2; i <= nmix; ++i) { if (frct(i) == 0.0) { @@ -163,22 +156,22 @@ namespace EnergyPlus::TARCOGGasses90 { return; } // calculate properties of mixture constituents: - fcon(i) = xgcon(1, iprop(i)) + xgcon(2, iprop(i)) * tmean + xgcon(3, iprop(i)) * tmean_2; - fvis(i) = xgvis(1, iprop(i)) + xgvis(2, iprop(i)) * tmean + xgvis(3, iprop(i)) * tmean_2; - fcp(i) = xgcp(1, iprop(i)) + xgcp(2, iprop(i)) * tmean + xgcp(3, iprop(i)) * tmean_2; + state.dataTARCOGGasses90->fcon(i) = xgcon(1, iprop(i)) + xgcon(2, iprop(i)) * tmean + xgcon(3, iprop(i)) * tmean_2; + state.dataTARCOGGasses90->fvis(i) = xgvis(1, iprop(i)) + xgvis(2, iprop(i)) * tmean + xgvis(3, iprop(i)) * tmean_2; + state.dataTARCOGGasses90->fcp(i) = xgcp(1, iprop(i)) + xgcp(2, iprop(i)) * tmean + xgcp(3, iprop(i)) * tmean_2; if (stdEN673) { // fdens( i ) = grho( iprop( i ), 1 ) + grho( iprop( i ), 2 ) * tmean + grho( iprop( i ), 3 ) * pow_2( tmean ); - fdens(i) = + state.dataTARCOGGasses90->fdens(i) = ENpressure * xwght(iprop(i)) / (gaslaw * tmean); // Density using ideal gas law: rho=(presure*mol. weight)/(gas const*Tmean) } if (stdISO15099) { molmix += frct(i) * xwght(iprop(i)); // equation 56 - cpmixm += frct(i) * fcp(i) * xwght(iprop(i)); // equation 58-59 - kprime(i) = 3.75 * DataGlobalConstants::UniversalGasConst / xwght(iprop(i)) * fvis(i); // equation 67 - kdblprm(i) = fcon(i) - kprime(i); // equation 68 - mukpdwn(i) = 1.0; // initialize denominator of equation 60 - kpdown(i) = 1.0; // initialize denominator of equation 63 - kdpdown(i) = 1.0; // initialize denominator of equation 65 + cpmixm += frct(i) * state.dataTARCOGGasses90->fcp(i) * xwght(iprop(i)); // equation 58-59 + state.dataTARCOGGasses90->kprime(i) = 3.75 * DataGlobalConstants::UniversalGasConst / xwght(iprop(i)) * state.dataTARCOGGasses90->fvis(i); // equation 67 + state.dataTARCOGGasses90->kdblprm(i) = state.dataTARCOGGasses90->fcon(i) - state.dataTARCOGGasses90->kprime(i); // equation 68 + state.dataTARCOGGasses90->mukpdwn(i) = 1.0; // initialize denominator of equation 60 + state.dataTARCOGGasses90->kpdown(i) = 1.0; // initialize denominator of equation 63 + state.dataTARCOGGasses90->kdpdown(i) = 1.0; // initialize denominator of equation 65 } } @@ -187,38 +180,38 @@ namespace EnergyPlus::TARCOGGasses90 { Real64 kpmix(0.0); Real64 kdpmix(0.0); for (int i = 1; i <= nmix; ++i) { - Real64 const kprime_i(kprime(i)); + Real64 const kprime_i(state.dataTARCOGGasses90->kprime(i)); Real64 const xwght_i(xwght(iprop(i))); for (int j = 1; j <= nmix; ++j) { Real64 const xwght_j(xwght(iprop(j))); // numerator of equation 61 Real64 const x_pow(root_4(xwght_j / xwght_i)); - phimup = pow_2(1.0 + std::sqrt(fvis(i) / fvis(j)) * x_pow); + phimup = pow_2(1.0 + std::sqrt(state.dataTARCOGGasses90->fvis(i) / state.dataTARCOGGasses90->fvis(j)) * x_pow); // denominator of equation 61, 64 and 66 downer = two_sqrt_2 * std::sqrt(1.0 + (xwght_i / xwght_j)); // calculate the denominator of equation 60 - if (i != j) mukpdwn(i) += phimup / downer * frct(j) / frct(i); + if (i != j) state.dataTARCOGGasses90->mukpdwn(i) += phimup / downer * frct(j) / frct(i); // numerator of equation 64, psiterm is the multiplied term in brackets - psiup = pow_2(1.0 + std::sqrt(kprime_i / kprime(j)) / x_pow); + psiup = pow_2(1.0 + std::sqrt(kprime_i / state.dataTARCOGGasses90->kprime(j)) / x_pow); psiterm = 1.0 + 2.41 * (xwght_i - xwght_j) * (xwght_i - 0.142 * xwght_j) / pow_2(xwght_i + xwght_j); // using the common denominator downer calculate the denominator for equation 63 - if (i != j) kpdown(i) += psiup * psiterm / downer * frct(j) / frct(i); + if (i != j) state.dataTARCOGGasses90->kpdown(i) += psiup * psiterm / downer * frct(j) / frct(i); // calculate the numerator of equation 66 phikup = psiup; // Tuned Was pow_2( 1.0 + std::sqrt( kprime_i / kprime( j ) ) * std::pow( xwght_i / xwght_j, 0.25 ) ); // using the common denominator downer calculate the denominator for equation 65 - if (i != j) kdpdown(i) += phikup / downer * frct(j) / frct(i); + if (i != j) state.dataTARCOGGasses90->kdpdown(i) += phikup / downer * frct(j) / frct(i); } - mumix += fvis(i) / mukpdwn(i); // equation 60 - kpmix += kprime(i) / kpdown(i); // equation 63 - kdpmix += kdblprm(i) / kdpdown(i); // equation 65 + mumix += state.dataTARCOGGasses90->fvis(i) / state.dataTARCOGGasses90->mukpdwn(i); // equation 60 + kpmix += state.dataTARCOGGasses90->kprime(i) / state.dataTARCOGGasses90->kpdown(i); // equation 63 + kdpmix += state.dataTARCOGGasses90->kdblprm(i) / state.dataTARCOGGasses90->kdpdown(i); // equation 65 } // calculate the density of the mixture assuming an ideal gas: @@ -241,10 +234,10 @@ namespace EnergyPlus::TARCOGGasses90 { cp = 0.0; for (int i = 1; i <= nmix; ++i) { Real64 const frct_i(frct(i)); - con += fcon(i) * frct_i; - visc += fvis(i) * frct_i; - dens += fdens(i) * frct_i; - cp += fcp(i) * frct_i; + con += state.dataTARCOGGasses90->fcon(i) * frct_i; + visc += state.dataTARCOGGasses90->fvis(i) * frct_i; + dens += state.dataTARCOGGasses90->fdens(i) * frct_i; + cp += state.dataTARCOGGasses90->fcp(i) * frct_i; } } else { assert(false); // should never come here - unsupported standard diff --git a/src/EnergyPlus/TARCOGGasses90.hh b/src/EnergyPlus/TARCOGGasses90.hh index 786cd413f2f..e8cfd1760e0 100644 --- a/src/EnergyPlus/TARCOGGasses90.hh +++ b/src/EnergyPlus/TARCOGGasses90.hh @@ -53,10 +53,19 @@ // EnergyPlus Headers #include +#include +#include -namespace EnergyPlus::TARCOGGasses90 { +namespace EnergyPlus { - void GASSES90(Real64 tmean, +// Using/Aliasing +using namespace TARCOGGassesParams; +using namespace TARCOGParams; + +namespace TARCOGGasses90 { + + void GASSES90(EnergyPlusData &state, + Real64 tmean, const Array1D_int &iprop, const Array1D &frct, Real64 pres, @@ -74,8 +83,24 @@ namespace EnergyPlus::TARCOGGasses90 { int &nperr, std::string &ErrorMessage); - void - GassesLow(Real64 tmean, Real64 mwght, Real64 pressure, Real64 gama, Real64 &cond, int &nperr, std::string &ErrorMessage); + void GassesLow(Real64 tmean, Real64 mwght, Real64 pressure, Real64 gama, Real64 &cond, int &nperr, std::string &ErrorMessage); +} +struct TARCOGGasses90Data : BaseGlobalStruct { + + Array1D fvis = Array1D(TARCOGGassesParams::maxgas); + Array1D fcon = Array1D(TARCOGGassesParams::maxgas); + Array1D fdens = Array1D(TARCOGGassesParams::maxgas); + Array1D fcp = Array1D(TARCOGGassesParams::maxgas); + Array1D kprime = Array1D(TARCOGGassesParams::maxgas); + Array1D kdblprm = Array1D(TARCOGGassesParams::maxgas); + Array1D mukpdwn = Array1D(TARCOGGassesParams::maxgas); + Array1D kpdown = Array1D(TARCOGGassesParams::maxgas); + Array1D kdpdown = Array1D(TARCOGGassesParams::maxgas); + + void clear_state() override + { + } +}; } // namespace EnergyPlus diff --git a/src/EnergyPlus/TARCOGMain.cc b/src/EnergyPlus/TARCOGMain.cc index acebf0a6eb7..d67fe9174b1 100644 --- a/src/EnergyPlus/TARCOGMain.cc +++ b/src/EnergyPlus/TARCOGMain.cc @@ -871,7 +871,8 @@ namespace EnergyPlus::TARCOGMain { NumOfIterations, edgeGlCorrFac); } else if ((standard == EN673) || (standard == EN673Design)) { - Calc_EN673(files, + Calc_EN673(state, + files, standard, nlayer, tout, @@ -1051,7 +1052,8 @@ namespace EnergyPlus::TARCOGMain { NumOfIterations, edgeGlCorrFac); } else if ((standard == EN673) || (standard == EN673Design)) { - Calc_EN673(files, + Calc_EN673(state, + files, standard, nlayer, tout, diff --git a/src/EnergyPlus/TarcogShading.cc b/src/EnergyPlus/TarcogShading.cc index 0979dc2d20b..0d3ebbb4746 100644 --- a/src/EnergyPlus/TarcogShading.cc +++ b/src/EnergyPlus/TarcogShading.cc @@ -91,7 +91,8 @@ namespace TarcogShading { // Functions - void shading(Array1D const &theta, + void shading(EnergyPlusData &state, + Array1D const &theta, Array1D const &gap, Array1D &hgas, Array1D &hcgas, @@ -244,7 +245,8 @@ namespace TarcogShading { Tgap = Tgaps(2); // bi......use Tout as temp of the air at inlet - shadingedge(iprop1, + shadingedge(state, + iprop1, frct1, press1, nmix1, @@ -307,7 +309,8 @@ namespace TarcogShading { Tgap = Tgaps(nlayer); // bi.........use Tin as temp of the air at inlet - shadingedge(iprop2, + shadingedge(state, + iprop2, frct2, press2, nmix2, @@ -369,7 +372,8 @@ namespace TarcogShading { // speed2 = vvent(i+1) if ((CalcForcedVentilation != 0) && ((vvent(i) != 0) || (vvent(i + 1) != 0))) { - forcedventilation(iprop1, + forcedventilation(state, + iprop1, frct1, press1, nmix1, @@ -388,7 +392,8 @@ namespace TarcogShading { qv1, nperr, ErrorMessage); - forcedventilation(iprop2, + forcedventilation(state, + iprop2, frct2, press2, nmix1, @@ -408,7 +413,7 @@ namespace TarcogShading { nperr, ErrorMessage); } else { - shadingin(iprop1, + shadingin(state,iprop1, frct1, press1, nmix1, @@ -473,7 +478,8 @@ namespace TarcogShading { } } - void forcedventilation(const Array1D_int &iprop, + void forcedventilation(EnergyPlusData &state, + const Array1D_int &iprop, const Array1D &frct, Real64 const press, int const nmix, @@ -528,7 +534,7 @@ namespace TarcogShading { Real64 con; Real64 visc; - GASSES90(Tav, iprop, frct, press, nmix, xwght, xgcon, xgvis, xgcp, con, visc, dens, cp, pr, 1, nperr, ErrorMessage); + GASSES90(state, Tav, iprop, frct, press, nmix, xwght, xgcon, xgvis, xgcp, con, visc, dens, cp, pr, 1, nperr, ErrorMessage); H0 = (dens * cp * s * forcedspeed) / (4.0 * hc + 8.0 * forcedspeed); @@ -541,7 +547,8 @@ namespace TarcogShading { hcv = 2.0 * hc + 4.0 * forcedspeed; } - void shadingin(const Array1D_int &iprop1, + void shadingin(EnergyPlusData &state, + const Array1D_int &iprop1, const Array1D &frct1, Real64 const press1, int const nmix1, @@ -684,7 +691,7 @@ namespace TarcogShading { P1 = 0.0; P2 = 0.0; - GASSES90(T0, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con0, visc0, dens0, cp0, pr0, 1, nperr, ErrorMessage); + GASSES90(state, T0, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con0, visc0, dens0, cp0, pr0, 1, nperr, ErrorMessage); // exit on error: if ((nperr > 0) && (nperr < 1000)) return; @@ -711,8 +718,8 @@ namespace TarcogShading { Real64 const cos_Tilt = std::cos(tilt); while (!converged) { ++iter; - GASSES90(Tgap1, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con1, visc1, dens1, cp1, pr1, 1, nperr, ErrorMessage); - GASSES90(Tgap2, iprop2, frct2, press2, nmix2, xwght, xgcon, xgvis, xgcp, con2, visc2, dens2, cp2, pr2, 1, nperr, ErrorMessage); + GASSES90(state, Tgap1, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con1, visc1, dens1, cp1, pr1, 1, nperr, ErrorMessage); + GASSES90(state, Tgap2, iprop2, frct2, press2, nmix2, xwght, xgcon, xgvis, xgcp, con2, visc2, dens2, cp2, pr2, 1, nperr, ErrorMessage); // A = dens0 * T0 * GravityConstant * ABS(cos(tilt)) * ABS(Tgap1 - Tgap2) / (Tgap1 * Tgap2) @@ -837,7 +844,8 @@ namespace TarcogShading { } } - void shadingedge(const Array1D_int &iprop1, + void shadingedge(EnergyPlusData &state, + const Array1D_int &iprop1, const Array1D &frct1, Real64 const press1, int const nmix1, @@ -948,7 +956,7 @@ namespace TarcogShading { tilt = DataGlobalConstants::Pi / 180.0 * (angle - 90.0); T0 = 0.0 + DataGlobalConstants::KelvinConv; - GASSES90(T0, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con0, visc0, dens0, cp0, pr0, 1, nperr, ErrorMessage); + GASSES90(state, T0, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con0, visc0, dens0, cp0, pr0, 1, nperr, ErrorMessage); // call gasses90(Tenv, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con1, visc1, dens1, cp1, pr1, 1, & // nperr, ErrorMessage) @@ -979,7 +987,7 @@ namespace TarcogShading { while (!converged) { ++iter; - GASSES90(Tgap, iprop2, frct2, press2, nmix2, xwght, xgcon, xgvis, xgcp, con2, visc2, dens2, cp2, pr2, 1, nperr, ErrorMessage); + GASSES90(state, Tgap, iprop2, frct2, press2, nmix2, xwght, xgcon, xgvis, xgcp, con2, visc2, dens2, cp2, pr2, 1, nperr, ErrorMessage); if ((nperr > 0) && (nperr < 1000)) return; diff --git a/src/EnergyPlus/TarcogShading.hh b/src/EnergyPlus/TarcogShading.hh index d80c64953fd..5772317ba09 100644 --- a/src/EnergyPlus/TarcogShading.hh +++ b/src/EnergyPlus/TarcogShading.hh @@ -60,7 +60,8 @@ namespace TarcogShading { // Functions - void shading(Array1D const &theta, + void shading(EnergyPlusData &state, + Array1D const &theta, Array1D const &gap, Array1D &hgas, Array1D &hcgas, @@ -94,7 +95,8 @@ namespace TarcogShading { std::string &ErrorMessage, Array1D &vfreevent); - void forcedventilation(const Array1D_int &iprop, + void forcedventilation(EnergyPlusData &state, + const Array1D_int &iprop, const Array1D &frct, Real64 const press, int const nmix, @@ -114,7 +116,8 @@ namespace TarcogShading { int &nperr, std::string &ErrorMessage); - void shadingin(const Array1D_int &iprop1, + void shadingin(EnergyPlusData &state, + const Array1D_int &iprop1, const Array1D &frct1, Real64 const press1, int const nmix1, @@ -151,7 +154,8 @@ namespace TarcogShading { int &nperr, std::string &ErrorMessage); - void shadingedge(const Array1D_int &iprop1, + void shadingedge(EnergyPlusData &state, + const Array1D_int &iprop1, const Array1D &frct1, Real64 const press1, int const nmix1, diff --git a/src/EnergyPlus/ThermalEN673Calc.cc b/src/EnergyPlus/ThermalEN673Calc.cc index 45e95170145..c2e368b4650 100644 --- a/src/EnergyPlus/ThermalEN673Calc.cc +++ b/src/EnergyPlus/ThermalEN673Calc.cc @@ -91,7 +91,8 @@ namespace ThermalEN673Calc { // Functions - void Calc_EN673(TARCOGOutput::Files &files, + void Calc_EN673(EnergyPlusData &state, + TARCOGOutput::Files &files, int const standard, int const nlayer, Real64 const tout, @@ -184,7 +185,8 @@ namespace ThermalEN673Calc { rtot = 0.0; sft = 0.0; if (GoAhead(nperr)) { - EN673ISO10292(nlayer, + EN673ISO10292(state, + nlayer, tout, tind, emis, @@ -227,7 +229,8 @@ namespace ThermalEN673Calc { } // GopAhead after propcon90 } - void EN673ISO10292(int const nlayer, + void EN673ISO10292(EnergyPlusData &state, + int const nlayer, Real64 const tout, Real64 const tind, const Array1D &emis, @@ -390,7 +393,8 @@ namespace ThermalEN673Calc { ipropg(j) = iprop(i + 1, j); frctg(j) = frct(i + 1, j); } - GASSES90(Tm, + GASSES90(state, + Tm, ipropg, frctg, presure(i + 1), @@ -458,7 +462,8 @@ namespace ThermalEN673Calc { ipropg(j) = iprop(i + 1, j); frctg(j) = frct(i + 1, j); } // j, gas mix - GASSES90(Tm, + GASSES90(state, + Tm, ipropg, frctg, presure(i + 1), diff --git a/src/EnergyPlus/ThermalEN673Calc.hh b/src/EnergyPlus/ThermalEN673Calc.hh index 5ec24fecc8d..242200cd609 100644 --- a/src/EnergyPlus/ThermalEN673Calc.hh +++ b/src/EnergyPlus/ThermalEN673Calc.hh @@ -60,7 +60,8 @@ namespace ThermalEN673Calc { // Functions - void Calc_EN673(TARCOGOutput::Files &files, + void Calc_EN673(EnergyPlusData &state, + TARCOGOutput::Files &files, int const standard, int const nlayer, Real64 const tout, @@ -96,7 +97,8 @@ namespace ThermalEN673Calc { Array1D &Ra, Array1D &Nu); - void EN673ISO10292(int const nlayer, + void EN673ISO10292(EnergyPlusData &state, + int const nlayer, Real64 const tout, Real64 const tind, const Array1D &emis, diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index 8e172e5153a..2c56bd49307 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -1545,7 +1545,8 @@ namespace EnergyPlus::ThermalISO15099Calc { matrixQBalance(nlayer, a, b, sconScaled, hcgas, state.dataThermalISO15099Calc->hcgapMod, asol, qv, state.dataThermalISO15099Calc->hcv, tind, tout, Gin, Gout, theta, tir, rir, emis, edgeGlCorrFac); } else { // bi...There are no Venetian layers, or ThermalMod is not CSM, so carry on as usual: - shading(theta, + shading(state, + theta, gap, state.dataThermalISO15099Calc->hgas, hcgas, @@ -1827,7 +1828,8 @@ namespace EnergyPlus::ThermalISO15099Calc { Ra, Nu); - shading(theta, + shading(state, + theta, gap, state.dataThermalISO15099Calc->hgas, hcgas, @@ -2347,7 +2349,7 @@ namespace EnergyPlus::ThermalISO15099Calc { Real64 dens; Real64 cp; Real64 pr; - GASSES90(tLayer, state.dataThermalISO15099Calc->iprop1, state.dataThermalISO15099Calc->frct1, press1, nmix1, wght, gcon, gvis, gcp, con, visc, dens, cp, pr, 1, nperr, ErrorMessage); + GASSES90(state, tLayer, state.dataThermalISO15099Calc->iprop1, state.dataThermalISO15099Calc->frct1, press1, nmix1, wght, gcon, gvis, gcp, con, visc, dens, cp, pr, 1, nperr, ErrorMessage); sconScaled(i) = (EffectiveOpenness(i) * con + (1 - EffectiveOpenness(i)) * scon(i)) / thick(i); } else { sconScaled(i) = scon(i) / thick(i); @@ -2441,7 +2443,8 @@ namespace EnergyPlus::ThermalISO15099Calc { state.dataThermalISO15099Calc->frcti(j) = frct(j, nlayer + 1); } - GASSES90(tmean, + GASSES90(state, + tmean, state.dataThermalISO15099Calc->ipropi, state.dataThermalISO15099Calc->frcti, presure(nlayer + 1), @@ -2595,7 +2598,7 @@ namespace EnergyPlus::ThermalISO15099Calc { } if (presure(i + 1) > VacuumPressure) { - GASSES90( + GASSES90(state, tmean, state.dataThermalISO15099Calc->ipropg, state.dataThermalISO15099Calc->frctg, presure(i + 1), nmix(i + 1), wght, gcon, gvis, gcp, con, visc, dens, cp, pr, ISO15099, nperr, ErrorMessage); // Calculate grashoff number: diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 224fe74c0e7..70952c7bfeb 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -1308,7 +1308,7 @@ namespace OutputProcessor { {"BAD INPUT", -11}}; for (auto const &indexGroup : resource_map) { - EXPECT_EQ(indexGroup.second, DetermineIndexGroupKeyFromMeterName(indexGroup.first)) << "where meterName is " << indexGroup.first; + EXPECT_EQ(indexGroup.second, DetermineIndexGroupKeyFromMeterName(*state, indexGroup.first)) << "where meterName is " << indexGroup.first; } } From 530c44f51fe6626c9f6b756484ea75a32f9ec426 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 00:57:42 -0600 Subject: [PATCH 13/21] TarcogShading --- src/EnergyPlus/Data/CommonIncludes.hh | 1 + src/EnergyPlus/Data/EnergyPlusData.cc | 5 +++ src/EnergyPlus/Data/EnergyPlusData.hh | 2 ++ src/EnergyPlus/TarcogShading.cc | 46 +++++++++++++-------------- src/EnergyPlus/TarcogShading.hh | 22 +++++++++++++ 5 files changed, 52 insertions(+), 24 deletions(-) diff --git a/src/EnergyPlus/Data/CommonIncludes.hh b/src/EnergyPlus/Data/CommonIncludes.hh index b988a1b9f6a..15689b287bb 100644 --- a/src/EnergyPlus/Data/CommonIncludes.hh +++ b/src/EnergyPlus/Data/CommonIncludes.hh @@ -268,6 +268,7 @@ #include #include #include +#include #include #include #include diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index 570b022e8ce..23ddaa8fcbe 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -264,6 +264,8 @@ namespace EnergyPlus { this->dataThermalChimneys = std::make_unique(); this->dataThermalComforts = std::make_unique(); this->dataThermalISO15099Calc = std::make_unique(); + this->dataTARCOGGasses90 = std::make_unique(); + this->dataTarcogShading = std::make_unique(); this->dataTimingsData = std::make_unique(); this->dataTranspiredCollector = std::make_unique(); this->dataUCSDShared = std::make_unique(); @@ -510,6 +512,9 @@ namespace EnergyPlus { this->dataTARCOGOutputs->clear_state(); this->dataThermalChimneys->clear_state(); this->dataThermalComforts->clear_state(); + this->dataThermalISO15099Calc->clear_state(); + this->dataTARCOGGasses90->clear_state(); + this->dataTarcogShading->clear_state(); this->dataTimingsData->clear_state(); this->dataTranspiredCollector->clear_state(); this->dataUCSDShared->clear_state(); diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index 31e7a712d8c..ac228431121 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -275,6 +275,7 @@ struct ThermalChimneysData; struct ThermalComfortsData; struct ThermalISO15099CalcData; struct TARCOGGasses90Data; +struct TarcogShadingData; struct TranspiredCollectorData; struct UCSDSharedData; struct UFADManagerData; @@ -526,6 +527,7 @@ struct EnergyPlusData : BaseGlobalStruct { std::unique_ptr dataThermalComforts; std::unique_ptr dataThermalISO15099Calc; std::unique_ptr dataTARCOGGasses90; + std::unique_ptr dataTarcogShading; std::unique_ptr dataTranspiredCollector; std::unique_ptr dataUCSDShared; std::unique_ptr dataUFADManager; diff --git a/src/EnergyPlus/TarcogShading.cc b/src/EnergyPlus/TarcogShading.cc index 0d3ebbb4746..85e89a32a87 100644 --- a/src/EnergyPlus/TarcogShading.cc +++ b/src/EnergyPlus/TarcogShading.cc @@ -51,6 +51,7 @@ // EnergyPlus Headers #include +#include #include #include #include @@ -180,8 +181,6 @@ namespace TarcogShading { Real64 hc; Real64 hc1; Real64 hc2; - static Array1D frct1(maxgas); - static Array1D frct2(maxgas); Real64 speed; Real64 Tav; Real64 Tgap; @@ -202,8 +201,6 @@ namespace TarcogShading { int k; int nmix1; int nmix2; - static Array1D_int iprop1(maxgas); - static Array1D_int iprop2(maxgas); // init vectors: qv = 0.0; @@ -230,10 +227,10 @@ namespace TarcogShading { press1 = pressure(i); press2 = pressure(i + 1); for (j = 1; j <= maxgas; ++j) { - iprop1(j) = iprop(j, i); - iprop2(j) = iprop(j, i + 1); - frct1(j) = frct(j, i); - frct2(j) = frct(j, i + 1); + state.dataTarcogShading->iprop1(j) = iprop(j, i); + state.dataTarcogShading->iprop2(j) = iprop(j, i + 1); + state.dataTarcogShading->frct1(j) = frct(j, i); + state.dataTarcogShading->frct2(j) = frct(j, i + 1); } // j // dr.......shading on outdoor side @@ -246,12 +243,12 @@ namespace TarcogShading { // bi......use Tout as temp of the air at inlet shadingedge(state, - iprop1, - frct1, + state.dataTarcogShading->iprop1, + state.dataTarcogShading->frct1, press1, nmix1, - iprop2, - frct2, + state.dataTarcogShading->iprop2, + state.dataTarcogShading->frct2, press2, nmix2, xwght, @@ -310,12 +307,12 @@ namespace TarcogShading { // bi.........use Tin as temp of the air at inlet shadingedge(state, - iprop2, - frct2, + state.dataTarcogShading->iprop2, + state.dataTarcogShading->frct2, press2, nmix2, - iprop1, - frct1, + state.dataTarcogShading->iprop1, + state.dataTarcogShading->frct1, press1, nmix1, xwght, @@ -373,8 +370,8 @@ namespace TarcogShading { if ((CalcForcedVentilation != 0) && ((vvent(i) != 0) || (vvent(i + 1) != 0))) { forcedventilation(state, - iprop1, - frct1, + state.dataTarcogShading->iprop1, + state.dataTarcogShading->frct1, press1, nmix1, xwght, @@ -393,8 +390,8 @@ namespace TarcogShading { nperr, ErrorMessage); forcedventilation(state, - iprop2, - frct2, + state.dataTarcogShading->iprop2, + state.dataTarcogShading->frct2, press2, nmix1, xwght, @@ -413,12 +410,13 @@ namespace TarcogShading { nperr, ErrorMessage); } else { - shadingin(state,iprop1, - frct1, + shadingin(state, + state.dataTarcogShading->iprop1, + state.dataTarcogShading->frct1, press1, nmix1, - iprop2, - frct2, + state.dataTarcogShading->iprop2, + state.dataTarcogShading->frct2, press2, nmix2, xwght, diff --git a/src/EnergyPlus/TarcogShading.hh b/src/EnergyPlus/TarcogShading.hh index 5772317ba09..ad55552409d 100644 --- a/src/EnergyPlus/TarcogShading.hh +++ b/src/EnergyPlus/TarcogShading.hh @@ -53,9 +53,15 @@ // EnergyPlus Headers #include +#include +#include namespace EnergyPlus { +// Using/Aliasing +using namespace TARCOGGassesParams; +using namespace TARCOGParams; + namespace TarcogShading { // Functions @@ -206,6 +212,22 @@ namespace TarcogShading { } // namespace TarcogShading +struct TarcogShadingData : BaseGlobalStruct { + + Array1D frct1 = Array1D(TARCOGGassesParams::maxgas); + Array1D frct2 = Array1D(TARCOGGassesParams::maxgas); + Array1D_int iprop1 = Array1D_int(TARCOGGassesParams::maxgas); + Array1D_int iprop2 = Array1D_int(TARCOGGassesParams::maxgas); + + void clear_state() override + { + frct1.clear(); + frct2.clear(); + iprop1.clear(); + iprop2.clear(); + } +}; + } // namespace EnergyPlus #endif From b2086347258cf6dacff316a142014f05cf1808d1 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 01:29:34 -0600 Subject: [PATCH 14/21] TARCOGMain --- src/EnergyPlus/Data/CommonIncludes.hh | 1 + src/EnergyPlus/Data/EnergyPlusData.cc | 2 + src/EnergyPlus/Data/EnergyPlusData.hh | 2 + src/EnergyPlus/TARCOGGasses90.hh | 9 ++ src/EnergyPlus/TARCOGMain.cc | 44 +++--- src/EnergyPlus/TARCOGMain.hh | 187 +++++++++++++++----------- 6 files changed, 140 insertions(+), 105 deletions(-) diff --git a/src/EnergyPlus/Data/CommonIncludes.hh b/src/EnergyPlus/Data/CommonIncludes.hh index 15689b287bb..872d861f5bb 100644 --- a/src/EnergyPlus/Data/CommonIncludes.hh +++ b/src/EnergyPlus/Data/CommonIncludes.hh @@ -267,6 +267,7 @@ #include #include #include +#include #include #include #include diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index 23ddaa8fcbe..4a8cfee4b0b 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -265,6 +265,7 @@ namespace EnergyPlus { this->dataThermalComforts = std::make_unique(); this->dataThermalISO15099Calc = std::make_unique(); this->dataTARCOGGasses90 = std::make_unique(); + this->dataTARCOGMain = std::make_unique(); this->dataTarcogShading = std::make_unique(); this->dataTimingsData = std::make_unique(); this->dataTranspiredCollector = std::make_unique(); @@ -514,6 +515,7 @@ namespace EnergyPlus { this->dataThermalComforts->clear_state(); this->dataThermalISO15099Calc->clear_state(); this->dataTARCOGGasses90->clear_state(); + this->dataTARCOGMain->clear_state(); this->dataTarcogShading->clear_state(); this->dataTimingsData->clear_state(); this->dataTranspiredCollector->clear_state(); diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index ac228431121..259ba5efc88 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -275,6 +275,7 @@ struct ThermalChimneysData; struct ThermalComfortsData; struct ThermalISO15099CalcData; struct TARCOGGasses90Data; +struct TARCOGMainData; struct TarcogShadingData; struct TranspiredCollectorData; struct UCSDSharedData; @@ -527,6 +528,7 @@ struct EnergyPlusData : BaseGlobalStruct { std::unique_ptr dataThermalComforts; std::unique_ptr dataThermalISO15099Calc; std::unique_ptr dataTARCOGGasses90; + std::unique_ptr dataTARCOGMain; std::unique_ptr dataTarcogShading; std::unique_ptr dataTranspiredCollector; std::unique_ptr dataUCSDShared; diff --git a/src/EnergyPlus/TARCOGGasses90.hh b/src/EnergyPlus/TARCOGGasses90.hh index e8cfd1760e0..282ad4cb41f 100644 --- a/src/EnergyPlus/TARCOGGasses90.hh +++ b/src/EnergyPlus/TARCOGGasses90.hh @@ -99,6 +99,15 @@ struct TARCOGGasses90Data : BaseGlobalStruct { void clear_state() override { + fvis.clear(); + fcon.clear(); + fdens.clear(); + fcp.clear(); + kprime.clear(); + kdblprm.clear(); + mukpdwn.clear(); + kpdown.clear(); + kdpdown.clear(); } }; diff --git a/src/EnergyPlus/TARCOGMain.cc b/src/EnergyPlus/TARCOGMain.cc index d67fe9174b1..88fe3e90ea8 100644 --- a/src/EnergyPlus/TARCOGMain.cc +++ b/src/EnergyPlus/TARCOGMain.cc @@ -49,6 +49,7 @@ #include // EnergyPlus Headers +#include #include #include #include @@ -621,16 +622,9 @@ namespace EnergyPlus::TARCOGMain { Real64 trminTemp; Real64 hinTemp; Real64 houtTemp; - static Array1D sconTemp(maxlay); - static Array1D thickTemp(maxlay); // REAL(r64), dimension(maxlay) :: sol ! Vector of Absorbed solar energy for each layer [W/m2] = dir*asol - // Internaly used - static bool converged(false); // used for convergence check in case of deflection calculations - static Array1D told(maxlay2); - static Array1D CurGap(MaxGap); - static Array1D GapDefMean(MaxGap); Real64 dtmax; int i; int counter; @@ -654,7 +648,7 @@ namespace EnergyPlus::TARCOGMain { ErrorMessage = "Normal Termination"; for (i = 1; i <= nlayer - 1; ++i) { - CurGap(i) = gap(i); + state.dataTARCOGMain->CurGap(i) = gap(i); } Files files; @@ -749,7 +743,7 @@ namespace EnergyPlus::TARCOGMain { thick, gap, GapDefMax, - GapDefMean, + state.dataTARCOGMain->GapDefMean, theta, YoungsMod, PoissonsRat, @@ -757,7 +751,7 @@ namespace EnergyPlus::TARCOGMain { nperr, ErrorMessage); for (i = 1; i <= nlayer - 1; ++i) { - CurGap(i) = GapDefMean(i); + state.dataTARCOGMain->CurGap(i) = state.dataTARCOGMain->GapDefMean(i); } // do i = 1, nlayer - 1 } @@ -769,8 +763,8 @@ namespace EnergyPlus::TARCOGMain { trminTemp = trmin; hinTemp = hin; houtTemp = hout; - sconTemp = scon; - thickTemp = thick; + state.dataTARCOGMain->sconTemp = scon; + state.dataTARCOGMain->thickTemp = thick; } if (GoAhead(nperr)) { @@ -792,7 +786,7 @@ namespace EnergyPlus::TARCOGMain { fclr, VacuumPressure, VacuumMaxGapThickness, - CurGap, + state.dataTARCOGMain->CurGap, thick, scon, tir, @@ -877,7 +871,7 @@ namespace EnergyPlus::TARCOGMain { nlayer, tout, tind, - CurGap, + state.dataTARCOGMain->CurGap, thick, scon, emis, @@ -918,8 +912,8 @@ namespace EnergyPlus::TARCOGMain { } if (CalcDeflection == DEFLECTION_CALC_TEMPERATURE) { - converged = false; - while (!(converged)) { + state.dataTARCOGMain->converged = false; + while (!(state.dataTARCOGMain->converged)) { PanesDeflection(CalcDeflection, width, height, @@ -930,7 +924,7 @@ namespace EnergyPlus::TARCOGMain { thick, gap, GapDefMax, - GapDefMean, + state.dataTARCOGMain->GapDefMean, theta, YoungsMod, PoissonsRat, @@ -944,7 +938,7 @@ namespace EnergyPlus::TARCOGMain { // store temperatures before new calculations are performed. This is necessary in order to determine for (i = 1; i <= 2 * nlayer; ++i) { - told(i) = theta(i); + state.dataTARCOGMain->told(i) = theta(i); } // do i=1, 2*nlayer // before calling thermal calculations, return back old variables @@ -952,8 +946,8 @@ namespace EnergyPlus::TARCOGMain { trmin = trminTemp; hin = hinTemp; hout = houtTemp; - scon = sconTemp; - thick = thickTemp; + scon = state.dataTARCOGMain->sconTemp; + thick = state.dataTARCOGMain->thickTemp; // after performed deflection recalculate temperatures with new gap widths if (standard == ISO15099) { @@ -973,7 +967,7 @@ namespace EnergyPlus::TARCOGMain { fclr, VacuumPressure, VacuumMaxGapThickness, - GapDefMean, + state.dataTARCOGMain->GapDefMean, thick, scon, tir, @@ -1058,7 +1052,7 @@ namespace EnergyPlus::TARCOGMain { nlayer, tout, tind, - GapDefMean, + state.dataTARCOGMain->GapDefMean, thick, scon, emis, @@ -1098,16 +1092,16 @@ namespace EnergyPlus::TARCOGMain { // calc error dtmax = 0.0; for (i = 1; i <= 2 * nlayer; ++i) { - dtmax = std::abs(told(i) - theta(i)); + dtmax = std::abs(state.dataTARCOGMain->told(i) - theta(i)); } // do i=1, 2*nlayer if (dtmax < DeflectionErrorMargin) { - converged = true; + state.dataTARCOGMain->converged = true; } ++counter; if (counter > DeflectionMaxIterations) { - converged = true; + state.dataTARCOGMain->converged = true; nperr = 41; // Deflection calculations failed to converge ErrorMessage = "Deflection calculations failed to converge"; } diff --git a/src/EnergyPlus/TARCOGMain.hh b/src/EnergyPlus/TARCOGMain.hh index d7ea60ec53a..db8025b0e4c 100644 --- a/src/EnergyPlus/TARCOGMain.hh +++ b/src/EnergyPlus/TARCOGMain.hh @@ -53,28 +53,33 @@ // EnergyPlus Headers #include +#include +#include -namespace EnergyPlus::TARCOGMain { +namespace EnergyPlus { - void TARCOG90(EnergyPlusData &state, int nlayer, // Number of layers (glass + SD) - int iwd, // Wind direction: - Real64 &tout, // Outdoor temperature [K] - Real64 &tind, // Indoor temperature [K] - Real64 &trmin, // Indoor mean radiant temperature [K] - Real64 wso, // Outdoor wind speed [m/s] - Real64 wsi, // Inside forced air speed [m/s] - Real64 dir, // Direct solar radiation [W/m2] - Real64 outir, // IR radiance of window's exterior surround [W/m2] - int isky, // Flag for sky temperature(Tsky) and sky emittance(esky) - Real64 tsky, // Night sky temperature [K] - Real64 &esky, // Effective night sky emittance - Real64 fclr, // Fraction of sky that is clear - Real64 VacuumPressure, // maximal pressure for gas to be considered as vacuum - Real64 &VacuumMaxGapThickness, // maximum allowed thickness without producing warning message - int CalcDeflection, // Deflection calculation flag: - Real64 Pa, // Atmospheric (outside/inside) pressure (used onlu if CalcDeflection = 1) - Real64 Pini, // Initial presssure at time of fabrication (used only if CalcDeflection = 1) - Real64 Tini, // Initial temperature at time of fabrication (used only if CalcDeflection = 1) +namespace TARCOGMain { + + void TARCOG90(EnergyPlusData &state, + int nlayer, // Number of layers (glass + SD) + int iwd, // Wind direction: + Real64 &tout, // Outdoor temperature [K] + Real64 &tind, // Indoor temperature [K] + Real64 &trmin, // Indoor mean radiant temperature [K] + Real64 wso, // Outdoor wind speed [m/s] + Real64 wsi, // Inside forced air speed [m/s] + Real64 dir, // Direct solar radiation [W/m2] + Real64 outir, // IR radiance of window's exterior surround [W/m2] + int isky, // Flag for sky temperature(Tsky) and sky emittance(esky) + Real64 tsky, // Night sky temperature [K] + Real64 &esky, // Effective night sky emittance + Real64 fclr, // Fraction of sky that is clear + Real64 VacuumPressure, // maximal pressure for gas to be considered as vacuum + Real64 &VacuumMaxGapThickness, // maximum allowed thickness without producing warning message + int CalcDeflection, // Deflection calculation flag: + Real64 Pa, // Atmospheric (outside/inside) pressure (used onlu if CalcDeflection = 1) + Real64 Pini, // Initial presssure at time of fabrication (used only if CalcDeflection = 1) + Real64 Tini, // Initial temperature at time of fabrication (used only if CalcDeflection = 1) Array1D &gap, // Vector of gap widths [m] Array1D &GapDefMax, // Vector of gap widths in deflected state. It will be used as input Array1D &thick, // Vector of glazing layer thicknesses [m] @@ -83,18 +88,18 @@ namespace EnergyPlus::TARCOGMain { const Array1D &PoissonsRat, // Poissons Ratio coefficients used in deflection calculations const Array1D &tir, // Vector of IR transmittances of each surface const Array1D &emis, // Vector of IR emittances of each surface - Real64 totsol, // Total solar transmittance of the IGU - Real64 tilt, // Window tilt [degrees] + Real64 totsol, // Total solar transmittance of the IGU + Real64 tilt, // Window tilt [degrees] const Array1D &asol, // Vector of Absorbed solar energy fractions for each layer - Real64 height, // IGU cavity height - Real64 heightt, // Window height - Real64 width, // Window width + Real64 height, // IGU cavity height + Real64 heightt, // Window height + Real64 width, // Window width const Array1D &presure, // Vector of gas pressures in gaps [N/m2] - Array2A_int iprop, // Matrix of gas codes - see mgas definition - Array2A frct, // Matrix of mass percentages in gap mixtures - Array2A xgcon, // Matrix of constants for gas conductivity calc - Array2A xgvis, // Matrix of constants for gas dynamic viscosity calc - Array2A xgcp, // Matrix of constants for gas specific heat calc at constant pressure + Array2A_int iprop, // Matrix of gas codes - see mgas definition + Array2A frct, // Matrix of mass percentages in gap mixtures + Array2A xgcon, // Matrix of constants for gas conductivity calc + Array2A xgvis, // Matrix of constants for gas dynamic viscosity calc + Array2A xgcp, // Matrix of constants for gas specific heat calc at constant pressure const Array1D &xwght, // Vector of Molecular weights for gasses const Array1D &gama, // Vector of spefic heat ration for low pressure calc const Array1D_int &nmix, // Vector of number of gasses in gas mixture of each gap @@ -105,70 +110,92 @@ namespace EnergyPlus::TARCOGMain { Array1D &LayerDef, // Vector of layers deflection. [m] Array1D &q, // Vector of various heat fluxes [W/m2] Array1D &qv, // Vector of heat fluxes to each gap by ventillation [W/m2] - Real64 &ufactor, // Center of glass U-value [W/m2 K] - Real64 &sc, // Shading Coefficient - Real64 &hflux, // Net heat flux between room and window [W/m2] - Real64 &hcin, // Indoor convective surface heat transfer coefficient [W/m2 K] - Real64 &hcout, // Outdoor convective surface heat transfer coefficient [W/m2 K] - Real64 &hrin, // Indoor radiative surface heat transfer coefficient [W/m2 K] - Real64 &hrout, // Outdoor radiative surface heat transfer coefficient [W/m2 K] - Real64 &hin, // Indoor combined film coefficient (if non-zero) [W/m2K] - Real64 &hout, // Outdoor combined film coefficient (if non-zero) [W/m2K] + Real64 &ufactor, // Center of glass U-value [W/m2 K] + Real64 &sc, // Shading Coefficient + Real64 &hflux, // Net heat flux between room and window [W/m2] + Real64 &hcin, // Indoor convective surface heat transfer coefficient [W/m2 K] + Real64 &hcout, // Outdoor convective surface heat transfer coefficient [W/m2 K] + Real64 &hrin, // Indoor radiative surface heat transfer coefficient [W/m2 K] + Real64 &hrout, // Outdoor radiative surface heat transfer coefficient [W/m2 K] + Real64 &hin, // Indoor combined film coefficient (if non-zero) [W/m2K] + Real64 &hout, // Outdoor combined film coefficient (if non-zero) [W/m2K] Array1D &hcgas, // Convective part of gap effective conductivity (including in and out) Array1D &hrgas, // Radiative part of gap effective conductivity (including in and out) - Real64 &shgc, // Solar heat gain coefficient - per ISO 15099 - int &nperr, // Error code - std::string &ErrorMessage, // To store error message from tarcog execution - Real64 &shgct, // Solar heat gain coefficient - per old procedure - Real64 &tamb, // Outdoor environmental temperature [K] - Real64 &troom, // Indoor environmental temperature [K] + Real64 &shgc, // Solar heat gain coefficient - per ISO 15099 + int &nperr, // Error code + std::string &ErrorMessage, // To store error message from tarcog execution + Real64 &shgct, // Solar heat gain coefficient - per old procedure + Real64 &tamb, // Outdoor environmental temperature [K] + Real64 &troom, // Indoor environmental temperature [K] const Array1D_int &ibc, // Vector of boundary condition flags (ibc(1) - outdoor, ibc(2) - indoor - const Array1D &Atop, // Vector with areas of top openings - between SD layers and top of - const Array1D &Abot, // Vector with areas of bottom openings - between SD layers and - const Array1D &Al, // Vector with areas of left-hand side openings - between SD layers and - const Array1D &Ar, // Vector of areas of right-hand side openings - between SD layers and - const Array1D &Ah, // Vector of total areas of holes for each SD [m2] - const Array1D &SlatThick, // Thickness of the slat material [m] - const Array1D &SlatWidth, // Slat width [m] - const Array1D &SlatAngle, // Slat tilt angle [deg] - const Array1D &SlatCond, // Conductivity of the slat material [W/m.K] - const Array1D &SlatSpacing, // Distance between slats [m] - const Array1D &SlatCurve, // Curvature radius of the slat [m] - const Array1D &vvent, // Vector of velocities for forced ventilation, for each gap, and for - const Array1D &tvent, // Vector of temperatures of ventilation gas for forced ventilation, + const Array1D &Atop, // Vector with areas of top openings - between SD layers and top of + const Array1D &Abot, // Vector with areas of bottom openings - between SD layers and + const Array1D &Al, // Vector with areas of left-hand side openings - between SD layers and + const Array1D &Ar, // Vector of areas of right-hand side openings - between SD layers and + const Array1D &Ah, // Vector of total areas of holes for each SD [m2] + const Array1D &SlatThick, // Thickness of the slat material [m] + const Array1D &SlatWidth, // Slat width [m] + const Array1D &SlatAngle, // Slat tilt angle [deg] + const Array1D &SlatCond, // Conductivity of the slat material [W/m.K] + const Array1D &SlatSpacing, // Distance between slats [m] + const Array1D &SlatCurve, // Curvature radius of the slat [m] + const Array1D &vvent, // Vector of velocities for forced ventilation, for each gap, and for + const Array1D &tvent, // Vector of temperatures of ventilation gas for forced ventilation, const Array1D_int &LayerType, // Glazing layer type flag const Array1D_int &nslice, // Vector of numbers of slices in a laminated glazing layers - const Array1D &LaminateA, // Left-hand side array for creating slice equations - const Array1D &LaminateB, // Right-hand side array for creating slice equations - const Array1D &sumsol, // Array of absorbed solar energy fractions for each laminated + const Array1D &LaminateA, // Left-hand side array for creating slice equations + const Array1D &LaminateB, // Right-hand side array for creating slice equations + const Array1D &sumsol, // Array of absorbed solar energy fractions for each laminated Array1D &hg, // Gas conductance of the glazing cavity [W/m2 K] Array1D &hr, // Radiation conductance of the glazing cavity [W/m2 K] Array1D &hs, // Thermal conductance of the glazing cavity [W/m2 K] - Real64 &he, // External heat transfer coefficient [W/m2 K] - EN673 and ISO 10292 procedure - Real64 &hi, // Internal heat transfer coefficient [W/m2 K] - EN673 and ISO 10292 procedure + Real64 &he, // External heat transfer coefficient [W/m2 K] - EN673 and ISO 10292 procedure + Real64 &hi, // Internal heat transfer coefficient [W/m2 K] - EN673 and ISO 10292 procedure Array1D &Ra, // Vector of Rayleigh numbers, for each gap Array1D &Nu, // Vector of Nusselt numbers, for each gap - int standard, // Calculation standard switch: - int ThermalMod, // Thermal model: - int Debug_mode, // Switch for debug output files: - std::string const &Debug_dir, // Target directory for debug files - std::string const &Debug_file, // File name template for debug files - int win_ID, // ID of window (passed by W6) - int igu_ID, // ID of the IGU (passed by W6) - Real64 &ShadeEmisRatioOut, // Ratio of modified to glass emissivity at the outermost glazing surface - Real64 &ShadeEmisRatioIn, // Ratio of modified to glass emissivity at the innermost glazing surface - Real64 &ShadeHcRatioOut, // Ratio of modified to unshaded Hc at the outermost glazing surface - Real64 &ShadeHcRatioIn, // Ratio of modified to unshaded Hc at the innermost glazing surface - Real64 &HcUnshadedOut, // Hc value at outermost glazing surface of an unshaded subsystem [W/m2 K] - Real64 &HcUnshadedIn, // Hc value at innermost glazing surface of an unshaded subsystem [W/m2 K] + int standard, // Calculation standard switch: + int ThermalMod, // Thermal model: + int Debug_mode, // Switch for debug output files: + std::string const &Debug_dir, // Target directory for debug files + std::string const &Debug_file, // File name template for debug files + int win_ID, // ID of window (passed by W6) + int igu_ID, // ID of the IGU (passed by W6) + Real64 &ShadeEmisRatioOut, // Ratio of modified to glass emissivity at the outermost glazing surface + Real64 &ShadeEmisRatioIn, // Ratio of modified to glass emissivity at the innermost glazing surface + Real64 &ShadeHcRatioOut, // Ratio of modified to unshaded Hc at the outermost glazing surface + Real64 &ShadeHcRatioIn, // Ratio of modified to unshaded Hc at the innermost glazing surface + Real64 &HcUnshadedOut, // Hc value at outermost glazing surface of an unshaded subsystem [W/m2 K] + Real64 &HcUnshadedIn, // Hc value at innermost glazing surface of an unshaded subsystem [W/m2 K] Array1D &Keff, // Vector of keff values for gaps [W/m.K] Array1D &ShadeGapKeffConv, // Vector of convective keff values for areas above/below - Real64 SDScalar, // Factor of Venetian SD layer contribution to convection - int SHGCCalc, // SHGC calculation switch: - int &NumOfIterations, // Number of iterations for reacing solution - Real64 edgeGlCorrFac // Edge of glass correction factor + Real64 SDScalar, // Factor of Venetian SD layer contribution to convection + int SHGCCalc, // SHGC calculation switch: + int &NumOfIterations, // Number of iterations for reacing solution + Real64 edgeGlCorrFac // Edge of glass correction factor ); +} +struct TARCOGMainData : BaseGlobalStruct +{ + + Array1D sconTemp = Array1D(maxlay); + Array1D thickTemp = Array1D(maxlay); + + // Internaly used + bool converged = false; // used for convergence check in case of deflection calculations + Array1D told = Array1D(maxlay2); + Array1D CurGap = Array1D(MaxGap); + Array1D GapDefMean = Array1D(MaxGap); + void clear_state() override + { + sconTemp.clear(); + thickTemp.clear(); + converged = false; + told.clear(); + CurGap.clear(); + GapDefMean.clear(); + }; +}; } // namespace EnergyPlus #endif From cb16e3ae1f42a9130d350c13589164d6538225d0 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 03:44:25 -0600 Subject: [PATCH 15/21] specify TARCOGParams --- src/EnergyPlus/TARCOGMain.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/TARCOGMain.hh b/src/EnergyPlus/TARCOGMain.hh index db8025b0e4c..a81dacebd3e 100644 --- a/src/EnergyPlus/TARCOGMain.hh +++ b/src/EnergyPlus/TARCOGMain.hh @@ -177,14 +177,14 @@ namespace TARCOGMain { struct TARCOGMainData : BaseGlobalStruct { - Array1D sconTemp = Array1D(maxlay); - Array1D thickTemp = Array1D(maxlay); + Array1D sconTemp = Array1D(TARCOGParams::maxlay); + Array1D thickTemp = Array1D(TARCOGParams::maxlay); // Internaly used bool converged = false; // used for convergence check in case of deflection calculations - Array1D told = Array1D(maxlay2); - Array1D CurGap = Array1D(MaxGap); - Array1D GapDefMean = Array1D(MaxGap); + Array1D told = Array1D(TARCOGParams::maxlay2); + Array1D CurGap = Array1D(TARCOGParams::MaxGap); + Array1D GapDefMean = Array1D(TARCOGParams::MaxGap); void clear_state() override { From 3f115d01f9b6ee440ddccad5d919280603b4b78a Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 04:16:43 -0600 Subject: [PATCH 16/21] fix clear_state() commands --- src/EnergyPlus/OutputReportTabular.hh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 1bc584a0e62..bfc82f20e84 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -1437,15 +1437,15 @@ struct OutputReportTabularData : BaseGlobalStruct { this->m2_unitConvWVST = 0.0; this->m3_unitConv = 0.0; this->Wm2_unitConv = 0.0; - this->zstArea.clear(); - this->zstVolume.clear(); - this->zstWallArea.clear(); - this->zstUndWallArea.clear(); - this->zstWindowArea.clear(); - this->zstOpeningArea.clear(); - this->zstLight.clear(); - this->zstPeople.clear(); - this->zstPlug.clear(); + this->zstArea = Array1D(4); + this->zstVolume = Array1D(4); + this->zstWallArea = Array1D(4); + this->zstUndWallArea = Array1D(4); + this->zstWindowArea = Array1D(4); + this->zstOpeningArea = Array1D(4); + this->zstLight = Array1D(4); + this->zstPeople = Array1D(4); + this->zstPlug = Array1D(4); this->indexUnitConvWCS = 0; this->curValueSIWCS = 0.0; this->curValueWCS = 0.0; From 11de4f9aa3c09338f5503f1436902cb923c60132 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 04:54:55 -0600 Subject: [PATCH 17/21] Typo Wm2_unitConv --- src/EnergyPlus/OutputReportTabular.cc | 12 ++++++------ src/EnergyPlus/OutputReportTabular.hh | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 27dfaf4d31b..f86e7ec8df7 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -10555,7 +10555,7 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptTab->m3_unitConv = ConvertIP(state, state.dataOutRptTab->unitConvIndexWVST, 1.0); SIunit = "[W/m2]"; LookupSItoIP(state, SIunit, state.dataOutRptTab->unitConvIndexWVST, Wm2_unitName); - state.dataOutRptTab->m3_unitConv = ConvertIP(state, state.dataOutRptTab->unitConvIndexWVST, 1.0); + state.dataOutRptTab->Wm2_unitConv = ConvertIP(state, state.dataOutRptTab->unitConvIndexWVST, 1.0); } else { m_unitName = "[m]"; state.dataOutRptTab->m_unitConv = 1.0; @@ -10564,7 +10564,7 @@ namespace EnergyPlus::OutputReportTabular { m3_unitName = "[m3]"; state.dataOutRptTab->m3_unitConv = 1.0; Wm2_unitName = "[W/m2]"; - state.dataOutRptTab->m3_unitConv = 1.0; + state.dataOutRptTab->Wm2_unitConv = 1.0; } //---- General Sub-Table @@ -11158,7 +11158,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (Zone(iZone).FloorArea > 0) { - tableBody(10, iZone) = RealToStr(state.dataOutRptTab->m3_unitConv * totLightPower / Zone(iZone).FloorArea, 4); + tableBody(10, iZone) = RealToStr(state.dataOutRptTab->Wm2_unitConv * totLightPower / Zone(iZone).FloorArea, 4); } // people density totNumPeople = 0.0; @@ -11193,7 +11193,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (Zone(iZone).FloorArea > 0) { - tableBody(12, iZone) = RealToStr(totPlugProcess * state.dataOutRptTab->m3_unitConv / Zone(iZone).FloorArea, 4); + tableBody(12, iZone) = RealToStr(totPlugProcess * state.dataOutRptTab->Wm2_unitConv / Zone(iZone).FloorArea, 4); } // total rows for Total / Not Part of Total @@ -11254,8 +11254,8 @@ namespace EnergyPlus::OutputReportTabular { tableBody(8, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstWindowArea(iTotal) * state.dataOutRptTab->m2_unitConvWVST, 2); tableBody(9, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstOpeningArea(iTotal) * state.dataOutRptTab->m2_unitConvWVST, 2); if (state.dataOutRptTab->zstArea(iTotal) != 0) { - tableBody(10, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstLight(iTotal) * state.dataOutRptTab->m3_unitConv / state.dataOutRptTab->zstArea(iTotal), 4); - tableBody(12, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstPlug(iTotal) * state.dataOutRptTab->m3_unitConv / state.dataOutRptTab->zstArea(iTotal), 4); + tableBody(10, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstLight(iTotal) * state.dataOutRptTab->Wm2_unitConv / state.dataOutRptTab->zstArea(iTotal), 4); + tableBody(12, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstPlug(iTotal) * state.dataOutRptTab->Wm2_unitConv / state.dataOutRptTab->zstArea(iTotal), 4); } if (state.dataOutRptTab->zstPeople(iTotal) != 0) { tableBody(11, state.dataGlobal->NumOfZones + iTotal) = RealToStr(state.dataOutRptTab->zstArea(iTotal) * state.dataOutRptTab->m2_unitConvWVST / state.dataOutRptTab->zstPeople(iTotal), 2); diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index bfc82f20e84..68706f5e0af 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -1460,7 +1460,7 @@ struct OutputReportTabularData : BaseGlobalStruct { this->TimeStepInDayGCLS = 0; this->iZoneGCLH = 0; this->TimeStepInDayGCLH = 0; - this->IntGainTypesTubularGCLS.clear(); + this->IntGainTypesTubularGCLS = Array1D_int(1, {DataHeatBalance::IntGainTypeOf_DaylightingDeviceTubular}); this->adjFenDone.clear(); this->BigNumRMG = 0.0; this->foundGsui = 0; From 36fef63d9fd10f6a523e82424187ac7d807c3f34 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 10:24:21 -0600 Subject: [PATCH 18/21] clear_state() fix --- src/EnergyPlus/ThermalISO15099Calc.hh | 168 +++++++++++++------------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/src/EnergyPlus/ThermalISO15099Calc.hh b/src/EnergyPlus/ThermalISO15099Calc.hh index 0903224f853..dd1232d7e0c 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.hh +++ b/src/EnergyPlus/ThermalISO15099Calc.hh @@ -546,90 +546,90 @@ namespace ThermalISO15099Calc { void clear_state() override { - this->thetas.clear(); - this->rir.clear(); - this->hcgass.clear(); - this->hrgass.clear(); - this->rs.clear(); - this->qs.clear(); - this->qvs.clear(); - this->LaminateAU.clear(); - this->sumsolU.clear(); - this->sol0.clear(); - this->qcgas.clear(); - this->qcgaps.clear(); - this->qrgas.clear(); - this->qrgaps.clear(); - this->Atop_NOSD.clear(); - this->Abot_NOSD.clear(); - this->Al_NOSD.clear(); - this->Ar_NOSD.clear(); - this->Ah_NOSD.clear(); - this->EffectiveOpenness_NOSD.clear(); - this->SlatThick_NOSD.clear(); - this->SlatWidth_NOSD.clear(); - this->SlatAngle_NOSD.clear(); - this->SlatCond_NOSD.clear(); - this->SlatSpacing_NOSD.clear(); - this->SlatCurve_NOSD.clear(); - this->vvent_NOSD.clear(); - this->tvent_NOSD.clear(); - this->qv_NOSD.clear(); - this->q_NOSD.clear(); - this->LayerType_NOSD.clear(); - this->gap_NOSD.clear(); - this->thick_NOSD.clear(); - this->scon_NOSD.clear(); - this->emis_NOSD.clear(); - this->rir_NOSD.clear(); - this->tir_NOSD.clear(); - this->theta_NOSD.clear(); - this->frct_NOSD.clear(); - this->iprop_NOSD.clear(); - this->nmix_NOSD.clear(); - this->presure_NOSD.clear(); - this->hcgas_NOSD.clear(); - this->hrgas_NOSD.clear(); - this->LaminateA_NOSD.clear(); - this->LaminateB_NOSD.clear(); - this->sumsol_NOSD.clear(); - this->Ra_NOSD.clear(); - this->Nu_NOSD.clear(); - this->Ebb.clear(); - this->Ebf.clear(); - this->Rb.clear(); - this->Rf.clear(); - this->Ebbs.clear(); - this->Ebfs.clear(); - this->Rbs.clear(); - this->Rfs.clear(); - this->Ebb_NOSD.clear(); - this->Ebf_NOSD.clear(); - this->Rb_NOSD.clear(); - this->Rf_NOSD.clear(); - this->ShadeGapKeffConv_NOSD.clear(); - this->qcgas_NOSD.clear(); - this->Keff_NOSD.clear(); - this->qrgas_NOSD.clear(); - this->nslice_NOSD.clear(); - this->vfreevent_NOSD.clear(); - this->vfreevent.clear(); - this->Atop_eff.clear(); - this->Abot_eff.clear(); - this->Al_eff.clear(); - this->Ar_eff.clear(); - this->Ah_eff.clear(); - this->EffectiveOpenness.clear(); - this->hgas.clear(); - this->Tgap.clear(); - this->hcgapMod.clear(); - this->hcv.clear(); - this->iprop1.clear(); - this->frct1.clear(); - this->frcti.clear(); - this->ipropi.clear(); - this->frctg.clear(); - this->ipropg.clear(); + this->thetas = Array1D(maxlay2); + this->rir = Array1D(maxlay2); + this->hcgass = Array1D(maxlay1); + this->hrgass = Array1D(maxlay1); + this->rs = Array1D(maxlay3, 0.0); + this->qs = Array1D(maxlay3); + this->qvs = Array1D(maxlay1); + this->LaminateAU = Array1D(maxlay); + this->sumsolU = Array1D(maxlay); + this->sol0 = Array1D(maxlay); + this->qcgas = Array1D(maxlay1); + this->qcgaps = Array1D(maxlay1); + this->qrgas = Array1D(maxlay1); + this->qrgaps = Array1D(maxlay1); + this->Atop_NOSD = Array1D(maxlay); + this->Abot_NOSD = Array1D(maxlay); + this->Al_NOSD = Array1D(maxlay); + this->Ar_NOSD = Array1D(maxlay); + this->Ah_NOSD = Array1D(maxlay); + this->EffectiveOpenness_NOSD = Array1D(maxlay); + this->SlatThick_NOSD = Array1D(maxlay); + this->SlatWidth_NOSD = Array1D(maxlay); + this->SlatAngle_NOSD = Array1D(maxlay); + this->SlatCond_NOSD = Array1D(maxlay); + this->SlatSpacing_NOSD = Array1D(maxlay); + this->SlatCurve_NOSD = Array1D(maxlay); + this->vvent_NOSD = Array1D(maxlay1); + this->tvent_NOSD = Array1D(maxlay1); + this->qv_NOSD = Array1D(maxlay1); + this->q_NOSD = Array1D(maxlay3); + this->LayerType_NOSD = Array1D_int(maxlay); + this->gap_NOSD = Array1D(maxlay); + this->thick_NOSD = Array1D(maxlay); + this->scon_NOSD = Array1D(maxlay); + this->emis_NOSD = Array1D(maxlay2); + this->rir_NOSD = Array1D(maxlay2); + this->tir_NOSD = Array1D(maxlay2); + this->theta_NOSD = Array1D(maxlay2); + this->frct_NOSD = Array2D(maxgas, maxlay1); + this->iprop_NOSD = Array2D_int(maxgas, maxlay1); + this->nmix_NOSD = Array1D_int(maxlay1); + this->presure_NOSD = Array1D(maxlay1); + this->hcgas_NOSD = Array1D(maxlay1); + this->hrgas_NOSD = Array1D(maxlay1); + this->LaminateA_NOSD = Array1D(maxlay); + this->LaminateB_NOSD = Array1D(maxlay); + this->sumsol_NOSD = Array1D(maxlay); + this->Ra_NOSD = Array1D(maxlay); + this->Nu_NOSD = Array1D(maxlay); + this->Ebb = Array1D(maxlay); + this->Ebf = Array1D(maxlay); + this->Rb = Array1D(maxlay); + this->Rf = Array1D(maxlay); + this->Ebbs = Array1D(maxlay); + this->Ebfs = Array1D(maxlay); + this->Rbs = Array1D(maxlay); + this->Rfs = Array1D(maxlay); + this->Ebb_NOSD = Array1D(maxlay); + this->Ebf_NOSD = Array1D(maxlay); + this->Rb_NOSD = Array1D(maxlay); + this->Rf_NOSD = Array1D(maxlay); + this->ShadeGapKeffConv_NOSD = Array1D(MaxGap); + this->qcgas_NOSD = Array1D(maxlay1); + this->Keff_NOSD = Array1D(maxlay1); + this->qrgas_NOSD = Array1D(maxlay1); + this->nslice_NOSD = Array1D_int(maxlay); + this->vfreevent_NOSD = Array1D(maxlay1); + this->vfreevent = Array1D(maxlay1); + this->Atop_eff = Array1D(maxlay, 0.0); + this->Abot_eff = Array1D(maxlay, 0.0); + this->Al_eff = Array1D(maxlay, 0.0); + this->Ar_eff = Array1D(maxlay, 0.0); + this->Ah_eff = Array1D(maxlay, 0.0); + this->EffectiveOpenness = Array1D(maxlay, 0.0); + this->hgas = Array1D(maxlay1); + this->Tgap = Array1D(maxlay1); + this->hcgapMod = Array1D(maxlay1); + this->hcv = Array1D(maxlay1); + this->iprop1 = Array1D_int(maxgas); + this->frct1 = Array1D(maxgas); + this->frcti = Array1D(maxgas); + this->ipropi = Array1D_int(maxgas); + this->frctg = Array1D(maxgas); + this->ipropg = Array1D_int(maxgas); this->rtot = 0.0; this->sft = 0.0; From 2dd1bc1527568898ae98106110d82be08be1b4e9 Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 10:30:08 -0600 Subject: [PATCH 19/21] clear_state() TARCOGGASEES fix --- src/EnergyPlus/TARCOGGasses90.hh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/EnergyPlus/TARCOGGasses90.hh b/src/EnergyPlus/TARCOGGasses90.hh index 282ad4cb41f..b45b368117c 100644 --- a/src/EnergyPlus/TARCOGGasses90.hh +++ b/src/EnergyPlus/TARCOGGasses90.hh @@ -99,15 +99,15 @@ struct TARCOGGasses90Data : BaseGlobalStruct { void clear_state() override { - fvis.clear(); - fcon.clear(); - fdens.clear(); - fcp.clear(); - kprime.clear(); - kdblprm.clear(); - mukpdwn.clear(); - kpdown.clear(); - kdpdown.clear(); + fvis = Array1D(TARCOGGassesParams::maxgas); + fcon = Array1D(TARCOGGassesParams::maxgas); + fdens = Array1D(TARCOGGassesParams::maxgas); + fcp = Array1D(TARCOGGassesParams::maxgas); + kprime = Array1D(TARCOGGassesParams::maxgas); + kdblprm = Array1D(TARCOGGassesParams::maxgas); + mukpdwn = Array1D(TARCOGGassesParams::maxgas); + kpdown = Array1D(TARCOGGassesParams::maxgas); + kdpdown = Array1D(TARCOGGassesParams::maxgas); } }; From 3d39713cf8bf7902dc63a8bd3cdc47a1d09c58eb Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 10:32:49 -0600 Subject: [PATCH 20/21] clear_state() TARCOGMain fix --- src/EnergyPlus/TARCOGMain.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/TARCOGMain.hh b/src/EnergyPlus/TARCOGMain.hh index a81dacebd3e..33ba1965593 100644 --- a/src/EnergyPlus/TARCOGMain.hh +++ b/src/EnergyPlus/TARCOGMain.hh @@ -188,12 +188,12 @@ struct TARCOGMainData : BaseGlobalStruct void clear_state() override { - sconTemp.clear(); - thickTemp.clear(); + sconTemp = Array1D(TARCOGParams::maxlay); + thickTemp = Array1D(TARCOGParams::maxlay); converged = false; - told.clear(); - CurGap.clear(); - GapDefMean.clear(); + told = Array1D(TARCOGParams::maxlay2); + CurGap = Array1D(TARCOGParams::MaxGap); + GapDefMean = Array1D(TARCOGParams::MaxGap); }; }; } // namespace EnergyPlus From 0914c4bd6f00458bdd8079c86a97ca1e14ba25ea Mon Sep 17 00:00:00 2001 From: Jermy Thomas Date: Thu, 25 Mar 2021 10:35:35 -0600 Subject: [PATCH 21/21] clear_state() TARCOGShading fix --- src/EnergyPlus/TarcogShading.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/TarcogShading.hh b/src/EnergyPlus/TarcogShading.hh index ad55552409d..5a78baefeea 100644 --- a/src/EnergyPlus/TarcogShading.hh +++ b/src/EnergyPlus/TarcogShading.hh @@ -221,10 +221,10 @@ struct TarcogShadingData : BaseGlobalStruct { void clear_state() override { - frct1.clear(); - frct2.clear(); - iprop1.clear(); - iprop2.clear(); + frct1 = Array1D(TARCOGGassesParams::maxgas); + frct2 = Array1D(TARCOGGassesParams::maxgas); + iprop1 = Array1D_int(TARCOGGassesParams::maxgas); + iprop2 = Array1D_int(TARCOGGassesParams::maxgas); } };