diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 006f686b5f7..23c787a476b 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -61,7 +61,6 @@ #include // EnergyPlus Headers -#include #include #include #include diff --git a/src/EnergyPlus/Data/CommonIncludes.hh b/src/EnergyPlus/Data/CommonIncludes.hh index bac26862ce6..09fa9992c1c 100644 --- a/src/EnergyPlus/Data/CommonIncludes.hh +++ b/src/EnergyPlus/Data/CommonIncludes.hh @@ -82,6 +82,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index b7dfadfd416..f6c87bd49fc 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -84,6 +84,8 @@ namespace EnergyPlus { this->dataGlobal = std::unique_ptr(new DataGlobal); this->dataPipes = std::unique_ptr(new PipesData); this->dataPlantChillers = std::unique_ptr(new PlantChillersData); + this->dataVariableSpeedCoils = std::unique_ptr(new VariableSpeedCoilsData); + this->dataVentilatedSlab = std::unique_ptr(new VentilatedSlabData); this->dataWaterCoils = std::unique_ptr(new WaterCoilsData); this->dataWaterManager = std::unique_ptr(new WaterManagerData); this->dataWaterThermalTanks = std::unique_ptr(new WaterThermalTanksData); @@ -133,6 +135,8 @@ namespace EnergyPlus { this->dataGlobal->clear_state(); this->dataPipes->clear_state(); this->dataPlantChillers->clear_state(); + this->dataVariableSpeedCoils->clear_state(); + this->dataVentilatedSlab->clear_state(); this->dataWaterCoils->clear_state(); this->dataWaterManager->clear_state(); this->dataWaterThermalTanks->clear_state(); diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index 8f736340e27..4ad3118d812 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -93,6 +93,8 @@ struct ExteriorEnergyUseData; struct FansData; struct PipesData; struct PlantChillersData; +struct VariableSpeedCoilsData; +struct VentilatedSlabData; struct WaterCoilsData; struct WaterManagerData; struct WaterThermalTanksData; @@ -145,6 +147,8 @@ struct EnergyPlusData : BaseGlobalStruct { std::unique_ptr dataFans; std::unique_ptr dataPipes; std::unique_ptr dataPlantChillers; + std::unique_ptr dataVariableSpeedCoils; + std::unique_ptr dataVentilatedSlab; std::unique_ptr dataWaterCoils; std::unique_ptr dataWaterManager; std::unique_ptr dataWaterThermalTanks; diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index ae62b17039c..b095b11d651 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -183,7 +183,6 @@ namespace Furnaces { using namespace ScheduleManager; using DXCoils::SimDXCoil; using Fans::SimulateFanComponents; - using VariableSpeedCoils::MaxSpedLevels; // Data // MODULE PARAMETER DEFINITIONS @@ -6067,7 +6066,6 @@ namespace Furnaces { using IntegratedHeatPump::IntegratedHeatPumps; using IntegratedHeatPump::SizeIHP; using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; using WaterToAirHeatPumpSimple::SimWatertoAirHPSimple; // Locals @@ -6135,9 +6133,9 @@ namespace Furnaces { if (Furnace(FurnaceNum).bIsIHP) { SizeIHP(state, Furnace(FurnaceNum).CoolingCoilIndex); IHPCoilIndex = IntegratedHeatPumps(Furnace(FurnaceNum).CoolingCoilIndex).SCCoilIndex; - Furnace(FurnaceNum).NumOfSpeedCooling = VarSpeedCoil(IHPCoilIndex).NumOfSpeeds; - MulSpeedFlowScale = VarSpeedCoil(IHPCoilIndex).RatedAirVolFlowRate / - VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(VarSpeedCoil(IHPCoilIndex).NormSpedLevel); + Furnace(FurnaceNum).NumOfSpeedCooling = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).NumOfSpeeds; + MulSpeedFlowScale = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).RatedAirVolFlowRate / + state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).NormSpedLevel); IntegratedHeatPumps(Furnace(FurnaceNum).CoolingCoilIndex).CoolVolFlowScale = MulSpeedFlowScale; } else { SimVariableSpeedCoils(state, @@ -6154,19 +6152,19 @@ namespace Furnaces { 0.0, 0.0, 0.0); // conduct the sizing operation in the VS WSHP - Furnace(FurnaceNum).NumOfSpeedCooling = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).NumOfSpeeds; - MulSpeedFlowScale = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).RatedAirVolFlowRate / - VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex) - .MSRatedAirVolFlowRate(VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).NormSpedLevel); + Furnace(FurnaceNum).NumOfSpeedCooling = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).NumOfSpeeds; + MulSpeedFlowScale = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).RatedAirVolFlowRate / + state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex) + .MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).NormSpedLevel); IHPCoilIndex = Furnace(FurnaceNum).CoolingCoilIndex; } for (Iter = 1; Iter <= Furnace(FurnaceNum).NumOfSpeedCooling; ++Iter) { - Furnace(FurnaceNum).CoolVolumeFlowRate(Iter) = VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale; - Furnace(FurnaceNum).CoolMassFlowRate(Iter) = VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(Iter) * MulSpeedFlowScale; + Furnace(FurnaceNum).CoolVolumeFlowRate(Iter) = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale; + Furnace(FurnaceNum).CoolMassFlowRate(Iter) = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(Iter) * MulSpeedFlowScale; Furnace(FurnaceNum).MSCoolingSpeedRatio(Iter) = - VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) / - VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Furnace(FurnaceNum).NumOfSpeedCooling); + state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) / + state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Furnace(FurnaceNum).NumOfSpeedCooling); } if (Furnace(FurnaceNum).HeatingCoilType_Num == Coil_HeatingWaterToAirHPVSEquationFit || @@ -6175,9 +6173,9 @@ namespace Furnaces { if (Furnace(FurnaceNum).bIsIHP) { SizeIHP(state, Furnace(FurnaceNum).CoolingCoilIndex); IHPCoilIndex = IntegratedHeatPumps(Furnace(FurnaceNum).CoolingCoilIndex).SHCoilIndex; - Furnace(FurnaceNum).NumOfSpeedHeating = VarSpeedCoil(IHPCoilIndex).NumOfSpeeds; - MulSpeedFlowScale = VarSpeedCoil(IHPCoilIndex).RatedAirVolFlowRate / - VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(VarSpeedCoil(IHPCoilIndex).NormSpedLevel); + Furnace(FurnaceNum).NumOfSpeedHeating = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).NumOfSpeeds; + MulSpeedFlowScale = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).RatedAirVolFlowRate / + state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).NormSpedLevel); IntegratedHeatPumps(Furnace(FurnaceNum).CoolingCoilIndex).HeatVolFlowScale = MulSpeedFlowScale; } else { SimVariableSpeedCoils(state, @@ -6194,19 +6192,19 @@ namespace Furnaces { 0.0, 0.0, 0.0); // conduct the sizing operation in the VS WSHP - Furnace(FurnaceNum).NumOfSpeedHeating = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).NumOfSpeeds; - MulSpeedFlowScale = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).RatedAirVolFlowRate / - VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex) - .MSRatedAirVolFlowRate(VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).NormSpedLevel); + Furnace(FurnaceNum).NumOfSpeedHeating = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).NumOfSpeeds; + MulSpeedFlowScale = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).RatedAirVolFlowRate / + state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex) + .MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).NormSpedLevel); IHPCoilIndex = Furnace(FurnaceNum).HeatingCoilIndex; } for (Iter = 1; Iter <= Furnace(FurnaceNum).NumOfSpeedHeating; ++Iter) { - Furnace(FurnaceNum).HeatVolumeFlowRate(Iter) = VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale; - Furnace(FurnaceNum).HeatMassFlowRate(Iter) = VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(Iter) * MulSpeedFlowScale; + Furnace(FurnaceNum).HeatVolumeFlowRate(Iter) = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale; + Furnace(FurnaceNum).HeatMassFlowRate(Iter) = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(Iter) * MulSpeedFlowScale; Furnace(FurnaceNum).MSHeatingSpeedRatio(Iter) = - VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) / - VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Furnace(FurnaceNum).NumOfSpeedHeating); + state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) / + state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Furnace(FurnaceNum).NumOfSpeedHeating); } } @@ -10690,7 +10688,6 @@ namespace Furnaces { using Fans::SimulateFanComponents; using IntegratedHeatPump::SimIHP; using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -10793,7 +10790,7 @@ namespace Furnaces { SavePartloadRatio = PartLoadFrac; SaveSpeedRatio = SpeedRatio; - SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio; + SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio; } else { if (Furnace(FurnaceNum).bIsIHP) { SimIHP(state, @@ -10869,7 +10866,7 @@ namespace Furnaces { SavePartloadRatio = PartLoadFrac; SaveSpeedRatio = SpeedRatio; - SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio; + SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio; } else { if (Furnace(FurnaceNum).bIsIHP) { SimIHP(state, @@ -10960,7 +10957,7 @@ namespace Furnaces { SavePartloadRatio = PartLoadFrac; SaveSpeedRatio = SpeedRatio; - SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio; + SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio; } else { if (Furnace(FurnaceNum).bIsIHP) { @@ -11036,7 +11033,7 @@ namespace Furnaces { SavePartloadRatio = PartLoadFrac; SaveSpeedRatio = SpeedRatio; - SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio; + SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio; } else { if (Furnace(FurnaceNum).bIsIHP) { SimIHP(state, @@ -11133,7 +11130,7 @@ namespace Furnaces { SavePartloadRatio = PartLoadFrac; SaveSpeedRatio = SpeedRatio; - SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio; + SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio; } else { if (Furnace(FurnaceNum).bIsIHP) { SimIHP(state, @@ -11209,7 +11206,7 @@ namespace Furnaces { SavePartloadRatio = PartLoadFrac; SaveSpeedRatio = SpeedRatio; - SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio; + SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio; } else { if (Furnace(FurnaceNum).bIsIHP) { SimIHP(state, diff --git a/src/EnergyPlus/Furnaces.hh b/src/EnergyPlus/Furnaces.hh index 624c7b0e032..ed00db83c8a 100644 --- a/src/EnergyPlus/Furnaces.hh +++ b/src/EnergyPlus/Furnaces.hh @@ -65,7 +65,6 @@ struct EnergyPlusData; namespace Furnaces { // Using/Aliasing - using VariableSpeedCoils::MaxSpedLevels; // Data // MODULE PARAMETER DEFINITIONS @@ -131,7 +130,8 @@ namespace Furnaces { // Types struct FurnaceEquipConditions - { + { + int MaxSpedLevels = 10; // Members std::string Name; // Name of the Furnace int FurnaceType_Num; // Numeric Equivalent for Furnace Type diff --git a/src/EnergyPlus/HVACDXHeatPumpSystem.cc b/src/EnergyPlus/HVACDXHeatPumpSystem.cc index 4a935e9d170..d6e19dd17bc 100644 --- a/src/EnergyPlus/HVACDXHeatPumpSystem.cc +++ b/src/EnergyPlus/HVACDXHeatPumpSystem.cc @@ -600,7 +600,6 @@ namespace HVACDXHeatPumpSystem { using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyTdpFnWPb; using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; // SUBROUTINE PARAMETER DEFINITIONS: int const MaxIte(500); // Maximum number of iterations for solver @@ -815,7 +814,7 @@ namespace HVACDXHeatPumpSystem { OnOffAirFlowRatio); VSCoilIndex = DXHeatPumpSystem(DXSystemNum).HeatPumpCoilIndex; - NumOfSpeeds = VarSpeedCoil(VSCoilIndex).NumOfSpeeds; + NumOfSpeeds = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).NumOfSpeeds; NoOutput = Node(InletNode).MassFlowRate * (PsyHFnTdbW(Node(OutletNode).Temp, Node(OutletNode).HumRat) - PsyHFnTdbW(Node(InletNode).Temp, Node(OutletNode).HumRat)); @@ -861,7 +860,7 @@ namespace HVACDXHeatPumpSystem { // OutletTempDXCoil is the full capacity outlet temperature at PartLoadFrac = 1 from the CALL above. If this // temp is greater than the desired outlet temp, then run the compressor at PartLoadFrac = 1, otherwise find the // operating PLR. - OutletTempDXCoil = VarSpeedCoil(VSCoilIndex).OutletAirDBTemp; + OutletTempDXCoil = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).OutletAirDBTemp; if (OutletTempDXCoil < DesOutTemp) { PartLoadFrac = 1.0; SpeedNum = NumOfSpeeds; @@ -885,7 +884,7 @@ namespace HVACDXHeatPumpSystem { QLatReq, OnOffAirFlowRatio); - TempSpeedOut = VarSpeedCoil(VSCoilIndex).OutletAirDBTemp; + TempSpeedOut = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).OutletAirDBTemp; if ((TempSpeedOut - DesOutTemp) < Acc) { // Check to see which speed to meet the load @@ -908,7 +907,7 @@ namespace HVACDXHeatPumpSystem { QLatReq, OnOffAirFlowRatio); - TempSpeedOut = VarSpeedCoil(VSCoilIndex).OutletAirDBTemp; + TempSpeedOut = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).OutletAirDBTemp; if ((TempSpeedOut - DesOutTemp) > Acc) { SpeedNum = I; @@ -1156,7 +1155,6 @@ namespace HVACDXHeatPumpSystem { // na // Using/Aliasing using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; // Return value Real64 Residuum; // residual to be minimized to zero @@ -1207,7 +1205,7 @@ namespace HVACDXHeatPumpSystem { QLatReq, OnOffAirFlowRatio); - OutletAirTemp = VarSpeedCoil(CoilIndex).OutletAirDBTemp; + OutletAirTemp = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).OutletAirDBTemp; Residuum = Par(2) - OutletAirTemp; return Residuum; @@ -1235,7 +1233,6 @@ namespace HVACDXHeatPumpSystem { // na // Using/Aliasing using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; // Return value Real64 Residuum; // residual to be minimized to zero @@ -1287,7 +1284,7 @@ namespace HVACDXHeatPumpSystem { QLatReq, OnOffAirFlowRatio); - OutletAirTemp = VarSpeedCoil(CoilIndex).OutletAirDBTemp; + OutletAirTemp = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).OutletAirDBTemp; Residuum = Par(2) - OutletAirTemp; return Residuum; diff --git a/src/EnergyPlus/HVACDXSystem.cc b/src/EnergyPlus/HVACDXSystem.cc index cca055ce5c9..d33b67cad24 100644 --- a/src/EnergyPlus/HVACDXSystem.cc +++ b/src/EnergyPlus/HVACDXSystem.cc @@ -1042,7 +1042,6 @@ namespace HVACDXSystem { using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyTdpFnWPb; using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; // SUBROUTINE PARAMETER DEFINITIONS: int const MaxIte(500); // Maximum number of iterations for solver @@ -2236,13 +2235,13 @@ namespace HVACDXSystem { OnOffAirFlowRatio); VSCoilIndex = DXCoolingSystem(DXSystemNum).CoolingCoilIndex; - NumOfSpeeds = VarSpeedCoil(VSCoilIndex).NumOfSpeeds; + NumOfSpeeds = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).NumOfSpeeds; NoOutput = Node(InletNode).MassFlowRate * (PsyHFnTdbW(Node(OutletNode).Temp, Node(OutletNode).HumRat) - PsyHFnTdbW(Node(InletNode).Temp, Node(OutletNode).HumRat)); ReqOutput = Node(InletNode).MassFlowRate * (PsyHFnTdbW(DesOutTemp, Node(OutletNode).HumRat) - PsyHFnTdbW(Node(InletNode).Temp, Node(OutletNode).HumRat)); - NoLoadHumRatOut = VarSpeedCoil(VSCoilIndex).OutletAirHumRat; + NoLoadHumRatOut = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).OutletAirHumRat; // IF NoOutput is lower than (more cooling than required) or very near the ReqOutput, do not run the compressor if ((NoOutput - ReqOutput) < Acc) { @@ -2461,7 +2460,7 @@ namespace HVACDXSystem { if (PartLoadFrac == 0.0) { OutletHumRatDXCoil = NoLoadHumRatOut; } else { - OutletHumRatDXCoil = VarSpeedCoil(DXCoolingSystem(DXSystemNum).CoolingCoilIndex).OutletAirHumRat; + OutletHumRatDXCoil = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoolingSystem(DXSystemNum).CoolingCoilIndex).OutletAirHumRat; } // If humidity setpoint is not satisfied and humidity control type is CoolReheat, @@ -2491,7 +2490,7 @@ namespace HVACDXSystem { QLatReq, OnOffAirFlowRatio); - TempSpeedOut = VarSpeedCoil(VSCoilIndex).OutletAirHumRat; + TempSpeedOut = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).OutletAirHumRat; if (NumOfSpeeds > 1 && (TempSpeedOut - DesOutHumRat) > HumRatAcc) { // Check to see which speed to meet the load @@ -2513,7 +2512,7 @@ namespace HVACDXSystem { QLatReq, OnOffAirFlowRatio); - TempSpeedOut = VarSpeedCoil(VSCoilIndex).OutletAirHumRat; + TempSpeedOut = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).OutletAirHumRat; // break here if coil outlet humrat is below DesOutHumRat, then only call SolveRoot below if delta humrat is > // HumRatAcc, otherwise just use this answer (i.e., SpeedNum = x and SpeedRatio = 1.0) if ((DesOutHumRat - TempSpeedOut) > -HumRatAcc) { @@ -3570,7 +3569,6 @@ namespace HVACDXSystem { // na // Using/Aliasing using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; // Return value Real64 Residuum; // residual to be minimized to zero @@ -3612,7 +3610,7 @@ namespace HVACDXSystem { QLatReq, OnOffAirFlowRatio); - OutletAirTemp = VarSpeedCoil(CoilIndex).OutletAirDBTemp; + OutletAirTemp = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).OutletAirDBTemp; Residuum = Par(2) - OutletAirTemp; return Residuum; @@ -3639,7 +3637,6 @@ namespace HVACDXSystem { // na // Using/Aliasing using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; // Return value Real64 Residuum; // residual to be minimized to zero @@ -3691,7 +3688,7 @@ namespace HVACDXSystem { QLatReq, OnOffAirFlowRatio); - OutletAirTemp = VarSpeedCoil(CoilIndex).OutletAirDBTemp; + OutletAirTemp = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).OutletAirDBTemp; Residuum = Par(2) - OutletAirTemp; return Residuum; @@ -3716,7 +3713,6 @@ namespace HVACDXSystem { // na // Using/Aliasing using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; // Return value Real64 Residuum; // residual to be minimized to zero @@ -3767,7 +3763,7 @@ namespace HVACDXSystem { QLatReq, OnOffAirFlowRatio); - OutletAirHumRat = VarSpeedCoil(CoilIndex).OutletAirHumRat; + OutletAirHumRat = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).OutletAirHumRat; Residuum = Par(2) - OutletAirHumRat; return Residuum; @@ -3795,7 +3791,6 @@ namespace HVACDXSystem { // na // Using/Aliasing using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; // Return value Real64 Residuum; // residual to be minimized to zero @@ -3847,7 +3842,7 @@ namespace HVACDXSystem { QLatReq, OnOffAirFlowRatio); - OutletAirHumRat = VarSpeedCoil(CoilIndex).OutletAirHumRat; + OutletAirHumRat = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).OutletAirHumRat; Residuum = Par(2) - OutletAirHumRat; return Residuum; diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index 9e928b52ac0..1f0e286106d 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -2502,7 +2502,7 @@ namespace HVACUnitaryBypassVAV { // OutletTempDXCoil is the full capacity outlet temperature at PartLoadFrac = 1 from the CALL above. If this // temp is greater than the desired outlet temp, then run the compressor at PartLoadFrac = 1, otherwise find the // operating PLR. - Real64 OutletTempDXCoil = VariableSpeedCoils::VarSpeedCoil(CBVAV(CBVAVNum).CoolCoilCompIndex).OutletAirDBTemp; + Real64 OutletTempDXCoil = state.dataVariableSpeedCoils->VarSpeedCoil(CBVAV(CBVAVNum).CoolCoilCompIndex).OutletAirDBTemp; if (OutletTempDXCoil > DesOutTemp) { PartLoadFrac = 1.0; SpeedNum = maxNumSpeeds; @@ -2684,7 +2684,7 @@ namespace HVACUnitaryBypassVAV { } else if (PartLoadFrac < 0.0) { PartLoadFrac = 0.0; } - SaveCompressorPLR = VariableSpeedCoils::getVarSpeedPartLoadRatio(CBVAV(CBVAVNum).CoolCoilCompIndex); + SaveCompressorPLR = VariableSpeedCoils::getVarSpeedPartLoadRatio(state, CBVAV(CBVAVNum).CoolCoilCompIndex); // variable-speed air-to-air cooling coil, end ------------------------- } else if (SELECT_CASE_var == DataHVACGlobals::CoilDX_CoolingTwoStageWHumControl) { @@ -2990,7 +2990,7 @@ namespace HVACUnitaryBypassVAV { SpeedRatio, QZnReq, QLatReq); - SaveCompressorPLR = VariableSpeedCoils::getVarSpeedPartLoadRatio(CBVAV(CBVAVNum).CoolCoilCompIndex); + SaveCompressorPLR = VariableSpeedCoils::getVarSpeedPartLoadRatio(state, CBVAV(CBVAVNum).CoolCoilCompIndex); } } @@ -3217,7 +3217,7 @@ namespace HVACUnitaryBypassVAV { } else { // Else find how the coil is modulating (speed level and speed ratio or part load between off and speed 1) to meet the load // OutletTempDXCoil is the full capacity outlet temperature at PartLoadFrac = 1 from the CALL above. If this temp is // greater than the desired outlet temp, then run the compressor at PartLoadFrac = 1, otherwise find the operating PLR. - Real64 OutletTempDXCoil = VariableSpeedCoils::VarSpeedCoil(CBVAV(CBVAVNum).DXHeatCoilIndexNum).OutletAirDBTemp; + Real64 OutletTempDXCoil = state.dataVariableSpeedCoils->VarSpeedCoil(CBVAV(CBVAVNum).DXHeatCoilIndexNum).OutletAirDBTemp; if (OutletTempDXCoil < DesOutTemp) { PartLoadFrac = 1.0; SpeedNum = maxNumSpeeds; @@ -3420,7 +3420,7 @@ namespace HVACUnitaryBypassVAV { } else if (PartLoadFrac < 0.0) { PartLoadFrac = 0.0; } - SaveCompressorPLR = VariableSpeedCoils::getVarSpeedPartLoadRatio(CBVAV(CBVAVNum).DXHeatCoilIndexNum); + SaveCompressorPLR = VariableSpeedCoils::getVarSpeedPartLoadRatio(state, CBVAV(CBVAVNum).DXHeatCoilIndexNum); } else if ((SELECT_CASE_var == DataHVACGlobals::Coil_HeatingGasOrOtherFuel) || (SELECT_CASE_var == DataHVACGlobals::Coil_HeatingElectric) || (SELECT_CASE_var == DataHVACGlobals::Coil_HeatingWater) || (SELECT_CASE_var == DataHVACGlobals::Coil_HeatingSteam)) { // not a DX heating coil diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index 2592c9c6437..81daed56c63 100644 --- a/src/EnergyPlus/HeatRecovery.cc +++ b/src/EnergyPlus/HeatRecovery.cc @@ -1591,8 +1591,8 @@ namespace HeatRecovery { } } else if (CompanionCoilType_Num == DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed) { // how to support VS dx coil here? - FullLoadOutAirTemp = VariableSpeedCoils::VarSpeedCoil(CompanionCoilIndex).OutletAirDBTemp; - FullLoadOutAirHumRat = VariableSpeedCoils::VarSpeedCoil(CompanionCoilIndex).OutletAirHumRat; + FullLoadOutAirTemp = state.dataVariableSpeedCoils->VarSpeedCoil(CompanionCoilIndex).OutletAirDBTemp; + FullLoadOutAirHumRat = state.dataVariableSpeedCoils->VarSpeedCoil(CompanionCoilIndex).OutletAirHumRat; } } else { diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index 1d7bc3a6b9f..8392dac0f3e 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -302,7 +302,7 @@ namespace HeatingCoils { StageNum, OpMode); // Autodesk:OPTIONAL SpeedRatio, PartLoadRatio, StageNum used without PRESENT check } else if (HeatingCoil(CoilNum).HCoilType_Num == Coil_HeatingDesuperheater) { - CalcDesuperheaterHeatingCoil(CoilNum, QCoilRequired, QCoilActual2); + CalcDesuperheaterHeatingCoil(state, CoilNum, QCoilRequired, QCoilActual2); } else { QCoilActual2 = 0.0; } @@ -1448,7 +1448,7 @@ namespace HeatingCoils { break; } } else if (HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_VARIABLE_COOLING) { - for (DXCoilNum = 1; DXCoilNum <= VariableSpeedCoils::NumVarSpeedCoils; ++DXCoilNum) { + for (DXCoilNum = 1; DXCoilNum <= state.dataVariableSpeedCoils->NumVarSpeedCoils; ++DXCoilNum) { if (!UtilityRoutines::SameString(DataHeatBalance::HeatReclaimVS_DXCoil(DXCoilNum).Name, HeatingCoil(CoilNum).ReclaimHeatingCoilName)) continue; @@ -2574,7 +2574,7 @@ namespace HeatingCoils { Node(HeatingCoil(CoilNum).AirOutletNodeNum).Temp = HeatingCoil(CoilNum).OutletAirTemp; } - void CalcDesuperheaterHeatingCoil(int const CoilNum, // index to desuperheater heating coil + void CalcDesuperheaterHeatingCoil(EnergyPlusData &state, int const CoilNum, // index to desuperheater heating coil Real64 const QCoilReq, // load requested by the simulation for load based control [W] Real64 &QCoilActual // coil load actually delivered ) @@ -2680,7 +2680,7 @@ namespace HeatingCoils { HeatReclaimDXCoil(SourceID).AvailCapacity * Effic - HeatReclaimDXCoil(SourceID).WaterHeatingDesuperheaterReclaimedHeatTotal; } else if (HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_VARIABLE_COOLING) { // condenser heat rejection - HeatingCoil(CoilNum).RTF = VariableSpeedCoils::VarSpeedCoil(SourceID).RunFrac; + HeatingCoil(CoilNum).RTF = state.dataVariableSpeedCoils->VarSpeedCoil(SourceID).RunFrac; HeatingCoil(CoilNum).NominalCapacity = DataHeatBalance::HeatReclaimVS_DXCoil(SourceID).AvailCapacity * Effic - DataHeatBalance::HeatReclaimVS_DXCoil(SourceID).WaterHeatingDesuperheaterReclaimedHeatTotal; } diff --git a/src/EnergyPlus/HeatingCoils.hh b/src/EnergyPlus/HeatingCoils.hh index 3079d0bf002..a99200e6c22 100644 --- a/src/EnergyPlus/HeatingCoils.hh +++ b/src/EnergyPlus/HeatingCoils.hh @@ -268,7 +268,7 @@ namespace HeatingCoils { int const FanOpMode // Fan operation mode ); - void CalcDesuperheaterHeatingCoil(int const CoilNum, // index to desuperheater heating coil + void CalcDesuperheaterHeatingCoil(EnergyPlusData &state, int const CoilNum, // index to desuperheater heating coil Real64 const QCoilReq, // load requested by the simulation for load based control [W] Real64 &QCoilActual // coil load actually delivered ); diff --git a/src/EnergyPlus/IntegratedHeatPump.cc b/src/EnergyPlus/IntegratedHeatPump.cc index f1fd2bad13b..8f1b1b0b611 100644 --- a/src/EnergyPlus/IntegratedHeatPump.cc +++ b/src/EnergyPlus/IntegratedHeatPump.cc @@ -1104,7 +1104,6 @@ namespace IntegratedHeatPump { using GlobalNames::VerifyUniqueCoilName; using General::TrimSigDigits; using VariableSpeedCoils::GetCoilIndexVariableSpeed; - using VariableSpeedCoils::VarSpeedCoil; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetIHPInput: "); // include trailing blank space @@ -1300,7 +1299,7 @@ namespace IntegratedHeatPump { ShowContinueError("...specified in " + CurrentModuleObject + "=\"" + AlphArray(1) + "\"."); ErrorsFound = true; } else { - VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).bIsDesuperheater = true; + state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).bIsDesuperheater = true; } } @@ -1338,7 +1337,7 @@ namespace IntegratedHeatPump { ShowContinueError("...specified in " + CurrentModuleObject + "=\"" + AlphArray(1) + "\"."); ErrorsFound = true; } else { - VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).bIsDesuperheater = true; + state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).bIsDesuperheater = true; } } @@ -1367,8 +1366,8 @@ namespace IntegratedHeatPump { // cooling coil air node connections ChildCoilIndex = IntegratedHeatPumps(DXCoilNum).SCCoilIndex; - InNode = VarSpeedCoil(ChildCoilIndex).AirInletNodeNum; - OutNode = VarSpeedCoil(ChildCoilIndex).AirOutletNodeNum; + InNode = state.dataVariableSpeedCoils->VarSpeedCoil(ChildCoilIndex).AirInletNodeNum; + OutNode = state.dataVariableSpeedCoils->VarSpeedCoil(ChildCoilIndex).AirOutletNodeNum; InNodeName = NodeID(InNode); OutNodeName = NodeID(OutNode); @@ -1416,8 +1415,8 @@ namespace IntegratedHeatPump { ObjectIsNotParent, ErrorsFound); - if ((VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).AirInletNodeNum != InNode) || - (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).AirOutletNodeNum != OutNode)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).AirInletNodeNum != InNode) || + (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).AirOutletNodeNum != OutNode)) { ShowContinueError("Mistaken air node connection: " + CurrentModuleObject + IntegratedHeatPumps(DXCoilNum).SCWHCoilName + "-wrong coil node names."); ErrorsFound = true; @@ -1445,8 +1444,8 @@ namespace IntegratedHeatPump { ObjectIsNotParent, ErrorsFound); - if ((VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).AirInletNodeNum != InNode) || - (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).AirOutletNodeNum != OutNode)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).AirInletNodeNum != InNode) || + (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).AirOutletNodeNum != OutNode)) { ShowContinueError("Mistaken air node connection: " + CurrentModuleObject + IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilName + "-wrong coil node names."); ErrorsFound = true; @@ -1478,11 +1477,11 @@ namespace IntegratedHeatPump { ChildCoilIndex = IntegratedHeatPumps(DXCoilNum).SHCoilIndex; InNode = IntegratedHeatPumps(DXCoilNum).AirHeatInletNodeNum; - OutNode = VarSpeedCoil(ChildCoilIndex).AirOutletNodeNum; + OutNode = state.dataVariableSpeedCoils->VarSpeedCoil(ChildCoilIndex).AirOutletNodeNum; IntegratedHeatPumps(DXCoilNum).AirOutletNodeNum = OutNode; InNodeName = NodeID(InNode); OutNodeName = NodeID(OutNode); - if (VarSpeedCoil(ChildCoilIndex).AirInletNodeNum != InNode) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(ChildCoilIndex).AirInletNodeNum != InNode) { ShowContinueError("Mistaken air node connection: " + CurrentModuleObject + "- cooling coil outlet mismatches heating coil inlet" + "."); ErrorsFound = true; @@ -1528,8 +1527,8 @@ namespace IntegratedHeatPump { ObjectIsNotParent, ErrorsFound); - if ((VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilIndex).AirInletNodeNum != InNode) || - (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilIndex).AirOutletNodeNum != OutNode)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilIndex).AirInletNodeNum != InNode) || + (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilIndex).AirOutletNodeNum != OutNode)) { ShowContinueError("Mistaken air node connection: " + CurrentModuleObject + IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilName + "-wrong coil node names."); ErrorsFound = true; @@ -1560,14 +1559,14 @@ namespace IntegratedHeatPump { // water node connections ChildCoilIndex = IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex; - InNode = VarSpeedCoil(ChildCoilIndex).WaterInletNodeNum; - OutNode = VarSpeedCoil(ChildCoilIndex).WaterOutletNodeNum; + InNode = state.dataVariableSpeedCoils->VarSpeedCoil(ChildCoilIndex).WaterInletNodeNum; + OutNode = state.dataVariableSpeedCoils->VarSpeedCoil(ChildCoilIndex).WaterOutletNodeNum; InNodeName = NodeID(InNode); OutNodeName = NodeID(OutNode); IntegratedHeatPumps(DXCoilNum).WaterInletNodeNum = InNode; IntegratedHeatPumps(DXCoilNum).WaterOutletNodeNum = OutNode; - if ((VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).WaterInletNodeNum != InNode) || - (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).WaterOutletNodeNum != OutNode)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).WaterInletNodeNum != InNode) || + (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).WaterOutletNodeNum != OutNode)) { ShowContinueError("Mistaken water node connection: " + CurrentModuleObject + IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilName + "-wrong coil node names."); ErrorsFound = true; @@ -1637,8 +1636,8 @@ namespace IntegratedHeatPump { ObjectIsNotParent, ErrorsFound); - if ((VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).WaterInletNodeNum != InNode) || - (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).WaterOutletNodeNum != OutNode)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).WaterInletNodeNum != InNode) || + (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).WaterOutletNodeNum != OutNode)) { ShowContinueError("Mistaken water node connection: " + CurrentModuleObject + IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilName + "-wrong coil node names."); ErrorsFound = true; @@ -1666,8 +1665,8 @@ namespace IntegratedHeatPump { ObjectIsNotParent, ErrorsFound); - if ((VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).WaterInletNodeNum != InNode) || - (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).WaterOutletNodeNum != OutNode)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).WaterInletNodeNum != InNode) || + (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).WaterOutletNodeNum != OutNode)) { ShowContinueError("Mistaken water node connection: " + CurrentModuleObject + IntegratedHeatPumps(DXCoilNum).DWHCoilName + "-wrong coil node names."); ErrorsFound = true; @@ -1701,14 +1700,14 @@ namespace IntegratedHeatPump { // outdoor air node connections for water heating coils // DWH, SCDWH, SHDWH coils have the same outdoor air nodes ChildCoilIndex = IntegratedHeatPumps(DXCoilNum).DWHCoilIndex; - InNode = VarSpeedCoil(ChildCoilIndex).AirInletNodeNum; - OutNode = VarSpeedCoil(ChildCoilIndex).AirOutletNodeNum; + InNode = state.dataVariableSpeedCoils->VarSpeedCoil(ChildCoilIndex).AirInletNodeNum; + OutNode = state.dataVariableSpeedCoils->VarSpeedCoil(ChildCoilIndex).AirOutletNodeNum; InNodeName = NodeID(InNode); OutNodeName = NodeID(OutNode); IntegratedHeatPumps(DXCoilNum).ODAirInletNodeNum = InNode; IntegratedHeatPumps(DXCoilNum).ODAirOutletNodeNum = OutNode; - if ((VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).AirInletNodeNum != InNode) || - (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).AirOutletNodeNum != OutNode)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).AirInletNodeNum != InNode) || + (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).AirOutletNodeNum != OutNode)) { ShowContinueError("Mistaken air node connection: " + CurrentModuleObject + IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilName + "-wrong coil node names."); ErrorsFound = true; @@ -1778,10 +1777,10 @@ namespace IntegratedHeatPump { ObjectIsNotParent, ErrorsFound); - VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).AirInletNodeNum = InNode; - VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).AirOutletNodeNum = OutNode; - if ((VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).AirInletNodeNum != InNode) || - (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).AirOutletNodeNum != OutNode)) { + state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).AirInletNodeNum = InNode; + state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).AirOutletNodeNum = OutNode; + if ((state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).AirInletNodeNum != InNode) || + (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).AirOutletNodeNum != OutNode)) { ShowContinueError("Mistaken air node connection: " + CurrentModuleObject + IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilName + "-wrong coil node names."); ErrorsFound = true; @@ -1929,7 +1928,6 @@ namespace IntegratedHeatPump { using VariableSpeedCoils::SetVarSpeedCoilData; using VariableSpeedCoils::SimVariableSpeedCoils; using VariableSpeedCoils::SizeVarSpeedCoil; - using VariableSpeedCoils::VarSpeedCoil; static bool ErrorsFound(false); // If errors detected in input Real64 RatedCapacity(0.0); // rated building cooling load @@ -1962,7 +1960,7 @@ namespace IntegratedHeatPump { ShowFatalError("SizeIHP: failed to size SC coil\"" + IntegratedHeatPumps(DXCoilNum).SCCoilName + "\""); ErrorsFound = false; } else { - RatedCapacity = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCCoilIndex).RatedCapCoolTotal; + RatedCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCCoilIndex).RatedCapCoolTotal; }; SizeVarSpeedCoil(state, IntegratedHeatPumps(DXCoilNum).SHCoilIndex); // size heating coil @@ -1972,8 +1970,8 @@ namespace IntegratedHeatPump { }; // pass SC coil capacity to SCDWH cool coil - if (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).RatedCapCoolTotal == AutoSize) { - VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).RatedCapCoolTotal = RatedCapacity; + if (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).RatedCapCoolTotal == AutoSize) { + state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).RatedCapCoolTotal = RatedCapacity; }; // associate SCDWH air coil to SHDWH air coil @@ -1995,9 +1993,9 @@ namespace IntegratedHeatPump { // size the water coils below // size SCWH water coil - if (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).RatedCapWH == AutoSize) { - VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).RatedCapWH = - RatedCapacity / (1.0 - 1.0 / VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).RatedCOPHeat); + if (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).RatedCapWH == AutoSize) { + state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).RatedCapWH = + RatedCapacity / (1.0 - 1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).RatedCOPHeat); } SizeVarSpeedCoil(state, IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex); @@ -2007,8 +2005,8 @@ namespace IntegratedHeatPump { }; // size DWH water coil - if (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).RatedCapWH == AutoSize) { - VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).RatedCapWH = RatedCapacity; + if (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).RatedCapWH == AutoSize) { + state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).RatedCapWH = RatedCapacity; } SizeVarSpeedCoil(state, IntegratedHeatPumps(DXCoilNum).DWHCoilIndex); @@ -2018,8 +2016,8 @@ namespace IntegratedHeatPump { }; // size SCDWH water coil - if (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).RatedCapWH == AutoSize) { - VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).RatedCapWH = RatedCapacity * 0.13; + if (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).RatedCapWH == AutoSize) { + state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex).RatedCapWH = RatedCapacity * 0.13; } SizeVarSpeedCoil(state, IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex); @@ -2029,8 +2027,8 @@ namespace IntegratedHeatPump { }; // size SHDWH water coil - if (VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).RatedCapWH == AutoSize) { - VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).RatedCapWH = RatedCapacity * 0.1; + if (state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).RatedCapWH == AutoSize) { + state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex).RatedCapWH = RatedCapacity * 0.1; } SizeVarSpeedCoil(state, IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex); @@ -2079,7 +2077,6 @@ namespace IntegratedHeatPump { { using DataHVACGlobals::TimeStepSys; using General::TrimSigDigits; - using VariableSpeedCoils::VarSpeedCoil; int VSCoilIndex(0); Real64 ReportingConstant(0.0); @@ -2099,64 +2096,64 @@ namespace IntegratedHeatPump { switch (IntegratedHeatPumps(DXCoilNum).CurMode) { case IHPOperationMode::SCMode: VSCoilIndex = IntegratedHeatPumps(DXCoilNum).SCCoilIndex; - IntegratedHeatPumps(DXCoilNum).TotalCoolingRate = VarSpeedCoil(VSCoilIndex).QLoadTotal; // total cooling rate [w] + IntegratedHeatPumps(DXCoilNum).TotalCoolingRate = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QLoadTotal; // total cooling rate [w] IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = 0.0; // total water heating rate [w] IntegratedHeatPumps(DXCoilNum).TotalSpaceHeatingRate = 0.0; // total space heating rate [w] - IntegratedHeatPumps(DXCoilNum).TotalPower = VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] - IntegratedHeatPumps(DXCoilNum).TotalLatentLoad = VarSpeedCoil(VSCoilIndex).QLatent; // total latent cooling rate [w] - IntegratedHeatPumps(DXCoilNum).Qsource = VarSpeedCoil(VSCoilIndex).QSource; // source energy rate, [w] + IntegratedHeatPumps(DXCoilNum).TotalPower = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] + IntegratedHeatPumps(DXCoilNum).TotalLatentLoad = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QLatent; // total latent cooling rate [w] + IntegratedHeatPumps(DXCoilNum).Qsource = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QSource; // source energy rate, [w] break; case IHPOperationMode::SHMode: VSCoilIndex = IntegratedHeatPumps(DXCoilNum).SHCoilIndex; IntegratedHeatPumps(DXCoilNum).TotalCoolingRate = 0.0; // total cooling rate [w] IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = 0.0; // total water heating rate [w] - IntegratedHeatPumps(DXCoilNum).TotalSpaceHeatingRate = VarSpeedCoil(VSCoilIndex).QLoadTotal; // total space heating rate [w] - IntegratedHeatPumps(DXCoilNum).TotalPower = VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] + IntegratedHeatPumps(DXCoilNum).TotalSpaceHeatingRate = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QLoadTotal; // total space heating rate [w] + IntegratedHeatPumps(DXCoilNum).TotalPower = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] IntegratedHeatPumps(DXCoilNum).TotalLatentLoad = 0.0; // total latent cooling rate [w] - IntegratedHeatPumps(DXCoilNum).Qsource = VarSpeedCoil(VSCoilIndex).QSource; // source energy rate, [w] + IntegratedHeatPumps(DXCoilNum).Qsource = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QSource; // source energy rate, [w] break; case IHPOperationMode::DWHMode: VSCoilIndex = IntegratedHeatPumps(DXCoilNum).DWHCoilIndex; IntegratedHeatPumps(DXCoilNum).TotalCoolingRate = 0.0; // total cooling rate [w] - IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = VarSpeedCoil(VSCoilIndex).QSource; // total water heating rate [w] + IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QSource; // total water heating rate [w] IntegratedHeatPumps(DXCoilNum).TotalSpaceHeatingRate = 0.0; // total space heating rate [w] - IntegratedHeatPumps(DXCoilNum).TotalPower = VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] + IntegratedHeatPumps(DXCoilNum).TotalPower = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] IntegratedHeatPumps(DXCoilNum).TotalLatentLoad = 0.0; // total latent cooling rate [w] - IntegratedHeatPumps(DXCoilNum).Qsource = VarSpeedCoil(VSCoilIndex).QLoadTotal; // source energy rate, [w] + IntegratedHeatPumps(DXCoilNum).Qsource = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QLoadTotal; // source energy rate, [w] break; case IHPOperationMode::SCWHMatchSCMode: case IHPOperationMode::SCWHMatchWHMode: VSCoilIndex = IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex; - IntegratedHeatPumps(DXCoilNum).TotalCoolingRate = VarSpeedCoil(VSCoilIndex).QLoadTotal; // total cooling rate [w] - IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = VarSpeedCoil(VSCoilIndex).QSource; // total water heating rate [w] + IntegratedHeatPumps(DXCoilNum).TotalCoolingRate = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QLoadTotal; // total cooling rate [w] + IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QSource; // total water heating rate [w] IntegratedHeatPumps(DXCoilNum).TotalSpaceHeatingRate = 0.0; // total space heating rate [w] - IntegratedHeatPumps(DXCoilNum).TotalPower = VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] - IntegratedHeatPumps(DXCoilNum).TotalLatentLoad = VarSpeedCoil(VSCoilIndex).QLatent; // total latent cooling rate [w] + IntegratedHeatPumps(DXCoilNum).TotalPower = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] + IntegratedHeatPumps(DXCoilNum).TotalLatentLoad = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QLatent; // total latent cooling rate [w] IntegratedHeatPumps(DXCoilNum).Qsource = 0.0; // source energy rate, [w] break; case IHPOperationMode::SCDWHMode: VSCoilIndex = IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex; - IntegratedHeatPumps(DXCoilNum).TotalCoolingRate = VarSpeedCoil(VSCoilIndex).QLoadTotal; // total cooling rate [w] + IntegratedHeatPumps(DXCoilNum).TotalCoolingRate = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QLoadTotal; // total cooling rate [w] IntegratedHeatPumps(DXCoilNum).TotalSpaceHeatingRate = 0.0; // total space heating rate [w] - IntegratedHeatPumps(DXCoilNum).TotalPower = VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] - IntegratedHeatPumps(DXCoilNum).TotalLatentLoad = VarSpeedCoil(VSCoilIndex).QLatent; // total latent cooling rate [w] - IntegratedHeatPumps(DXCoilNum).Qsource = VarSpeedCoil(VSCoilIndex).QSource; // source energy rate, [w] + IntegratedHeatPumps(DXCoilNum).TotalPower = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] + IntegratedHeatPumps(DXCoilNum).TotalLatentLoad = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QLatent; // total latent cooling rate [w] + IntegratedHeatPumps(DXCoilNum).Qsource = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QSource; // source energy rate, [w] VSCoilIndex = IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex; - IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = VarSpeedCoil(VSCoilIndex).QSource; // total water heating rate [w] + IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QSource; // total water heating rate [w] break; case IHPOperationMode::SHDWHElecHeatOffMode: case IHPOperationMode::SHDWHElecHeatOnMode: VSCoilIndex = IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilIndex; IntegratedHeatPumps(DXCoilNum).TotalCoolingRate = 0.0; // total cooling rate [w] - IntegratedHeatPumps(DXCoilNum).TotalSpaceHeatingRate = VarSpeedCoil(VSCoilIndex).QLoadTotal; // total space heating rate [w] - IntegratedHeatPumps(DXCoilNum).TotalPower = VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] + IntegratedHeatPumps(DXCoilNum).TotalSpaceHeatingRate = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QLoadTotal; // total space heating rate [w] + IntegratedHeatPumps(DXCoilNum).TotalPower = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).Power; // total power consumption [w] IntegratedHeatPumps(DXCoilNum).TotalLatentLoad = 0.0; // total latent cooling rate [w] - IntegratedHeatPumps(DXCoilNum).Qsource = VarSpeedCoil(VSCoilIndex).QSource; // source energy rate, [w] + IntegratedHeatPumps(DXCoilNum).Qsource = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QSource; // source energy rate, [w] VSCoilIndex = IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex; - IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = VarSpeedCoil(VSCoilIndex).QSource; // total water heating rate [w] + IntegratedHeatPumps(DXCoilNum).TotalWaterHeatingRate = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).QSource; // total water heating rate [w] break; case IHPOperationMode::IdleMode: @@ -2734,7 +2731,6 @@ namespace IntegratedHeatPump { int GetMaxSpeedNumIHP(EnergyPlusData &state, int const DXCoilNum) { using General::TrimSigDigits; - using VariableSpeedCoils::VarSpeedCoil; // Obtains and Allocates WatertoAirHP related parameters from input file if (GetCoilsInputFlag) { // First time subroutine has been entered @@ -2752,30 +2748,30 @@ namespace IntegratedHeatPump { switch (IntegratedHeatPumps(DXCoilNum).CurMode) { case IHPOperationMode::IdleMode: - SpeedNum = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCCoilIndex).NumOfSpeeds; + SpeedNum = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCCoilIndex).NumOfSpeeds; break; case IHPOperationMode::SCMode: - SpeedNum = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCCoilIndex).NumOfSpeeds; + SpeedNum = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCCoilIndex).NumOfSpeeds; break; case IHPOperationMode::SHMode: - SpeedNum = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHCoilIndex).NumOfSpeeds; + SpeedNum = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHCoilIndex).NumOfSpeeds; break; case IHPOperationMode::DWHMode: - SpeedNum = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).NumOfSpeeds; + SpeedNum = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).DWHCoilIndex).NumOfSpeeds; break; case IHPOperationMode::SCWHMatchSCMode: case IHPOperationMode::SCWHMatchWHMode: - SpeedNum = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).NumOfSpeeds; + SpeedNum = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).NumOfSpeeds; break; case IHPOperationMode::SCDWHMode: - SpeedNum = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).NumOfSpeeds; + SpeedNum = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).NumOfSpeeds; break; case IHPOperationMode::SHDWHElecHeatOffMode: case IHPOperationMode::SHDWHElecHeatOnMode: - SpeedNum = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilIndex).NumOfSpeeds; + SpeedNum = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilIndex).NumOfSpeeds; break; default: - SpeedNum = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCCoilIndex).NumOfSpeeds; + SpeedNum = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCCoilIndex).NumOfSpeeds; break; } @@ -2789,7 +2785,6 @@ namespace IntegratedHeatPump { ) { using General::TrimSigDigits; - using VariableSpeedCoils::VarSpeedCoil; int IHPCoilIndex(0); Real64 AirVolFlowRate(0.0); @@ -2839,7 +2834,7 @@ namespace IntegratedHeatPump { if (IsCallbyWH) // call from water loop { IsResultFlow = true; - AirVolFlowRate = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).AirVolFlowRate; + AirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).AirVolFlowRate; } break; case IHPOperationMode::SCWHMatchWHMode: @@ -2847,7 +2842,7 @@ namespace IntegratedHeatPump { FlowScale = IntegratedHeatPumps(DXCoilNum).CoolVolFlowScale; if (!IsCallbyWH) { IsResultFlow = true; - AirVolFlowRate = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).AirVolFlowRate; + AirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex).AirVolFlowRate; } break; case IHPOperationMode::SCDWHMode: @@ -2855,7 +2850,7 @@ namespace IntegratedHeatPump { FlowScale = IntegratedHeatPumps(DXCoilNum).CoolVolFlowScale; if (IsCallbyWH) { IsResultFlow = true; - AirVolFlowRate = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).AirVolFlowRate; + AirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SCDWHCoolCoilIndex).AirVolFlowRate; } break; case IHPOperationMode::SHDWHElecHeatOffMode: @@ -2864,7 +2859,7 @@ namespace IntegratedHeatPump { FlowScale = IntegratedHeatPumps(DXCoilNum).HeatVolFlowScale; if (IsCallbyWH) { IsResultFlow = true; - AirVolFlowRate = VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilIndex).AirVolFlowRate; + AirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IntegratedHeatPumps(DXCoilNum).SHDWHHeatCoilIndex).AirVolFlowRate; } break; default: @@ -2875,10 +2870,10 @@ namespace IntegratedHeatPump { if (!IsResultFlow) { if (1 == SpeedNum) - AirVolFlowRate = VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(SpeedNum); + AirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(SpeedNum); else - AirVolFlowRate = SpeedRatio * VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(SpeedNum) + - (1.0 - SpeedRatio) * VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(SpeedNum - 1); + AirVolFlowRate = SpeedRatio * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(SpeedNum) + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(SpeedNum - 1); AirVolFlowRate = AirVolFlowRate * FlowScale; } @@ -2897,7 +2892,6 @@ namespace IntegratedHeatPump { ) { using General::TrimSigDigits; - using VariableSpeedCoils::VarSpeedCoil; int IHPCoilIndex(0); Real64 WaterVolFlowRate(0.0); @@ -2928,36 +2922,36 @@ namespace IntegratedHeatPump { case IHPOperationMode::DWHMode: IHPCoilIndex = IntegratedHeatPumps(DXCoilNum).DWHCoilIndex; if (1 == SpeedNum) - WaterVolFlowRate = VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum); + WaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum); else - WaterVolFlowRate = SpeedRatio * VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum) + - (1.0 - SpeedRatio) * VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum - 1); + WaterVolFlowRate = SpeedRatio * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum) + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum - 1); break; case IHPOperationMode::SCWHMatchSCMode: case IHPOperationMode::SCWHMatchWHMode: IHPCoilIndex = IntegratedHeatPumps(DXCoilNum).SCWHCoilIndex; if (1 == SpeedNum) - WaterVolFlowRate = VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum); + WaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum); else - WaterVolFlowRate = SpeedRatio * VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum) + - (1.0 - SpeedRatio) * VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum - 1); + WaterVolFlowRate = SpeedRatio * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum) + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum - 1); break; case IHPOperationMode::SCDWHMode: IHPCoilIndex = IntegratedHeatPumps(DXCoilNum).SCDWHWHCoilIndex; if (1 == SpeedNum) - WaterVolFlowRate = VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum); + WaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum); else - WaterVolFlowRate = SpeedRatio * VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum) + - (1.0 - SpeedRatio) * VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum - 1); + WaterVolFlowRate = SpeedRatio * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum) + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum - 1); break; case IHPOperationMode::SHDWHElecHeatOffMode: case IHPOperationMode::SHDWHElecHeatOnMode: IHPCoilIndex = IntegratedHeatPumps(DXCoilNum).SHDWHWHCoilIndex; if (1 == SpeedNum) - WaterVolFlowRate = VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum); + WaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum); else - WaterVolFlowRate = SpeedRatio * VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum) + - (1.0 - SpeedRatio) * VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum - 1); + WaterVolFlowRate = SpeedRatio * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum) + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedWaterVolFlowRate(SpeedNum - 1); break; default: WaterVolFlowRate = 0.0; @@ -2974,7 +2968,6 @@ namespace IntegratedHeatPump { ) { using General::TrimSigDigits; - using VariableSpeedCoils::VarSpeedCoil; int IHPCoilIndex(0); Real64 AirMassFlowRate(0.0); @@ -3070,10 +3063,10 @@ namespace IntegratedHeatPump { if (!IsResultFlow) { if (SpeedNum == 1) { - AirMassFlowRate = VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(SpeedNum); + AirMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(SpeedNum); } else { - AirMassFlowRate = SpeedRatio * VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(SpeedNum) + - (1.0 - SpeedRatio) * VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(SpeedNum - 1); + AirMassFlowRate = SpeedRatio * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(SpeedNum) + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(SpeedNum - 1); } AirMassFlowRate = AirMassFlowRate * FlowScale; diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 8a54c8d38ed..f8af0519488 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -762,28 +762,6 @@ namespace OutputReportTabular { // loop and updates the arrays of data that will later being put // into the tabular reports. - // METHODOLOGY EMPLOYED: - - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - if (t_timeStepType != OutputProcessor::TimeStepType::TimeStepZone && t_timeStepType != OutputProcessor::TimeStepType::TimeStepSystem) { ShowFatalError("Invalid reporting requested -- UpdateTabularReports"); } @@ -817,7 +795,7 @@ namespace OutputReportTabular { GatherBEPSResultsForTimestep(t_timeStepType); GatherSourceEnergyEndUseResultsForTimestep(t_timeStepType); GatherPeakDemandForTimestep(t_timeStepType); - GatherHeatGainReport(t_timeStepType); + GatherHeatGainReport(state, t_timeStepType); GatherHeatEmissionReport(state, t_timeStepType); } } @@ -4925,8 +4903,6 @@ namespace OutputReportTabular { using PackagedThermalStorageCoil::TESCoil; using RefrigeratedCase::Condenser; using RefrigeratedCase::RefrigRack; - using VariableSpeedCoils::NumVarSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; static int iOACtrl(0); static int iCoil(0); @@ -5019,18 +4995,18 @@ namespace OutputReportTabular { } } // VAV coils - air to air - for (iCoil = 1; iCoil <= NumVarSpeedCoils; ++iCoil) { - if (VarSpeedCoil(iCoil).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed) { - if (VarSpeedCoil(iCoil).CondenserType == AirCooled) { - SysTotalHVACRejectHeatLoss += VarSpeedCoil(iCoil).Energy + VarSpeedCoil(iCoil).CrankcaseHeaterConsumption + - VarSpeedCoil(iCoil).DefrostConsumption + VarSpeedCoil(iCoil).EnergyLoadTotal; - } else if (VarSpeedCoil(iCoil).CondenserType == EvapCooled) { - SysTotalHVACRejectHeatLoss += VarSpeedCoil(iCoil).EvapCondPumpElecConsumption + VarSpeedCoil(iCoil).BasinHeaterConsumption + - VarSpeedCoil(iCoil).EvapWaterConsump * RhoWater * H2OHtOfVap_HVAC; + for (iCoil = 1; iCoil <= state.dataVariableSpeedCoils->NumVarSpeedCoils; ++iCoil) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).CondenserType == AirCooled) { + SysTotalHVACRejectHeatLoss += state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).Energy + state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).CrankcaseHeaterConsumption + + state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).DefrostConsumption + state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).EnergyLoadTotal; + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).CondenserType == EvapCooled) { + SysTotalHVACRejectHeatLoss += state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).EvapCondPumpElecConsumption + state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).BasinHeaterConsumption + + state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).EvapWaterConsump * RhoWater * H2OHtOfVap_HVAC; } - } else if (VarSpeedCoil(iCoil).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingAirToAirVariableSpeed) { - SysTotalHVACRejectHeatLoss += VarSpeedCoil(iCoil).Energy + VarSpeedCoil(iCoil).CrankcaseHeaterConsumption + - VarSpeedCoil(iCoil).DefrostConsumption - VarSpeedCoil(iCoil).EnergyLoadTotal; + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingAirToAirVariableSpeed) { + SysTotalHVACRejectHeatLoss += state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).Energy + state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).CrankcaseHeaterConsumption + + state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).DefrostConsumption - state.dataVariableSpeedCoils->VarSpeedCoil(iCoil).EnergyLoadTotal; } } @@ -5098,7 +5074,7 @@ namespace OutputReportTabular { } } - void GatherHeatGainReport(OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC) + void GatherHeatGainReport(EnergyPlusData &state, OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -5185,21 +5161,7 @@ namespace OutputReportTabular { using LowTempRadiantSystem::NumOfHydrLowTempRadSys; using OutputReportPredefined::pdrSensibleGain; using OutputReportPredefined::reportName; - using VentilatedSlab::NumOfVentSlabs; - using VentilatedSlab::VentSlab; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static int iZone(0); static int iRadiant(0); static int iunit(0); @@ -5304,14 +5266,14 @@ namespace OutputReportTabular { curZone = 0; // HVAC Input Heated Surface Heating // HVAC Input Cooled Surface Cooling - for (iRadiant = 1; iRadiant <= NumOfVentSlabs; ++iRadiant) { - curZone = VentSlab(iRadiant).ZonePtr; + 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 <= NumOfZones)) { - ZonePreDefRep(curZone).SHGSAnSurfHt += VentSlab(iRadiant).RadHeatingEnergy * mult; - ZonePreDefRep(curZone).SHGSAnSurfCl -= VentSlab(iRadiant).RadCoolingEnergy * mult; - radiantHeat(curZone) = VentSlab(iRadiant).RadHeatingPower * mult; - radiantCool(curZone) = -VentSlab(iRadiant).RadCoolingPower * mult; + 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 (iRadiant = 1; iRadiant <= NumOfHydrLowTempRadSys; ++iRadiant) { diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index bd64c995376..6ffc9847c79 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -779,7 +779,7 @@ namespace OutputReportTabular { void GatherPeakDemandForTimestep(OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) - void GatherHeatGainReport(OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) + void GatherHeatGainReport(EnergyPlusData &state, OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) void GatherHeatEmissionReport(EnergyPlusData &state, OutputProcessor::TimeStepType t_timeStepType); diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index db1eb4cdaa6..4fd8e55ea9d 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -149,7 +149,6 @@ namespace PackagedTerminalHeatPump { using DataGlobals::SysSizingCalc; using namespace DataHVACGlobals; using DXCoils::DXCoilPartLoadRatio; - using VariableSpeedCoils::MaxSpedLevels; // Use statements for access to subroutines in other modules using namespace ScheduleManager; @@ -3792,7 +3791,6 @@ namespace PackagedTerminalHeatPump { using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; using WaterCoils::GetCoilMaxWaterFlowRate; using WaterCoils::SimulateWaterCoilComponents; @@ -4061,12 +4059,12 @@ namespace PackagedTerminalHeatPump { 0.0, 0.0, 0.0); // conduct the sizing operation in the VS WSHP - PTUnit(PTUnitNum).NumOfSpeedCooling = VarSpeedCoil(PTUnit(PTUnitNum).DXCoolCoilIndexNum).NumOfSpeeds; + PTUnit(PTUnitNum).NumOfSpeedCooling = state.dataVariableSpeedCoils->VarSpeedCoil(PTUnit(PTUnitNum).DXCoolCoilIndexNum).NumOfSpeeds; for (Iter = 1; Iter <= PTUnit(PTUnitNum).NumOfSpeedCooling; ++Iter) { PTUnit(PTUnitNum).MSCoolingSpeedRatio(Iter) = - VarSpeedCoil(PTUnit(PTUnitNum).DXCoolCoilIndexNum).MSRatedAirVolFlowRate(Iter) / - VarSpeedCoil(PTUnit(PTUnitNum).DXCoolCoilIndexNum).MSRatedAirVolFlowRate(PTUnit(PTUnitNum).NumOfSpeedCooling); + state.dataVariableSpeedCoils->VarSpeedCoil(PTUnit(PTUnitNum).DXCoolCoilIndexNum).MSRatedAirVolFlowRate(Iter) / + state.dataVariableSpeedCoils->VarSpeedCoil(PTUnit(PTUnitNum).DXCoolCoilIndexNum).MSRatedAirVolFlowRate(PTUnit(PTUnitNum).NumOfSpeedCooling); PTUnit(PTUnitNum).CoolVolumeFlowRate(Iter) = PTUnit(PTUnitNum).MaxCoolAirVolFlow * PTUnit(PTUnitNum).MSCoolingSpeedRatio(Iter); PTUnit(PTUnitNum).CoolMassFlowRate(Iter) = PTUnit(PTUnitNum).MaxCoolAirMassFlow * PTUnit(PTUnitNum).MSCoolingSpeedRatio(Iter); } @@ -4089,12 +4087,12 @@ namespace PackagedTerminalHeatPump { 0.0, 0.0); // conduct the sizing operation in the VS WSHP - PTUnit(PTUnitNum).NumOfSpeedHeating = VarSpeedCoil(PTUnit(PTUnitNum).DXHeatCoilIndexNum).NumOfSpeeds; + PTUnit(PTUnitNum).NumOfSpeedHeating = state.dataVariableSpeedCoils->VarSpeedCoil(PTUnit(PTUnitNum).DXHeatCoilIndexNum).NumOfSpeeds; for (Iter = 1; Iter <= PTUnit(PTUnitNum).NumOfSpeedHeating; ++Iter) { PTUnit(PTUnitNum).MSHeatingSpeedRatio(Iter) = - VarSpeedCoil(PTUnit(PTUnitNum).DXHeatCoilIndexNum).MSRatedAirVolFlowRate(Iter) / - VarSpeedCoil(PTUnit(PTUnitNum).DXHeatCoilIndexNum).MSRatedAirVolFlowRate(PTUnit(PTUnitNum).NumOfSpeedHeating); + state.dataVariableSpeedCoils->VarSpeedCoil(PTUnit(PTUnitNum).DXHeatCoilIndexNum).MSRatedAirVolFlowRate(Iter) / + state.dataVariableSpeedCoils->VarSpeedCoil(PTUnit(PTUnitNum).DXHeatCoilIndexNum).MSRatedAirVolFlowRate(PTUnit(PTUnitNum).NumOfSpeedHeating); PTUnit(PTUnitNum).HeatVolumeFlowRate(Iter) = PTUnit(PTUnitNum).MaxHeatAirVolFlow * PTUnit(PTUnitNum).MSHeatingSpeedRatio(Iter); PTUnit(PTUnitNum).HeatMassFlowRate(Iter) = PTUnit(PTUnitNum).MaxHeatAirMassFlow * PTUnit(PTUnitNum).MSHeatingSpeedRatio(Iter); @@ -8115,7 +8113,6 @@ namespace PackagedTerminalHeatPump { using SteamCoils::SimulateSteamCoilComponents; using TempSolveRoot::SolveRoot; using VariableSpeedCoils::SimVariableSpeedCoils; - using VariableSpeedCoils::VarSpeedCoil; using WaterCoils::SimulateWaterCoilComponents; using WaterToAirHeatPumpSimple::SimWatertoAirHPSimple; diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.hh b/src/EnergyPlus/PackagedTerminalHeatPump.hh index 87981c1f833..cdab3260fbf 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.hh +++ b/src/EnergyPlus/PackagedTerminalHeatPump.hh @@ -64,9 +64,6 @@ struct EnergyPlusData; namespace PackagedTerminalHeatPump { - // Using/Aliasing - using VariableSpeedCoils::MaxSpedLevels; - // Data // MODULE PARAMETER DEFINITIONS // Compressor operation @@ -119,6 +116,7 @@ namespace PackagedTerminalHeatPump { struct PTUnitData { + int MaxSpedLevels = 10; // Members // input data int UnitType_Num; // paramter equivalent to type of unit diff --git a/src/EnergyPlus/StateManagement.cc b/src/EnergyPlus/StateManagement.cc index 2f8956f1e4a..5e7c26fefcf 100644 --- a/src/EnergyPlus/StateManagement.cc +++ b/src/EnergyPlus/StateManagement.cc @@ -224,15 +224,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include void EnergyPlus::clearAllStates(EnergyPlusData &state) { @@ -412,8 +403,6 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state) UnitVentilator::clear_state(); UserDefinedComponents::clear_state(); UtilityRoutines::clear_state(); - VariableSpeedCoils::clear_state(); - VentilatedSlab::clear_state(); EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::clear_state(); ResultsFramework::clear_state(); } diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 104c72dd6ff..c74f6ca03b8 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -1972,19 +1972,19 @@ namespace UnitarySystems { if (this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed || this->m_HeatingCoilType_Num == DataHVACGlobals::Coil_HeatingAirToAirVariableSpeed) { if (this->m_CoolCoilExists && this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed) { - Real64 MaxSpeedFlowRate = VariableSpeedCoils::VarSpeedCoil(this->m_CoolingCoilIndex) - .MSRatedAirVolFlowRate(VariableSpeedCoils::VarSpeedCoil(this->m_CoolingCoilIndex).NumOfSpeeds); + Real64 MaxSpeedFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex) + .MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex).NumOfSpeeds); if (MaxSpeedFlowRate > 0.0) { NoLoadCoolingAirFlowRateRatio = - VariableSpeedCoils::VarSpeedCoil(this->m_CoolingCoilIndex).MSRatedAirVolFlowRate(1) / MaxSpeedFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex).MSRatedAirVolFlowRate(1) / MaxSpeedFlowRate; } } if (this->m_HeatCoilExists && this->m_HeatingCoilType_Num == DataHVACGlobals::Coil_HeatingAirToAirVariableSpeed) { - Real64 MaxSpeedFlowRate = VariableSpeedCoils::VarSpeedCoil(this->m_HeatingCoilIndex) - .MSRatedAirVolFlowRate(VariableSpeedCoils::VarSpeedCoil(this->m_HeatingCoilIndex).NumOfSpeeds); + Real64 MaxSpeedFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(this->m_HeatingCoilIndex) + .MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(this->m_HeatingCoilIndex).NumOfSpeeds); if (MaxSpeedFlowRate > 0.0) { NoLoadHeatingAirFlowRateRatio = - VariableSpeedCoils::VarSpeedCoil(this->m_HeatingCoilIndex).MSRatedAirVolFlowRate(1) / MaxSpeedFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(this->m_HeatingCoilIndex).MSRatedAirVolFlowRate(1) / MaxSpeedFlowRate; } } this->m_NoLoadAirFlowRateRatio = min(NoLoadCoolingAirFlowRateRatio, NoLoadHeatingAirFlowRateRatio); @@ -2137,11 +2137,11 @@ namespace UnitarySystems { 0.0, 0.0, 0.0); // conduct the sizing operation in the VS WSHP - if (this->m_NumOfSpeedCooling != VariableSpeedCoils::VarSpeedCoil(this->m_CoolingCoilIndex).NumOfSpeeds) { + if (this->m_NumOfSpeedCooling != state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex).NumOfSpeeds) { ShowWarningError(RoutineName + ": " + CompType + " = " + CompName); ShowContinueError("Number of cooling speeds does not match coil object."); - ShowFatalError("Cooling coil = " + VariableSpeedCoils::VarSpeedCoil(this->m_CoolingCoilIndex).VarSpeedCoilType + ": " + - VariableSpeedCoils::VarSpeedCoil(this->m_CoolingCoilIndex).Name); + ShowFatalError("Cooling coil = " + state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex).VarSpeedCoilType + ": " + + state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex).Name); } DataSizing::DXCoolCap = VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num), this->m_CoolingCoilName, ErrFound); @@ -2149,7 +2149,7 @@ namespace UnitarySystems { EqSizing.DesHeatingLoad = DataSizing::DXCoolCap; for (Iter = 1; Iter <= this->m_NumOfSpeedCooling; ++Iter) { - this->m_CoolVolumeFlowRate[Iter] = VariableSpeedCoils::VarSpeedCoil(this->m_CoolingCoilIndex).MSRatedAirVolFlowRate(Iter); + this->m_CoolVolumeFlowRate[Iter] = state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex).MSRatedAirVolFlowRate(Iter); this->m_CoolMassFlowRate[Iter] = this->m_CoolVolumeFlowRate[Iter] * DataEnvironment::StdRhoAir; this->m_MSCoolingSpeedRatio[Iter] = this->m_CoolVolumeFlowRate[Iter] / this->m_DesignFanVolFlowRate; } @@ -2386,11 +2386,11 @@ namespace UnitarySystems { 0.0, 0.0); // conduct the sizing operation in the VS WSHP - if (this->m_NumOfSpeedHeating != VariableSpeedCoils::VarSpeedCoil(this->m_HeatingCoilIndex).NumOfSpeeds) { + if (this->m_NumOfSpeedHeating != state.dataVariableSpeedCoils->VarSpeedCoil(this->m_HeatingCoilIndex).NumOfSpeeds) { ShowWarningError(RoutineName + ": " + CompType + " = " + CompName); ShowContinueError("Number of heating speeds does not match coil object."); - ShowFatalError("Heating coil = " + VariableSpeedCoils::VarSpeedCoil(this->m_HeatingCoilIndex).VarSpeedCoilType + ": " + - VariableSpeedCoils::VarSpeedCoil(this->m_HeatingCoilIndex).Name); + ShowFatalError("Heating coil = " + state.dataVariableSpeedCoils->VarSpeedCoil(this->m_HeatingCoilIndex).VarSpeedCoilType + ": " + + state.dataVariableSpeedCoils->VarSpeedCoil(this->m_HeatingCoilIndex).Name); } if (this->m_NumOfSpeedHeating > 0) { @@ -2400,7 +2400,7 @@ namespace UnitarySystems { } for (Iter = 1; Iter <= this->m_NumOfSpeedHeating; ++Iter) { - this->m_HeatVolumeFlowRate[Iter] = VariableSpeedCoils::VarSpeedCoil(this->m_HeatingCoilIndex).MSRatedAirVolFlowRate(Iter); + this->m_HeatVolumeFlowRate[Iter] = state.dataVariableSpeedCoils->VarSpeedCoil(this->m_HeatingCoilIndex).MSRatedAirVolFlowRate(Iter); this->m_HeatMassFlowRate[Iter] = this->m_HeatVolumeFlowRate[Iter] * DataEnvironment::StdRhoAir; if (this->m_DesignFanVolFlowRate > 0.0 && this->m_FanExists) { this->m_MSHeatingSpeedRatio[Iter] = this->m_HeatVolumeFlowRate[Iter] / this->m_DesignFanVolFlowRate; @@ -5106,7 +5106,7 @@ namespace UnitarySystems { // Set fan info if (thisSys.m_FanExists) { - VariableSpeedCoils::setVarSpeedFanInfo( + VariableSpeedCoils::setVarSpeedFanInfo(state, thisSys.m_CoolingCoilIndex, loc_m_FanName, thisSys.m_FanIndex, thisSys.m_FanType_Num); } } diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index 08eaca3f884..93414338594 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -109,189 +109,8 @@ namespace VariableSpeedCoils { using DXCoils::CalcCBF; using General::RoundSigDigits; - // Use statements for access to subroutines in other modules - - // Data - // MODULE PARAMETER DEFINITIONS - - Real64 const RatedInletAirTemp(26.6667); // 26.6667C or 80F - Real64 const RatedInletWetBulbTemp(19.4444); // 19.44 or 67F, cooling mode - Real64 const RatedInletAirHumRat(0.0111847); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb - Real64 const RatedInletWaterTemp(29.4444); // 85 F cooling mode - Real64 const RatedAmbAirTemp(35.0); // 95 F cooling mode - Real64 const RatedInletAirTempHeat(21.1111); // 21.11C or 70F, heating mode - Real64 const RatedInletWaterTempHeat(21.1111); // 21.11C or 70F, heating mode - Real64 const RatedAmbAirTempHeat(8.3333); // 8.33 or 47F, heating mode - Real64 const RatedAmbAirWBHeat(6.1111); // 8.33 or 43F, heating mode, rated wet bulb temperature - - // Water Systems - int const CondensateDiscarded(1001); // default mode where water is "lost" - int const CondensateToTank(1002); // collect coil condensate from air and store in water storage tank - - int const WaterSupplyFromMains(101); - int const WaterSupplyFromTank(102); - - // Curve Types - int const Linear(1); - int const BiLinear(2); - int const Quadratic(3); - int const BiQuadratic(4); - int const Cubic(5); - - // Defrost strategy (heat pump only) - int const ReverseCycle(1); // uses reverse cycle defrost strategy - int const Resistive(2); // uses electric resistance heater for defrost - // Defrost control (heat pump only) - int const Timed(1); // defrost cycle is timed - int const OnDemand(2); // defrost cycle occurs only when required - - int const MaxSpedLevels(10); // Maximum number of speed that supports - static std::string const BlankString; - // DERIVED TYPE DEFINITIONS - - // MODULE VARIABLE DECLARATIONS: - // Identifier is VarSpeedCoil - int NumVarSpeedCoils(0); // The Number of Water to Air Heat Pumps found in the Input - - bool MyOneTimeFlag(true); // one time allocation flag - bool GetCoilsInputFlag(true); // Flag set to make sure you get input once - // LOGICAL, ALLOCATABLE, DIMENSION(:) :: MySizeFlag - - Real64 SourceSideMassFlowRate(0.0); // Source Side Mass flow rate [Kg/s] - Real64 SourceSideInletTemp(0.0); // Source Side Inlet Temperature [C] - Real64 SourceSideInletEnth(0.0); // Source Side Inlet Enthalpy [J/kg] - Real64 LoadSideMassFlowRate(0.0); // Load Side Mass flow rate [Kg/s] - Real64 LoadSideInletDBTemp(0.0); // Load Side Inlet Dry Bulb Temp [C] - Real64 LoadSideInletWBTemp(0.0); // Load Side Inlet Wet Bulb Temp [C] - Real64 LoadSideInletHumRat(0.0); // Load Side Outlet Humidity ratio - Real64 LoadSideInletEnth(0.0); // Load Side Inlet Enthalpy [J/kg] - Real64 LoadSideOutletDBTemp(0.0); // Load Side Outlet Dry Bulb Temp [C] - Real64 LoadSideOutletHumRat(0.0); // Load Side Outlet Humidity ratio - Real64 LoadSideOutletEnth(0.0); // Load Side Outlet Enthalpy [J/kg] - Real64 QSensible(0.0); // Load side sensible heat transfer rate [W] - Real64 QLoadTotal(0.0); // Load side total heat transfer rate [W] - Real64 QLatRated(0.0); // Latent Capacity [W] rated at entering air conditions [Tdb=26.7C Twb=19.4C] - Real64 QLatActual(0.0); // Actual Latent Capacity [W] - Real64 QSource(0.0); // Source side heat transfer rate [W] - Real64 Winput(0.0); // Power Consumption [W] - Real64 PLRCorrLoadSideMdot(0.0); // Load Side Mdot corrected for Part Load Ratio of the unit - - Real64 VSHPWHHeatingCapacity(0.0); // Used by Heat Pump:Water Heater object as total water heating capacity [W] - Real64 VSHPWHHeatingCOP(0.0); // Used by Heat Pump:Water Heater object as water heating COP [W/W] - - // SUBROUTINE SPECIFICATIONS FOR MODULE - - // Driver/Manager Routines - - // Get Input routines for module - - // Initialization routines for module - - // Update routines to check convergence and update nodes - - // Update routine - - // Utility routines - // SHR, bypass factor routines - - // Object Data - Array1D VarSpeedCoil; - bool firstTime(true); - - // MODULE SUBROUTINES: - //************************************************************************* - - // Functions - void clear_state() - { - NumVarSpeedCoils = 0; - MyOneTimeFlag = true; - GetCoilsInputFlag = true; - SourceSideMassFlowRate = 0.0; - SourceSideInletTemp = 0.0; - SourceSideInletEnth = 0.0; - LoadSideMassFlowRate = 0.0; - LoadSideInletDBTemp = 0.0; - LoadSideInletWBTemp = 0.0; - LoadSideInletHumRat = 0.0; - LoadSideInletEnth = 0.0; - LoadSideOutletDBTemp = 0.0; - LoadSideOutletHumRat = 0.0; - LoadSideOutletEnth = 0.0; - QSensible = 0.0; - QLoadTotal = 0.0; - QLatRated = 0.0; - QLatActual = 0.0; - QSource = 0.0; - Winput = 0.0; - PLRCorrLoadSideMdot = 0.0; - VSHPWHHeatingCapacity = 0.0; - VSHPWHHeatingCOP = 0.0; - VarSpeedCoil.deallocate(); - firstTime = true; - } - - // Default Constructor - VariableSpeedCoilData::VariableSpeedCoilData() - : NumOfSpeeds(2), NormSpedLevel(MaxSpedLevels), RatedWaterVolFlowRate(AutoSize), RatedWaterMassFlowRate(AutoSize), - RatedAirVolFlowRate(AutoSize), RatedCapHeat(AutoSize), RatedCapCoolTotal(AutoSize), MaxONOFFCyclesperHour(0.0), Twet_Rated(0.0), - Gamma_Rated(0.0), HOTGASREHEATFLG(0), HPTimeConstant(0.0), PLFFPLR(0), VSCoilTypeOfNum(0), SimFlag(false), DesignWaterMassFlowRate(0.0), - DesignWaterVolFlowRate(0.0), DesignAirMassFlowRate(0.0), DesignAirVolFlowRate(0.0), AirVolFlowRate(0.0), AirMassFlowRate(0.0), - InletAirPressure(0.0), InletAirDBTemp(0.0), InletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirDBTemp(0.0), OutletAirHumRat(0.0), - OutletAirEnthalpy(0.0), WaterVolFlowRate(0.0), WaterMassFlowRate(0.0), InletWaterTemp(0.0), InletWaterEnthalpy(0.0), OutletWaterTemp(0.0), - OutletWaterEnthalpy(0.0), Power(0.0), QLoadTotal(0.0), QSensible(0.0), QLatent(0.0), QSource(0.0), QWasteHeat(0.0), Energy(0.0), - EnergyLoadTotal(0.0), EnergySensible(0.0), EnergyLatent(0.0), EnergySource(0.0), COP(0.0), RunFrac(0.0), PartLoadRatio(0.0), - RatedPowerHeat(0.0), RatedCOPHeat(0.0), RatedCapCoolSens(0.0), RatedPowerCool(0.0), RatedCOPCool(0.0), AirInletNodeNum(0), - AirOutletNodeNum(0), WaterInletNodeNum(0), WaterOutletNodeNum(0), LoopNum(0), LoopSide(0), BranchNum(0), CompNum(0), - FindCompanionUpStreamCoil(true), IsDXCoilInZone(false), CompanionCoolingCoilNum(0), CompanionHeatingCoilNum(0), FanDelayTime(0.0), - // This one calls into a std::vector, so it's 0-indexed, so we initialize it to -1 - MSHPDesignSpecIndex(-1), MSErrIndex(MaxSpedLevels, 0), MSRatedPercentTotCap(MaxSpedLevels, 0.0), MSRatedTotCap(MaxSpedLevels, 0.0), - MSRatedSHR(MaxSpedLevels, 0.0), MSRatedCOP(MaxSpedLevels, 0.0), MSRatedAirVolFlowPerRatedTotCap(MaxSpedLevels, 0.0), - MSRatedAirVolFlowRate(MaxSpedLevels, 0.0), MSRatedAirMassFlowRate(MaxSpedLevels, 0.0), - MSRatedWaterVolFlowPerRatedTotCap(MaxSpedLevels, 0.0), MSRatedWaterVolFlowRate(MaxSpedLevels, 0.0), - MSRatedWaterMassFlowRate(MaxSpedLevels, 0.0), MSRatedCBF(MaxSpedLevels, 0.0), MSEffectiveAo(MaxSpedLevels, 0.0), - MSCCapFTemp(MaxSpedLevels, 0), MSCCapAirFFlow(MaxSpedLevels, 0), MSCCapWaterFFlow(MaxSpedLevels, 0), MSEIRFTemp(MaxSpedLevels, 0), - MSEIRAirFFlow(MaxSpedLevels, 0), MSEIRWaterFFlow(MaxSpedLevels, 0), MSWasteHeat(MaxSpedLevels, 0), MSWasteHeatFrac(MaxSpedLevels, 0.0), - MSWHPumpPower(MaxSpedLevels, 0.0), MSWHPumpPowerPerRatedTotCap(MaxSpedLevels, 0.0), SpeedNumReport(0.0), SpeedRatioReport(0.0), - DefrostStrategy(0), DefrostControl(0), EIRFPLR(0), DefrostEIRFT(0), MinOATCompressor(0.0), OATempCompressorOn(0.0), MaxOATDefrost(0.0), - DefrostTime(0.0), DefrostCapacity(0.0), HPCompressorRuntime(0.0), HPCompressorRuntimeLast(0.0), TimeLeftToDefrost(0.0), DefrostPower(0.0), - DefrostConsumption(0.0), ReportCoolingCoilCrankcasePower(true), CrankcaseHeaterCapacity(0.0), CrankcaseHeaterPower(0.0), - MaxOATCrankcaseHeater(0.0), CrankcaseHeaterConsumption(0.0), CondenserInletNodeNum(0), CondenserType(AirCooled), ReportEvapCondVars(false), - EvapCondPumpElecNomPower(0.0), EvapCondPumpElecPower(0.0), EvapWaterConsumpRate(0.0), EvapCondPumpElecConsumption(0.0), - EvapWaterConsump(0.0), BasinHeaterConsumption(0.0), BasinHeaterPowerFTempDiff(0.0), BasinHeaterSetPointTemp(0.0), BasinHeaterPower(0.0), - BasinHeaterSchedulePtr(0), EvapCondAirFlow(MaxSpedLevels, 0.0), EvapCondEffect(MaxSpedLevels, 0.0), - MSRatedEvapCondVolFlowPerRatedTotCap(MaxSpedLevels, 0.0), EvapWaterSupplyMode(WaterSupplyFromMains), EvapWaterSupTankID(0), - EvapWaterTankDemandARRID(0), CondensateCollectMode(CondensateDiscarded), CondensateTankID(0), CondensateTankSupplyARRID(0), - CondensateVdot(0.0), CondensateVol(0.0), CondInletTemp(0.0), SupplyFanIndex(0), SupplyFan_TypeNum(0), SourceAirMassFlowRate(0.0), - InletSourceAirTemp(0.0), InletSourceAirEnthalpy(0.0), - // begin varibles for HPWH - RatedCapWH(0.0), // Rated water heating Capacity [W] - InletAirTemperatureType(0), // Specifies to use either air wet-bulb or dry-bulb temp for curve objects - WHRatedInletDBTemp(0.0), // Rated inlet air dry-bulb temperature [C] - WHRatedInletWBTemp(0.0), // Rated inlet air wet-bulb temperature [C] - WHRatedInletWaterTemp(0.0), // Rated condenser water inlet temperature [C] - HPWHCondPumpElecNomPower(0.0), // Nominal power input to the condenser water circulation pump [W] - HPWHCondPumpFracToWater(1.0), // Nominal power fraction to water for the condenser water circulation pump - RatedHPWHCondWaterFlow(0.0), // Rated water flow rate through the condenser of the HPWH DX coil [m3/s] - ElecWaterHeatingPower(0.0), // Total electric power consumed by compressor and condenser pump [W] - ElecWaterHeatingConsumption(0.0), // Total electric consumption by compressor and condenser pump [J] - FanPowerIncludedInCOP(false), // Indicates that fan heat is included in heating capacity and COP - CondPumpHeatInCapacity(false), // Indicates that condenser pump heat is included in heating capacity - CondPumpPowerInCOP(false), // Indicates that condenser pump power is included in heating COP - AirVolFlowAutoSized(false), // Used to report autosizing info for the HPWH DX coil - WaterVolFlowAutoSized(false), // Used to report autosizing info for the HPWH DX coil - TotalHeatingEnergy(0.0), // total water heating energy - TotalHeatingEnergyRate(0.0), // total WH energy rate - bIsDesuperheater(false), // whether the coil is used for a desuperheater, i.e. zero all the cooling capacity and power - // end variables for HPWH - reportCoilFinalSizes(true), // coil report - capModFacTotal(0.0) // coil report - - { - } - void SimVariableSpeedCoils(EnergyPlusData &state, std::string const &CompName, // Coil Name int &CompIndex, // Index for Component name @@ -329,26 +148,26 @@ namespace VariableSpeedCoils { int SpeedCal; // variable for error proof speed input // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } if (CompIndex == 0) { - DXCoilNum = UtilityRoutines::FindItemInList(CompName, VarSpeedCoil); + DXCoilNum = UtilityRoutines::FindItemInList(CompName, state.dataVariableSpeedCoils->VarSpeedCoil); if (DXCoilNum == 0) { ShowFatalError("WaterToAirHPVSWEquationFit not found=" + CompName); } CompIndex = DXCoilNum; } else { DXCoilNum = CompIndex; - if (DXCoilNum > NumVarSpeedCoils || DXCoilNum < 1) { + if (DXCoilNum > state.dataVariableSpeedCoils->NumVarSpeedCoils || DXCoilNum < 1) { ShowFatalError("SimVariableSpeedCoils: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Water to Air HPs=" + TrimSigDigits(NumVarSpeedCoils) + ", WaterToAir HP name=" + CompName); + ", Number of Water to Air HPs=" + TrimSigDigits(state.dataVariableSpeedCoils->NumVarSpeedCoils) + ", WaterToAir HP name=" + CompName); } - if (!CompName.empty() && CompName != VarSpeedCoil(DXCoilNum).Name) { + if (!CompName.empty() && CompName != state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name) { ShowFatalError("SimVariableSpeedCoils: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + ", WaterToAir HP name=" + CompName + - ", stored WaterToAir HP Name for that index=" + VarSpeedCoil(DXCoilNum).Name); + ", stored WaterToAir HP Name for that index=" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); } } @@ -365,8 +184,8 @@ namespace VariableSpeedCoils { SpeedCal = SpeedNum; } - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) || - (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) || + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed)) { // Cooling mode InitVarSpeedCoil(state, DXCoilNum, @@ -381,9 +200,9 @@ namespace VariableSpeedCoils { SpeedCal); CalcVarSpeedCoilCooling( state, DXCoilNum, CyclingScheme, RuntimeFrac, SensLoad, LatentLoad, CompOp, PartLoadFrac, OnOffAirFlowRatio, SpeedRatio, SpeedCal); - UpdateVarSpeedCoil(DXCoilNum); - } else if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) || - (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed)) { + UpdateVarSpeedCoil(state, DXCoilNum); + } else if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) || + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed)) { // Heating mode InitVarSpeedCoil(state, DXCoilNum, @@ -397,8 +216,8 @@ namespace VariableSpeedCoils { SpeedRatio, SpeedCal); CalcVarSpeedCoilHeating(state, DXCoilNum, CyclingScheme, RuntimeFrac, SensLoad, CompOp, PartLoadFrac, OnOffAirFlowRatio, SpeedRatio, SpeedCal); - UpdateVarSpeedCoil(DXCoilNum); - } else if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed) { + UpdateVarSpeedCoil(state, DXCoilNum); + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed) { // Heating mode InitVarSpeedCoil(state, DXCoilNum, @@ -412,14 +231,14 @@ namespace VariableSpeedCoils { SpeedRatio, SpeedCal); CalcVarSpeedHPWH(state, DXCoilNum, RuntimeFrac, PartLoadFrac, SpeedRatio, SpeedNum, CyclingScheme); - UpdateVarSpeedCoil(DXCoilNum); + UpdateVarSpeedCoil(state, DXCoilNum); } else { ShowFatalError("SimVariableSpeedCoils: WatertoAir heatpump not in either HEATING or COOLING mode"); } // two additional output variables - VarSpeedCoil(DXCoilNum).SpeedNumReport = SpeedCal; - VarSpeedCoil(DXCoilNum).SpeedRatioReport = SpeedRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedNumReport = SpeedCal; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedRatioReport = SpeedRatio; } void GetVarSpeedCoilInput(EnergyPlusData &state) @@ -487,18 +306,18 @@ namespace VariableSpeedCoils { NumCoolAS = inputProcessor->getNumObjectsFound("COIL:COOLING:DX:VARIABLESPEED"); NumHeatAS = inputProcessor->getNumObjectsFound("COIL:HEATING:DX:VARIABLESPEED"); NumHPWHAirToWater = inputProcessor->getNumObjectsFound("COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED"); - NumVarSpeedCoils = NumCool + NumHeat + NumCoolAS + NumHeatAS + NumHPWHAirToWater; + state.dataVariableSpeedCoils->NumVarSpeedCoils = NumCool + NumHeat + NumCoolAS + NumHeatAS + NumHPWHAirToWater; DXCoilNum = 0; - if (NumVarSpeedCoils <= 0) { + if (state.dataVariableSpeedCoils->NumVarSpeedCoils <= 0) { ShowSevereError("No Equipment found in GetVarSpeedCoilInput"); ErrorsFound = true; } // Allocate Arrays - if (NumVarSpeedCoils > 0) { - VarSpeedCoil.allocate(NumVarSpeedCoils); - DataHeatBalance::HeatReclaimVS_DXCoil.allocate(NumVarSpeedCoils); + if (state.dataVariableSpeedCoils->NumVarSpeedCoils > 0) { + state.dataVariableSpeedCoils->VarSpeedCoil.allocate(state.dataVariableSpeedCoils->NumVarSpeedCoils); + DataHeatBalance::HeatReclaimVS_DXCoil.allocate(state.dataVariableSpeedCoils->NumVarSpeedCoils); } inputProcessor->getObjectDefMaxArgs("COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT", NumParams, NumAlphas, NumNums); @@ -551,102 +370,102 @@ namespace VariableSpeedCoils { // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueCoilName(CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); - VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; - VarSpeedCoil(DXCoilNum).Name = AlphArray(1); - VarSpeedCoil(DXCoilNum).CoolHeatType = "COOLING"; - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit; - VarSpeedCoil(DXCoilNum).VarSpeedCoilType = DataHVACGlobals::cAllCoilTypes(VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum); - VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); - VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = NumArray(3); - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(4); - VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = NumArray(5); - VarSpeedCoil(DXCoilNum).Twet_Rated = NumArray(6); - VarSpeedCoil(DXCoilNum).Gamma_Rated = NumArray(7); - VarSpeedCoil(DXCoilNum).HOTGASREHEATFLG = int(NumArray(8)); - VarSpeedCoil(DXCoilNum).CondenserType = WaterCooled; - - VarSpeedCoil(DXCoilNum).WaterInletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name = AlphArray(1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType = "COOLING"; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType = DataHVACGlobals::cAllCoilTypes(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = NumArray(3); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(4); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = NumArray(5); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Twet_Rated = NumArray(6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Gamma_Rated = NumArray(7); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HOTGASREHEATFLG = int(NumArray(8)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType = WaterCooled; + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum = GetOnlySingleNode(state, AlphArray(2), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Inlet, 2, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).WaterOutletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum = GetOnlySingleNode(state, AlphArray(3), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Outlet, 2, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, AlphArray(4), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, AlphArray(5), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent); TestCompSet(CurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Water Nodes"); TestCompSet(CurrentModuleObject, AlphArray(1), AlphArray(4), AlphArray(5), "Air Nodes"); - // If (VarSpeedCoil(DXCoilNum)%NumOfSpeeds .LT. 2) Then - if (VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + // If (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%NumOfSpeeds .LT. 2) Then + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(1) + " must be >= 1. entered number is " + TrimSigDigits(NumArray(1), 0)); ErrorsFound = true; } - if (VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) { - VarSpeedCoil(DXCoilNum).NormSpedLevel = VarSpeedCoil(DXCoilNum).NumOfSpeeds; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; } - if ((VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(2) + " must be valid speed level entered number is " + TrimSigDigits(NumArray(2), 0)); ErrorsFound = true; } // part load curve - VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(6)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(6)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { if (lAlphaBlanks(6)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(6) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(6) + "=\"" + AlphArray(6) + "\"."); } ErrorsFound = true; } else { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(6) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } } - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(9 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedSHR(I) = NumArray(10 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(11 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(12 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) = NumArray(13 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(I) = NumArray(14 + (I - 1) * 6); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(9 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedSHR(I) = NumArray(10 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(11 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(12 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) = NumArray(13 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(I) = NumArray(14 + (I - 1) * 6); AlfaFieldIncre = 7 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), RatedInletWetBulbTemp, RatedInletWaterTemp); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), state.dataVariableSpeedCoils->RatedInletWetBulbTemp, state.dataVariableSpeedCoils->RatedInletWaterTemp); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -654,29 +473,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 8 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -684,29 +503,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 9 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -714,29 +533,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 10 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), RatedInletWetBulbTemp, RatedInletWaterTemp); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), state.dataVariableSpeedCoils->RatedInletWetBulbTemp, state.dataVariableSpeedCoils->RatedInletWaterTemp); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -744,29 +563,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 11 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -774,29 +593,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 12 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -805,29 +624,29 @@ namespace VariableSpeedCoils { AlfaFieldIncre = 13 + (I - 1) * 7; // Read waste heat modifier curve name - VarSpeedCoil(DXCoilNum).MSWasteHeat(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSWasteHeat(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal types are BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(I), RatedInletWaterTemp, RatedInletAirTemp); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(I), state.dataVariableSpeedCoils->RatedInletWaterTemp, state.dataVariableSpeedCoils->RatedInletAirTemp); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -835,22 +654,22 @@ namespace VariableSpeedCoils { } } - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); } // CurrentModuleObject = "Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit" SetupOutputVariable(state, "Cooling Coil Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).Energy, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "Cooling", @@ -858,10 +677,10 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Cooling Coil Total Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergyLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "ENERGYTRANSFER", "COOLINGCOILS", @@ -869,22 +688,22 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Cooling Coil Sensible Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergySensible, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Latent Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergyLatent, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Source Side Heat Transfer Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergySource, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "PLANTLOOPCOOLINGDEMAND", "COOLINGCOILS", @@ -892,24 +711,24 @@ namespace VariableSpeedCoils { "System"); // for table output, being consistent with outher water-to-air coils - // IF (VarSpeedCoil(DXCoilNum)%RatedCapCoolTotal /= AutoSize) THEN - // VarSpeedCoil(DXCoilNum)%RatedCapCoolSens = VarSpeedCoil(DXCoilNum)%RatedCapCoolTotal & - // *VarSpeedCoil(DXCoilNum)%MSRatedSHR(VarSpeedCoil(DXCoilNum)%NormSpedLevel) + // IF (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%RatedCapCoolTotal /= AutoSize) THEN + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%RatedCapCoolSens = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%RatedCapCoolTotal & + // *VarSpeedCoil(DXCoilNum)%MSRatedSHR(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%NormSpedLevel) // ELSE - // VarSpeedCoil(DXCoilNum)%RatedCapCoolSens = AUTOSIZE + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%RatedCapCoolSens = AUTOSIZE // END IF - VarSpeedCoil(DXCoilNum).RatedCapCoolSens = AutoSize; // always auto-sized, to be determined in the sizing calculation + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens = AutoSize; // always auto-sized, to be determined in the sizing calculation // BAN Sept 30 2103, CR9322, commented out, now it is redundant, it is reported from sizing routine // create predefined report entries - // PreDefTableEntry( pdchCoolCoilType, VarSpeedCoil( DXCoilNum ).Name, CurrentModuleObject ); - // PreDefTableEntry( pdchCoolCoilTotCap, VarSpeedCoil( DXCoilNum ).Name, VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal ); - // PreDefTableEntry( pdchCoolCoilSensCap, VarSpeedCoil( DXCoilNum ).Name, VarSpeedCoil( DXCoilNum ).RatedCapCoolSens ); - // PreDefTableEntry( pdchCoolCoilLatCap, VarSpeedCoil( DXCoilNum ).Name, VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal - VarSpeedCoil( - // DXCoilNum ).RatedCapCoolSens ); PreDefTableEntry( pdchCoolCoilSHR, VarSpeedCoil( DXCoilNum ).Name, VarSpeedCoil( DXCoilNum - // ).RatedCapCoolSens / VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal ); PreDefTableEntry( pdchCoolCoilNomEff, VarSpeedCoil( DXCoilNum - // ).Name, VarSpeedCoil( DXCoilNum ).MSRatedCOP( VarSpeedCoil( DXCoilNum ).NormSpedLevel ) ); + // PreDefTableEntry( pdchCoolCoilType, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, CurrentModuleObject ); + // PreDefTableEntry( pdchCoolCoilTotCap, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal ); + // PreDefTableEntry( pdchCoolCoilSensCap, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).RatedCapCoolSens ); + // PreDefTableEntry( pdchCoolCoilLatCap, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal - state.dataVariableSpeedCoils->VarSpeedCoil( + // DXCoilNum ).RatedCapCoolSens ); PreDefTableEntry( pdchCoolCoilSHR, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum + // ).RatedCapCoolSens / state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal ); PreDefTableEntry( pdchCoolCoilNomEff, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum + // ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).MSRatedCOP( state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).NormSpedLevel ) ); } //-------------------------AIR SOURCE, COOLING---BEGIN @@ -936,59 +755,59 @@ namespace VariableSpeedCoils { // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueCoilName(CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); - VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; - VarSpeedCoil(DXCoilNum).Name = AlphArray(1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name = AlphArray(1); // Initialize DataHeatBalance heat reclaim variable name for use by heat reclaim coils - DataHeatBalance::HeatReclaimVS_DXCoil(DXCoilNum).Name = VarSpeedCoil(DXCoilNum).Name; + DataHeatBalance::HeatReclaimVS_DXCoil(DXCoilNum).Name = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name; DataHeatBalance::HeatReclaimVS_DXCoil(DXCoilNum).SourceType = CurrentModuleObject; - VarSpeedCoil(DXCoilNum).CoolHeatType = "COOLING"; - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = Coil_CoolingAirToAirVariableSpeed; - VarSpeedCoil(DXCoilNum).VarSpeedCoilType = DataHVACGlobals::cAllCoilTypes(Coil_CoolingAirToAirVariableSpeed); - VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); - VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = NumArray(3); - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(4); - VarSpeedCoil(DXCoilNum).Twet_Rated = NumArray(5); - VarSpeedCoil(DXCoilNum).Gamma_Rated = NumArray(6); - - VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType = "COOLING"; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = Coil_CoolingAirToAirVariableSpeed; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType = DataHVACGlobals::cAllCoilTypes(Coil_CoolingAirToAirVariableSpeed); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = NumArray(3); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(4); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Twet_Rated = NumArray(5); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Gamma_Rated = NumArray(6); + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, AlphArray(2), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, AlphArray(3), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent); TestCompSet(CurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Air Nodes"); - if (VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(1) + " must be >= 1. entered number is " + TrimSigDigits(NumArray(1), 0)); ErrorsFound = true; } - if (VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) { - VarSpeedCoil(DXCoilNum).NormSpedLevel = VarSpeedCoil(DXCoilNum).NumOfSpeeds; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; } - if ((VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(2) + " must be valid speed level entered number is " + TrimSigDigits(NumArray(2), 0)); ErrorsFound = true; } // part load curve - VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(4)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(4)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { if (lAlphaBlanks(4)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(6) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(4) + "=\"" + AlphArray(4) + "\"."); } ErrorsFound = true; } else { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(4) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -996,19 +815,19 @@ namespace VariableSpeedCoils { // outdoor condenser node if (lAlphaBlanks(5)) { - VarSpeedCoil(DXCoilNum).CondenserInletNodeNum = 0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum = 0; } else { - VarSpeedCoil(DXCoilNum).CondenserInletNodeNum = GetOnlySingleNode(state, AlphArray(5), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum = GetOnlySingleNode(state, AlphArray(5), ErrorsFound, CurrentModuleObject, - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, NodeType_Air, NodeConnectionType_OutsideAirReference, 1, ObjectIsNotParent); - if (!CheckOutAirNodeNumber(state, VarSpeedCoil(DXCoilNum).CondenserInletNodeNum)) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", may be invalid"); + if (!CheckOutAirNodeNumber(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum)) { + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", may be invalid"); ShowContinueError(cAlphaFields(10) + "=\"" + AlphArray(5) + "\", node does not appear in an OutdoorAir:NodeList or as an OutdoorAir:Node."); ShowContinueError( @@ -1017,136 +836,136 @@ namespace VariableSpeedCoils { } if ((UtilityRoutines::SameString(AlphArray(6), "AirCooled")) || lAlphaBlanks(6)) { - VarSpeedCoil(DXCoilNum).CondenserType = AirCooled; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType = AirCooled; } else if (UtilityRoutines::SameString(AlphArray(6), "EvaporativelyCooled")) { - VarSpeedCoil(DXCoilNum).CondenserType = EvapCooled; - VarSpeedCoil(DXCoilNum).ReportEvapCondVars = true; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType = EvapCooled; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).ReportEvapCondVars = true; } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cAlphaFields(6) + "=\"" + AlphArray(6) + "\":"); ShowContinueError("...must be AirCooled or EvaporativelyCooled."); ErrorsFound = true; } - VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower = NumArray(7); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower = NumArray(7); - if (VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower < 0.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower < 0.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(7) + " cannot be < 0.0."); ShowContinueError("...entered value=[" + TrimSigDigits(NumArray(7), 2) + "]."); ErrorsFound = true; } // Set crankcase heater capacity - VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity = NumArray(8); - if (VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity = NumArray(8); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(8) + " cannot be < 0.0."); ShowContinueError("...entered value=[" + TrimSigDigits(NumArray(8), 2) + "]."); ErrorsFound = true; } // Set crankcase heater cutout temperature - VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater = NumArray(9); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater = NumArray(9); // Set crankcase heater cutout temperature - VarSpeedCoil(DXCoilNum).MinOATCompressor = NumArray(10); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MinOATCompressor = NumArray(10); // Get Water System tank connections // A7, \field Name of Water Storage Tank for Supply - VarSpeedCoil(DXCoilNum).EvapWaterSupplyName = AlphArray(7); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterSupplyName = AlphArray(7); if (lAlphaBlanks(7)) { - VarSpeedCoil(DXCoilNum).EvapWaterSupplyMode = WaterSupplyFromMains; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterSupplyMode = state.dataVariableSpeedCoils->WaterSupplyFromMains; } else { - VarSpeedCoil(DXCoilNum).EvapWaterSupplyMode = WaterSupplyFromTank; - SetupTankDemandComponent(state, VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterSupplyMode = state.dataVariableSpeedCoils->WaterSupplyFromTank; + SetupTankDemandComponent(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, CurrentModuleObject, - VarSpeedCoil(DXCoilNum).EvapWaterSupplyName, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterSupplyName, ErrorsFound, - VarSpeedCoil(DXCoilNum).EvapWaterSupTankID, - VarSpeedCoil(DXCoilNum).EvapWaterTankDemandARRID); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterSupTankID, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterTankDemandARRID); } // A8; \field Name of Water Storage Tank for Condensate Collection - VarSpeedCoil(DXCoilNum).CondensateCollectName = AlphArray(8); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateCollectName = AlphArray(8); if (lAlphaBlanks(8)) { - VarSpeedCoil(DXCoilNum).CondensateCollectMode = CondensateDiscarded; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateCollectMode = state.dataVariableSpeedCoils->CondensateDiscarded; } else { - VarSpeedCoil(DXCoilNum).CondensateCollectMode = CondensateToTank; - SetupTankSupplyComponent(state, VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateCollectMode = state.dataVariableSpeedCoils->CondensateToTank; + SetupTankSupplyComponent(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, CurrentModuleObject, - VarSpeedCoil(DXCoilNum).CondensateCollectName, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateCollectName, ErrorsFound, - VarSpeedCoil(DXCoilNum).CondensateTankID, - VarSpeedCoil(DXCoilNum).CondensateTankSupplyARRID); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateTankID, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateTankSupplyARRID); } // Basin heater power as a function of temperature must be greater than or equal to 0 - VarSpeedCoil(DXCoilNum).BasinHeaterPowerFTempDiff = NumArray(11); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPowerFTempDiff = NumArray(11); if (NumArray(11) < 0.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(11) + " must be >= 0.0."); ShowContinueError("...entered value=[" + TrimSigDigits(NumArray(11), 2) + "]."); ErrorsFound = true; } - VarSpeedCoil(DXCoilNum).BasinHeaterSetPointTemp = NumArray(12); - if (VarSpeedCoil(DXCoilNum).BasinHeaterPowerFTempDiff > 0.0) { - if (VarSpeedCoil(DXCoilNum).BasinHeaterSetPointTemp < 2.0) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", freeze possible"); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterSetPointTemp = NumArray(12); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPowerFTempDiff > 0.0) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterSetPointTemp < 2.0) { + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", freeze possible"); ShowContinueError("..." + cNumericFields(12) + " is < 2 {C}. Freezing could occur."); ShowContinueError("...entered value=[" + TrimSigDigits(NumArray(12), 2) + "]."); } } if (!lAlphaBlanks(9)) { - VarSpeedCoil(DXCoilNum).BasinHeaterSchedulePtr = GetScheduleIndex(state, AlphArray(9)); - if (VarSpeedCoil(DXCoilNum).BasinHeaterSchedulePtr == 0) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterSchedulePtr = GetScheduleIndex(state, AlphArray(9)); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterSchedulePtr == 0) { + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(14) + "=\"" + AlphArray(9) + "\"."); ShowContinueError("Basin heater will be available to operate throughout the simulation."); } } - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(13 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedSHR(I) = NumArray(14 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(15 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(16 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).EvapCondAirFlow(I) = NumArray(17 + (I - 1) * 6); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(13 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedSHR(I) = NumArray(14 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(15 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(16 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondAirFlow(I) = NumArray(17 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).EvapCondEffect(I) = NumArray(18 + (I - 1) * 6); - if (VarSpeedCoil(DXCoilNum).EvapCondEffect(I) < 0.0 || VarSpeedCoil(DXCoilNum).EvapCondEffect(I) > 1.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondEffect(I) = NumArray(18 + (I - 1) * 6); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondEffect(I) < 0.0 || state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondEffect(I) > 1.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(18 + (I - 1) * 6) + " cannot be < 0.0 or > 1.0."); ShowContinueError("...entered value=[" + TrimSigDigits(NumArray(18 + (I - 1) * 6), 2) + "]."); ErrorsFound = true; } AlfaFieldIncre = 10 + (I - 1) * 4; - VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), RatedInletWetBulbTemp, RatedAmbAirTemp); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), state.dataVariableSpeedCoils->RatedInletWetBulbTemp, state.dataVariableSpeedCoils->RatedAmbAirTemp); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1154,29 +973,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 11 + (I - 1) * 4; - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1184,29 +1003,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 12 + (I - 1) * 4; - VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), RatedInletWetBulbTemp, RatedAmbAirTemp); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), state.dataVariableSpeedCoils->RatedInletWetBulbTemp, state.dataVariableSpeedCoils->RatedAmbAirTemp); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1214,29 +1033,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 13 + (I - 1) * 4; - VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1244,22 +1063,22 @@ namespace VariableSpeedCoils { } } - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); - VarSpeedCoil(DXCoilNum).MSRatedEvapCondVolFlowPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).EvapCondAirFlow(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedEvapCondVolFlowPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondAirFlow(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); } // CurrentModuleObject = "Coil:Cooling:DX:VariableSpeed" SetupOutputVariable(state, "Cooling Coil Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).Energy, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "Cooling", @@ -1267,10 +1086,10 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Cooling Coil Total Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergyLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "ENERGYTRANSFER", "COOLINGCOILS", @@ -1278,34 +1097,34 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Cooling Coil Sensible Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergySensible, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Latent Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergyLatent, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Source Side Heat Transfer Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergySource, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); - VarSpeedCoil(DXCoilNum).RatedCapCoolSens = AutoSize; // always auto-sized, to be determined in the sizing calculation + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens = AutoSize; // always auto-sized, to be determined in the sizing calculation // BAN Sept 30 2103, CR9322, commented out, now it is redundant, it is reported from sizing routine // create predefined report entries - // PreDefTableEntry( pdchCoolCoilType, VarSpeedCoil( DXCoilNum ).Name, CurrentModuleObject ); - // PreDefTableEntry( pdchCoolCoilTotCap, VarSpeedCoil( DXCoilNum ).Name, VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal ); - // PreDefTableEntry( pdchCoolCoilSensCap, VarSpeedCoil( DXCoilNum ).Name, VarSpeedCoil( DXCoilNum ).RatedCapCoolSens ); - // PreDefTableEntry( pdchCoolCoilLatCap, VarSpeedCoil( DXCoilNum ).Name, VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal - VarSpeedCoil( - // DXCoilNum ).RatedCapCoolSens ); PreDefTableEntry( pdchCoolCoilSHR, VarSpeedCoil( DXCoilNum ).Name, VarSpeedCoil( DXCoilNum - // ).RatedCapCoolSens / VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal ); PreDefTableEntry( pdchCoolCoilNomEff, VarSpeedCoil( DXCoilNum - // ).Name, VarSpeedCoil( DXCoilNum ).MSRatedCOP( VarSpeedCoil( DXCoilNum ).NormSpedLevel ) ); + // PreDefTableEntry( pdchCoolCoilType, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, CurrentModuleObject ); + // PreDefTableEntry( pdchCoolCoilTotCap, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal ); + // PreDefTableEntry( pdchCoolCoilSensCap, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).RatedCapCoolSens ); + // PreDefTableEntry( pdchCoolCoilLatCap, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal - state.dataVariableSpeedCoils->VarSpeedCoil( + // DXCoilNum ).RatedCapCoolSens ); PreDefTableEntry( pdchCoolCoilSHR, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum + // ).RatedCapCoolSens / state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).RatedCapCoolTotal ); PreDefTableEntry( pdchCoolCoilNomEff, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum + // ).Name, state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).MSRatedCOP( state.dataVariableSpeedCoils->VarSpeedCoil( DXCoilNum ).NormSpedLevel ) ); } //-------------------------AIR SOURCE COOLING---END @@ -1332,99 +1151,99 @@ namespace VariableSpeedCoils { // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueCoilName(CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); - VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; - VarSpeedCoil(DXCoilNum).Name = AlphArray(1); - VarSpeedCoil(DXCoilNum).CoolHeatType = "HEATING"; - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = Coil_HeatingWaterToAirHPVSEquationFit; // fix coil type + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name = AlphArray(1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType = "HEATING"; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = Coil_HeatingWaterToAirHPVSEquationFit; // fix coil type - VarSpeedCoil(DXCoilNum).VarSpeedCoilType = DataHVACGlobals::cAllCoilTypes(VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum); - VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); - VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); - VarSpeedCoil(DXCoilNum).RatedCapHeat = NumArray(3); - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(4); - VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = NumArray(5); - VarSpeedCoil(DXCoilNum).CondenserType = WaterCooled; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType = DataHVACGlobals::cAllCoilTypes(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat = NumArray(3); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(4); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = NumArray(5); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType = WaterCooled; - VarSpeedCoil(DXCoilNum).WaterInletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum = GetOnlySingleNode(state, AlphArray(2), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Inlet, 2, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).WaterOutletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum = GetOnlySingleNode(state, AlphArray(3), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Outlet, 2, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, AlphArray(4), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, AlphArray(5), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent); TestCompSet(CurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Water Nodes"); TestCompSet(CurrentModuleObject, AlphArray(1), AlphArray(4), AlphArray(5), "Air Nodes"); - // If (VarSpeedCoil(DXCoilNum)%NumOfSpeeds .LT. 2) Then - if (VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + // If (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%NumOfSpeeds .LT. 2) Then + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(1) + " must be >= 1. entered number is " + TrimSigDigits(NumArray(1), 0)); ErrorsFound = true; } - if (VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) { - VarSpeedCoil(DXCoilNum).NormSpedLevel = VarSpeedCoil(DXCoilNum).NumOfSpeeds; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; } - if ((VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(2) + " must be valid speed level entered number is " + TrimSigDigits(NumArray(2), 0)); ErrorsFound = true; } // part load curve - VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(6)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(6)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { if (lAlphaBlanks(6)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(6) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(6) + "=\"" + AlphArray(6) + "\"."); } ErrorsFound = true; } else { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(6) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } } - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(6 + (I - 1) * 5); - VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(7 + (I - 1) * 5); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(8 + (I - 1) * 5); - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) = NumArray(9 + (I - 1) * 5); - VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(I) = NumArray(10 + (I - 1) * 5); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(6 + (I - 1) * 5); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(7 + (I - 1) * 5); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(8 + (I - 1) * 5); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) = NumArray(9 + (I - 1) * 5); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(I) = NumArray(10 + (I - 1) * 5); AlfaFieldIncre = 7 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), RatedInletAirTempHeat, RatedInletWaterTempHeat); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), state.dataVariableSpeedCoils->RatedInletAirTempHeat, state.dataVariableSpeedCoils->RatedInletWaterTempHeat); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1432,29 +1251,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 8 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1462,29 +1281,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 9 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(14 + (I - 1) * 6) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1492,29 +1311,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 10 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), RatedInletAirTempHeat, RatedInletWaterTempHeat); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), state.dataVariableSpeedCoils->RatedInletAirTempHeat, state.dataVariableSpeedCoils->RatedInletWaterTempHeat); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1522,29 +1341,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 11 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(16 + (I - 1) * 6) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1552,29 +1371,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 12 + (I - 1) * 7; - VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1583,29 +1402,29 @@ namespace VariableSpeedCoils { AlfaFieldIncre = 13 + (I - 1) * 7; // Read waste heat modifier curve name - VarSpeedCoil(DXCoilNum).MSWasteHeat(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSWasteHeat(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal types are BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(I), RatedInletAirTempHeat, RatedInletWaterTempHeat); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(I), state.dataVariableSpeedCoils->RatedInletAirTempHeat, state.dataVariableSpeedCoils->RatedInletWaterTempHeat); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1613,22 +1432,22 @@ namespace VariableSpeedCoils { } } - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); } // CurrentModuleObject = "Coil:Heating:WaterToAirHeatPump:VariableSpeedEquationFit" SetupOutputVariable(state, "Heating Coil Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).Energy, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "Heating", @@ -1636,10 +1455,10 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Heating Coil Heating Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergyLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "ENERGYTRANSFER", "HEATINGCOILS", @@ -1647,10 +1466,10 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Heating Coil Source Side Heat Transfer Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergySource, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "PLANTLOOPHEATINGDEMAND", "HEATINGCOILS", @@ -1658,10 +1477,10 @@ namespace VariableSpeedCoils { "System"); // create predefined report entries - PreDefTableEntry(pdchHeatCoilType, VarSpeedCoil(DXCoilNum).Name, CurrentModuleObject); - PreDefTableEntry(pdchHeatCoilNomCap, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).RatedCapHeat); + PreDefTableEntry(pdchHeatCoilType, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, CurrentModuleObject); + PreDefTableEntry(pdchHeatCoilNomCap, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat); PreDefTableEntry( - pdchHeatCoilNomEff, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).MSRatedCOP(VarSpeedCoil(DXCoilNum).NormSpedLevel)); + pdchHeatCoilNomEff, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel)); } //-------------------------AIR SOURCE, HEATING---BEGIN @@ -1687,172 +1506,172 @@ namespace VariableSpeedCoils { // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueCoilName(CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); - VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; - VarSpeedCoil(DXCoilNum).Name = AlphArray(1); - VarSpeedCoil(DXCoilNum).CoolHeatType = "HEATING"; - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = Coil_HeatingAirToAirVariableSpeed; - VarSpeedCoil(DXCoilNum).VarSpeedCoilType = DataHVACGlobals::cAllCoilTypes(Coil_HeatingAirToAirVariableSpeed); - VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); - VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); - VarSpeedCoil(DXCoilNum).RatedCapHeat = NumArray(3); - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(4); - - VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name = AlphArray(1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType = "HEATING"; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = Coil_HeatingAirToAirVariableSpeed; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType = DataHVACGlobals::cAllCoilTypes(Coil_HeatingAirToAirVariableSpeed); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat = NumArray(3); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(4); + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, AlphArray(2), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, AlphArray(3), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent); TestCompSet(CurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Air Nodes"); - if (VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(1) + " must be >= 1. entered number is " + TrimSigDigits(NumArray(1), 0)); ErrorsFound = true; } - if (VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) { - VarSpeedCoil(DXCoilNum).NormSpedLevel = VarSpeedCoil(DXCoilNum).NumOfSpeeds; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; } - if ((VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(2) + " must be valid speed level entered number is " + TrimSigDigits(NumArray(2), 0)); ErrorsFound = true; } // part load curve - VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(4)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(4)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { if (lAlphaBlanks(4)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(4) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(4) + "=\"" + AlphArray(4) + "\"."); } ErrorsFound = true; } else { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(4) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } } - VarSpeedCoil(DXCoilNum).DefrostEIRFT = GetCurveIndex(state, AlphArray(5)); // convert curve name to number + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostEIRFT = GetCurveIndex(state, AlphArray(5)); // convert curve name to number if (UtilityRoutines::SameString(AlphArray(6), "ReverseCycle")) { - if (VarSpeedCoil(DXCoilNum).DefrostEIRFT == 0) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostEIRFT == 0) { if (lAlphaBlanks(5)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(5) + " is blank."); ShowContinueError("...field is required because " + cAlphaFields(6) + " is \"ReverseCycle\"."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(5) + "=\"" + AlphArray(5) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).DefrostEIRFT, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostEIRFT, // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name } } - if (UtilityRoutines::SameString(AlphArray(6), "ReverseCycle")) VarSpeedCoil(DXCoilNum).DefrostStrategy = ReverseCycle; - if (UtilityRoutines::SameString(AlphArray(6), "Resistive")) VarSpeedCoil(DXCoilNum).DefrostStrategy = Resistive; - if (VarSpeedCoil(DXCoilNum).DefrostStrategy == 0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if (UtilityRoutines::SameString(AlphArray(6), "ReverseCycle")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy = state.dataVariableSpeedCoils->ReverseCycle; + if (UtilityRoutines::SameString(AlphArray(6), "Resistive")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy = state.dataVariableSpeedCoils->Resistive; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy == 0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...illegal " + cAlphaFields(6) + "=\"" + AlphArray(6) + "\"."); ShowContinueError("...valid values for this field are ReverseCycle or Resistive."); ErrorsFound = true; } - if (UtilityRoutines::SameString(AlphArray(7), "Timed")) VarSpeedCoil(DXCoilNum).DefrostControl = Timed; - if (UtilityRoutines::SameString(AlphArray(7), "OnDemand")) VarSpeedCoil(DXCoilNum).DefrostControl = OnDemand; - if (VarSpeedCoil(DXCoilNum).DefrostControl == 0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if (UtilityRoutines::SameString(AlphArray(7), "Timed")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl = state.dataVariableSpeedCoils->Timed; + if (UtilityRoutines::SameString(AlphArray(7), "OnDemand")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl = state.dataVariableSpeedCoils->OnDemand; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl == 0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...illegal " + cAlphaFields(7) + "=\"" + AlphArray(7) + "\"."); ShowContinueError("...valid values for this field are Timed or OnDemand."); ErrorsFound = true; } // Set minimum OAT for heat pump compressor operation - VarSpeedCoil(DXCoilNum).MinOATCompressor = NumArray(5); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MinOATCompressor = NumArray(5); // reserved for HSPF calculation - VarSpeedCoil(DXCoilNum).OATempCompressorOn = NumArray(6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OATempCompressorOn = NumArray(6); // Set maximum outdoor temp for defrost to occur - VarSpeedCoil(DXCoilNum).MaxOATDefrost = NumArray(7); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATDefrost = NumArray(7); // Set crankcase heater capacity - VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity = NumArray(8); - if (VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity = NumArray(8); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(9) + " cannot be < 0.0."); ShowContinueError("...entered value=[" + TrimSigDigits(NumArray(9), 2) + "]."); ErrorsFound = true; } // Set crankcase heater cutout temperature - VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater = NumArray(9); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater = NumArray(9); // Set defrost time period - VarSpeedCoil(DXCoilNum).DefrostTime = NumArray(10); - if (VarSpeedCoil(DXCoilNum).DefrostTime == 0.0 && VarSpeedCoil(DXCoilNum).DefrostControl == 1) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", "); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostTime = NumArray(10); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostTime == 0.0 && state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl == 1) { + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", "); ShowContinueError("..." + cNumericFields(5) + " = 0.0 for defrost control = TIMED."); } // Set defrost capacity (for resistive defrost) - VarSpeedCoil(DXCoilNum).DefrostCapacity = NumArray(11); - if (VarSpeedCoil(DXCoilNum).DefrostCapacity == 0.0 && VarSpeedCoil(DXCoilNum).DefrostStrategy == 2) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", "); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostCapacity = NumArray(11); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostCapacity == 0.0 && state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy == 2) { + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", "); ShowContinueError("..." + cNumericFields(6) + " = 0.0 for defrost strategy = RESISTIVE."); } - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(12 + (I - 1) * 3); - VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(13 + (I - 1) * 3); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(14 + (I - 1) * 3); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(12 + (I - 1) * 3); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(13 + (I - 1) * 3); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(14 + (I - 1) * 3); - if (VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) < 1.e-10) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid value"); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) < 1.e-10) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid value"); ShowContinueError("...too small " + cNumericFields(12 + (I - 1) * 3) + "=[" + - RoundSigDigits(VarSpeedCoil(DXCoilNum).MSRatedTotCap(I), 2) + "]."); + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I), 2) + "]."); ErrorsFound = true; } AlfaFieldIncre = 8 + (I - 1) * 4; - VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), RatedInletAirTempHeat, RatedAmbAirTempHeat); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), state.dataVariableSpeedCoils->RatedInletAirTempHeat, state.dataVariableSpeedCoils->RatedAmbAirTempHeat); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1860,29 +1679,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 9 + (I - 1) * 4; - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1890,29 +1709,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 10 + (I - 1) * 4; - VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), RatedInletAirTempHeat, RatedAmbAirTempHeat); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), state.dataVariableSpeedCoils->RatedInletAirTempHeat, state.dataVariableSpeedCoils->RatedAmbAirTempHeat); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1920,29 +1739,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 11 + (I - 1) * 4; - VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); ShowContinueError("...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); } @@ -1952,20 +1771,20 @@ namespace VariableSpeedCoils { if (ErrorsFound) continue; - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); } // CurrentModuleObject = "Coil:Heating:DX:Variablespeed " SetupOutputVariable(state, "Heating Coil Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).Energy, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "Heating", @@ -1973,10 +1792,10 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Heating Coil Heating Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergyLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "ENERGYTRANSFER", "HEATINGCOILS", @@ -1984,16 +1803,16 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Heating Coil Source Side Heat Transfer Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergySource, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); // create predefined report entries - PreDefTableEntry(pdchHeatCoilType, VarSpeedCoil(DXCoilNum).Name, CurrentModuleObject); - PreDefTableEntry(pdchHeatCoilNomCap, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).RatedCapHeat); + PreDefTableEntry(pdchHeatCoilType, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, CurrentModuleObject); + PreDefTableEntry(pdchHeatCoilNomCap, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat); PreDefTableEntry( - pdchHeatCoilNomEff, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).MSRatedCOP(VarSpeedCoil(DXCoilNum).NormSpedLevel)); + pdchHeatCoilNomEff, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel)); } //-------------------------AIR SOURCE HEATING---END @@ -2021,18 +1840,18 @@ namespace VariableSpeedCoils { // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueCoilName(CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); - VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; - VarSpeedCoil(DXCoilNum).CondenserType = WaterHeater; - VarSpeedCoil(DXCoilNum).CoolHeatType = "WATERHEATING"; - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = CoilDX_HeatPumpWaterHeaterVariableSpeed; - VarSpeedCoil(DXCoilNum).VarSpeedCoilType = cAllCoilTypes(CoilDX_HeatPumpWaterHeaterVariableSpeed); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).bIsDesuperheater = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType = WaterHeater; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType = "WATERHEATING"; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum = CoilDX_HeatPumpWaterHeaterVariableSpeed; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType = cAllCoilTypes(CoilDX_HeatPumpWaterHeaterVariableSpeed); - VarSpeedCoil(DXCoilNum).Name = AlphArray(1); - VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); - VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name = AlphArray(1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds = int(NumArray(1)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); - if (VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(1) + " must be >= 1." " entered number is " + @@ -2040,12 +1859,12 @@ namespace VariableSpeedCoils { ErrorsFound = true; } - if (VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) { - VarSpeedCoil(DXCoilNum).NormSpedLevel = VarSpeedCoil(DXCoilNum).NumOfSpeeds; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; } - if ((VarSpeedCoil(DXCoilNum).NormSpedLevel > VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(2) + " must be valid speed level" " entered number is " + @@ -2053,31 +1872,31 @@ namespace VariableSpeedCoils { ErrorsFound = true; } - VarSpeedCoil(DXCoilNum).RatedCapWH = NumArray(3); - if (VarSpeedCoil(DXCoilNum).RatedCapWH <= 0.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH = NumArray(3); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH <= 0.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(3) + " must be > 0.0, entered value=[" + TrimSigDigits(NumArray(3), 2) + "]."); ErrorsFound = true; } - VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp = NumArray(4); - VarSpeedCoil(DXCoilNum).WHRatedInletWBTemp = NumArray(5); - VarSpeedCoil(DXCoilNum).WHRatedInletWaterTemp = NumArray(6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp = NumArray(4); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletWBTemp = NumArray(5); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletWaterTemp = NumArray(6); - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(7); - VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = NumArray(8); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(7); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = NumArray(8); - if (VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate != AutoCalculate) { - if (VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate <= 0.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate != AutoCalculate) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate <= 0.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(7) + " must be > 0.0. entered value=[" + TrimSigDigits(NumArray(7), 3) + "]."); ErrorsFound = true; } } - if (VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate != AutoCalculate) { - if (VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate <= 0.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate != AutoCalculate) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate <= 0.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(8) + " must be > 0.0 entered value=[" + TrimSigDigits(NumArray(8), 3) + "]."); ErrorsFound = true; } @@ -2086,11 +1905,11 @@ namespace VariableSpeedCoils { if (UtilityRoutines::SameString(AlphArray(2), "Yes") || UtilityRoutines::SameString(AlphArray(2), "No")) { // initialized to TRUE on allocate if (UtilityRoutines::SameString(AlphArray(2), "No")) - VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP = false; else - VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP = true; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP = true; } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(",,,invalid choice for " + cAlphaFields(2) + ". Entered choice = " + AlphArray(2)); ShowContinueError("Valid choices are Yes or No."); ErrorsFound = true; @@ -2099,11 +1918,11 @@ namespace VariableSpeedCoils { if (UtilityRoutines::SameString(AlphArray(3), "Yes") || UtilityRoutines::SameString(AlphArray(3), "No")) { // initialized to FALSE on allocate if (UtilityRoutines::SameString(AlphArray(3), "Yes")) - VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP = true; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP = true; else - VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP = false; } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(",,,invalid choice for " + cAlphaFields(3) + ". Entered choice = " + AlphArray(3)); ShowContinueError("Valid choices are Yes or No."); ErrorsFound = true; @@ -2112,98 +1931,98 @@ namespace VariableSpeedCoils { if (UtilityRoutines::SameString(AlphArray(4), "Yes") || UtilityRoutines::SameString(AlphArray(4), "No")) { // initialized to FALSE on allocate if (UtilityRoutines::SameString(AlphArray(4), "Yes")) - VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity = true; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity = true; else - VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity = false; } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(",,,invalid choice for " + cAlphaFields(4) + ". Entered choice = " + AlphArray(4)); ShowContinueError("Valid choices are Yes or No."); ErrorsFound = true; } - VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater = NumArray(9); - if (VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater <= 0.0 || VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater > 1.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater = NumArray(9); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater <= 0.0 || state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater > 1.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(10) + " must be >= 0 and <= 1. entered value=[" + TrimSigDigits(NumArray(9), 3) + "]."); ErrorsFound = true; } - if (!VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { - VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater = 0.0; + if (!state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater = 0.0; } // Air nodes - VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum = GetOnlySingleNode(state, AlphArray(5), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirOutletNodeNum = GetOnlySingleNode(state, AlphArray(6), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent); TestCompSet(CurrentModuleObject, AlphArray(1), AlphArray(5), AlphArray(6), "Air Nodes"); // Check if the air inlet node is OA node, to justify whether the coil is placed in zone or not - VarSpeedCoil(DXCoilNum).IsDXCoilInZone = !CheckOutAirNodeNumber(state, VarSpeedCoil(DXCoilNum).AirInletNodeNum); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).IsDXCoilInZone = !CheckOutAirNodeNumber(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum); // Water nodes - VarSpeedCoil(DXCoilNum).WaterInletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum = GetOnlySingleNode(state, AlphArray(7), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Inlet, 2, ObjectIsNotParent); - VarSpeedCoil(DXCoilNum).WaterOutletNodeNum = GetOnlySingleNode(state, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum = GetOnlySingleNode(state, AlphArray(8), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Outlet, 2, ObjectIsNotParent); TestCompSet(CurrentModuleObject, AlphArray(1), AlphArray(7), AlphArray(8), "Water Nodes"); - VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity = NumArray(10); - if (VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity = NumArray(10); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(10) + " must be >= 0.0 entered value=[" + TrimSigDigits(NumArray(10), 1) + "]."); ErrorsFound = true; } - VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater = NumArray(11); - if (VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater < 0.0) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater = NumArray(11); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater < 0.0) { + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(11) + " must be >= 0 {C}. entered value=[" + TrimSigDigits(NumArray(11), 1) + "]."); ErrorsFound = true; } if (UtilityRoutines::SameString(AlphArray(9), "DryBulbTemperature")) { - VarSpeedCoil(DXCoilNum).InletAirTemperatureType = DryBulbIndicator; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirTemperatureType = DryBulbIndicator; } else if (UtilityRoutines::SameString(AlphArray(9), "WetBulbTemperature")) { - VarSpeedCoil(DXCoilNum).InletAirTemperatureType = WetBulbIndicator; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirTemperatureType = WetBulbIndicator; } else { // wrong temperature type selection - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cAlphaFields(9) + " must be DryBulbTemperature or WetBulbTemperature."); ShowContinueError("...entered value=\"" + AlphArray(9) + "\"."); ErrorsFound = true; } // set rated inlet air temperature for curve object verification - if (VarSpeedCoil(DXCoilNum).InletAirTemperatureType == WetBulbIndicator) { - WHInletAirTemp = VarSpeedCoil(DXCoilNum).WHRatedInletWBTemp; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirTemperatureType == WetBulbIndicator) { + WHInletAirTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletWBTemp; } else { - WHInletAirTemp = VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp; + WHInletAirTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp; } // set rated water temperature for curve object verification - WHInletWaterTemp = VarSpeedCoil(DXCoilNum).WHRatedInletWaterTemp; + WHInletWaterTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletWaterTemp; // part load curve - VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(10)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR = GetCurveIndex(state, AlphArray(10)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR == 0) { if (lAlphaBlanks(10)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(10) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(10) + "=\"" + AlphArray(10) + "\"."); } ErrorsFound = true; } else { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR, 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(10) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); @@ -2211,38 +2030,38 @@ namespace VariableSpeedCoils { } } - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(12 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(13 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedSHR(I) = NumArray(14 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(15 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) = NumArray(16 + (I - 1) * 6); - VarSpeedCoil(DXCoilNum).MSWHPumpPower(I) = NumArray(17 + (I - 1) * 6); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) = NumArray(12 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(I) = NumArray(13 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedSHR(I) = NumArray(14 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(15 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) = NumArray(16 + (I - 1) * 6); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(I) = NumArray(17 + (I - 1) * 6); AlfaFieldIncre = 11 + (I - 1) * 6; - VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), WHInletAirTemp, WHInletWaterTemp); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(I), WHInletAirTemp, WHInletWaterTemp); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); @@ -2252,29 +2071,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 12 + (I - 1) * 6; - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); @@ -2284,29 +2103,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 13 + (I - 1) * 6; - VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); @@ -2316,29 +2135,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 14 + (I - 1) * 6; - VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), // Curve index {2}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), WHInletAirTemp, WHInletWaterTemp); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(I), WHInletAirTemp, WHInletWaterTemp); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); @@ -2348,29 +2167,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 15 + (I - 1) * 6; - VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); @@ -2380,29 +2199,29 @@ namespace VariableSpeedCoils { } AlfaFieldIncre = 16 + (I - 1) * 6; - VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number - if (VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) == 0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) = GetCurveIndex(state, AlphArray(AlfaFieldIncre)); // convert curve name to number + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I) == 0) { if (lAlphaBlanks(AlfaFieldIncre)) { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", missing"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", missing"); ShowContinueError("...required " + cAlphaFields(AlfaFieldIncre) + " is blank."); } else { - ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("...not found " + cAlphaFields(AlfaFieldIncre) + "=\"" + AlphArray(AlfaFieldIncre) + "\"."); } ErrorsFound = true; } else { // Verify Curve Object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), // Curve index {1}, // Valid dimensions RoutineName, // Routine name CurrentModuleObject, // Object Type - VarSpeedCoil(DXCoilNum).Name, // Object Name + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name cAlphaFields(AlfaFieldIncre)); // Field Name if (!ErrorsFound) { - CurveVal = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), 1.0); + CurveVal = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(I), 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + VarSpeedCoil(DXCoilNum).Name + "\", curve values"); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError("..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); @@ -2413,24 +2232,24 @@ namespace VariableSpeedCoils { } // get scale values - for (I = 1; I <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { - VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); - VarSpeedCoil(DXCoilNum).MSWHPumpPowerPerRatedTotCap(I) = - VarSpeedCoil(DXCoilNum).MSWHPumpPower(I) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + for (I = 1; I <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++I) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPowerPerRatedTotCap(I) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(I) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I); } // CurrentModuleObject = "Coil:Waterheating:Airtowaterheatpump:Variablespeed" SetupOutputVariable(state, "Cooling Coil Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).Energy, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "Heating", @@ -2438,35 +2257,35 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Cooling Coil Sensible Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergySensible, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Latent Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergyLatent, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Water Side Heat Transfer Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergySource, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "PLANTLOOPHEATINGDEMAND", "HEATINGCOILS", _, "System"); - if (VarSpeedCoil(DXCoilNum).IsDXCoilInZone) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).IsDXCoilInZone) { SetupOutputVariable(state, "Cooling Coil Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergyLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "ENERGYTRANSFER", "COOLINGCOILS", @@ -2475,13 +2294,13 @@ namespace VariableSpeedCoils { } else { SetupOutputVariable(state, "Cooling Coil Cooling Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EnergyLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal, "System", "Summed", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); } - VarSpeedCoil(DXCoilNum).RatedCapCoolSens = AutoSize; // always auto-sized, to be determined in the sizing calculation + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens = AutoSize; // always auto-sized, to be determined in the sizing calculation } //---------------------------VARIABLE-SPEED AIR SOURCE HPWH END -------------- @@ -2496,112 +2315,112 @@ namespace VariableSpeedCoils { ShowFatalError(RoutineName + "Errors found getting input. Program terminates."); } - for (DXCoilNum = 1; DXCoilNum <= NumVarSpeedCoils; ++DXCoilNum) { - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) || - (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed)) { + for (DXCoilNum = 1; DXCoilNum <= state.dataVariableSpeedCoils->NumVarSpeedCoils; ++DXCoilNum) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) || + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed)) { // Setup Report variables for the Heat Pump // cooling and heating coils separately - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { // air source cooling coils SetupOutputVariable(state, "Cooling Coil Air Mass Flow Rate", OutputProcessor::Unit::kg_s, - VarSpeedCoil(DXCoilNum).AirMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Inlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).InletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Inlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).InletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Latent Cooling Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QLatent, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Outlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).OutletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Outlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).OutletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Sensible Cooling Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QSensible, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Total Cooling Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Part Load Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).PartLoadRatio, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).Power, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Runtime Fraction", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).RunFrac, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Source Side Heat Transfer Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QSource, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Upper Speed Level", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedNumReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedNumReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Neighboring Speed Levels Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedRatioReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedRatioReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); - if (VarSpeedCoil(DXCoilNum).CondensateCollectMode == CondensateToTank) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateCollectMode == state.dataVariableSpeedCoils->CondensateToTank) { SetupOutputVariable(state, "Cooling Coil Condensate Volume Flow Rate", OutputProcessor::Unit::m3_s, - VarSpeedCoil(DXCoilNum).CondensateVdot, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateVdot, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Condensate Volume", OutputProcessor::Unit::m3, - VarSpeedCoil(DXCoilNum).CondensateVol, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateVol, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "OnSiteWater", "Condensate", @@ -2609,19 +2428,19 @@ namespace VariableSpeedCoils { "System"); } - if (VarSpeedCoil(DXCoilNum).ReportEvapCondVars) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).ReportEvapCondVars) { SetupOutputVariable(state, "Cooling Coil Condenser Inlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).CondInletTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondInletTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Evaporative Condenser Water Volume", OutputProcessor::Unit::m3, - VarSpeedCoil(DXCoilNum).EvapWaterConsump, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterConsump, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Water", "Cooling", @@ -2629,10 +2448,10 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Cooling Coil Evaporative Condenser Mains Water Volume", OutputProcessor::Unit::m3, - VarSpeedCoil(DXCoilNum).EvapWaterConsump, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterConsump, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "MainsWater", "Cooling", @@ -2640,34 +2459,34 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Cooling Coil Evaporative Condenser Pump Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).EvapCondPumpElecPower, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecPower, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Evaporative Condenser Pump Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "COOLING", _, "System"); - if (VarSpeedCoil(DXCoilNum).BasinHeaterPowerFTempDiff > 0.0) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPowerFTempDiff > 0.0) { SetupOutputVariable(state, "Cooling Coil Basin Heater Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).BasinHeaterPower, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPower, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Basin Heater Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).BasinHeaterConsumption, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterConsumption, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "COOLING", @@ -2678,16 +2497,16 @@ namespace VariableSpeedCoils { SetupOutputVariable(state, "Cooling Coil Crankcase Heater Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Crankcase Heater Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "COOLING", @@ -2697,96 +2516,96 @@ namespace VariableSpeedCoils { // air source heating coils SetupOutputVariable(state, "Heating Coil Air Mass Flow Rate", OutputProcessor::Unit::kg_s, - VarSpeedCoil(DXCoilNum).AirMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Air Inlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).InletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Air Inlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).InletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Air Outlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).OutletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Air Outlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).OutletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Sensible Heating Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QSensible, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Heating Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Part Load Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).PartLoadRatio, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).Power, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Runtime Fraction", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).RunFrac, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Source Side Heat Transfer Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QSource, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Upper Speed Level", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedNumReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedNumReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Neighboring Speed Levels Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedRatioReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedRatioReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Defrost Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).DefrostPower, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostPower, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Defrost Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).DefrostConsumption, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostConsumption, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "HEATING", @@ -2794,16 +2613,16 @@ namespace VariableSpeedCoils { "System"); SetupOutputVariable(state, "Heating Coil Crankcase Heater Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Crankcase Heater Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "HEATING", @@ -2812,333 +2631,333 @@ namespace VariableSpeedCoils { } } else { - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit) { // fix coil type + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit) { // fix coil type // cooling WAHP coil // Setup Report variables for water source Heat Pump SetupOutputVariable(state, "Cooling Coil Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).Power, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Total Cooling Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Sensible Cooling Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QSensible, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Latent Cooling Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QLatent, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Source Side Heat Transfer Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QSource, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Part Load Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).PartLoadRatio, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Runtime Fraction", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).RunFrac, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Mass Flow Rate", OutputProcessor::Unit::kg_s, - VarSpeedCoil(DXCoilNum).AirMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Inlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).InletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Inlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).InletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Outlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).OutletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Outlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).OutletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Source Side Mass Flow Rate", OutputProcessor::Unit::kg_s, - VarSpeedCoil(DXCoilNum).WaterMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Source Side Inlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).InletWaterTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Source Side Outlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).OutletWaterTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Upper Speed Level", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedNumReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedNumReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Neighboring Speed Levels Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedRatioReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedRatioReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Recoverable Heat Transfer Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QWasteHeat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QWasteHeat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); - } else if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit) { // fix coil type + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit) { // fix coil type // heating WAHP coil // Setup Report variables for water source Heat Pump SetupOutputVariable(state, "Heating Coil Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).Power, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Heating Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Sensible Heating Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QSensible, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Source Side Heat Transfer Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QSource, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Part Load Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).PartLoadRatio, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Runtime Fraction", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).RunFrac, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Air Mass Flow Rate", OutputProcessor::Unit::kg_s, - VarSpeedCoil(DXCoilNum).AirMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Air Inlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).InletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Air Inlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).InletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Air Outlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).OutletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Air Outlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).OutletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Source Side Mass Flow Rate", OutputProcessor::Unit::kg_s, - VarSpeedCoil(DXCoilNum).WaterMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Source Side Inlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).InletWaterTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Source Side Outlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).OutletWaterTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Upper Speed Level", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedNumReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedNumReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Neighboring Speed Levels Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedRatioReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedRatioReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Heating Coil Recoverable Heat Transfer Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QWasteHeat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QWasteHeat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); - } else if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed) { // air source water heating coil SetupOutputVariable(state, "Cooling Coil Water Heating Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).Power, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Total Cooling Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QLoadTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Sensible Cooling Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QSensible, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Latent Cooling Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).QLatent, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Total Water Heating Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).TotalHeatingEnergyRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).TotalHeatingEnergyRate, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Part Load Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).PartLoadRatio, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Runtime Fraction", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).RunFrac, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Mass Flow Rate", OutputProcessor::Unit::kg_s, - VarSpeedCoil(DXCoilNum).AirMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Inlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).InletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Inlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).InletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Outlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).OutletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Air Outlet Humidity Ratio", OutputProcessor::Unit::kgWater_kgDryAir, - VarSpeedCoil(DXCoilNum).OutletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Water Mass Flow Rate", OutputProcessor::Unit::kg_s, - VarSpeedCoil(DXCoilNum).WaterMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Water Inlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).InletWaterTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Water Outlet Temperature", OutputProcessor::Unit::C, - VarSpeedCoil(DXCoilNum).OutletWaterTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Crankcase Heater Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Crankcase Heater Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "HEATING", @@ -3147,29 +2966,29 @@ namespace VariableSpeedCoils { SetupOutputVariable(state, "Cooling Coil Upper Speed Level", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedNumReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedNumReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Neighboring Speed Levels Ratio", OutputProcessor::Unit::None, - VarSpeedCoil(DXCoilNum).SpeedRatioReport, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SpeedRatioReport, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Water Heating Pump Electricity Rate", OutputProcessor::Unit::W, - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower, "System", "Average", - VarSpeedCoil(DXCoilNum).Name); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); SetupOutputVariable(state, "Cooling Coil Water Heating Pump Electricity Energy", OutputProcessor::Unit::J, - VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption, "System", "Sum", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, _, "Electricity", "HEATING", @@ -3258,22 +3077,22 @@ namespace VariableSpeedCoils { // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("InitVarSpeedCoil"); - if (MyOneTimeFlag) { + if (state.dataVariableSpeedCoils->MyOneTimeFlag) { // initialize the environment and sizing flags - MySizeFlag.allocate(NumVarSpeedCoils); - MyEnvrnFlag.allocate(NumVarSpeedCoils); - MyPlantScanFlag.allocate(NumVarSpeedCoils); + MySizeFlag.allocate(state.dataVariableSpeedCoils->NumVarSpeedCoils); + MyEnvrnFlag.allocate(state.dataVariableSpeedCoils->NumVarSpeedCoils); + MyPlantScanFlag.allocate(state.dataVariableSpeedCoils->NumVarSpeedCoils); MySizeFlag = true; MyEnvrnFlag = true; MyPlantScanFlag = true; - MyOneTimeFlag = false; + state.dataVariableSpeedCoils->MyOneTimeFlag = false; } DXCT = 1; // hard-code to non-DOAS sizing routine for cfm/ton until .ISHundredPercentDOASDXCoil member from DXcoils.cc is added to // VarSpeedCoil object // variable-speed heat pump water heating, begin - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed && MySizeFlag(DXCoilNum)) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed && MySizeFlag(DXCoilNum)) { SizeVarSpeedCoil(state, DXCoilNum); @@ -3284,24 +3103,24 @@ namespace VariableSpeedCoils { // variable-speed heat pump water heating, end // water source - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) || - (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit)) { // fix coil type + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) || + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit)) { // fix coil type if (MyPlantScanFlag(DXCoilNum) && allocated(PlantLoop)) { // switch from coil type numbers in DataHVACGlobals, to coil type numbers in plant. int plantTypeOfNum(0); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) { plantTypeOfNum = DataPlant::TypeOf_CoilVSWAHPCoolingEquationFit; - } else if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) { + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) { plantTypeOfNum = DataPlant::TypeOf_CoilVSWAHPHeatingEquationFit; } errFlag = false; ScanPlantLoopsForObject(state, - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, plantTypeOfNum, - VarSpeedCoil(DXCoilNum).LoopNum, - VarSpeedCoil(DXCoilNum).LoopSide, - VarSpeedCoil(DXCoilNum).BranchNum, - VarSpeedCoil(DXCoilNum).CompNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopSide, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BranchNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompNum, errFlag, _, _, @@ -3324,17 +3143,17 @@ namespace VariableSpeedCoils { MySizeFlag(DXCoilNum) = false; // Multispeed Cooling - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) || - (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed)) { - for (Mode = 1; Mode <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) || + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed)) { + for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { // Check for zero capacity or zero max flow rate - if (VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) <= 0.0) { - ShowSevereError("Sizing: " + VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + VarSpeedCoil(DXCoilNum).Name + + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) <= 0.0) { + ShowSevereError("Sizing: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + " has zero rated total capacity at speed " + TrimSigDigits(Mode)); ErrorsFound = true; } - if (VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) <= 0.0) { - ShowSevereError("Sizing: " + VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + VarSpeedCoil(DXCoilNum).Name + + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) <= 0.0) { + ShowSevereError("Sizing: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + " has zero rated air flow rate at speed " + TrimSigDigits(Mode)); ErrorsFound = true; } @@ -3342,12 +3161,12 @@ namespace VariableSpeedCoils { ShowFatalError("Preceding condition causes termination."); } // Check for valid range of (Rated Air Volume Flow Rate / Rated Total Capacity) - RatedVolFlowPerRatedTotCap = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode); + RatedVolFlowPerRatedTotCap = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode); // note: variable-speed HP can exceed the flow rate restrictions at low speed levels // IF (((MinRatedAirVolFlowPerRatedTotCap - RatedVolFlowPerRatedTotCap) > SmallDifferenceTest).OR. & // ((RatedVolFlowPerRatedTotCap - MaxRatedAirVolFlowPerRatedTotCap) > SmallDifferenceTest)) THEN - // CALL ShowSevereError('Sizing: '//TRIM(VarSpeedCoil(DXCoilNum)%VarSpeedCoilType) & - // // ' "'//TRIM(VarSpeedCoil(DXCoilNum)%Name)// & + // CALL ShowSevereError('Sizing: '//TRIM(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%VarSpeedCoilType) & + // // ' "'//TRIM(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%Name)// & // '": Rated air volume flow rate per watt of rated total '// & // 'cooling capacity is out of range at speed '//TRIM(TrimSigDigits(Mode))) // CALL ShowContinueError & @@ -3356,26 +3175,26 @@ namespace VariableSpeedCoils { // Max Rated Vol Flow Per Watt=['// & // TRIM(TrimSigDigits(MaxRatedAirVolFlowPerRatedTotCap,3))//']. See Input-Output Reference Manual for valid range.') // END IF - // VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(Mode)* & + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(Mode) = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(Mode)* & // PsyRhoAirFnPbTdbW(OutBaroPress,RatedInletAirTemp,RatedInletAirHumRat,RoutineName) // ! get high speed rated coil bypass factor - // VarSpeedCoil(DXCoilNum)%MSRatedCBF(Mode) = CalcCBF(VarSpeedCoil(DXCoilNum)%VarSpeedCoilType, & - // VarSpeedCoil(DXCoilNum)%Name,& + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%MSRatedCBF(Mode) = CalcCBF(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%VarSpeedCoilType, & + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%Name,& // RatedInletAirTemp,RatedInletAirHumRat,VarSpeedCoil(DXCoilNum)%MSRatedTotCap(Mode),& - // VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(Mode), & - // VarSpeedCoil(DXCoilNum)%MSRatedSHR(Mode)) + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(Mode), & + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%MSRatedSHR(Mode)) } // call coil model with everthing set at rating point - VarSpeedCoil(DXCoilNum).InletAirDBTemp = RatedInletAirTemp; - VarSpeedCoil(DXCoilNum).InletAirHumRat = - Psychrometrics::PsyWFnTdbTwbPb(RatedInletAirTemp, RatedInletWetBulbTemp, DataEnvironment::StdPressureSeaLevel); - VarSpeedCoil(DXCoilNum).InletAirEnthalpy = Psychrometrics::PsyHFnTdbW(RatedInletAirTemp, VarSpeedCoil(DXCoilNum).InletAirHumRat); - VarSpeedCoil(DXCoilNum).InletAirPressure = DataEnvironment::StdPressureSeaLevel; - - VarSpeedCoil(DXCoilNum).AirMassFlowRate = - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdPressureSeaLevel, - RatedInletAirTemp, - VarSpeedCoil(DXCoilNum).InletAirHumRat); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp = state.dataVariableSpeedCoils->RatedInletAirTemp; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat = + Psychrometrics::PsyWFnTdbTwbPb(state.dataVariableSpeedCoils->RatedInletAirTemp, state.dataVariableSpeedCoils->RatedInletWetBulbTemp, DataEnvironment::StdPressureSeaLevel); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirEnthalpy = Psychrometrics::PsyHFnTdbW(state.dataVariableSpeedCoils->RatedInletAirTemp, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirPressure = DataEnvironment::StdPressureSeaLevel; + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdPressureSeaLevel, + state.dataVariableSpeedCoils->RatedInletAirTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat); // store environment data fill back in after rating point calc is over Real64 holdOutDryBulbTemp = DataEnvironment::OutDryBulbTemp; Real64 holdOutHumRat = DataEnvironment::OutHumRat; @@ -3383,57 +3202,57 @@ namespace VariableSpeedCoils { Real64 holdOutBaroPress = DataEnvironment::OutBaroPress; Real64 ratedOutdoorAirWetBulb = 23.9; // from I/O ref. more precise value? - DataEnvironment::OutDryBulbTemp = RatedAmbAirTemp; + DataEnvironment::OutDryBulbTemp = state.dataVariableSpeedCoils->RatedAmbAirTemp; DataEnvironment::OutWetBulbTemp = ratedOutdoorAirWetBulb; DataEnvironment::OutBaroPress = DataEnvironment::StdPressureSeaLevel; // assume rating is for sea level. DataEnvironment::OutHumRat = - Psychrometrics::PsyWFnTdbTwbPb(RatedAmbAirTemp, ratedOutdoorAirWetBulb, DataEnvironment::StdPressureSeaLevel, RoutineName); - if (VarSpeedCoil(DXCoilNum).CondenserInletNodeNum > 0) { - Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Temp = RatedAmbAirTemp; - Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).HumRat = DataEnvironment::OutHumRat; - Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Press = DataEnvironment::StdPressureSeaLevel; - Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).OutAirWetBulb = ratedOutdoorAirWetBulb; + Psychrometrics::PsyWFnTdbTwbPb(state.dataVariableSpeedCoils->RatedAmbAirTemp, ratedOutdoorAirWetBulb, DataEnvironment::StdPressureSeaLevel, RoutineName); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum > 0) { + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Temp = state.dataVariableSpeedCoils->RatedAmbAirTemp; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).HumRat = DataEnvironment::OutHumRat; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Press = DataEnvironment::StdPressureSeaLevel; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).OutAirWetBulb = ratedOutdoorAirWetBulb; } - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) { // need to set water info for WSHP - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).InletWaterTemp = RatedInletWaterTemp; // 85 F cooling mode - Real64 CpSource = GetSpecificHeatGlycol(state, PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidName, - SourceSideInletTemp, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp = state.dataVariableSpeedCoils->RatedInletWaterTemp; // 85 F cooling mode + Real64 CpSource = GetSpecificHeatGlycol(state, PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataVariableSpeedCoils->SourceSideInletTemp, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineName); - VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = VarSpeedCoil(DXCoilNum).InletWaterTemp * CpSource; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp * CpSource; } // calculate coil model at rating point Real64 runtimeFrac(1.0); - VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate = VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate = - VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).DesignWaterVolFlowRate = VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); - CalcVarSpeedCoilCooling(state, DXCoilNum, 2.0, runtimeFrac, SensLoad, LatentLoad, 1, 1.0, 1.0, 1.0, VarSpeedCoil(DXCoilNum).NumOfSpeeds); + CalcVarSpeedCoilCooling(state, DXCoilNum, 2.0, runtimeFrac, SensLoad, LatentLoad, 1, 1.0, 1.0, 1.0, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); // coil outlets Real64 RatedOutletWetBulb(0.0); - RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb(VarSpeedCoil(DXCoilNum).OutletAirDBTemp, - VarSpeedCoil(DXCoilNum).OutletAirHumRat, + RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, DataEnvironment::StdPressureSeaLevel, RoutineName); - coilSelectionReportObj->setRatedCoilConditions(VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).QLoadTotal, // this is the report variable - VarSpeedCoil(DXCoilNum).QSensible, // this is the report variable - VarSpeedCoil(DXCoilNum).AirMassFlowRate, - VarSpeedCoil(DXCoilNum).InletAirDBTemp, - VarSpeedCoil(DXCoilNum).InletAirHumRat, - RatedInletWetBulbTemp, - VarSpeedCoil(DXCoilNum).OutletAirDBTemp, - VarSpeedCoil(DXCoilNum).OutletAirHumRat, + coilSelectionReportObj->setRatedCoilConditions(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal, // this is the report variable + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible, // this is the report variable + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat, + state.dataVariableSpeedCoils->RatedInletWetBulbTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, RatedOutletWetBulb, - RatedAmbAirTemp, + state.dataVariableSpeedCoils->RatedAmbAirTemp, ratedOutdoorAirWetBulb, - VarSpeedCoil(DXCoilNum).MSRatedCBF(VarSpeedCoil(DXCoilNum).NumOfSpeeds), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds), -999.0); // coil effectiveness not define for DX // now replace the outdoor air conditions set above for one time rating point calc @@ -3444,21 +3263,21 @@ namespace VariableSpeedCoils { } // Multispeed Heating - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) || - (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) || + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed)) { RatedHeatPumpIndoorAirTemp = 21.11; // 21.11C or 70F RatedHeatPumpIndoorHumRat = 0.00881; // Humidity ratio corresponding to 70F dry bulb/60F wet bulb - for (Mode = 1; Mode <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { + for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { - VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * PsyRhoAirFnPbTdbW(OutBaroPress, RatedHeatPumpIndoorAirTemp, RatedHeatPumpIndoorHumRat, RoutineName); // Check for valid range of (Rated Air Volume Flow Rate / Rated Total Capacity) - RatedVolFlowPerRatedTotCap = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode); + RatedVolFlowPerRatedTotCap = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode); // note: variable-speed HP can exceed the flow rate restrictions at low speed levels // IF (((MinRatedAirVolFlowPerRatedTotCap - RatedVolFlowPerRatedTotCap) > SmallDifferenceTest).OR. & // ((RatedVolFlowperRatedTotCap - MaxRatedAirVolFlowPerRatedTotCap) > SmallDifferenceTest)) THEN - // CALL ShowSevereError('Coil:Heating:DX:MultiSpeed '//TRIM(VarSpeedCoil(DXCoilNum)%Name)// & + // CALL ShowSevereError('Coil:Heating:DX:MultiSpeed '//TRIM(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%Name)// & // ': Rated air volume flow rate per watt of rated total '// & // 'heating capacity is out of range at speed '//TRIM(TrimSigDigits(Mode))) // CALL ShowContinueError('Min Rated Vol Flow Per Watt=['//TRIM(TrimSigDigits & @@ -3470,74 +3289,74 @@ namespace VariableSpeedCoils { // END IF } // call coil model with everthing set at rating point - VarSpeedCoil(DXCoilNum).InletAirDBTemp = RatedInletAirTempHeat; - VarSpeedCoil(DXCoilNum).InletAirHumRat = - Psychrometrics::PsyWFnTdbTwbPb(RatedInletAirTempHeat, RatedInletWetBulbTemp, DataEnvironment::StdPressureSeaLevel); - VarSpeedCoil(DXCoilNum).InletAirEnthalpy = Psychrometrics::PsyHFnTdbW(RatedInletAirTempHeat, VarSpeedCoil(DXCoilNum).InletAirHumRat); - VarSpeedCoil(DXCoilNum).InletAirPressure = DataEnvironment::StdPressureSeaLevel; - - VarSpeedCoil(DXCoilNum).AirMassFlowRate = - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdPressureSeaLevel, - RatedInletAirTempHeat, - VarSpeedCoil(DXCoilNum).InletAirHumRat); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp = state.dataVariableSpeedCoils->RatedInletAirTempHeat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat = + Psychrometrics::PsyWFnTdbTwbPb(state.dataVariableSpeedCoils->RatedInletAirTempHeat, state.dataVariableSpeedCoils->RatedInletWetBulbTemp, DataEnvironment::StdPressureSeaLevel); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirEnthalpy = Psychrometrics::PsyHFnTdbW(state.dataVariableSpeedCoils->RatedInletAirTempHeat, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirPressure = DataEnvironment::StdPressureSeaLevel; + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdPressureSeaLevel, + state.dataVariableSpeedCoils->RatedInletAirTempHeat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat); // store environment data fill back in after rating point calc is over Real64 holdOutDryBulbTemp = DataEnvironment::OutDryBulbTemp; Real64 holdOutHumRat = DataEnvironment::OutHumRat; Real64 holdOutWetBulb = DataEnvironment::OutWetBulbTemp; Real64 holdOutBaroPress = DataEnvironment::OutBaroPress; - DataEnvironment::OutDryBulbTemp = RatedAmbAirTempHeat; - DataEnvironment::OutWetBulbTemp = RatedAmbAirWBHeat; + DataEnvironment::OutDryBulbTemp = state.dataVariableSpeedCoils->RatedAmbAirTempHeat; + DataEnvironment::OutWetBulbTemp = state.dataVariableSpeedCoils->RatedAmbAirWBHeat; DataEnvironment::OutBaroPress = DataEnvironment::StdPressureSeaLevel; // assume rating is for sea level. DataEnvironment::OutHumRat = - Psychrometrics::PsyWFnTdbTwbPb(RatedAmbAirTempHeat, RatedAmbAirWBHeat, DataEnvironment::StdPressureSeaLevel, RoutineName); - if (VarSpeedCoil(DXCoilNum).CondenserInletNodeNum > 0) { - Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Temp = RatedAmbAirTempHeat; - Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).HumRat = DataEnvironment::OutHumRat; - Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Press = DataEnvironment::StdPressureSeaLevel; - Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).OutAirWetBulb = RatedAmbAirWBHeat; + Psychrometrics::PsyWFnTdbTwbPb(state.dataVariableSpeedCoils->RatedAmbAirTempHeat, state.dataVariableSpeedCoils->RatedAmbAirWBHeat, DataEnvironment::StdPressureSeaLevel, RoutineName); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum > 0) { + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Temp = state.dataVariableSpeedCoils->RatedAmbAirTempHeat; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).HumRat = DataEnvironment::OutHumRat; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Press = DataEnvironment::StdPressureSeaLevel; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).OutAirWetBulb = state.dataVariableSpeedCoils->RatedAmbAirWBHeat; } - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) { // need to set water info for WSHP - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).InletWaterTemp = RatedInletWaterTempHeat; // 21.11C or 70F, heating mode + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp = state.dataVariableSpeedCoils->RatedInletWaterTempHeat; // 21.11C or 70F, heating mode Real64 CpSource = GetSpecificHeatGlycol(state, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidName, - SourceSideInletTemp, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataVariableSpeedCoils->SourceSideInletTemp, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineName); - VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = VarSpeedCoil(DXCoilNum).InletWaterTemp * CpSource; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp * CpSource; } // calculate coil model at rating point Real64 runtimeFrac(1.0); - VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate = VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate = - VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - VarSpeedCoil(DXCoilNum).DesignWaterVolFlowRate = VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(VarSpeedCoil(DXCoilNum).NumOfSpeeds); - CalcVarSpeedCoilHeating(state, DXCoilNum, 2.0, runtimeFrac, SensLoad, 1, 1.0, 1.0, 1.0, VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); + CalcVarSpeedCoilHeating(state, DXCoilNum, 2.0, runtimeFrac, SensLoad, 1, 1.0, 1.0, 1.0, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); // coil outlets Real64 RatedOutletWetBulb(0.0); - RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb(VarSpeedCoil(DXCoilNum).OutletAirDBTemp, - VarSpeedCoil(DXCoilNum).OutletAirHumRat, + RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, DataEnvironment::StdPressureSeaLevel, RoutineName); - coilSelectionReportObj->setRatedCoilConditions(VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).QLoadTotal, // this is the report variable - VarSpeedCoil(DXCoilNum).QSensible, // this is the report variable - VarSpeedCoil(DXCoilNum).AirMassFlowRate, - VarSpeedCoil(DXCoilNum).InletAirDBTemp, - VarSpeedCoil(DXCoilNum).InletAirHumRat, - RatedInletWetBulbTemp, - VarSpeedCoil(DXCoilNum).OutletAirDBTemp, - VarSpeedCoil(DXCoilNum).OutletAirHumRat, + coilSelectionReportObj->setRatedCoilConditions(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal, // this is the report variable + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible, // this is the report variable + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat, + state.dataVariableSpeedCoils->RatedInletWetBulbTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, RatedOutletWetBulb, - RatedAmbAirTempHeat, - RatedAmbAirWBHeat, - VarSpeedCoil(DXCoilNum).MSRatedCBF(VarSpeedCoil(DXCoilNum).NumOfSpeeds), + state.dataVariableSpeedCoils->RatedAmbAirTempHeat, + state.dataVariableSpeedCoils->RatedAmbAirWBHeat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds), -999.0); // coil effectiveness not define for DX // now replace the outdoor air conditions set above for one time rating point calc @@ -3548,114 +3367,114 @@ namespace VariableSpeedCoils { } // store fan info for coil - if (VarSpeedCoil(DXCoilNum).SupplyFan_TypeNum == DataHVACGlobals::FanType_SystemModelObject) { - if (VarSpeedCoil(DXCoilNum).SupplyFanIndex > -1) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFan_TypeNum == DataHVACGlobals::FanType_SystemModelObject) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanIndex > -1) { coilSelectionReportObj->setCoilSupplyFanInfo(state, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).SupplyFanName, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanName, DataAirSystems::objectVectorOOFanSystemModel, - VarSpeedCoil(DXCoilNum).SupplyFanIndex); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanIndex); } } else { - if (VarSpeedCoil(DXCoilNum).SupplyFanIndex > 0) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanIndex > 0) { coilSelectionReportObj->setCoilSupplyFanInfo(state, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).SupplyFanName, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanName, DataAirSystems::structArrayLegacyFanModels, - VarSpeedCoil(DXCoilNum).SupplyFanIndex); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanIndex); } } } - if (SpeedNum > VarSpeedCoil(DXCoilNum).NumOfSpeeds) { - SpeedCal = VarSpeedCoil(DXCoilNum).NumOfSpeeds; + if (SpeedNum > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) { + SpeedCal = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; } else if (SpeedNum < 1) { SpeedCal = 1; } else { SpeedCal = SpeedNum; } - if ((SpeedNum <= 1) || (SpeedNum > VarSpeedCoil(DXCoilNum).NumOfSpeeds)) { - VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate = VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal); - VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(SpeedCal); - VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate = VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(SpeedCal); - VarSpeedCoil(DXCoilNum).DesignWaterVolFlowRate = VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(SpeedCal); + if ((SpeedNum <= 1) || (SpeedNum > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds)) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(SpeedCal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(SpeedCal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(SpeedCal); } else { - VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate = VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal - 1); - VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(SpeedCal) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(SpeedCal - 1); - VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate = VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(SpeedCal) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(SpeedCal - 1); - VarSpeedCoil(DXCoilNum).DesignWaterVolFlowRate = VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(SpeedCal) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(SpeedCal - 1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal - 1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(SpeedCal) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(SpeedCal - 1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(SpeedCal) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(SpeedCal - 1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(SpeedCal) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(SpeedCal - 1); } // Do the Begin Environment initializations if (BeginEnvrnFlag && MyEnvrnFlag(DXCoilNum) && !MyPlantScanFlag(DXCoilNum)) { // Do the initializations to start simulation - AirInletNode = VarSpeedCoil(DXCoilNum).AirInletNodeNum; + AirInletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum; // Initialize all report variables to a known state at beginning of simulation - VarSpeedCoil(DXCoilNum).AirVolFlowRate = 0.0; - VarSpeedCoil(DXCoilNum).InletAirDBTemp = 0.0; - VarSpeedCoil(DXCoilNum).InletAirHumRat = 0.0; - VarSpeedCoil(DXCoilNum).OutletAirDBTemp = 0.0; - VarSpeedCoil(DXCoilNum).OutletAirHumRat = 0.0; - VarSpeedCoil(DXCoilNum).WaterVolFlowRate = 0.0; - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; - VarSpeedCoil(DXCoilNum).InletWaterTemp = 0.0; - VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = 0.0; - VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = 0.0; - VarSpeedCoil(DXCoilNum).OutletWaterTemp = 0.0; - VarSpeedCoil(DXCoilNum).Power = 0.0; - VarSpeedCoil(DXCoilNum).QLoadTotal = 0.0; - VarSpeedCoil(DXCoilNum).QSensible = 0.0; - VarSpeedCoil(DXCoilNum).QLatent = 0.0; - VarSpeedCoil(DXCoilNum).QSource = 0.0; - VarSpeedCoil(DXCoilNum).Energy = 0.0; - VarSpeedCoil(DXCoilNum).EnergyLoadTotal = 0.0; - VarSpeedCoil(DXCoilNum).EnergySensible = 0.0; - VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; - VarSpeedCoil(DXCoilNum).EnergySource = 0.0; - VarSpeedCoil(DXCoilNum).COP = 0.0; - VarSpeedCoil(DXCoilNum).RunFrac = 0.0; - VarSpeedCoil(DXCoilNum).PartLoadRatio = 0.0; - - VarSpeedCoil(DXCoilNum).MaxONOFFCyclesperHour = MaxONOFFCyclesperHour; - VarSpeedCoil(DXCoilNum).HPTimeConstant = HPTimeConstant; - VarSpeedCoil(DXCoilNum).FanDelayTime = FanDelayTime; - - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit) || - (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit)) { - WaterInletNode = VarSpeedCoil(DXCoilNum).WaterInletNodeNum; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirVolFlowRate = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterVolFlowRate = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).COP = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio = 0.0; + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxONOFFCyclesperHour = MaxONOFFCyclesperHour; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPTimeConstant = HPTimeConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).FanDelayTime = FanDelayTime; + + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit) || + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit)) { + WaterInletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum; rho = GetDensityGlycol(state, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, CWInitConvTemp, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSimpleWatertoAirHP); Cp = GetSpecificHeatGlycol(state, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, CWInitConvTemp, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSimpleWatertoAirHP); - // VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate= & - // rho * VarSpeedCoil(DXCoilNum)%RatedWaterVolFlowRate + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate= & + // rho * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%RatedWaterVolFlowRate InitComponentNodes(0.0, - VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate, - VarSpeedCoil(DXCoilNum).WaterInletNodeNum, - VarSpeedCoil(DXCoilNum).WaterOutletNodeNum, - VarSpeedCoil(DXCoilNum).LoopNum, - VarSpeedCoil(DXCoilNum).LoopSide, - VarSpeedCoil(DXCoilNum).BranchNum, - VarSpeedCoil(DXCoilNum).CompNum); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopSide, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BranchNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompNum); Node(WaterInletNode).Temp = 5.0; Node(WaterInletNode).Enthalpy = Cp * Node(WaterInletNode).Temp; @@ -3663,14 +3482,14 @@ namespace VariableSpeedCoils { Node(WaterInletNode).Press = 0.0; Node(WaterInletNode).HumRat = 0.0; - Node(VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).Temp = 5.0; - Node(VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).Enthalpy = Cp * Node(WaterInletNode).Temp; - Node(VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).Quality = 0.0; - Node(VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).Press = 0.0; - Node(VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).HumRat = 0.0; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).Temp = 5.0; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).Enthalpy = Cp * Node(WaterInletNode).Temp; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).Quality = 0.0; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).Press = 0.0; + Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum).HumRat = 0.0; } - VarSpeedCoil(DXCoilNum).SimFlag = true; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = true; DataHeatBalance::HeatReclaimVS_DXCoil(DXCoilNum).AvailCapacity = 0.0; MyEnvrnFlag(DXCoilNum) = false; @@ -3687,112 +3506,112 @@ namespace VariableSpeedCoils { // Set water and air inlet nodes - AirInletNode = VarSpeedCoil(DXCoilNum).AirInletNodeNum; - WaterInletNode = VarSpeedCoil(DXCoilNum).WaterInletNodeNum; + AirInletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum; + WaterInletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum; if ((SensLoad != 0.0 || LatentLoad != 0.0) && (Node(AirInletNode).MassFlowRate > 0.0)) { - if (VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(VarSpeedCoil(DXCoilNum).NormSpedLevel) > 0.0) { - WaterFlowScale = VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate / - VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(VarSpeedCoil(DXCoilNum).NormSpedLevel); - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate * WaterFlowScale; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel) > 0.0) { + WaterFlowScale = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate / + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate * WaterFlowScale; } else { - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; } if (CyclingScheme == ContFanCycCoil) { // continuous fan, cycling compressor - VarSpeedCoil(DXCoilNum).AirMassFlowRate = Node(AirInletNode).MassFlowRate; - // VarSpeedCoil(DXCoilNum)%AirMassFlowRate = VarSpeedCoil(DXCoilNum)%DesignAirVolFlowRate* & + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = Node(AirInletNode).MassFlowRate; + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%AirMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%DesignAirVolFlowRate* & // PsyRhoAirFnPbTdbW(OutBaroPress,Node(AirInletNode)%Temp,Node(AirInletNode)%HumRat) // If air flow is less than 25% rated flow. Then set air flow to the 25% of rated conditions - if (VarSpeedCoil(DXCoilNum).AirMassFlowRate < - 0.25 * VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate * + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate < + 0.25 * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate * PsyRhoAirFnPbTdbW(OutBaroPress, Node(AirInletNode).Temp, Node(AirInletNode).HumRat)) { - VarSpeedCoil(DXCoilNum).AirMassFlowRate = 0.25 * VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate * + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = 0.25 * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirVolFlowRate * PsyRhoAirFnPbTdbW(OutBaroPress, Node(AirInletNode).Temp, Node(AirInletNode).HumRat); } } else { // CYCLIC FAN, NOT CORRECTION, WILL BE PROCESSED IN THE FOLLOWING SUBROUTINES - VarSpeedCoil(DXCoilNum).AirMassFlowRate = Node(AirInletNode).MassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = Node(AirInletNode).MassFlowRate; } } else { // heat pump is off - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; - VarSpeedCoil(DXCoilNum).AirMassFlowRate = 0.0; - } - - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit) || - (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit)) { - SetComponentFlowRate(VarSpeedCoil(DXCoilNum).WaterMassFlowRate, - VarSpeedCoil(DXCoilNum).WaterInletNodeNum, - VarSpeedCoil(DXCoilNum).WaterOutletNodeNum, - VarSpeedCoil(DXCoilNum).LoopNum, - VarSpeedCoil(DXCoilNum).LoopSide, - VarSpeedCoil(DXCoilNum).BranchNum, - VarSpeedCoil(DXCoilNum).CompNum); - - VarSpeedCoil(DXCoilNum).InletWaterTemp = Node(WaterInletNode).Temp; - VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = Node(WaterInletNode).Enthalpy; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = 0.0; + } + + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit) || + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit)) { + SetComponentFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopSide, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BranchNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompNum); + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp = Node(WaterInletNode).Temp; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = Node(WaterInletNode).Enthalpy; } else { - VarSpeedCoil(DXCoilNum).InletWaterTemp = 0.0; - VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = 0.0; } - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed) { - VarSpeedCoil(DXCoilNum).InletWaterTemp = Node(WaterInletNode).Temp; - VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = Node(WaterInletNode).Enthalpy; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp = Node(WaterInletNode).Temp; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = Node(WaterInletNode).Enthalpy; }; - VarSpeedCoil(DXCoilNum).InletAirDBTemp = Node(AirInletNode).Temp; - VarSpeedCoil(DXCoilNum).InletAirHumRat = Node(AirInletNode).HumRat; - VarSpeedCoil(DXCoilNum).InletAirEnthalpy = Node(AirInletNode).Enthalpy; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp = Node(AirInletNode).Temp; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat = Node(AirInletNode).HumRat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirEnthalpy = Node(AirInletNode).Enthalpy; - VarSpeedCoil(DXCoilNum).MaxONOFFCyclesperHour = MaxONOFFCyclesperHour; - VarSpeedCoil(DXCoilNum).HPTimeConstant = HPTimeConstant; - VarSpeedCoil(DXCoilNum).FanDelayTime = FanDelayTime; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxONOFFCyclesperHour = MaxONOFFCyclesperHour; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPTimeConstant = HPTimeConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).FanDelayTime = FanDelayTime; - VarSpeedCoil(DXCoilNum).InletAirPressure = OutBaroPress; // temporary + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirPressure = OutBaroPress; // temporary // Outlet variables - VarSpeedCoil(DXCoilNum).Power = 0.0; - VarSpeedCoil(DXCoilNum).QLoadTotal = 0.0; - VarSpeedCoil(DXCoilNum).QSensible = 0.0; - VarSpeedCoil(DXCoilNum).QLatent = 0.0; - VarSpeedCoil(DXCoilNum).QSource = 0.0; - VarSpeedCoil(DXCoilNum).QWasteHeat = 0.0; - VarSpeedCoil(DXCoilNum).Energy = 0.0; - VarSpeedCoil(DXCoilNum).EnergyLoadTotal = 0.0; - VarSpeedCoil(DXCoilNum).EnergySensible = 0.0; - VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; - VarSpeedCoil(DXCoilNum).EnergySource = 0.0; - VarSpeedCoil(DXCoilNum).COP = 0.0; - - VarSpeedCoil(DXCoilNum).OutletAirDBTemp = 0.0; - VarSpeedCoil(DXCoilNum).OutletWaterTemp = 0.0; - VarSpeedCoil(DXCoilNum).OutletAirHumRat = 0.0; - VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = 0.0; - VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QWasteHeat = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).COP = 0.0; + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = 0.0; // bug fix, must set zeros to the variables below, otherwise can't pass switch DD test - VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = 0.0; - VarSpeedCoil(DXCoilNum).EvapWaterConsump = 0.0; - VarSpeedCoil(DXCoilNum).BasinHeaterConsumption = 0.0; - VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption = 0.0; - VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = 0.0; - VarSpeedCoil(DXCoilNum).DefrostConsumption = 0.0; - VarSpeedCoil(DXCoilNum).CondensateVdot = 0.0; - VarSpeedCoil(DXCoilNum).CondensateVol = 0.0; - VarSpeedCoil(DXCoilNum).QWasteHeat = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterConsump = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterConsumption = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostConsumption = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateVdot = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateVol = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QWasteHeat = 0.0; // clear zeros to HPWH variables - VarSpeedCoil(DXCoilNum).ElecWaterHeatingPower = 0.0; // Total electric power consumed by compressor and condenser pump [W] - VarSpeedCoil(DXCoilNum).ElecWaterHeatingConsumption = 0.0; // Total electric consumption by compressor and condenser pump [J] - VarSpeedCoil(DXCoilNum).TotalHeatingEnergy = 0.0; // total water heating energy - VarSpeedCoil(DXCoilNum).TotalHeatingEnergyRate = 0.0; // total WH energy rate - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = 0.0; // power power - - VSHPWHHeatingCapacity = 0.0; // Used by Heat Pump:Water Heater object as total water heating capacity [W] - VSHPWHHeatingCOP = 0.0; // Used by Heat Pump:Water Heater object as water heating COP [W/W] - VarSpeedCoil(DXCoilNum).OutletWaterTemp = VarSpeedCoil(DXCoilNum).InletWaterTemp; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).ElecWaterHeatingPower = 0.0; // Total electric power consumed by compressor and condenser pump [W] + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).ElecWaterHeatingConsumption = 0.0; // Total electric consumption by compressor and condenser pump [J] + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).TotalHeatingEnergy = 0.0; // total water heating energy + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).TotalHeatingEnergyRate = 0.0; // total WH energy rate + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = 0.0; // power power + + state.dataVariableSpeedCoils->VSHPWHHeatingCapacity = 0.0; // Used by Heat Pump:Water Heater object as total water heating capacity [W] + state.dataVariableSpeedCoils->VSHPWHHeatingCOP = 0.0; // Used by Heat Pump:Water Heater object as water heating COP [W/W] + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp; DataHeatBalance::HeatReclaimVS_DXCoil(DXCoilNum).AvailCapacity = 0.0; } @@ -3910,8 +3729,8 @@ namespace VariableSpeedCoils { Real64 HPInletAirHumRat; // Rated inlet air humidity ratio for heat pump water heater [kgWater/kgDryAir] Real64 HPWHCoolCapacity; // estimate cooling capacity in HPWH - UpperSpeed = VarSpeedCoil(DXCoilNum).NumOfSpeeds; - NormSpeed = VarSpeedCoil(DXCoilNum).NormSpedLevel; + UpperSpeed = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; + NormSpeed = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel; PltSizNum = 0; ErrorsFound = false; RatedAirFlowAutoSized = false; @@ -3949,58 +3768,58 @@ namespace VariableSpeedCoils { DefrostCapacityDes = 0.0; DefrostCapacityUser = 0.0; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit || - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit || + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) { CurrentObjSubfix = ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT"; - } else if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed) { + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == CoilDX_HeatPumpWaterHeaterVariableSpeed) { CurrentObjSubfix = ":WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED"; } else { CurrentObjSubfix = ":DX:VARIABLESPEED"; } - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { - if (VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate == AutoCalculate) { - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = VarSpeedCoil(DXCoilNum).RatedCapWH * - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(NormSpeed) / - VarSpeedCoil(DXCoilNum).MSRatedTotCap(NormSpeed); // 0.00005035; - VarSpeedCoil(DXCoilNum).AirVolFlowAutoSized = true; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate == AutoCalculate) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH * + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(NormSpeed) / + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(NormSpeed); // 0.00005035; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirVolFlowAutoSized = true; } - coilSelectionReportObj->setCoilAirFlow(VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate, - VarSpeedCoil(DXCoilNum).AirVolFlowAutoSized); + coilSelectionReportObj->setCoilAirFlow(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirVolFlowAutoSized); - if (VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate == AutoCalculate) { - VarSpeedCoil(DXCoilNum).RatedHPWHCondWaterFlow = VarSpeedCoil(DXCoilNum).RatedCapWH * - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(NormSpeed) / - VarSpeedCoil(DXCoilNum).MSRatedTotCap(NormSpeed); // 0.00000004487; - VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = VarSpeedCoil(DXCoilNum).RatedHPWHCondWaterFlow; - VarSpeedCoil(DXCoilNum).WaterVolFlowAutoSized = true; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate == AutoCalculate) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedHPWHCondWaterFlow = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH * + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(NormSpeed) / + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(NormSpeed); // 0.00000004487; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedHPWHCondWaterFlow; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterVolFlowAutoSized = true; } coilSelectionReportObj->setCoilWaterFlowPltSizNum(state, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate, - VarSpeedCoil(DXCoilNum).WaterVolFlowAutoSized, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterVolFlowAutoSized, -999, - VarSpeedCoil(DXCoilNum).LoopNum); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum); } - if (VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate == AutoSize) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate == AutoSize) { RatedAirFlowAutoSized = true; } if (CurSysNum > 0) { if (!RatedAirFlowAutoSized && !SizingDesRunThisAirSys) { // Simulation continue HardSizeNoDesRunAirFlow = true; - if (VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate > 0.0) { - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate > 0.0) { + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "User-Specified Rated Air Flow Rate [m3/s]", - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate); } } else { - CheckSysSizing("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, VarSpeedCoil(DXCoilNum).Name); + CheckSysSizing("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); if (FinalSysSizing(CurSysNum).DesMainVolFlow >= SmallAirVolFlow) { RatedAirVolFlowRateDes = FinalSysSizing(CurSysNum).DesMainVolFlow; } else { @@ -4012,14 +3831,14 @@ namespace VariableSpeedCoils { if (CurZoneEqNum > 0) { if (!RatedAirFlowAutoSized && !SizingDesRunThisZone) { // Simulation continue HardSizeNoDesRunAirFlow = true; - if (VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate > 0.0) { - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate > 0.0) { + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "User-Specified Rated Air Flow Rate [m3/s]", - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate); } } else { - CheckZoneSizing("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, VarSpeedCoil(DXCoilNum).Name); + CheckZoneSizing("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); RatedAirVolFlowRateDes = max(FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow, FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow); if (RatedAirVolFlowRateDes < SmallAirVolFlow) { RatedAirVolFlowRateDes = 0.0; @@ -4027,11 +3846,11 @@ namespace VariableSpeedCoils { } } - if (RatedAirFlowAutoSized) VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = RatedAirVolFlowRateDes; - // CALL BaseSizer::reportSizerOutput('COIL:'//TRIM(VarSpeedCoil(DXCoilNum)%CoolHeatType)//TRIM(CurrentObjSubfix), & - // VarSpeedCoil(DXCoilNum)%Name, & + if (RatedAirFlowAutoSized) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = RatedAirVolFlowRateDes; + // CALL BaseSizer::reportSizerOutput('COIL:'//TRIM(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%CoolHeatType)//TRIM(CurrentObjSubfix), & + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%Name, & // 'Rated Air Flow Rate [m3/s]', & - // VarSpeedCoil(DXCoilNum)%RatedAirVolFlowRate) + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%RatedAirVolFlowRate) // RatedAirFlowAutoSized = .TRUE. @@ -4040,22 +3859,22 @@ namespace VariableSpeedCoils { // size rated total cooling capacity IsAutoSize = false; - if (VarSpeedCoil(DXCoilNum).RatedCapCoolTotal == AutoSize && VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal == AutoSize && state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { RatedCapCoolTotalAutoSized = true; } if (SizingDesRunThisZone || SizingDesRunThisAirSys) HardSizeNoDesRun = false; if (CurSysNum > 0) { if (!RatedCapCoolTotalAutoSized && !SizingDesRunThisAirSys) { // Simulation continue HardSizeNoDesRun = true; - if (VarSpeedCoil(DXCoilNum).RatedCapCoolTotal > 0.0) { - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal > 0.0) { + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "User-Specified Rated Total Cooling Capacity [W]", - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); } } else { - CheckSysSizing("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, VarSpeedCoil(DXCoilNum).Name); - VolFlowRate = VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate; + CheckSysSizing("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); + VolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate; if (VolFlowRate >= SmallAirVolFlow) { if (CurOASysNum > 0) { // coil is in the OA stream MixTemp = FinalSysSizing(CurSysNum).OutTempAtCoolPeak; @@ -4096,14 +3915,14 @@ namespace VariableSpeedCoils { SupTemp -= FanCoolLoad / (CpAir * rhoair * VolFlowRate); } MixWetBulb = PsyTwbFnTdbWPb(MixTemp, MixHumRat, OutBaroPress, RoutineName); - // need to use OutTemp for air-cooled and RatedInletWaterTemp for water-cooled - if (VarSpeedCoil(DXCoilNum).CondenserInletNodeNum != 0) { - RatedSourceTempCool = RatedInletWaterTemp; + // need to use OutTemp for air-cooled and state.dataVariableSpeedCoils->RatedInletWaterTemp for water-cooled + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum != 0) { + RatedSourceTempCool = state.dataVariableSpeedCoils->RatedInletWaterTemp; } else { RatedSourceTempCool = OutTemp; } TotCapTempModFac = - CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(VarSpeedCoil(DXCoilNum).NormSpedLevel), MixWetBulb, RatedSourceTempCool); + CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel), MixWetBulb, RatedSourceTempCool); // The mixed air temp for zone equipment without an OA mixer is 0. // This test avoids a negative capacity until a solution can be found. @@ -4126,15 +3945,15 @@ namespace VariableSpeedCoils { } else if (CurZoneEqNum > 0) { if (!RatedCapCoolTotalAutoSized && !SizingDesRunThisZone) { // Simulation continue HardSizeNoDesRun = true; - if (VarSpeedCoil(DXCoilNum).RatedCapCoolTotal > 0.0) { - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal > 0.0) { + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "User-Specified Rated Total Cooling Capacity [W]", - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); } } else { - CheckZoneSizing("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, VarSpeedCoil(DXCoilNum).Name); - VolFlowRate = VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate; + CheckZoneSizing("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); + VolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate; if (VolFlowRate >= SmallAirVolFlow) { if (ZoneEqDXCoil) { if (ZoneEqSizing(CurZoneEqNum).OAVolFlow > 0.0) { @@ -4173,14 +3992,14 @@ namespace VariableSpeedCoils { } MixWetBulb = PsyTwbFnTdbWPb(MixTemp, MixHumRat, OutBaroPress, RoutineName); - // need to use OutTemp for air-cooled and RatedInletWaterTemp for water-cooled - if (VarSpeedCoil(DXCoilNum).CondenserInletNodeNum != 0) { - RatedSourceTempCool = RatedInletWaterTemp; + // need to use OutTemp for air-cooled and state.dataVariableSpeedCoils->RatedInletWaterTemp for water-cooled + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum != 0) { + RatedSourceTempCool = state.dataVariableSpeedCoils->RatedInletWaterTemp; } else { RatedSourceTempCool = OutTemp; } TotCapTempModFac = - CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(VarSpeedCoil(DXCoilNum).NormSpedLevel), MixWetBulb, RatedSourceTempCool); + CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel), MixWetBulb, RatedSourceTempCool); // The mixed air temp for zone equipment without an OA mixer is 0. // This test avoids a negative capacity until a solution can be found. @@ -4205,41 +4024,41 @@ namespace VariableSpeedCoils { } if (!HardSizeNoDesRun) { if (RatedCapCoolTotalAutoSized) { - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = RatedCapCoolTotalDes; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = RatedCapCoolTotalDes; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Rated Total Cooling Capacity [W]", - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); - PreDefTableEntry(pdchCoolCoilTotCap, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); + PreDefTableEntry(pdchCoolCoilTotCap, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); PreDefTableEntry(pdchCoolCoilLatCap, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal - VarSpeedCoil(DXCoilNum).RatedCapCoolSens); - if (VarSpeedCoil(DXCoilNum).RatedCapCoolTotal != 0.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal != 0.0) { PreDefTableEntry(pdchCoolCoilSHR, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).RatedCapCoolSens / VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); - PreDefTableEntry(pdchCoolCoilNomEff, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).MSRatedCOP(NormSpeed)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); + PreDefTableEntry(pdchCoolCoilNomEff, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(NormSpeed)); } else { - PreDefTableEntry(pdchCoolCoilSHR, VarSpeedCoil(DXCoilNum).Name, 0.0); - PreDefTableEntry(pdchCoolCoilNomEff, VarSpeedCoil(DXCoilNum).Name, 0.0); + PreDefTableEntry(pdchCoolCoilSHR, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, 0.0); + PreDefTableEntry(pdchCoolCoilNomEff, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, 0.0); } addFootNoteSubTable( pdstCoolCoil, "Nominal values are gross at rated conditions, i.e., the supply air fan heat and electric power NOT accounted for."); } else { - if (VarSpeedCoil(DXCoilNum).RatedCapCoolTotal > 0.0 && RatedCapCoolTotalDes > 0.0) { - RatedCapCoolTotalUser = VarSpeedCoil(DXCoilNum).RatedCapCoolTotal; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal > 0.0 && RatedCapCoolTotalDes > 0.0) { + RatedCapCoolTotalUser = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Rated Total Cooling Capacity [W]", RatedCapCoolTotalDes, "User-Specified Rated Total Cooling Capacity [W]", RatedCapCoolTotalUser); if (DisplayExtraWarnings) { if ((std::abs(RatedCapCoolTotalDes - RatedCapCoolTotalUser) / RatedCapCoolTotalUser) > AutoVsHardSizingThreshold) { - ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for " + VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + + ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); - ShowContinueError("Coil Name =" + VarSpeedCoil(DXCoilNum).Name); + ShowContinueError("Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); ShowContinueError("User-Specified Rated Total Cooling Capacity of " + RoundSigDigits(RatedCapCoolTotalUser, 2) + " [W]"); ShowContinueError("differs from Design Size Rated Total Cooling Capacity of " + RoundSigDigits(RatedCapCoolTotalDes, 2) + " [W]"); @@ -4251,13 +4070,13 @@ namespace VariableSpeedCoils { } coilSelectionReportObj->setCoilEntAirTemp(state, - VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).VarSpeedCoilType, MixTemp, CurSysNum, CurZoneEqNum); - coilSelectionReportObj->setCoilEntAirHumRat(VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).VarSpeedCoilType, MixHumRat); - coilSelectionReportObj->setCoilLvgAirTemp(VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).VarSpeedCoilType, SupTemp); - coilSelectionReportObj->setCoilLvgAirHumRat(VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).VarSpeedCoilType, SupHumRat); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, MixTemp, CurSysNum, CurZoneEqNum); + coilSelectionReportObj->setCoilEntAirHumRat(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, MixHumRat); + coilSelectionReportObj->setCoilLvgAirTemp(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, SupTemp); + coilSelectionReportObj->setCoilLvgAirHumRat(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, SupHumRat); coilSelectionReportObj->setCoilCoolingCapacity(state, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, RatedCapCoolTotalDes, RatedCapCoolTotalAutoSized, CurSysNum, @@ -4270,28 +4089,28 @@ namespace VariableSpeedCoils { } // Set the global DX cooling coil capacity variable for use by other objects - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { - DXCoolCap = VarSpeedCoil(DXCoilNum).RatedCapCoolTotal; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { + DXCoolCap = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal; } // size rated heating capacity - if (VarSpeedCoil(DXCoilNum).RatedCapHeat == AutoSize && VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat == AutoSize && state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { RatedCapHeatAutoSized = true; } // simply set heating capacity equal to the cooling capacity - // VarSpeedCoil(DXCoilNum)%RatedCapHeat = DXCoolCap - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { - if (VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum > 0) { - RatedCapHeatDes = VarSpeedCoil(VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal; - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = RatedCapHeatDes; // AVOID BEING ZERO + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%RatedCapHeat = DXCoolCap + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum > 0) { + RatedCapHeatDes = state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = RatedCapHeatDes; // AVOID BEING ZERO } else { RatedCapHeatDes = DXCoolCap; // previous code, can be risky } // END IF if (RatedCapHeatAutoSized) { if (RatedCapHeatDes == AutoSize) { - ShowWarningError("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + - VarSpeedCoil(DXCoilNum).Name + "\""); + ShowWarningError("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\""); ShowContinueError(RoutineName + ": Heating coil could not be autosized since cooling coil was not previously sized."); ShowContinueError("... Cooling coil must be upstream of heating coil."); ShowContinueError("... Manually sizing this heating coil will be required."); @@ -4301,8 +4120,8 @@ namespace VariableSpeedCoils { RatedCapHeatDes = 0.0; } coilSelectionReportObj->setCoilHeatingCapacity(state, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, RatedCapHeatDes, RatedCapHeatAutoSized, CurSysNum, @@ -4314,33 +4133,33 @@ namespace VariableSpeedCoils { -999.0); } if (RatedCapHeatAutoSized) { - VarSpeedCoil(DXCoilNum).RatedCapHeat = RatedCapHeatDes; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat = RatedCapHeatDes; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Nominal Heating Capacity [W]", RatedCapHeatDes); - PreDefTableEntry(pdchHeatCoilNomCap, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).RatedCapHeat); - if (VarSpeedCoil(DXCoilNum).RatedCapHeat != 0.0) { - PreDefTableEntry(pdchHeatCoilNomEff, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).MSRatedCOP(NormSpeed)); + PreDefTableEntry(pdchHeatCoilNomCap, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat != 0.0) { + PreDefTableEntry(pdchHeatCoilNomEff, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(NormSpeed)); } else { - PreDefTableEntry(pdchHeatCoilNomEff, VarSpeedCoil(DXCoilNum).Name, 0.0); + PreDefTableEntry(pdchHeatCoilNomEff, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, 0.0); } addFootNoteSubTable(pdstHeatCoil, "Nominal values are gross at rated conditions, i.e., the supply air fan heat and electric power NOT accounted for."); } else { - if (VarSpeedCoil(DXCoilNum).RatedCapHeat > 0.0 && RatedCapHeatDes > 0.0) { - RatedCapHeatUser = VarSpeedCoil(DXCoilNum).RatedCapHeat; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat > 0.0 && RatedCapHeatDes > 0.0) { + RatedCapHeatUser = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Nominal Heating Capacity [W]", RatedCapHeatDes, "User-Specified Nominal Heating Capacity [W]", RatedCapHeatUser); if (DisplayExtraWarnings) { if ((std::abs(RatedCapHeatDes - RatedCapHeatUser) / RatedCapHeatUser) > AutoVsHardSizingThreshold) { - ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for " + VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + + ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); - ShowContinueError("Coil Name =" + VarSpeedCoil(DXCoilNum).Name); + ShowContinueError("Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); ShowContinueError("User-Specified Rated Total Heating Capacity of " + RoundSigDigits(RatedCapHeatUser, 2) + " [W]"); ShowContinueError("differs from Design Size Rated Total Heating Capacity of " + RoundSigDigits(RatedCapHeatDes, 2) + " [W]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); @@ -4354,32 +4173,32 @@ namespace VariableSpeedCoils { if (!HardSizeNoDesRunAirFlow) { if ((RatedCapCoolTotalAutoSized) && (RatedAirFlowAutoSized)) { RatedAirVolFlowRateDes = - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(NormSpeed); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(NormSpeed); } else if ((RatedCapHeatAutoSized) && (RatedAirFlowAutoSized)) { - RatedAirVolFlowRateDes = VarSpeedCoil(DXCoilNum).RatedCapHeat * VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(NormSpeed); + RatedAirVolFlowRateDes = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(NormSpeed); } // write the air flow sizing output if (RatedAirFlowAutoSized) { - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = RatedAirVolFlowRateDes; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = RatedAirVolFlowRateDes; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Rated Air Flow Rate [m3/s]", RatedAirVolFlowRateDes); } else { - if (VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate > 0.0 && RatedAirVolFlowRateDes > 0.0) { - RatedAirVolFlowRateUser = VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate > 0.0 && RatedAirVolFlowRateDes > 0.0) { + RatedAirVolFlowRateUser = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Rated Air Flow Rate [m3/s]", RatedAirVolFlowRateDes, "User-Specified Rated Air Flow Rate [m3/s]", RatedAirVolFlowRateUser); if (DisplayExtraWarnings) { if ((std::abs(RatedAirVolFlowRateDes - RatedAirVolFlowRateUser) / RatedAirVolFlowRateUser) > AutoVsHardSizingThreshold) { - ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for" + VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + + ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); - ShowContinueError("Coil Name =" + VarSpeedCoil(DXCoilNum).Name); + ShowContinueError("Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); ShowContinueError("User-Specified Rated Air Flow Rate of " + RoundSigDigits(RatedAirVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Rated Air Flow Rate of " + RoundSigDigits(RatedAirVolFlowRateDes, 5) + " [m3/s]"); @@ -4390,214 +4209,214 @@ namespace VariableSpeedCoils { } } coilSelectionReportObj->setCoilAirFlow( - VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).VarSpeedCoilType, RatedAirVolFlowRateDes, RatedAirFlowAutoSized); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, RatedAirVolFlowRateDes, RatedAirFlowAutoSized); } // Check that heat pump heating capacity is within 20% of cooling capacity. Check only for heating coil and report both. - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING" && VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum > 0) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING" && state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum > 0) { - if (VarSpeedCoil(VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal > 0.0) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal > 0.0) { - if (std::abs(VarSpeedCoil(VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal - VarSpeedCoil(DXCoilNum).RatedCapHeat) / - VarSpeedCoil(VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal > + if (std::abs(state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat) / + state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal > 0.2) { - ShowWarningError("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + - VarSpeedCoil(DXCoilNum).Name + "\""); - ShowContinueError("...used with COIL:" + VarSpeedCoil(VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).CoolHeatType + + ShowWarningError("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\""); + ShowContinueError("...used with COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).CoolHeatType + ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + - VarSpeedCoil(VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).Name + "\""); + state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).Name + "\""); ShowContinueError("...heating capacity is disproportionate (> 20% different) to total cooling capacity"); - ShowContinueError("...heating capacity = " + TrimSigDigits(VarSpeedCoil(DXCoilNum).RatedCapHeat, 3) + " W"); + ShowContinueError("...heating capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat, 3) + " W"); ShowContinueError("...cooling capacity = " + - TrimSigDigits(VarSpeedCoil(VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal, 3) + " W"); + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal, 3) + " W"); } } } // ASSIGN CAPACITY - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) = - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal / VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(NormSpeed); - } else if (VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) = - VarSpeedCoil(DXCoilNum).RatedCapHeat / VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(NormSpeed); - } else if (VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) = - VarSpeedCoil(DXCoilNum).RatedCapWH / VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(NormSpeed); - } - - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(NormSpeed); + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(NormSpeed); + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(NormSpeed); + } + + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { HPInletAirHumRat = - PsyWFnTdbTwbPb(VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp, VarSpeedCoil(DXCoilNum).WHRatedInletWBTemp, StdBaroPress, RoutineName); - rhoA = PsyRhoAirFnPbTdbW(OutBaroPress, VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp, HPInletAirHumRat, RoutineName); - - for (Mode = VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) * VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(Mode); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(Mode); - VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; + PsyWFnTdbTwbPb(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletWBTemp, StdBaroPress, RoutineName); + rhoA = PsyRhoAirFnPbTdbW(OutBaroPress, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp, HPInletAirHumRat, RoutineName); + + for (Mode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; // EVAPORATIVE PRECOOLING CONDENSER AIR FLOW RATE - VarSpeedCoil(DXCoilNum).EvapCondAirFlow(Mode) = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondAirFlow(Mode) = 0.0; } } else { - rhoA = PsyRhoAirFnPbTdbW(OutBaroPress, RatedInletAirTemp, RatedInletAirHumRat, RoutineName); + rhoA = PsyRhoAirFnPbTdbW(OutBaroPress, state.dataVariableSpeedCoils->RatedInletAirTemp, state.dataVariableSpeedCoils->RatedInletAirHumRat, RoutineName); // HPWH, the mass flow rate will be updated by a revised entering air density - if (VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex > -1 && UnitarySystems::designSpecMSHP.size() > 0) { - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { - if (UnitarySystems::designSpecMSHP[VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex].numOfSpeedCooling != - VarSpeedCoil(DXCoilNum).NumOfSpeeds) { - ShowFatalError("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix + " = " + VarSpeedCoil(DXCoilNum).Name + + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex > -1 && UnitarySystems::designSpecMSHP.size() > 0) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { + if (UnitarySystems::designSpecMSHP[state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex].numOfSpeedCooling != + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) { + ShowFatalError("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix + " = " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + " number of speeds not equal to number of speed specified in UnitarySystemPerformance:Multispeed object."); } else { - for (Mode = VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) = - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * - UnitarySystems::designSpecMSHP[VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex].coolingVolFlowRatio[Mode - 1]; - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(Mode); - VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; + for (Mode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * + UnitarySystems::designSpecMSHP[state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex].coolingVolFlowRatio[Mode - 1]; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; // EVAPORATIVE PRECOOLING CONDENSER AIR FLOW RATE - VarSpeedCoil(DXCoilNum).EvapCondAirFlow(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * VarSpeedCoil(DXCoilNum).MSRatedEvapCondVolFlowPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondAirFlow(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedEvapCondVolFlowPerRatedTotCap(Mode); } } - } else if (VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { - if (UnitarySystems::designSpecMSHP[VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex].numOfSpeedHeating != - VarSpeedCoil(DXCoilNum).NumOfSpeeds) { - ShowFatalError("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix + " = " + VarSpeedCoil(DXCoilNum).Name + + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { + if (UnitarySystems::designSpecMSHP[state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex].numOfSpeedHeating != + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) { + ShowFatalError("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix + " = " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + " number of speeds not equal to number of speed specified in UnitarySystemPerformance:Multispeed object."); } else { - for (Mode = VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) = - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * - UnitarySystems::designSpecMSHP[VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex].heatingVolFlowRatio[Mode - 1]; - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(Mode); - VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; + for (Mode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * + UnitarySystems::designSpecMSHP[state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSHPDesignSpecIndex].heatingVolFlowRatio[Mode - 1]; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; // EVAPORATIVE PRECOOLING CONDENSER AIR FLOW RATE - VarSpeedCoil(DXCoilNum).EvapCondAirFlow(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * VarSpeedCoil(DXCoilNum).MSRatedEvapCondVolFlowPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondAirFlow(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedEvapCondVolFlowPerRatedTotCap(Mode); } } } } else { - for (Mode = VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) * VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(Mode); - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(Mode); - VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; + for (Mode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(UpperSpeed) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedPercentTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; // EVAPORATIVE PRECOOLING CONDENSER AIR FLOW RATE - VarSpeedCoil(DXCoilNum).EvapCondAirFlow(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * VarSpeedCoil(DXCoilNum).MSRatedEvapCondVolFlowPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondAirFlow(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedEvapCondVolFlowPerRatedTotCap(Mode); } } } // size rated power - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { - VarSpeedCoil(DXCoilNum).RatedCOPCool = VarSpeedCoil(DXCoilNum).MSRatedCOP(VarSpeedCoil(DXCoilNum).NormSpedLevel); - VarSpeedCoil(DXCoilNum).RatedPowerCool = VarSpeedCoil(DXCoilNum).RatedCapCoolTotal / VarSpeedCoil(DXCoilNum).RatedCOPCool; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCOPCool = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedPowerCool = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCOPCool; - } else if (VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { - VarSpeedCoil(DXCoilNum).RatedCOPHeat = VarSpeedCoil(DXCoilNum).MSRatedCOP(VarSpeedCoil(DXCoilNum).NormSpedLevel); - VarSpeedCoil(DXCoilNum).RatedPowerHeat = VarSpeedCoil(DXCoilNum).RatedCapHeat / VarSpeedCoil(DXCoilNum).RatedCOPHeat; - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = VarSpeedCoil(DXCoilNum).RatedCapHeat; - } else if (VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { - VarSpeedCoil(DXCoilNum).RatedCOPHeat = VarSpeedCoil(DXCoilNum).MSRatedCOP(VarSpeedCoil(DXCoilNum).NormSpedLevel); - VarSpeedCoil(DXCoilNum).RatedPowerHeat = VarSpeedCoil(DXCoilNum).RatedCapWH / VarSpeedCoil(DXCoilNum).RatedCOPHeat; - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = VarSpeedCoil(DXCoilNum).RatedCapWH * (1.0 - 1.0 / VarSpeedCoil(DXCoilNum).RatedCOPHeat); + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCOPHeat = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedPowerHeat = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCOPHeat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat; + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCOPHeat = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedPowerHeat = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCOPHeat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH * (1.0 - 1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCOPHeat); } // Size water volumetric flow rate - if ((VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate == AutoSize) && - (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit || - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate == AutoSize) && + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit || + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit)) { RatedWaterFlowAutoSized = true; } //! if not found on a plant loop, check condenser loop and warn user if not found // IF(PltSizNum == 0) THEN // PltSizNum = & - // MyCondPlantSizingIndex('COIL:'//TRIM(VarSpeedCoil(DXCoilNum)%CoolHeatType)// & + // MyCondPlantSizingIndex('COIL:'//TRIM(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%CoolHeatType)// & // TRIM(CurrentObjSubfix), & - // VarSpeedCoil(DXCoilNum)%Name, & - // VarSpeedCoil(DXCoilNum)%WaterInletNodeNum, & - // VarSpeedCoil(DXCoilNum)%WaterOutletNodeNum, ErrorsFound) + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%Name, & + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%WaterInletNodeNum, & + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%WaterOutletNodeNum, ErrorsFound) // END IF // WSHP condenser can be on either a plant loop or condenser loop. Test each to find plant sizing number. // first check to see if coil is connected to a plant loop, no warning on this CALL if (RatedWaterFlowAutoSized) { - if (VarSpeedCoil(DXCoilNum).CondenserType == WaterCooled) - PltSizNum = MyPlantSizingIndex("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).WaterInletNodeNum, - VarSpeedCoil(DXCoilNum).WaterOutletNodeNum, + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType == WaterCooled) + PltSizNum = MyPlantSizingIndex("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum, ErrorsFound, false); if (PltSizNum > 0) { - rho = GetDensityGlycol(state, PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + rho = GetDensityGlycol(state, PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, PlantSizData(PltSizNum).ExitTemp, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameAlt); cp = GetSpecificHeatGlycol(state, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, PlantSizData(PltSizNum).ExitTemp, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameAlt); - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { - RatedWaterVolFlowRateDes = VarSpeedCoil(DXCoilNum).RatedCapHeat / (PlantSizData(PltSizNum).DeltaT * cp * rho); + RatedWaterVolFlowRateDes = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat / (PlantSizData(PltSizNum).DeltaT * cp * rho); - // CALL BaseSizer::reportSizerOutput('COIL:'//TRIM(VarSpeedCoil(DXCoilNum)%CoolHeatType)//& + // CALL BaseSizer::reportSizerOutput('COIL:'//TRIM(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%CoolHeatType)//& // TRIM(CurrentObjSubfix), & - // VarSpeedCoil(DXCoilNum)%Name, & - // 'Rated Water Flow Rate [m3/s]', VarSpeedCoil(DXCoilNum)%RatedWaterVolFlowRate) - coilSelectionReportObj->setCoilLvgWaterTemp(VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%Name, & + // 'Rated Water Flow Rate [m3/s]', state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%RatedWaterVolFlowRate) + coilSelectionReportObj->setCoilLvgWaterTemp(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, PlantSizData(PltSizNum).ExitTemp + PlantSizData(PltSizNum).DeltaT); // TRACE 3D Plus coil selection report - } else if (VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { // use companion heating coil capacity to calculate volumetric flow rate - if (VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum > 0) { - SystemCapacity = VarSpeedCoil(VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapHeat; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum > 0) { + SystemCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapHeat; } else { - SystemCapacity = VarSpeedCoil(DXCoilNum).RatedCapCoolTotal; + SystemCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal; } RatedWaterVolFlowRateDes = SystemCapacity / (PlantSizData(PltSizNum).DeltaT * cp * rho); - // CALL BaseSizer::reportSizerOutput('COIL:'//TRIM(VarSpeedCoil(DXCoilNum)%CoolHeatType)& + // CALL BaseSizer::reportSizerOutput('COIL:'//TRIM(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%CoolHeatType)& // //TRIM(CurrentObjSubfix), & - // VarSpeedCoil(DXCoilNum)%Name, & - // 'Rated Water Flow Rate [m3/s]', VarSpeedCoil(DXCoilNum)%RatedWaterVolFlowRate) - coilSelectionReportObj->setCoilLvgWaterTemp(VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%Name, & + // 'Rated Water Flow Rate [m3/s]', state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%RatedWaterVolFlowRate) + coilSelectionReportObj->setCoilLvgWaterTemp(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, PlantSizData(PltSizNum).ExitTemp - PlantSizData(PltSizNum).DeltaT); // TRACE 3D Plus coil selection report } - coilSelectionReportObj->setCoilEntWaterTemp(VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + coilSelectionReportObj->setCoilEntWaterTemp(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, PlantSizData(PltSizNum).ExitTemp); // TRACE 3D Plus coil selection report - coilSelectionReportObj->setCoilWaterDeltaT(VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + coilSelectionReportObj->setCoilWaterDeltaT(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, PlantSizData(PltSizNum).DeltaT); // TRACE 3D Plus coil selection report } else { ShowSevereError("Autosizing of water flow requires a loop Sizing:Plant object"); ShowContinueError("Autosizing also requires physical connection to a plant or condenser loop."); - ShowContinueError("Occurs in COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix + - " Object=" + VarSpeedCoil(DXCoilNum).Name); + ShowContinueError("Occurs in COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix + + " Object=" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); ErrorsFound = true; } } @@ -4607,50 +4426,50 @@ namespace VariableSpeedCoils { // FORCE BACK TO THE RATED WATER FLOW RATE WITH THE SAME RATIO DEFINED BY THE CATLOG DATA if (RatedCapCoolTotalAutoSized) { RatedWaterVolFlowRateDes = - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(NormSpeed); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(NormSpeed); } else if (RatedCapHeatAutoSized) { RatedWaterVolFlowRateDes = - VarSpeedCoil(DXCoilNum).RatedCapHeat * VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(NormSpeed); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(NormSpeed); } coilSelectionReportObj->setCoilWaterFlowNodeNums(state, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, RatedWaterVolFlowRateDes, RatedWaterFlowAutoSized, - VarSpeedCoil(DXCoilNum).WaterInletNodeNum, - VarSpeedCoil(DXCoilNum).WaterOutletNodeNum, - VarSpeedCoil(DXCoilNum).LoopNum); - VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = RatedWaterVolFlowRateDes; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = RatedWaterVolFlowRateDes; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Rated Water Flow Rate [m3/s]", RatedWaterVolFlowRateDes); // Ensure water flow rate at lower speed must be lower or // equal to the flow rate at higher speed. Otherwise, a severe error is isssued. - for (Mode = 1; Mode <= VarSpeedCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { - if (VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) > VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode + 1) * 1.05) { - ShowWarningError("SizeDXCoil: " + VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + VarSpeedCoil(DXCoilNum).Name + ", Speed " + + for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode + 1) * 1.05) { + ShowWarningError("SizeDXCoil: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + ", Speed " + TrimSigDigits(Mode) + " Rated Air Flow Rate must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + " Rated Air Flow Rate."); - ShowContinueError("Instead, " + RoundSigDigits(VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), 2) + " > " + - RoundSigDigits(VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1), 2)); + ShowContinueError("Instead, " + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), 2) + " > " + + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1), 2)); ShowFatalError("Preceding conditions cause termination."); } } } else { - if (VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate > 0.0 && RatedWaterVolFlowRateDes > 0.0) { - RatedWaterVolFlowRateUser = VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate > 0.0 && RatedWaterVolFlowRateDes > 0.0) { + RatedWaterVolFlowRateUser = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Rated Water Flow Rate [m3/s]", RatedWaterVolFlowRateDes, "User-Specified Rated Water Flow Rate [m3/s]", RatedWaterVolFlowRateUser); if (DisplayExtraWarnings) { if ((std::abs(RatedWaterVolFlowRateDes - RatedWaterVolFlowRateUser) / RatedWaterVolFlowRateUser) > AutoVsHardSizingThreshold) { - ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for" + VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + + ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); - ShowContinueError("Coil Name =" + VarSpeedCoil(DXCoilNum).Name); + ShowContinueError("Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); ShowContinueError("User-Specified Rated Water Flow Rate of " + RoundSigDigits(RatedWaterVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Rated Water Flow Rate of " + RoundSigDigits(RatedWaterVolFlowRateDes, 5) + " [m3/s]"); @@ -4662,181 +4481,181 @@ namespace VariableSpeedCoils { } // Save component design water volumetric flow rate. - if (VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate > 0.0 && VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { - RegisterPlantCompDesignFlow(VarSpeedCoil(DXCoilNum).WaterInletNodeNum, VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate > 0.0 && state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { + RegisterPlantCompDesignFlow(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate); } // Use 1/2 flow since both cooling and heating coil will save flow yet only 1 will operate at a time - else if (VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate > 0.0) { - RegisterPlantCompDesignFlow(VarSpeedCoil(DXCoilNum).WaterInletNodeNum, 0.5 * VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate); + else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate > 0.0) { + RegisterPlantCompDesignFlow(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum, 0.5 * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate); } - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit || - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit || + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit) { - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit) { - RatedSourceTempCool = RatedInletWaterTemp; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit) { + RatedSourceTempCool = state.dataVariableSpeedCoils->RatedInletWaterTemp; } else { - RatedSourceTempCool = RatedInletWaterTempHeat; + RatedSourceTempCool = state.dataVariableSpeedCoils->RatedInletWaterTempHeat; } if (PltSizNum > 0) { rhoW = rho; } else { rhoW = GetDensityGlycol(state, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, RatedSourceTempCool, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineName); } - VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate = VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate * rhoW; - for (Mode = VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(Mode); - VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) * rhoW; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate * rhoW; + for (Mode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(Mode) = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) * rhoW; } - } else if (VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { - RatedSourceTempCool = VarSpeedCoil(DXCoilNum).WHRatedInletWaterTemp; + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { + RatedSourceTempCool = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletWaterTemp; rhoW = RhoH2O(RatedSourceTempCool); - VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate = VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate * rhoW; - for (Mode = VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { - VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(Mode); - VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * VarSpeedCoil(DXCoilNum).MSWHPumpPowerPerRatedTotCap(Mode); - VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) * rhoW; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate * rhoW; + for (Mode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; Mode >= 1; --Mode) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPowerPerRatedTotCap(Mode); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(Mode) = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) * rhoW; } } else { - RatedSourceTempCool = RatedAmbAirTemp; + RatedSourceTempCool = state.dataVariableSpeedCoils->RatedAmbAirTemp; } // Ensure air flow rate at lower speed must be lower or // equal to the flow rate at higher speed. Otherwise, a severe error is isssued. - for (Mode = 1; Mode <= VarSpeedCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { - if (VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) > VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1)) { - ShowWarningError("SizeDXCoil: " + VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + VarSpeedCoil(DXCoilNum).Name + ", Speed " + + for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1)) { + ShowWarningError("SizeDXCoil: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + ", Speed " + TrimSigDigits(Mode) + " Rated Air Flow Rate must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + " Rated Air Flow Rate."); - ShowContinueError("Instead, " + RoundSigDigits(VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), 2) + " > " + - RoundSigDigits(VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1), 2)); + ShowContinueError("Instead, " + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), 2) + " > " + + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1), 2)); ShowFatalError("Preceding conditions cause termination."); } } // Ensure capacity at lower speed must be lower or equal to the capacity at higher speed. - for (Mode = 1; Mode <= VarSpeedCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { - if (VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) > VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode + 1)) { - ShowWarningError("SizeDXCoil: " + VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + VarSpeedCoil(DXCoilNum).Name + ", Speed " + + for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode + 1)) { + ShowWarningError("SizeDXCoil: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + ", Speed " + TrimSigDigits(Mode) + " Rated Total Cooling Capacity must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + " Rated Total Cooling Capacity."); - ShowContinueError("Instead, " + RoundSigDigits(VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode), 2) + " > " + - RoundSigDigits(VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode + 1), 2)); + ShowContinueError("Instead, " + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode), 2) + " > " + + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode + 1), 2)); ShowFatalError("Preceding conditions cause termination."); } } // convert SHR to rated Bypass factor and effective air side surface area - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { - for (Mode = 1; Mode <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { - VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode) = CalcCBF(VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).Name, - RatedInletAirTemp, - RatedInletAirHumRat, - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode), - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), - VarSpeedCoil(DXCoilNum).MSRatedSHR(Mode), + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { + for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode) = CalcCBF(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->RatedInletAirTemp, + state.dataVariableSpeedCoils->RatedInletAirHumRat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedSHR(Mode), true); - if (VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode) > 0.0) { - VarSpeedCoil(DXCoilNum).MSEffectiveAo(Mode) = - -std::log(VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode)) * VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode) > 0.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEffectiveAo(Mode) = + -std::log(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode)) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode); } else { - VarSpeedCoil(DXCoilNum).MSEffectiveAo(Mode) = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEffectiveAo(Mode) = 0.0; } } - } else if (VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { - HPWHInletDBTemp = VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp; - HPWHInletWBTemp = VarSpeedCoil(DXCoilNum).WHRatedInletWBTemp; + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { + HPWHInletDBTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletDBTemp; + HPWHInletWBTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WHRatedInletWBTemp; rhoA = PsyRhoAirFnPbTdbW(StdBaroPress, HPWHInletDBTemp, HPInletAirHumRat, RoutineName); - for (Mode = 1; Mode <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { - VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; + for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * rhoA; // Check for valid range of (Rated Air Volume Flow Rate / Rated Total Capacity) - // RatedVolFlowPerRatedTotCap = VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / + // RatedVolFlowPerRatedTotCap = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / // VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode);//prepared for checking ratios, not used here } - for (Mode = 1; Mode <= VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { + for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { // get cooling capacity, without fan power, i.e. total coil cooling - if (VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) - HPWHCoolCapacity = VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * (1.0 - 1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(Mode)) + - VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) - - VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) * VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) + HPWHCoolCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * (1.0 - 1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(Mode)) + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) - + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; else - HPWHCoolCapacity = VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * (1.0 - 1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(Mode)) - - VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) * VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; + HPWHCoolCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * (1.0 - 1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(Mode)) - + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; - VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode) = CalcCBF(VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode) = CalcCBF(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, HPWHInletDBTemp, HPInletAirHumRat, HPWHCoolCapacity, - VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), - VarSpeedCoil(DXCoilNum).MSRatedSHR(Mode), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedSHR(Mode), true); - if (VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode) > 0.0) { - VarSpeedCoil(DXCoilNum).MSEffectiveAo(Mode) = - -std::log(VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode)) * VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode) > 0.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEffectiveAo(Mode) = + -std::log(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(Mode)) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode); } else { - VarSpeedCoil(DXCoilNum).MSEffectiveAo(Mode) = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEffectiveAo(Mode) = 0.0; } } - // update VarSpeedCoil(DXCoilNum).RatedCapCoolTotal - Mode = VarSpeedCoil(DXCoilNum).NormSpedLevel; - if (VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * (1.0 - 1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(Mode)) + - VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) - - VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) * VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; + // update state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal + Mode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * (1.0 - 1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(Mode)) + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) - + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; } else { - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = - VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * (1.0 - 1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(Mode)) - - VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) * VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) * (1.0 - 1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(Mode)) - + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(Mode) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; } } // size rated sensible cooling capacity RatedCapCoolSensAutoSized = true; // always do that - if (VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate >= SmallAirVolFlow && VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate >= SmallAirVolFlow && state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { RatedAirMassFlowRate = - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * PsyRhoAirFnPbTdbW(StdBaroPress, RatedInletAirTemp, RatedInletAirHumRat, RoutineName); - RatedInletEnth = PsyHFnTdbW(RatedInletAirTemp, RatedInletAirHumRat); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate * PsyRhoAirFnPbTdbW(StdBaroPress, state.dataVariableSpeedCoils->RatedInletAirTemp, state.dataVariableSpeedCoils->RatedInletAirHumRat, RoutineName); + RatedInletEnth = PsyHFnTdbW(state.dataVariableSpeedCoils->RatedInletAirTemp, state.dataVariableSpeedCoils->RatedInletAirHumRat); CBFRated = AdjustCBF( - VarSpeedCoil(DXCoilNum).MSRatedCBF(NormSpeed), VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(NormSpeed), RatedAirMassFlowRate); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(NormSpeed), state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(NormSpeed), RatedAirMassFlowRate); if (CBFRated > 0.999) CBFRated = 0.999; - AirMassFlowRatio = RatedAirMassFlowRate / VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(NormSpeed); + AirMassFlowRatio = RatedAirMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(NormSpeed); - if (VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(NormSpeed) > 1.0e-10) { - WaterMassFlowRatio = VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate / VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(NormSpeed); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(NormSpeed) > 1.0e-10) { + WaterMassFlowRatio = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(NormSpeed); } else { WaterMassFlowRatio = 1.0; } - Real64 TempInletWetBulb = RatedInletWetBulbTemp; + Real64 TempInletWetBulb = state.dataVariableSpeedCoils->RatedInletWetBulbTemp; CalcTotCapSHR_VSWSHP(state, - RatedInletAirTemp, - RatedInletAirHumRat, + state.dataVariableSpeedCoils->RatedInletAirTemp, + state.dataVariableSpeedCoils->RatedInletAirHumRat, RatedInletEnth, TempInletWetBulb, AirMassFlowRatio, WaterMassFlowRatio, RatedAirMassFlowRate, CBFRated, - VarSpeedCoil(DXCoilNum).MSRatedTotCap(NormSpeed), - VarSpeedCoil(DXCoilNum).MSCCapFTemp(NormSpeed), - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(NormSpeed), - VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(NormSpeed), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(NormSpeed), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(NormSpeed), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(NormSpeed), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(NormSpeed), 0.0, 0, 0, @@ -4849,12 +4668,12 @@ namespace VariableSpeedCoils { StdBaroPress, 0.0, 1, - VarSpeedCoil(DXCoilNum).capModFacTotal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).capModFacTotal); - RatedCapCoolSensDes = VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * SHR; - } else if (VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate >= SmallAirVolFlow && VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { - SHR = VarSpeedCoil(DXCoilNum).MSRatedSHR(NormSpeed); - RatedCapCoolSensDes = VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * SHR; + RatedCapCoolSensDes = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * SHR; + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate >= SmallAirVolFlow && state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { + SHR = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedSHR(NormSpeed); + RatedCapCoolSensDes = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * SHR; } else { RatedCapCoolSensDes = 0.0; } @@ -4863,61 +4682,61 @@ namespace VariableSpeedCoils { RatedCapCoolSensDes = 0.0; } - if (VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { // always report for cooling mode + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "COOLING") { // always report for cooling mode if (RatedCapCoolTotalAutoSized) { - VarSpeedCoil(DXCoilNum).RatedCapCoolSens = RatedCapCoolSensDes; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens = RatedCapCoolSensDes; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Rated Sensible Cooling Capacity [W]", - VarSpeedCoil(DXCoilNum).RatedCapCoolSens); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens); } else { // sensible capacity does not have an input field if (RatedCapCoolSensDes > 0.0) { - VarSpeedCoil(DXCoilNum).RatedCapCoolSens = RatedCapCoolSensDes; - BaseSizer::reportSizerOutput("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens = RatedCapCoolSensDes; + BaseSizer::reportSizerOutput("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + CurrentObjSubfix, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Rated Sensible Cooling Capacity [W]", RatedCapCoolSensDes); //, & } } - PreDefTableEntry(pdchCoolCoilTotCap, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); - PreDefTableEntry(pdchCoolCoilSensCap, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).RatedCapCoolSens); + PreDefTableEntry(pdchCoolCoilTotCap, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); + PreDefTableEntry(pdchCoolCoilSensCap, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens); PreDefTableEntry(pdchCoolCoilLatCap, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal - VarSpeedCoil(DXCoilNum).RatedCapCoolSens); - if (VarSpeedCoil(DXCoilNum).RatedCapCoolTotal != 0.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal != 0.0) { PreDefTableEntry(pdchCoolCoilSHR, - VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).RatedCapCoolSens / VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal); } else { - PreDefTableEntry(pdchCoolCoilSHR, VarSpeedCoil(DXCoilNum).Name, 0.0); + PreDefTableEntry(pdchCoolCoilSHR, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, 0.0); } PreDefTableEntry( - pdchCoolCoilNomEff, VarSpeedCoil(DXCoilNum).Name, VarSpeedCoil(DXCoilNum).MSRatedCOP(VarSpeedCoil(DXCoilNum).NormSpedLevel)); + pdchCoolCoilNomEff, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel)); addFootNoteSubTable(pdstCoolCoil, "Nominal values are gross at rated conditions, i.e., the supply air fan heat and electric power NOT accounted for."); } // START SIZING EVAP PRECOOLING PUMP POWER IsAutoSize = false; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { - if (VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower == AutoSize) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower == AutoSize) { IsAutoSize = true; } // Auto size high speed evap condenser pump power to Total Capacity * 0.004266 w/w (15 w/ton) - EvapCondPumpElecNomPowerDes = VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * 0.004266; + EvapCondPumpElecNomPowerDes = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal * 0.004266; if (IsAutoSize) { - VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower = EvapCondPumpElecNomPowerDes; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower = EvapCondPumpElecNomPowerDes; BaseSizer::reportSizerOutput("AS VS COOLING COIL", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Evaporative Condenser Pump Rated Power Consumption [W]", EvapCondPumpElecNomPowerDes); } else { - if (VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower > 0.0 && EvapCondPumpElecNomPowerDes > 0.0) { - EvapCondPumpElecNomPowerUser = VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower > 0.0 && EvapCondPumpElecNomPowerDes > 0.0) { + EvapCondPumpElecNomPowerUser = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower; BaseSizer::reportSizerOutput("AS VS COOLING COIL", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Evaporative Condenser Pump Rated Power Consumption [W]", EvapCondPumpElecNomPowerDes, "User-Specified Evaporative Condenser Pump Rated Power Consumption [W]", @@ -4925,9 +4744,9 @@ namespace VariableSpeedCoils { if (DisplayExtraWarnings) { if ((std::abs(EvapCondPumpElecNomPowerDes - EvapCondPumpElecNomPowerUser) / EvapCondPumpElecNomPowerUser) > AutoVsHardSizingThreshold) { - ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for " + VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + + ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); - ShowContinueError("Coil Name =" + VarSpeedCoil(DXCoilNum).Name); + ShowContinueError("Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); ShowContinueError("User-Specified Evaporative Condenser Pump Rated Power Consumption of " + RoundSigDigits(EvapCondPumpElecNomPowerUser, 2) + " [W]"); ShowContinueError("differs from Design Size Evaporative Condenser Pump Rated Power Consumption of " + @@ -4945,33 +4764,33 @@ namespace VariableSpeedCoils { // Resistive Defrost Heater Capacity = capacity at the first stage IsAutoSize = false; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { - if (VarSpeedCoil(DXCoilNum).DefrostCapacity == AutoSize) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostCapacity == AutoSize) { IsAutoSize = true; } - if (VarSpeedCoil(DXCoilNum).DefrostStrategy == Resistive) { - DefrostCapacityDes = VarSpeedCoil(DXCoilNum).RatedCapHeat; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy == state.dataVariableSpeedCoils->Resistive) { + DefrostCapacityDes = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat; } else { DefrostCapacityDes = 0.0; } if (IsAutoSize) { - VarSpeedCoil(DXCoilNum).DefrostCapacity = DefrostCapacityDes; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostCapacity = DefrostCapacityDes; BaseSizer::reportSizerOutput( - "AS VS HEATING COIL", VarSpeedCoil(DXCoilNum).Name, "Design Size Resistive Defrost Heater Capacity [W]", DefrostCapacityDes); + "AS VS HEATING COIL", state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Resistive Defrost Heater Capacity [W]", DefrostCapacityDes); } else { - if (VarSpeedCoil(DXCoilNum).DefrostCapacity > 0.0 && DefrostCapacityDes > 0.0 && !HardSizeNoDesRun) { - DefrostCapacityUser = VarSpeedCoil(DXCoilNum).DefrostCapacity; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostCapacity > 0.0 && DefrostCapacityDes > 0.0 && !HardSizeNoDesRun) { + DefrostCapacityUser = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostCapacity; BaseSizer::reportSizerOutput("AS VS HEATING COIL", - VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, "Design Size Resistive Defrost Heater Capacity [W]", DefrostCapacityDes, "User-Specified Resistive Defrost Heater Capacity [W]", DefrostCapacityUser); if (DisplayExtraWarnings) { if ((std::abs(DefrostCapacityDes - DefrostCapacityUser) / DefrostCapacityUser) > AutoVsHardSizingThreshold) { - ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for " + VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + + ShowMessage("SizeVarSpeedCoil: Potential issue with equipment sizing for " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); - ShowContinueError("Coil Name =" + VarSpeedCoil(DXCoilNum).Name); + ShowContinueError("Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); ShowContinueError("User-Specified Resistive Defrost Heater Capacity of " + RoundSigDigits(DefrostCapacityUser, 2) + " [W]"); ShowContinueError("differs from Design Size Resistive Defrost Heater Capacity of " + @@ -4987,13 +4806,13 @@ namespace VariableSpeedCoils { // test autosized sensible and total cooling capacity for total > sensible if (RatedCapCoolSensAutoSized && RatedCapCoolTotalAutoSized) { - if (VarSpeedCoil(DXCoilNum).RatedCapCoolSens > VarSpeedCoil(DXCoilNum).RatedCapCoolTotal) { - ShowWarningError("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + - VarSpeedCoil(DXCoilNum).Name + "\""); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal) { + ShowWarningError("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\""); ShowContinueError(RoutineName + ": Rated Sensible Cooling Capacity > Rated Total Cooling Capacity"); ShowContinueError("Each of these capacity inputs have been autosized."); - ShowContinueError("Rated Sensible Cooling Capacity = " + TrimSigDigits(VarSpeedCoil(DXCoilNum).RatedCapCoolSens, 2) + " W"); - ShowContinueError("Rated Total Cooling Capacity = " + TrimSigDigits(VarSpeedCoil(DXCoilNum).RatedCapCoolTotal, 2) + " W"); + ShowContinueError("Rated Sensible Cooling Capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens, 2) + " W"); + ShowContinueError("Rated Total Cooling Capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal, 2) + " W"); ShowContinueError("See eio file for further details."); ShowContinueError("Check Total and Sensible Cooling Capacity Coefficients to ensure they are accurate."); ShowContinueError("Check Zone and System Sizing objects to verify sizing inputs."); @@ -5012,13 +4831,13 @@ namespace VariableSpeedCoils { ShowContinueError("... to ensure they meet the expected manufacturers performance specifications."); } } else if (RatedCapCoolTotalAutoSized) { - if (VarSpeedCoil(DXCoilNum).RatedCapCoolSens > VarSpeedCoil(DXCoilNum).RatedCapCoolTotal) { - ShowWarningError("COIL:" + VarSpeedCoil(DXCoilNum).CoolHeatType + ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + - VarSpeedCoil(DXCoilNum).Name + "\""); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal) { + ShowWarningError("COIL:" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\""); ShowContinueError(RoutineName + ": Rated Sensible Cooling Capacity > Rated Total Cooling Capacity"); ShowContinueError("Only the rated total capacity input is autosized, consider autosizing both inputs."); - ShowContinueError("Rated Sensible Cooling Capacity = " + TrimSigDigits(VarSpeedCoil(DXCoilNum).RatedCapCoolSens, 2) + " W"); - ShowContinueError("Rated Total Cooling Capacity = " + TrimSigDigits(VarSpeedCoil(DXCoilNum).RatedCapCoolTotal, 2) + " W"); + ShowContinueError("Rated Sensible Cooling Capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens, 2) + " W"); + ShowContinueError("Rated Total Cooling Capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal, 2) + " W"); ShowContinueError("See eio file for further details."); ShowContinueError("Check Total and Sensible Cooling Capacity Coefficients to ensure they are accurate."); ShowContinueError("Check Zone and System Sizing objects to verify sizing inputs."); @@ -5162,17 +4981,17 @@ namespace VariableSpeedCoils { Real64 SpecHumOut; // outlet air specific humidity Real64 rhoair(0); // entering air density - if (firstTime) { + if (state.dataVariableSpeedCoils->firstTime) { // Set indoor air conditions to the rated condition LoadSideInletDBTemp_Init = 26.7; LoadSideInletHumRat_Init = 0.0111; LoadSideInletEnth_Init = PsyHFnTdbW(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init); CpAir_Init = PsyCpAirFnW(LoadSideInletHumRat_Init); - firstTime = false; + state.dataVariableSpeedCoils->firstTime = false; } LoadSideInletWBTemp_Init = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init, OutBaroPress, RoutineName); - MaxSpeed = VarSpeedCoil(DXCoilNum).NumOfSpeeds; + MaxSpeed = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; // must be placed inside the loop, otherwise cause bug in release mode, need to be present at two places if (SpeedNum > MaxSpeed) { @@ -5183,21 +5002,21 @@ namespace VariableSpeedCoils { // LOAD LOCAL VARIABLES FROM DATA STRUCTURE (for code readability) if (!(CyclingScheme == ContFanCycCoil) && PartLoadRatio > 0.0) { - VarSpeedCoil(DXCoilNum).AirMassFlowRate = Node(VarSpeedCoil(DXCoilNum).AirInletNodeNum).MassFlowRate / PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum).MassFlowRate / PartLoadRatio; } - Twet_Rated = VarSpeedCoil(DXCoilNum).Twet_Rated; - Gamma_Rated = VarSpeedCoil(DXCoilNum).Gamma_Rated; + Twet_Rated = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Twet_Rated; + Gamma_Rated = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Gamma_Rated; - LoadSideMassFlowRate = VarSpeedCoil(DXCoilNum).AirMassFlowRate; + state.dataVariableSpeedCoils->LoadSideMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { // Get condenser outdoor node info from DX COOLING Coil - if (VarSpeedCoil(DXCoilNum).CondenserInletNodeNum != 0) { - OutdoorDryBulb = Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Temp; - OutdoorHumRat = Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).HumRat; - OutdoorPressure = Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Press; - OutdoorWetBulb = Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).OutAirWetBulb; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum != 0) { + OutdoorDryBulb = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Temp; + OutdoorHumRat = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).HumRat; + OutdoorPressure = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Press; + OutdoorWetBulb = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).OutAirWetBulb; } else { OutdoorDryBulb = OutDryBulbTemp; OutdoorHumRat = OutHumRat; @@ -5208,19 +5027,19 @@ namespace VariableSpeedCoils { RhoSourceAir = PsyRhoAirFnPbTdbW(OutdoorPressure, OutdoorDryBulb, OutdoorHumRat); if ((SpeedNum == 1) || (SpeedNum > MaxSpeed) || (SpeedRatio == 1.0)) { - CondAirMassFlow = RhoSourceAir * VarSpeedCoil(DXCoilNum).EvapCondAirFlow(SpeedCal); + CondAirMassFlow = RhoSourceAir * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondAirFlow(SpeedCal); } else { - CondAirMassFlow = RhoSourceAir * (VarSpeedCoil(DXCoilNum).EvapCondAirFlow(SpeedCal) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).EvapCondAirFlow(SpeedCal - 1)); + CondAirMassFlow = RhoSourceAir * (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondAirFlow(SpeedCal) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondAirFlow(SpeedCal - 1)); } // AIR COOL OR EVAP COOLED CONDENSER - if (VarSpeedCoil(DXCoilNum).CondenserType == EvapCooled) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType == EvapCooled) { if ((SpeedNum == 1) || (SpeedNum > MaxSpeed) || (SpeedRatio == 1.0)) { - EvapCondEffectSped = VarSpeedCoil(DXCoilNum).EvapCondEffect(SpeedCal); + EvapCondEffectSped = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondEffect(SpeedCal); } else { - EvapCondEffectSped = VarSpeedCoil(DXCoilNum).EvapCondEffect(SpeedCal) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).EvapCondEffect(SpeedCal - 1); + EvapCondEffectSped = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondEffect(SpeedCal) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondEffect(SpeedCal - 1); } // (Outdoor wet-bulb temp from DataEnvironment) + (1.0-EvapCondEffectiveness) * (drybulb - wetbulb) CondInletTemp = OutdoorWetBulb + (OutdoorDryBulb - OutdoorWetBulb) * (1.0 - EvapCondEffectSped); @@ -5232,53 +5051,53 @@ namespace VariableSpeedCoils { CondInletHumRat = OutHumRat; } - SourceSideMassFlowRate = CondAirMassFlow; - SourceSideInletTemp = CondInletTemp; - SourceSideInletEnth = PsyHFnTdbW(CondInletTemp, CondInletHumRat); + state.dataVariableSpeedCoils->SourceSideMassFlowRate = CondAirMassFlow; + state.dataVariableSpeedCoils->SourceSideInletTemp = CondInletTemp; + state.dataVariableSpeedCoils->SourceSideInletEnth = PsyHFnTdbW(CondInletTemp, CondInletHumRat); CpSource = PsyCpAirFnW(CondInletHumRat); - VarSpeedCoil(DXCoilNum).CondInletTemp = CondInletTemp; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondInletTemp = CondInletTemp; // If used in a heat pump, the value of MaxOAT in the heating coil overrides that in the cooling coil (in GetInput) // Initialize crankcase heater, operates below OAT defined in input deck for HP DX heating coil - if (OutdoorDryBulb < VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater) { - CrankcaseHeatingPower = VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity; + if (OutdoorDryBulb < state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater) { + CrankcaseHeatingPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity; } else { CrankcaseHeatingPower = 0.0; } } else { - SourceSideMassFlowRate = VarSpeedCoil(DXCoilNum).WaterMassFlowRate; - SourceSideInletTemp = VarSpeedCoil(DXCoilNum).InletWaterTemp; - SourceSideInletEnth = VarSpeedCoil(DXCoilNum).InletWaterEnthalpy; + state.dataVariableSpeedCoils->SourceSideMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate; + state.dataVariableSpeedCoils->SourceSideInletTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp; + state.dataVariableSpeedCoils->SourceSideInletEnth = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy; CpSource = GetSpecificHeatGlycol(state, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidName, - SourceSideInletTemp, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataVariableSpeedCoils->SourceSideInletTemp, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSourceSideInletTemp); } // Check for flows, do not perform simulation if no flow in load side or source side. - if (SourceSideMassFlowRate <= 0.0 || LoadSideMassFlowRate <= 0.0) { + if (state.dataVariableSpeedCoils->SourceSideMassFlowRate <= 0.0 || state.dataVariableSpeedCoils->LoadSideMassFlowRate <= 0.0) { - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) && - (VarSpeedCoil(DXCoilNum).CondenserType == AirCooled) && (LoadSideMassFlowRate > 0.0)) { + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) && + (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType == AirCooled) && (state.dataVariableSpeedCoils->LoadSideMassFlowRate > 0.0)) { // ALLOW SIMULATION IF AIR-COOLED CONDENSER COIL - VarSpeedCoil(DXCoilNum).SimFlag = true; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = true; } else { - VarSpeedCoil(DXCoilNum).SimFlag = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = false; return; } } else { - VarSpeedCoil(DXCoilNum).SimFlag = true; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = true; } if (CompOp == 0) { - VarSpeedCoil(DXCoilNum).SimFlag = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = false; return; } - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) && - (CondInletTemp < VarSpeedCoil(DXCoilNum).MinOATCompressor)) { - VarSpeedCoil(DXCoilNum).SimFlag = false; + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) && + (CondInletTemp < state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MinOATCompressor)) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = false; return; } @@ -5296,50 +5115,50 @@ namespace VariableSpeedCoils { } // Set indoor air conditions to the actual condition - LoadSideInletDBTemp_Unit = VarSpeedCoil(DXCoilNum).InletAirDBTemp; - LoadSideInletHumRat_Unit = VarSpeedCoil(DXCoilNum).InletAirHumRat; + LoadSideInletDBTemp_Unit = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp; + LoadSideInletHumRat_Unit = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat; LoadSideInletWBTemp_Unit = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Unit, LoadSideInletHumRat_Unit, OutBaroPress, RoutineName); - LoadSideInletEnth_Unit = VarSpeedCoil(DXCoilNum).InletAirEnthalpy; + LoadSideInletEnth_Unit = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirEnthalpy; CpAir_Unit = PsyCpAirFnW(LoadSideInletHumRat_Unit); RuntimeFrac = 1.0; OnOffFanPartLoadFraction = 1.0; - VarSpeedCoil(DXCoilNum).RunFrac = 1.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 1.0; if ((SpeedNum == 1) && (PartLoadRatio < 1.0)) { - PLF = CurveValue(state, VarSpeedCoil(DXCoilNum).PLFFPLR, PartLoadRatio); + PLF = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR, PartLoadRatio); if (PLF < 0.7) { PLF = 0.7; } if (CyclingScheme == CycFanCycCoil) OnOffFanPartLoadFraction = PLF; // save PLF for fan model, don't change fan power for constant fan mode if coil is off // calculate the run time fraction - VarSpeedCoil(DXCoilNum).RunFrac = PartLoadRatio / PLF; - VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = PartLoadRatio / PLF; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; - if (VarSpeedCoil(DXCoilNum).RunFrac > 1.0) { - VarSpeedCoil(DXCoilNum).RunFrac = 1.0; // Reset coil runtime fraction to 1.0 - } else if (VarSpeedCoil(DXCoilNum).RunFrac < 0.0) { - VarSpeedCoil(DXCoilNum).RunFrac = 0.0; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac > 1.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 1.0; // Reset coil runtime fraction to 1.0 + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac < 0.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 0.0; } - RuntimeFrac = VarSpeedCoil(DXCoilNum).RunFrac; + RuntimeFrac = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac; } while (true) { ++NumIteration; if (NumIteration == 1) { // Set indoor air conditions to the rated conditions - LoadSideInletDBTemp = LoadSideInletDBTemp_Init; - LoadSideInletHumRat = LoadSideInletHumRat_Init; - LoadSideInletWBTemp = LoadSideInletWBTemp_Init; - LoadSideInletEnth = LoadSideInletEnth_Init; + state.dataVariableSpeedCoils->LoadSideInletDBTemp = LoadSideInletDBTemp_Init; + state.dataVariableSpeedCoils->LoadSideInletHumRat = LoadSideInletHumRat_Init; + state.dataVariableSpeedCoils->LoadSideInletWBTemp = LoadSideInletWBTemp_Init; + state.dataVariableSpeedCoils->LoadSideInletEnth = LoadSideInletEnth_Init; CpAir = CpAir_Init; } else { // Set indoor air conditions to the actual condition - LoadSideInletDBTemp = LoadSideInletDBTemp_Unit; - LoadSideInletHumRat = LoadSideInletHumRat_Unit; - LoadSideInletWBTemp = LoadSideInletWBTemp_Unit; - LoadSideInletEnth = LoadSideInletEnth_Unit; + state.dataVariableSpeedCoils->LoadSideInletDBTemp = LoadSideInletDBTemp_Unit; + state.dataVariableSpeedCoils->LoadSideInletHumRat = LoadSideInletHumRat_Unit; + state.dataVariableSpeedCoils->LoadSideInletWBTemp = LoadSideInletWBTemp_Unit; + state.dataVariableSpeedCoils->LoadSideInletEnth = LoadSideInletEnth_Unit; CpAir = CpAir_Unit; } @@ -5351,349 +5170,349 @@ namespace VariableSpeedCoils { } if ((SpeedNum == 1) || (SpeedNum > MaxSpeed) || (SpeedRatio == 1.0)) { - AirMassFlowRatio = LoadSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; + AirMassFlowRatio = state.dataVariableSpeedCoils->LoadSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { WaterMassFlowRatio = 1.0; } else { - WaterMassFlowRatio = SourceSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; + WaterMassFlowRatio = state.dataVariableSpeedCoils->SourceSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; } CBFSpeed = AdjustCBF( - VarSpeedCoil(DXCoilNum).MSRatedCBF(SpeedCal), VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal), LoadSideMassFlowRate); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(SpeedCal), state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal), state.dataVariableSpeedCoils->LoadSideMassFlowRate); if (CBFSpeed > 0.999) CBFSpeed = 0.999; CalcTotCapSHR_VSWSHP(state, - LoadSideInletDBTemp, - LoadSideInletHumRat, - LoadSideInletEnth, - LoadSideInletWBTemp, + state.dataVariableSpeedCoils->LoadSideInletDBTemp, + state.dataVariableSpeedCoils->LoadSideInletHumRat, + state.dataVariableSpeedCoils->LoadSideInletEnth, + state.dataVariableSpeedCoils->LoadSideInletWBTemp, AirMassFlowRatio, WaterMassFlowRatio, - LoadSideMassFlowRate, + state.dataVariableSpeedCoils->LoadSideMassFlowRate, CBFSpeed, - VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal), - VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), - VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), 0.0, 0, 0, 0, QLoadTotal1, QLoadTotal2, - QLoadTotal, + state.dataVariableSpeedCoils->QLoadTotal, SHR, - SourceSideInletTemp, - VarSpeedCoil(DXCoilNum).InletAirPressure, + state.dataVariableSpeedCoils->SourceSideInletTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirPressure, 0.0, 1, - VarSpeedCoil(DXCoilNum).capModFacTotal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).capModFacTotal); - EIRTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), LoadSideInletWBTemp, SourceSideInletTemp); - EIRAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); + EIRTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletWBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + EIRAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { EIRWaterFFModFac = 1.0; } else { - EIRWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); + EIRWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); } - EIR = (1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; + EIR = (1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; CBFSpeed = AdjustCBF( - VarSpeedCoil(DXCoilNum).MSRatedCBF(SpeedCal), VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal), LoadSideMassFlowRate); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(SpeedCal), state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal), state.dataVariableSpeedCoils->LoadSideMassFlowRate); if (CBFSpeed > 0.999) CBFSpeed = 0.999; CalcTotCapSHR_VSWSHP(state, - LoadSideInletDBTemp, - LoadSideInletHumRat, - LoadSideInletEnth, - LoadSideInletWBTemp, + state.dataVariableSpeedCoils->LoadSideInletDBTemp, + state.dataVariableSpeedCoils->LoadSideInletHumRat, + state.dataVariableSpeedCoils->LoadSideInletEnth, + state.dataVariableSpeedCoils->LoadSideInletWBTemp, AirMassFlowRatio, WaterMassFlowRatio, - LoadSideMassFlowRate, + state.dataVariableSpeedCoils->LoadSideMassFlowRate, CBFSpeed, - VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal), - VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), - VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), 0.0, 0, 0, 0, QLoadTotal1, QLoadTotal2, - QLoadTotal, + state.dataVariableSpeedCoils->QLoadTotal, SHR, - SourceSideInletTemp, - VarSpeedCoil(DXCoilNum).InletAirPressure, + state.dataVariableSpeedCoils->SourceSideInletTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirPressure, 0.0, 1, - VarSpeedCoil(DXCoilNum).capModFacTotal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).capModFacTotal); - Winput = QLoadTotal * EIR; + state.dataVariableSpeedCoils->Winput = state.dataVariableSpeedCoils->QLoadTotal * EIR; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { QWasteHeat = 0.0; } else { - QWasteHeat = Winput * VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); - QWasteHeat *= CurveValue(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), LoadSideInletWBTemp, SourceSideInletTemp); + QWasteHeat = state.dataVariableSpeedCoils->Winput * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); + QWasteHeat *= CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletWBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); } } else { - AirMassFlowRatio = LoadSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; + AirMassFlowRatio = state.dataVariableSpeedCoils->LoadSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { WaterMassFlowRatio = 1.0; } else { - WaterMassFlowRatio = SourceSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; + WaterMassFlowRatio = state.dataVariableSpeedCoils->SourceSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; } - AoEff = VarSpeedCoil(DXCoilNum).MSEffectiveAo(SpeedCal) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).MSEffectiveAo(SpeedCal - 1); + AoEff = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEffectiveAo(SpeedCal) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEffectiveAo(SpeedCal - 1); - CBFSpeed = std::exp(-AoEff / LoadSideMassFlowRate); + CBFSpeed = std::exp(-AoEff / state.dataVariableSpeedCoils->LoadSideMassFlowRate); if (CBFSpeed > 0.999) CBFSpeed = 0.999; CalcTotCapSHR_VSWSHP(state, - LoadSideInletDBTemp, - LoadSideInletHumRat, - LoadSideInletEnth, - LoadSideInletWBTemp, + state.dataVariableSpeedCoils->LoadSideInletDBTemp, + state.dataVariableSpeedCoils->LoadSideInletHumRat, + state.dataVariableSpeedCoils->LoadSideInletEnth, + state.dataVariableSpeedCoils->LoadSideInletWBTemp, AirMassFlowRatio, WaterMassFlowRatio, - LoadSideMassFlowRate, + state.dataVariableSpeedCoils->LoadSideMassFlowRate, CBFSpeed, - VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal - 1), - VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal - 1), - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal - 1), - VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal - 1), - VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal), - VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), - VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), - VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal - 1), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal - 1), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal - 1), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal - 1), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), QLoadTotal1, QLoadTotal2, - QLoadTotal, + state.dataVariableSpeedCoils->QLoadTotal, SHR, - SourceSideInletTemp, - VarSpeedCoil(DXCoilNum).InletAirPressure, + state.dataVariableSpeedCoils->SourceSideInletTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirPressure, SpeedRatio, 2, - VarSpeedCoil(DXCoilNum).capModFacTotal); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).capModFacTotal); SpeedCal = SpeedNum - 1; - EIRTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), LoadSideInletWBTemp, SourceSideInletTemp); - EIRAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); + EIRTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletWBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + EIRAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { EIRWaterFFModFac = 1.0; } else { - EIRWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); + EIRWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); } - EIR = (1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; + EIR = (1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; Winput1 = QLoadTotal1 * EIR; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { QWasteHeat1 = 0.0; } else { - QWasteHeat1 = Winput1 * VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); - QWasteHeat1 *= CurveValue(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), LoadSideInletWBTemp, SourceSideInletTemp); + QWasteHeat1 = Winput1 * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); + QWasteHeat1 *= CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletWBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); } SpeedCal = SpeedNum; - EIRTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), LoadSideInletWBTemp, SourceSideInletTemp); - EIRAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); + EIRTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletWBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + EIRAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { EIRWaterFFModFac = 1.0; } else { - EIRWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); + EIRWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); } - EIR = (1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; + EIR = (1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; Winput2 = QLoadTotal2 * EIR; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { QWasteHeat2 = 0.0; } else { - QWasteHeat2 = Winput2 * VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); - QWasteHeat2 *= CurveValue(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), LoadSideInletWBTemp, SourceSideInletTemp); + QWasteHeat2 = Winput2 * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); + QWasteHeat2 *= CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletWBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); } - Winput = Winput2 * SpeedRatio + (1.0 - SpeedRatio) * Winput1; + state.dataVariableSpeedCoils->Winput = Winput2 * SpeedRatio + (1.0 - SpeedRatio) * Winput1; QWasteHeat = QWasteHeat2 * SpeedRatio + (1.0 - SpeedRatio) * QWasteHeat1; } - QSensible = QLoadTotal * SHR; + state.dataVariableSpeedCoils->QSensible = state.dataVariableSpeedCoils->QLoadTotal * SHR; - QSource = QLoadTotal + Winput - QWasteHeat; + state.dataVariableSpeedCoils->QSource = state.dataVariableSpeedCoils->QLoadTotal + state.dataVariableSpeedCoils->Winput - QWasteHeat; - if (QSource < 0) { - QSource = 0.0; - QWasteHeat = QLoadTotal + Winput; + if (state.dataVariableSpeedCoils->QSource < 0) { + state.dataVariableSpeedCoils->QSource = 0.0; + QWasteHeat = state.dataVariableSpeedCoils->QLoadTotal + state.dataVariableSpeedCoils->Winput; } // Check if the Sensible Load is greater than the Total Cooling Load - if (QSensible > QLoadTotal) { - QSensible = QLoadTotal; + if (state.dataVariableSpeedCoils->QSensible > state.dataVariableSpeedCoils->QLoadTotal) { + state.dataVariableSpeedCoils->QSensible = state.dataVariableSpeedCoils->QLoadTotal; } if (LatDegradModelSimFlag) { // Calculate for SHReff using the Latent Degradation Model if (NumIteration == 1) { - QLatRated = QLoadTotal - QSensible; + state.dataVariableSpeedCoils->QLatRated = state.dataVariableSpeedCoils->QLoadTotal - state.dataVariableSpeedCoils->QSensible; } else if (NumIteration == 2) { - QLatActual = QLoadTotal - QSensible; - SHRss = QSensible / QLoadTotal; - SHReff = CalcEffectiveSHR( - DXCoilNum, SHRss, CyclingScheme, RuntimeFrac, QLatRated, QLatActual, LoadSideInletDBTemp, LoadSideInletWBTemp); + state.dataVariableSpeedCoils->QLatActual = state.dataVariableSpeedCoils->QLoadTotal - state.dataVariableSpeedCoils->QSensible; + SHRss = state.dataVariableSpeedCoils->QSensible / state.dataVariableSpeedCoils->QLoadTotal; + SHReff = CalcEffectiveSHR(state, + DXCoilNum, SHRss, CyclingScheme, RuntimeFrac, state.dataVariableSpeedCoils->QLatRated, state.dataVariableSpeedCoils->QLatActual, state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->LoadSideInletWBTemp); // Update sensible capacity based on effective SHR - QSensible = QLoadTotal * SHReff; + state.dataVariableSpeedCoils->QSensible = state.dataVariableSpeedCoils->QLoadTotal * SHReff; goto LOOP_exit; } } else { // Assume SHReff=SHRss - SHReff = QSensible / QLoadTotal; + SHReff = state.dataVariableSpeedCoils->QSensible / state.dataVariableSpeedCoils->QLoadTotal; goto LOOP_exit; } } LOOP_exit:; // considering hot gas reheat here - if (VarSpeedCoil(DXCoilNum).HOTGASREHEATFLG > 0) { - QLoadTotal -= QWasteHeat; - QSensible -= QWasteHeat; - SHReff = QSensible / QLoadTotal; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HOTGASREHEATFLG > 0) { + state.dataVariableSpeedCoils->QLoadTotal -= QWasteHeat; + state.dataVariableSpeedCoils->QSensible -= QWasteHeat; + SHReff = state.dataVariableSpeedCoils->QSensible / state.dataVariableSpeedCoils->QLoadTotal; } - VarSpeedCoil(DXCoilNum).BasinHeaterPower = 0.0; - VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPower = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = 0.0; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { - if (VarSpeedCoil(DXCoilNum).CondenserType == EvapCooled) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType == EvapCooled) { //****************** // WATER CONSUMPTION IN m3 OF WATER FOR DIRECT // H2O [m3/s] = Delta W[kgWater/kgDryAir]*Mass Flow Air[kgDryAir/s] // /RhoWater [kgWater/m3] //****************** RhoEvapCondWater = RhoH2O(OutdoorDryBulb); - VarSpeedCoil(DXCoilNum).EvapWaterConsumpRate = (CondInletHumRat - OutdoorHumRat) * CondAirMassFlow / RhoEvapCondWater * RuntimeFrac; - VarSpeedCoil(DXCoilNum).EvapCondPumpElecPower = VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower * RuntimeFrac; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterConsumpRate = (CondInletHumRat - OutdoorHumRat) * CondAirMassFlow / RhoEvapCondWater * RuntimeFrac; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower * RuntimeFrac; // Calculate basin heater power - CalcBasinHeaterPower(VarSpeedCoil(DXCoilNum).BasinHeaterPowerFTempDiff, - VarSpeedCoil(DXCoilNum).BasinHeaterSchedulePtr, - VarSpeedCoil(DXCoilNum).BasinHeaterSetPointTemp, - VarSpeedCoil(DXCoilNum).BasinHeaterPower); - VarSpeedCoil(DXCoilNum).BasinHeaterPower *= (1.0 - RuntimeFrac); + CalcBasinHeaterPower(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPowerFTempDiff, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterSchedulePtr, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterSetPointTemp, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPower); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPower *= (1.0 - RuntimeFrac); } - VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = CrankcaseHeatingPower * (1.0 - RuntimeFrac); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = CrankcaseHeatingPower * (1.0 - RuntimeFrac); // set water system demand request (if needed) - if (VarSpeedCoil(DXCoilNum).EvapWaterSupplyMode == WaterSupplyFromTank) { - WaterStorage(VarSpeedCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(VarSpeedCoil(DXCoilNum).EvapWaterTankDemandARRID) = - VarSpeedCoil(DXCoilNum).EvapWaterConsumpRate; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterSupplyMode == state.dataVariableSpeedCoils->WaterSupplyFromTank) { + WaterStorage(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterTankDemandARRID) = + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterConsumpRate; } } // calculate coil outlet state variables - LoadSideOutletEnth = LoadSideInletEnth - QLoadTotal / LoadSideMassFlowRate; - LoadSideOutletDBTemp = LoadSideInletDBTemp - QSensible / (LoadSideMassFlowRate * CpAir); + state.dataVariableSpeedCoils->LoadSideOutletEnth = state.dataVariableSpeedCoils->LoadSideInletEnth - state.dataVariableSpeedCoils->QLoadTotal / state.dataVariableSpeedCoils->LoadSideMassFlowRate; + state.dataVariableSpeedCoils->LoadSideOutletDBTemp = state.dataVariableSpeedCoils->LoadSideInletDBTemp - state.dataVariableSpeedCoils->QSensible / (state.dataVariableSpeedCoils->LoadSideMassFlowRate * CpAir); - MaxHumRat = PsyWFnTdbRhPb(LoadSideOutletDBTemp, 0.9999, VarSpeedCoil(DXCoilNum).InletAirPressure, RoutineName); - MaxOutletEnth = PsyHFnTdbW(LoadSideOutletDBTemp, MaxHumRat); - if (LoadSideOutletEnth > MaxOutletEnth) { - LoadSideOutletEnth = MaxOutletEnth; - // QLoadTotal = LoadSideMassFlowRate * (LoadSideInletEnth - LoadSideOutletEnth) + MaxHumRat = PsyWFnTdbRhPb(state.dataVariableSpeedCoils->LoadSideOutletDBTemp, 0.9999, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirPressure, RoutineName); + MaxOutletEnth = PsyHFnTdbW(state.dataVariableSpeedCoils->LoadSideOutletDBTemp, MaxHumRat); + if (state.dataVariableSpeedCoils->LoadSideOutletEnth > MaxOutletEnth) { + state.dataVariableSpeedCoils->LoadSideOutletEnth = MaxOutletEnth; + // QLoadTotal = state.dataVariableSpeedCoils->LoadSideMassFlowRate * (LoadSideInletEnth - LoadSideOutletEnth) } - LoadSideOutletHumRat = PsyWFnTdbH(LoadSideOutletDBTemp, LoadSideOutletEnth, RoutineName); - if (LoadSideOutletHumRat > MaxHumRat) { - LoadSideOutletHumRat = MaxHumRat; + state.dataVariableSpeedCoils->LoadSideOutletHumRat = PsyWFnTdbH(state.dataVariableSpeedCoils->LoadSideOutletDBTemp, state.dataVariableSpeedCoils->LoadSideOutletEnth, RoutineName); + if (state.dataVariableSpeedCoils->LoadSideOutletHumRat > MaxHumRat) { + state.dataVariableSpeedCoils->LoadSideOutletHumRat = MaxHumRat; } ++Count; // Actual outlet conditions are "average" for time step if (CyclingScheme == ContFanCycCoil) { // continuous fan, cycling compressor - VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = PartLoadRatio * LoadSideOutletEnth + (1.0 - PartLoadRatio) * LoadSideInletEnth; - VarSpeedCoil(DXCoilNum).OutletAirHumRat = PartLoadRatio * LoadSideOutletHumRat + (1.0 - PartLoadRatio) * LoadSideInletHumRat; - VarSpeedCoil(DXCoilNum).OutletAirDBTemp = PsyTdbFnHW(VarSpeedCoil(DXCoilNum).OutletAirEnthalpy, VarSpeedCoil(DXCoilNum).OutletAirHumRat); - PLRCorrLoadSideMdot = LoadSideMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = PartLoadRatio * state.dataVariableSpeedCoils->LoadSideOutletEnth + (1.0 - PartLoadRatio) * state.dataVariableSpeedCoils->LoadSideInletEnth; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat = PartLoadRatio * state.dataVariableSpeedCoils->LoadSideOutletHumRat + (1.0 - PartLoadRatio) * state.dataVariableSpeedCoils->LoadSideInletHumRat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp = PsyTdbFnHW(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat); + state.dataVariableSpeedCoils->PLRCorrLoadSideMdot = state.dataVariableSpeedCoils->LoadSideMassFlowRate; } else { // default to cycling fan, cycling compressor - VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = LoadSideOutletEnth; - VarSpeedCoil(DXCoilNum).OutletAirHumRat = LoadSideOutletHumRat; - VarSpeedCoil(DXCoilNum).OutletAirDBTemp = LoadSideOutletDBTemp; - PLRCorrLoadSideMdot = LoadSideMassFlowRate * PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = state.dataVariableSpeedCoils->LoadSideOutletEnth; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat = state.dataVariableSpeedCoils->LoadSideOutletHumRat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp = state.dataVariableSpeedCoils->LoadSideOutletDBTemp; + state.dataVariableSpeedCoils->PLRCorrLoadSideMdot = state.dataVariableSpeedCoils->LoadSideMassFlowRate * PartLoadRatio; } // scale heat transfer rates to PLR and power to RTF - QLoadTotal *= PartLoadRatio; - QSensible *= PartLoadRatio; + state.dataVariableSpeedCoils->QLoadTotal *= PartLoadRatio; + state.dataVariableSpeedCoils->QSensible *= PartLoadRatio; // count the powr separately - Winput *= RuntimeFrac; //+ VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower & - //+ VarSpeedCoil(DXCoilNum)%BasinHeaterPower + VarSpeedCoil(DXCoilNum)%EvapCondPumpElecPower - QSource *= PartLoadRatio; + state.dataVariableSpeedCoils->Winput *= RuntimeFrac; //+ state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower & + //+ state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%BasinHeaterPower + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%EvapCondPumpElecPower + state.dataVariableSpeedCoils->QSource *= PartLoadRatio; QWasteHeat *= PartLoadRatio; // Add power to global variable so power can be summed by parent object - DXElecCoolingPower = Winput; + DXElecCoolingPower = state.dataVariableSpeedCoils->Winput; ReportingConstant = TimeStepSys * SecInHour; // Update heat pump data structure - VarSpeedCoil(DXCoilNum).Power = Winput; - VarSpeedCoil(DXCoilNum).QLoadTotal = QLoadTotal; - VarSpeedCoil(DXCoilNum).QSensible = QSensible; - VarSpeedCoil(DXCoilNum).QLatent = QLoadTotal - QSensible; - VarSpeedCoil(DXCoilNum).QSource = QSource; - VarSpeedCoil(DXCoilNum).Energy = Winput * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergyLoadTotal = QLoadTotal * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergySensible = QSensible * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergyLatent = (QLoadTotal - QSensible) * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergySource = QSource * ReportingConstant; - VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower * ReportingConstant; - VarSpeedCoil(DXCoilNum).EvapWaterConsump = VarSpeedCoil(DXCoilNum).EvapWaterConsumpRate * ReportingConstant; - VarSpeedCoil(DXCoilNum).BasinHeaterConsumption = VarSpeedCoil(DXCoilNum).BasinHeaterPower * ReportingConstant; - VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption = VarSpeedCoil(DXCoilNum).EvapCondPumpElecPower * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = state.dataVariableSpeedCoils->Winput; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal = state.dataVariableSpeedCoils->QLoadTotal; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible = state.dataVariableSpeedCoils->QSensible; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent = state.dataVariableSpeedCoils->QLoadTotal - state.dataVariableSpeedCoils->QSensible; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource = state.dataVariableSpeedCoils->QSource; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy = state.dataVariableSpeedCoils->Winput * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal = state.dataVariableSpeedCoils->QLoadTotal * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible = state.dataVariableSpeedCoils->QSensible * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent = ( state.dataVariableSpeedCoils->QLoadTotal - state.dataVariableSpeedCoils->QSensible) * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource = state.dataVariableSpeedCoils->QSource * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterConsump = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterConsumpRate * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterConsumption = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPower * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecPower * ReportingConstant; if (RuntimeFrac == 0.0) { - VarSpeedCoil(DXCoilNum).COP = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).COP = 0.0; } else { - VarSpeedCoil(DXCoilNum).COP = QLoadTotal / Winput; - } - VarSpeedCoil(DXCoilNum).RunFrac = RuntimeFrac; - VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; - VarSpeedCoil(DXCoilNum).AirMassFlowRate = PLRCorrLoadSideMdot; - rhoair = PsyRhoAirFnPbTdbW(OutBaroPress, LoadSideInletDBTemp, LoadSideInletHumRat, RoutineName); - VarSpeedCoil(DXCoilNum).AirVolFlowRate = VarSpeedCoil(DXCoilNum).AirMassFlowRate / rhoair; - - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; - VarSpeedCoil(DXCoilNum).OutletWaterTemp = 0.0; - VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = 0.0; - DataHeatBalance::HeatReclaimVS_DXCoil(DXCoilNum).AvailCapacity = QSource; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).COP = state.dataVariableSpeedCoils->QLoadTotal / state.dataVariableSpeedCoils->Winput; + } + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = RuntimeFrac; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = state.dataVariableSpeedCoils->PLRCorrLoadSideMdot; + rhoair = PsyRhoAirFnPbTdbW(OutBaroPress, state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->LoadSideInletHumRat, RoutineName); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate / rhoair; + + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = 0.0; + DataHeatBalance::HeatReclaimVS_DXCoil(DXCoilNum).AvailCapacity = state.dataVariableSpeedCoils->QSource; } else { - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = SourceSideMassFlowRate; - VarSpeedCoil(DXCoilNum).OutletWaterTemp = SourceSideInletTemp + QSource / (SourceSideMassFlowRate * CpSource); - VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = SourceSideInletEnth + QSource / SourceSideMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = state.dataVariableSpeedCoils->SourceSideMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp = state.dataVariableSpeedCoils->SourceSideInletTemp + state.dataVariableSpeedCoils->QSource / (state.dataVariableSpeedCoils->SourceSideMassFlowRate * CpSource); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = state.dataVariableSpeedCoils->SourceSideInletEnth + state.dataVariableSpeedCoils->QSource / state.dataVariableSpeedCoils->SourceSideMassFlowRate; } - VarSpeedCoil(DXCoilNum).QWasteHeat = QWasteHeat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QWasteHeat = QWasteHeat; - if (VarSpeedCoil(DXCoilNum).CondensateCollectMode == CondensateToTank) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateCollectMode == state.dataVariableSpeedCoils->CondensateToTank) { // calculate and report condensation rates (how much water extracted from the air stream) // water flow of water in m3/s for water system interactions - RhoWater = RhoH2O((VarSpeedCoil(DXCoilNum).InletAirDBTemp + VarSpeedCoil(DXCoilNum).OutletAirDBTemp) / 2.0); + RhoWater = RhoH2O((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp) / 2.0); // CR9155 Remove specific humidity calculations - SpecHumIn = LoadSideInletHumRat; - SpecHumOut = LoadSideOutletHumRat; + SpecHumIn = state.dataVariableSpeedCoils->LoadSideInletHumRat; + SpecHumOut = state.dataVariableSpeedCoils->LoadSideOutletHumRat; // mdot * del HumRat / rho water - VarSpeedCoil(DXCoilNum).CondensateVdot = max(0.0, (LoadSideMassFlowRate * (SpecHumIn - SpecHumOut) / RhoWater)); - VarSpeedCoil(DXCoilNum).CondensateVol = VarSpeedCoil(DXCoilNum).CondensateVdot * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateVdot = max(0.0, (state.dataVariableSpeedCoils->LoadSideMassFlowRate * (SpecHumIn - SpecHumOut) / RhoWater)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateVol = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondensateVdot * ReportingConstant; } } @@ -5799,15 +5618,15 @@ namespace VariableSpeedCoils { // note: load side is the evaporator side, and source side is the condenser side - CondInletNode = VarSpeedCoil(DXCoilNum).WaterInletNodeNum; - CondOutletNode = VarSpeedCoil(DXCoilNum).WaterOutletNodeNum; + CondInletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum; + CondOutletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum; // If heat pump water heater is OFF, set outlet to inlet and RETURN if (PartLoadRatio == 0.0) { Node(CondOutletNode) = Node(CondInletNode); return; } else { - EvapInletNode = VarSpeedCoil(DXCoilNum).AirInletNodeNum; - EvapOutletNode = VarSpeedCoil(DXCoilNum).AirOutletNodeNum; + EvapInletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum; + EvapOutletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirOutletNodeNum; InletWaterTemp = Node(CondInletNode).Temp; CondInletMassFlowRate = Node(CondInletNode).MassFlowRate; EvapInletMassFlowRate = Node(EvapInletNode).MassFlowRate; @@ -5823,11 +5642,11 @@ namespace VariableSpeedCoils { EvapInletMassFlowRate = EvapInletMassFlowRate / PartLoadRatio; } - VarSpeedCoil(DXCoilNum).AirMassFlowRate = EvapInletMassFlowRate; - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = CondInletMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = EvapInletMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = CondInletMassFlowRate; // determine inlet air temperature type for curve objects - if (VarSpeedCoil(DXCoilNum).InletAirTemperatureType == WetBulbIndicator) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirTemperatureType == WetBulbIndicator) { InletAirTemp = HPWHInletWBTemp; } else { InletAirTemp = HPWHInletDBTemp; @@ -5836,42 +5655,42 @@ namespace VariableSpeedCoils { // check if indoor evaporator or outdoor evaporator CrankcaseHeatingPower = 0.0; if (EvapInletNode != 0) { - LoadSideInletDBTemp = Node(EvapInletNode).Temp; - LoadSideInletHumRat = Node(EvapInletNode).HumRat; + state.dataVariableSpeedCoils->LoadSideInletDBTemp = Node(EvapInletNode).Temp; + state.dataVariableSpeedCoils->LoadSideInletHumRat = Node(EvapInletNode).HumRat; LoadPressure = Node(EvapInletNode).Press; // prevent the air pressure not given if (LoadPressure < 10.0) LoadPressure = OutBaroPress; - LoadSideInletWBTemp = Node(EvapInletNode).OutAirWetBulb; - LoadSideInletEnth = Node(EvapInletNode).Enthalpy; + state.dataVariableSpeedCoils->LoadSideInletWBTemp = Node(EvapInletNode).OutAirWetBulb; + state.dataVariableSpeedCoils->LoadSideInletEnth = Node(EvapInletNode).Enthalpy; } else { - LoadSideInletDBTemp = OutDryBulbTemp; - LoadSideInletHumRat = OutHumRat; + state.dataVariableSpeedCoils->LoadSideInletDBTemp = OutDryBulbTemp; + state.dataVariableSpeedCoils->LoadSideInletHumRat = OutHumRat; LoadPressure = OutBaroPress; - LoadSideInletWBTemp = OutWetBulbTemp; - LoadSideInletEnth = OutEnthalpy; + state.dataVariableSpeedCoils->LoadSideInletWBTemp = OutWetBulbTemp; + state.dataVariableSpeedCoils->LoadSideInletEnth = OutEnthalpy; // Initialize crankcase heater, operates below OAT defined in input deck for HP DX heating coil - if (OutDryBulbTemp < VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater) { - CrankcaseHeatingPower = VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity; + if (OutDryBulbTemp < state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater) { + CrankcaseHeatingPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity; }; } - LoadSideMassFlowRate = EvapInletMassFlowRate; - SourceSideMassFlowRate = CondInletMassFlowRate; - SourceSideInletTemp = InletWaterTemp; - SourceSideInletEnth = Node(CondInletNode).Enthalpy; - VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = SourceSideInletEnth; + state.dataVariableSpeedCoils->LoadSideMassFlowRate = EvapInletMassFlowRate; + state.dataVariableSpeedCoils->SourceSideMassFlowRate = CondInletMassFlowRate; + state.dataVariableSpeedCoils->SourceSideInletTemp = InletWaterTemp; + state.dataVariableSpeedCoils->SourceSideInletEnth = Node(CondInletNode).Enthalpy; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = state.dataVariableSpeedCoils->SourceSideInletEnth; // Check for flows, do not perform simulation if no flow in load side or source side. - if ((SourceSideMassFlowRate <= 0.0) || (LoadSideMassFlowRate <= 0.0)) { - VarSpeedCoil(DXCoilNum).SimFlag = false; + if ((state.dataVariableSpeedCoils->SourceSideMassFlowRate <= 0.0) || (state.dataVariableSpeedCoils->LoadSideMassFlowRate <= 0.0)) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = false; return; } else { - VarSpeedCoil(DXCoilNum).SimFlag = true; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = true; } - MaxSpeed = VarSpeedCoil(DXCoilNum).NumOfSpeeds; + MaxSpeed = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; // must be placed inside the loop, otherwise cause bug in release mode, need to be present at two places if (SpeedNum > MaxSpeed) { @@ -5883,25 +5702,25 @@ namespace VariableSpeedCoils { // part-load calculation RuntimeFrac = 1.0; OnOffFanPartLoadFraction = 1.0; - VarSpeedCoil(DXCoilNum).RunFrac = 1.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 1.0; if ((SpeedNum == 1) && (PartLoadRatio < 1.0)) { - PLF = CurveValue(state, VarSpeedCoil(DXCoilNum).PLFFPLR, PartLoadRatio); + PLF = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR, PartLoadRatio); if (PLF < 0.7) { PLF = 0.7; } if (CyclingScheme == CycFanCycCoil) OnOffFanPartLoadFraction = PLF; // save PLF for fan model, don't change fan power for constant fan mode if coil is off // calculate the run time fraction - VarSpeedCoil(DXCoilNum).RunFrac = PartLoadRatio / PLF; - VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = PartLoadRatio / PLF; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; - if (VarSpeedCoil(DXCoilNum).RunFrac > 1.0) { - VarSpeedCoil(DXCoilNum).RunFrac = 1.0; // Reset coil runtime fraction to 1.0 - } else if (VarSpeedCoil(DXCoilNum).RunFrac < 0.0) { - VarSpeedCoil(DXCoilNum).RunFrac = 0.0; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac > 1.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 1.0; // Reset coil runtime fraction to 1.0 + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac < 0.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 0.0; } - RuntimeFrac = VarSpeedCoil(DXCoilNum).RunFrac; + RuntimeFrac = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac; } // interpolate between speeds @@ -5913,44 +5732,44 @@ namespace VariableSpeedCoils { } Real64 locFanElecPower = 0.0; // local for fan electric power - if (VarSpeedCoil(DXCoilNum).SupplyFan_TypeNum == DataHVACGlobals::FanType_SystemModelObject) { - if (VarSpeedCoil(DXCoilNum).SupplyFanIndex > -1) { - locFanElecPower = HVACFan::fanObjs[VarSpeedCoil(DXCoilNum).SupplyFanIndex]->fanPower(); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFan_TypeNum == DataHVACGlobals::FanType_SystemModelObject) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanIndex > -1) { + locFanElecPower = HVACFan::fanObjs[ state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanIndex]->fanPower(); } } else { - if (VarSpeedCoil(DXCoilNum).SupplyFanIndex > 0) { - locFanElecPower = Fans::GetFanPower(VarSpeedCoil(DXCoilNum).SupplyFanIndex); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanIndex > 0) { + locFanElecPower = Fans::GetFanPower(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SupplyFanIndex); } } if ((SpeedNum == 1) || (SpeedNum > MaxSpeed) || (SpeedRatio == 1.0)) { - AirMassFlowRatio = LoadSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; - WaterMassFlowRatio = SourceSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedCal); + AirMassFlowRatio = state.dataVariableSpeedCoils->LoadSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; + WaterMassFlowRatio = state.dataVariableSpeedCoils->SourceSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedCal); - COPTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), InletAirTemp, SourceSideInletTemp); - COPAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); - COPWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); + COPTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), InletAirTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + COPAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); + COPWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); - COP = VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal) * COPTempModFac * COPAirFFModFac * COPWaterFFModFac; + COP = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal) * COPTempModFac * COPAirFFModFac * COPWaterFFModFac; - TOTCAPTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), InletAirTemp, SourceSideInletTemp); + TOTCAPTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), InletAirTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); // Get capacity modifying factor (function of mass flow) for off-rated conditions - TOTCAPAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); + TOTCAPAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); // Get capacity modifying factor (function of mass flow) for off-rated conditions - TOTCAPWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); + TOTCAPWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); - OperatingHeatingCapacity = VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TOTCAPTempModFac * TOTCAPAirFFModFac * TOTCAPWaterFFModFac; + OperatingHeatingCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TOTCAPTempModFac * TOTCAPAirFFModFac * TOTCAPWaterFFModFac; - Winput = OperatingHeatingCapacity / COP; - OperatingHeatingPower = Winput; + state.dataVariableSpeedCoils->Winput = OperatingHeatingCapacity / COP; + OperatingHeatingPower = state.dataVariableSpeedCoils->Winput; OperatingHeatingCOP = COP; - PumpHeatToWater = VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower * VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; + PumpHeatToWater = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; TankHeatingCOP = OperatingHeatingCOP; // account for pump heat if not included in total water heating capacity - if (VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { TotalTankHeatingCapacity = OperatingHeatingCapacity; } else { TotalTankHeatingCapacity = OperatingHeatingCapacity + PumpHeatToWater; @@ -5958,107 +5777,107 @@ namespace VariableSpeedCoils { HPRTF = RuntimeFrac; // calculate evaporator total cooling capacity - if (VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP) { - if (VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { // make sure fan power is full load fan power, it isn't though, - CompressorPower = OperatingHeatingPower - locFanElecPower / HPRTF - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower; + CompressorPower = OperatingHeatingPower - locFanElecPower / HPRTF - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower; if (OperatingHeatingPower > 0.0) TankHeatingCOP = TotalTankHeatingCapacity / OperatingHeatingPower; } else { CompressorPower = OperatingHeatingPower - locFanElecPower / HPRTF; - if ((OperatingHeatingPower + VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) > 0.0) - TankHeatingCOP = TotalTankHeatingCapacity / (OperatingHeatingPower + VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower); + if ((OperatingHeatingPower + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) > 0.0) + TankHeatingCOP = TotalTankHeatingCapacity / (OperatingHeatingPower + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower); } } else { - if (VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { // make sure fan power is full load fan power - CompressorPower = OperatingHeatingPower - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower; + CompressorPower = OperatingHeatingPower - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower; if ((OperatingHeatingPower + locFanElecPower / HPRTF) > 0.0) TankHeatingCOP = TotalTankHeatingCapacity / (OperatingHeatingPower + locFanElecPower / HPRTF); } else { CompressorPower = OperatingHeatingPower; - if ((OperatingHeatingPower + locFanElecPower / HPRTF + VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) > 0.0) + if ((OperatingHeatingPower + locFanElecPower / HPRTF + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) > 0.0) TankHeatingCOP = TotalTankHeatingCapacity / - (OperatingHeatingPower + locFanElecPower / HPRTF + VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower); + (OperatingHeatingPower + locFanElecPower / HPRTF + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower); } } - if (VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { EvapCoolingCapacity = TotalTankHeatingCapacity - PumpHeatToWater - CompressorPower; } else { EvapCoolingCapacity = TotalTankHeatingCapacity - CompressorPower; } CBFSpeed = AdjustCBF( - VarSpeedCoil(DXCoilNum).MSRatedCBF(SpeedCal), VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal), LoadSideMassFlowRate); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCBF(SpeedCal), state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirMassFlowRate(SpeedCal), state.dataVariableSpeedCoils->LoadSideMassFlowRate); } else { - AirMassFlowRatio = LoadSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; - WaterMassFlowRatio = SourceSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; - AoEff = VarSpeedCoil(DXCoilNum).MSEffectiveAo(SpeedCal) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).MSEffectiveAo(SpeedCal - 1); - CBFSpeed = std::exp(-AoEff / LoadSideMassFlowRate); + AirMassFlowRatio = state.dataVariableSpeedCoils->LoadSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; + WaterMassFlowRatio = state.dataVariableSpeedCoils->SourceSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; + AoEff = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEffectiveAo(SpeedCal) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEffectiveAo(SpeedCal - 1); + CBFSpeed = std::exp(-AoEff / state.dataVariableSpeedCoils->LoadSideMassFlowRate); // calculate low speed SpeedCal = SpeedNum - 1; - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedCal); - COPTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), InletAirTemp, SourceSideInletTemp); - COPAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); - COPWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedCal); + COPTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), InletAirTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + COPAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); + COPWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); - COP = VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal) * COPTempModFac * COPAirFFModFac * COPWaterFFModFac; + COP = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal) * COPTempModFac * COPAirFFModFac * COPWaterFFModFac; - TOTCAPTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), InletAirTemp, SourceSideInletTemp); + TOTCAPTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), InletAirTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); // Get capacity modifying factor (function of mass flow) for off-rated conditions - TOTCAPAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); + TOTCAPAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); // Get capacity modifying factor (function of mass flow) for off-rated conditions - TOTCAPWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); + TOTCAPWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); - OperatingHeatingCapacity = VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TOTCAPTempModFac * TOTCAPAirFFModFac * TOTCAPWaterFFModFac; + OperatingHeatingCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TOTCAPTempModFac * TOTCAPAirFFModFac * TOTCAPWaterFFModFac; - Winput = OperatingHeatingCapacity / COP; - OperatingHeatingPower = Winput; - Winput1 = Winput; + state.dataVariableSpeedCoils->Winput = OperatingHeatingCapacity / COP; + OperatingHeatingPower = state.dataVariableSpeedCoils->Winput; + Winput1 = state.dataVariableSpeedCoils->Winput; WHCAP1 = OperatingHeatingCapacity; // calculate upper speed SpeedCal = SpeedNum; - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedCal); - COPTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), InletAirTemp, SourceSideInletTemp); - COPAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); - COPWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedCal); + COPTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), InletAirTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + COPAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); + COPWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); - COP = VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal) * COPTempModFac * COPAirFFModFac * COPWaterFFModFac; + COP = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal) * COPTempModFac * COPAirFFModFac * COPWaterFFModFac; - TOTCAPTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), InletAirTemp, SourceSideInletTemp); + TOTCAPTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), InletAirTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); // Get capacity modifying factor (function of mass flow) for off-rated conditions - TOTCAPAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); + TOTCAPAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); // Get capacity modifying factor (function of mass flow) for off-rated conditions - TOTCAPWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); + TOTCAPWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); - OperatingHeatingCapacity = VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TOTCAPTempModFac * TOTCAPAirFFModFac * TOTCAPWaterFFModFac; + OperatingHeatingCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TOTCAPTempModFac * TOTCAPAirFFModFac * TOTCAPWaterFFModFac; - Winput = OperatingHeatingCapacity / COP; - OperatingHeatingPower = Winput; + state.dataVariableSpeedCoils->Winput = OperatingHeatingCapacity / COP; + OperatingHeatingPower = state.dataVariableSpeedCoils->Winput; - Winput2 = Winput; + Winput2 = state.dataVariableSpeedCoils->Winput; WHCAP2 = OperatingHeatingCapacity; // interpolation - Winput = Winput2 * SpeedRatio + (1.0 - SpeedRatio) * Winput1; - OperatingHeatingPower = Winput; + state.dataVariableSpeedCoils->Winput = Winput2 * SpeedRatio + (1.0 - SpeedRatio) * Winput1; + OperatingHeatingPower = state.dataVariableSpeedCoils->Winput; OperatingHeatingCapacity = WHCAP2 * SpeedRatio + (1.0 - SpeedRatio) * WHCAP1; - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedNum) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedNum - 1); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedNum) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWHPumpPower(SpeedNum - 1); OperatingHeatingCOP = OperatingHeatingCapacity / OperatingHeatingPower; TankHeatingCOP = OperatingHeatingCOP; - PumpHeatToWater = VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower * VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; + PumpHeatToWater = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater; // account for pump heat if not included in total water heating capacity - if (VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { TotalTankHeatingCapacity = OperatingHeatingCapacity; } else { TotalTankHeatingCapacity = OperatingHeatingCapacity + PumpHeatToWater; @@ -6066,39 +5885,39 @@ namespace VariableSpeedCoils { HPRTF = RuntimeFrac; // calculate evaporator total cooling capacity - if (VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP) { - if (VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { // make sure fan power is full load fan power - CompressorPower = OperatingHeatingPower - locFanElecPower / HPRTF - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower; + CompressorPower = OperatingHeatingPower - locFanElecPower / HPRTF - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower; if (OperatingHeatingPower > 0.0) TankHeatingCOP = TotalTankHeatingCapacity / OperatingHeatingPower; } else { CompressorPower = OperatingHeatingPower - locFanElecPower / HPRTF; - if ((OperatingHeatingPower + VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) > 0.0) - TankHeatingCOP = TotalTankHeatingCapacity / (OperatingHeatingPower + VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower); + if ((OperatingHeatingPower + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) > 0.0) + TankHeatingCOP = TotalTankHeatingCapacity / (OperatingHeatingPower + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower); } } else { - if (VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP) { // make sure fan power is full load fan power - CompressorPower = OperatingHeatingPower - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower; + CompressorPower = OperatingHeatingPower - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower; if ((OperatingHeatingPower + locFanElecPower / HPRTF) > 0.0) TankHeatingCOP = TotalTankHeatingCapacity / (OperatingHeatingPower + locFanElecPower / HPRTF); } else { CompressorPower = OperatingHeatingPower; - if ((OperatingHeatingPower + locFanElecPower / HPRTF + VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) > 0.0) + if ((OperatingHeatingPower + locFanElecPower / HPRTF + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) > 0.0) TankHeatingCOP = TotalTankHeatingCapacity / - (OperatingHeatingPower + locFanElecPower / HPRTF + VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower); + (OperatingHeatingPower + locFanElecPower / HPRTF + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower); } } - if (VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity) { EvapCoolingCapacity = TotalTankHeatingCapacity - PumpHeatToWater - CompressorPower; } else { EvapCoolingCapacity = TotalTankHeatingCapacity - CompressorPower; } } - QSource = TotalTankHeatingCapacity; - QLoadTotal = EvapCoolingCapacity; + state.dataVariableSpeedCoils->QSource = TotalTankHeatingCapacity; + state.dataVariableSpeedCoils->QLoadTotal = EvapCoolingCapacity; DXCoilTotalCapacity = EvapCoolingCapacity; // for standard rating calculation SHR = 1.0; // if indoor, calculate SHR @@ -6108,20 +5927,20 @@ namespace VariableSpeedCoils { if (CBFSpeed < 0.001) { SHR = 1.0; } else { - hDelta = QLoadTotal / LoadSideMassFlowRate; - hADP = LoadSideInletEnth - hDelta / (1.0 - CBFSpeed); + hDelta = state.dataVariableSpeedCoils->QLoadTotal / state.dataVariableSpeedCoils->LoadSideMassFlowRate; + hADP = state.dataVariableSpeedCoils->LoadSideInletEnth - hDelta / (1.0 - CBFSpeed); tADP = PsyTsatFnHPb(hADP, LoadPressure, RoutineName); wADP = PsyWFnTdbH(tADP, hADP, RoutineName); - hTinwADP = PsyHFnTdbW(LoadSideInletDBTemp, wADP); - if ((LoadSideInletEnth - hADP) > 1.e-10) { - SHR = min((hTinwADP - hADP) / (LoadSideInletEnth - hADP), 1.0); + hTinwADP = PsyHFnTdbW(state.dataVariableSpeedCoils->LoadSideInletDBTemp, wADP); + if (( state.dataVariableSpeedCoils->LoadSideInletEnth - hADP) > 1.e-10) { + SHR = min((hTinwADP - hADP) / ( state.dataVariableSpeedCoils->LoadSideInletEnth - hADP), 1.0); } else { SHR = 1.0; } } } - QSensible = QLoadTotal * SHR; + state.dataVariableSpeedCoils->QSensible = state.dataVariableSpeedCoils->QLoadTotal * SHR; // determine condenser water inlet/outlet condition at full capacity if (CondInletMassFlowRate == 0.0) { @@ -6136,124 +5955,124 @@ namespace VariableSpeedCoils { // send heating capacity and COP to water heater module for standards rating calculation // total heating capacity including condenser pump - VSHPWHHeatingCapacity = TotalTankHeatingCapacity; + state.dataVariableSpeedCoils->VSHPWHHeatingCapacity = TotalTankHeatingCapacity; // total heating COP including compressor, fan, and condenser pump - VSHPWHHeatingCOP = TankHeatingCOP; + state.dataVariableSpeedCoils->VSHPWHHeatingCOP = TankHeatingCOP; - VarSpeedCoil(DXCoilNum).TotalHeatingEnergyRate = TotalTankHeatingCapacity * PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).TotalHeatingEnergyRate = TotalTankHeatingCapacity * PartLoadRatio; // calculate total compressor plus condenser pump power, fan power reported in fan module - VarSpeedCoil(DXCoilNum).ElecWaterHeatingPower = (CompressorPower + VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) * HPRTF; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).ElecWaterHeatingPower = (CompressorPower + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower) * HPRTF; // pass the outputs for the cooling coil section - VarSpeedCoil(DXCoilNum).BasinHeaterPower = 0.0; - VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = CrankcaseHeatingPower * (1.0 - RuntimeFrac); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPower = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = CrankcaseHeatingPower * (1.0 - RuntimeFrac); // calculate coil outlet state variables - LoadSideOutletEnth = LoadSideInletEnth - QLoadTotal / LoadSideMassFlowRate; - CpAir = PsyCpAirFnW(LoadSideInletHumRat); - LoadSideOutletDBTemp = LoadSideInletDBTemp - QSensible / (LoadSideMassFlowRate * CpAir); + state.dataVariableSpeedCoils->LoadSideOutletEnth = state.dataVariableSpeedCoils->LoadSideInletEnth - state.dataVariableSpeedCoils->QLoadTotal / state.dataVariableSpeedCoils->LoadSideMassFlowRate; + CpAir = PsyCpAirFnW(state.dataVariableSpeedCoils->LoadSideInletHumRat); + state.dataVariableSpeedCoils->LoadSideOutletDBTemp = state.dataVariableSpeedCoils->LoadSideInletDBTemp - state.dataVariableSpeedCoils->QSensible / (state.dataVariableSpeedCoils->LoadSideMassFlowRate * CpAir); - MaxHumRat = PsyWFnTdbRhPb(LoadSideOutletDBTemp, 0.9999, VarSpeedCoil(DXCoilNum).InletAirPressure, RoutineName); - MaxOutletEnth = PsyHFnTdbW(LoadSideOutletDBTemp, MaxHumRat); - if (LoadSideOutletEnth > MaxOutletEnth) { - LoadSideOutletEnth = MaxOutletEnth; + MaxHumRat = PsyWFnTdbRhPb( state.dataVariableSpeedCoils->LoadSideOutletDBTemp, 0.9999, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirPressure, RoutineName); + MaxOutletEnth = PsyHFnTdbW( state.dataVariableSpeedCoils->LoadSideOutletDBTemp, MaxHumRat); + if ( state.dataVariableSpeedCoils->LoadSideOutletEnth > MaxOutletEnth) { + state.dataVariableSpeedCoils->LoadSideOutletEnth = MaxOutletEnth; } - LoadSideOutletHumRat = PsyWFnTdbH(LoadSideOutletDBTemp, LoadSideOutletEnth, RoutineName); - if (LoadSideOutletHumRat > MaxHumRat) { - LoadSideOutletHumRat = MaxHumRat; + state.dataVariableSpeedCoils->LoadSideOutletHumRat = PsyWFnTdbH( state.dataVariableSpeedCoils->LoadSideOutletDBTemp, state.dataVariableSpeedCoils->LoadSideOutletEnth, RoutineName); + if ( state.dataVariableSpeedCoils->LoadSideOutletHumRat > MaxHumRat) { + state.dataVariableSpeedCoils->LoadSideOutletHumRat = MaxHumRat; } // Actual outlet conditions are "average" for time step if (CyclingScheme == ContFanCycCoil) { // continuous fan, cycling compressor - VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = PartLoadRatio * LoadSideOutletEnth + (1.0 - PartLoadRatio) * LoadSideInletEnth; - VarSpeedCoil(DXCoilNum).OutletAirHumRat = PartLoadRatio * LoadSideOutletHumRat + (1.0 - PartLoadRatio) * LoadSideInletHumRat; - VarSpeedCoil(DXCoilNum).OutletAirDBTemp = PsyTdbFnHW(VarSpeedCoil(DXCoilNum).OutletAirEnthalpy, VarSpeedCoil(DXCoilNum).OutletAirHumRat); - PLRCorrLoadSideMdot = LoadSideMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = PartLoadRatio * state.dataVariableSpeedCoils->LoadSideOutletEnth + (1.0 - PartLoadRatio) * state.dataVariableSpeedCoils->LoadSideInletEnth; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat = PartLoadRatio * state.dataVariableSpeedCoils->LoadSideOutletHumRat + (1.0 - PartLoadRatio) * state.dataVariableSpeedCoils->LoadSideInletHumRat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp = PsyTdbFnHW(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat); + state.dataVariableSpeedCoils->PLRCorrLoadSideMdot = state.dataVariableSpeedCoils->LoadSideMassFlowRate; } else { - VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = LoadSideOutletEnth; - VarSpeedCoil(DXCoilNum).OutletAirHumRat = LoadSideOutletHumRat; - VarSpeedCoil(DXCoilNum).OutletAirDBTemp = LoadSideOutletDBTemp; - PLRCorrLoadSideMdot = LoadSideMassFlowRate * PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = state.dataVariableSpeedCoils->LoadSideOutletEnth; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat = state.dataVariableSpeedCoils->LoadSideOutletHumRat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp = state.dataVariableSpeedCoils->LoadSideOutletDBTemp; + state.dataVariableSpeedCoils->PLRCorrLoadSideMdot = state.dataVariableSpeedCoils->LoadSideMassFlowRate * PartLoadRatio; } // scale heat transfer rates to PLR and power to RTF - QLoadTotal *= PartLoadRatio; - QSensible *= PartLoadRatio; + state.dataVariableSpeedCoils->QLoadTotal *= PartLoadRatio; + state.dataVariableSpeedCoils->QSensible *= PartLoadRatio; // count the powr separately - Winput *= RuntimeFrac; //+ VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower & - //+ VarSpeedCoil(DXCoilNum)%BasinHeaterPower + VarSpeedCoil(DXCoilNum)%EvapCondPumpElecPower - QSource *= PartLoadRatio; + state.dataVariableSpeedCoils->Winput *= RuntimeFrac; //+ state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower & + //+ state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%BasinHeaterPower + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%EvapCondPumpElecPower + state.dataVariableSpeedCoils->QSource *= PartLoadRatio; // Add power to global variable so power can be summed by parent object - DXElecCoolingPower = Winput; + DXElecCoolingPower = state.dataVariableSpeedCoils->Winput; ReportingConstant = TimeStepSys * SecInHour; // Update heat pump data structure - VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower * RuntimeFrac; // water heating pump power - VarSpeedCoil(DXCoilNum).Power = Winput; - VarSpeedCoil(DXCoilNum).QLoadTotal = QLoadTotal; - VarSpeedCoil(DXCoilNum).QSensible = QSensible; - VarSpeedCoil(DXCoilNum).QLatent = QLoadTotal - QSensible; - VarSpeedCoil(DXCoilNum).QSource = QSource; - VarSpeedCoil(DXCoilNum).Energy = Winput * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergyLoadTotal = QLoadTotal * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergySensible = QSensible * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergyLatent = (QLoadTotal - QSensible) * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergySource = QSource * ReportingConstant; - VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower * ReportingConstant; - VarSpeedCoil(DXCoilNum).EvapWaterConsump = 0.0; - VarSpeedCoil(DXCoilNum).BasinHeaterConsumption = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower * RuntimeFrac; // water heating pump power + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = state.dataVariableSpeedCoils->Winput; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal = state.dataVariableSpeedCoils->QLoadTotal; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible = state.dataVariableSpeedCoils->QSensible; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent = state.dataVariableSpeedCoils->QLoadTotal - state.dataVariableSpeedCoils->QSensible; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource = state.dataVariableSpeedCoils->QSource; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy = state.dataVariableSpeedCoils->Winput * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal = state.dataVariableSpeedCoils->QLoadTotal * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible = state.dataVariableSpeedCoils->QSensible * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent = ( state.dataVariableSpeedCoils->QLoadTotal - state.dataVariableSpeedCoils->QSensible) * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource = state.dataVariableSpeedCoils->QSource * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapWaterConsump = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterConsumption = 0.0; // re-use EvapCondPumpElecConsumption to store WH pump energy consumption - VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption = VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecConsumption = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower * ReportingConstant; if (RuntimeFrac == 0.0) { - VarSpeedCoil(DXCoilNum).COP = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).COP = 0.0; } else { - VarSpeedCoil(DXCoilNum).COP = QLoadTotal / Winput; - } - VarSpeedCoil(DXCoilNum).RunFrac = RuntimeFrac; - VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; - VarSpeedCoil(DXCoilNum).AirMassFlowRate = PLRCorrLoadSideMdot; - rhoair = PsyRhoAirFnPbTdbW(OutBaroPress, LoadSideInletDBTemp, LoadSideInletHumRat, RoutineName); - VarSpeedCoil(DXCoilNum).AirVolFlowRate = VarSpeedCoil(DXCoilNum).AirMassFlowRate / rhoair; - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = SourceSideMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).COP = state.dataVariableSpeedCoils->QLoadTotal / state.dataVariableSpeedCoils->Winput; + } + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = RuntimeFrac; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = state.dataVariableSpeedCoils->PLRCorrLoadSideMdot; + rhoair = PsyRhoAirFnPbTdbW(OutBaroPress, state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->LoadSideInletHumRat, RoutineName); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate / rhoair; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = state.dataVariableSpeedCoils->SourceSideMassFlowRate; RhoWater = RhoH2O(InletWaterTemp); // initialize - VarSpeedCoil(DXCoilNum).WaterVolFlowRate = VarSpeedCoil(DXCoilNum).WaterMassFlowRate / RhoWater; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate / RhoWater; - VarSpeedCoil(DXCoilNum).OutletWaterTemp = SourceSideInletTemp + QSource / (SourceSideMassFlowRate * CpWater); - VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = SourceSideInletEnth + QSource / SourceSideMassFlowRate; - VarSpeedCoil(DXCoilNum).QWasteHeat = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp = state.dataVariableSpeedCoils->SourceSideInletTemp + state.dataVariableSpeedCoils->QSource / (state.dataVariableSpeedCoils->SourceSideMassFlowRate * CpWater); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = state.dataVariableSpeedCoils->SourceSideInletEnth + state.dataVariableSpeedCoils->QSource / state.dataVariableSpeedCoils->SourceSideMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QWasteHeat = 0.0; - if (VarSpeedCoil(DXCoilNum).bIsDesuperheater) // desuperheater doesn't save power and cooling energy variables + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).bIsDesuperheater) // desuperheater doesn't save power and cooling energy variables { // source side is the water side; load side is the air side - VarSpeedCoil(DXCoilNum).Power = 0.0; - VarSpeedCoil(DXCoilNum).QLoadTotal = 0.0; - VarSpeedCoil(DXCoilNum).QSensible = 0.0; - VarSpeedCoil(DXCoilNum).QLatent = 0.0; - VarSpeedCoil(DXCoilNum).Energy = 0.0; - VarSpeedCoil(DXCoilNum).EnergyLoadTotal = 0.0; - VarSpeedCoil(DXCoilNum).EnergySensible = 0.0; - VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; - VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = 0.0; } } - void setVarSpeedHPWHFanTypeNum(int const dXCoilNum, int const fanTypeNum) + void setVarSpeedHPWHFanTypeNum(EnergyPlusData &state, int const dXCoilNum, int const fanTypeNum) { - VarSpeedCoil(dXCoilNum).SupplyFan_TypeNum = fanTypeNum; + state.dataVariableSpeedCoils->VarSpeedCoil(dXCoilNum).SupplyFan_TypeNum = fanTypeNum; } - void setVarSpeedHPWHFanIndex(int const dXCoilNum, int const fanIndex) + void setVarSpeedHPWHFanIndex(EnergyPlusData &state, int const dXCoilNum, int const fanIndex) { - VarSpeedCoil(dXCoilNum).SupplyFanIndex = fanIndex; + state.dataVariableSpeedCoils->VarSpeedCoil(dXCoilNum).SupplyFanIndex = fanIndex; } - void setVarSpeedFanInfo(int const dXCoilNum, std::string const fanName, int const fanIndex, int const fanTypeNum) + void setVarSpeedFanInfo(EnergyPlusData &state, int const dXCoilNum, std::string const fanName, int const fanIndex, int const fanTypeNum) { - VarSpeedCoil(dXCoilNum).SupplyFanIndex = fanIndex; - VarSpeedCoil(dXCoilNum).SupplyFan_TypeNum = fanTypeNum; - VarSpeedCoil(dXCoilNum).SupplyFanName = fanName; + state.dataVariableSpeedCoils->VarSpeedCoil(dXCoilNum).SupplyFanIndex = fanIndex; + state.dataVariableSpeedCoils->VarSpeedCoil(dXCoilNum).SupplyFan_TypeNum = fanTypeNum; + state.dataVariableSpeedCoils->VarSpeedCoil(dXCoilNum).SupplyFanName = fanName; } void CalcVarSpeedCoilHeating(EnergyPlusData &state, @@ -6301,7 +6120,7 @@ namespace VariableSpeedCoils { // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcVarSpeedCoilHeating"); - static std::string const RoutineNameSourceSideInletTemp("CalcVarSpeedCoilHeating:SourceSideInletTemp"); + static std::string const RoutineNameSourceSideInletTemp("CalcVarSpeedCoilHeating:state.dataVariableSpeedCoils->SourceSideInletTemp"); // INTERFACE BLOCK SPECIFICATIONS // na @@ -6350,72 +6169,72 @@ namespace VariableSpeedCoils { static Real64 DefrostEIRTempModFac(0.0); // EIR modifier for defrost (function of entering wetbulb, outside drybulb) static Real64 TotRatedCapacity(0.0); // total rated capacity at the given speed and speed ratio for defrosting - MaxSpeed = VarSpeedCoil(DXCoilNum).NumOfSpeeds; + MaxSpeed = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; // LOAD LOCAL VARIABLES FROM DATA STRUCTURE (for code readability) if (!(CyclingScheme == ContFanCycCoil) && PartLoadRatio > 0.0) { - VarSpeedCoil(DXCoilNum).AirMassFlowRate = Node(VarSpeedCoil(DXCoilNum).AirInletNodeNum).MassFlowRate / PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum).MassFlowRate / PartLoadRatio; } - LoadSideMassFlowRate = VarSpeedCoil(DXCoilNum).AirMassFlowRate; - LoadSideInletDBTemp = VarSpeedCoil(DXCoilNum).InletAirDBTemp; - LoadSideInletHumRat = VarSpeedCoil(DXCoilNum).InletAirHumRat; + state.dataVariableSpeedCoils->LoadSideMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate; + state.dataVariableSpeedCoils->LoadSideInletDBTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp; + state.dataVariableSpeedCoils->LoadSideInletHumRat = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat; - LoadSideInletWBTemp = PsyTwbFnTdbWPb(LoadSideInletDBTemp, LoadSideInletHumRat, OutBaroPress, RoutineName); - LoadSideInletEnth = VarSpeedCoil(DXCoilNum).InletAirEnthalpy; - CpAir = PsyCpAirFnW(LoadSideInletHumRat); + state.dataVariableSpeedCoils->LoadSideInletWBTemp = PsyTwbFnTdbWPb(state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->LoadSideInletHumRat, OutBaroPress, RoutineName); + state.dataVariableSpeedCoils->LoadSideInletEnth = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirEnthalpy; + CpAir = PsyCpAirFnW(state.dataVariableSpeedCoils->LoadSideInletHumRat); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { // Get condenser outdoor node info from DX Heating Coil - if (VarSpeedCoil(DXCoilNum).CondenserInletNodeNum != 0) { - OutdoorDryBulb = Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Temp; - OutdoorHumRat = Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).HumRat; - OutdoorPressure = Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Press; - OutdoorWetBulb = Node(VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).OutAirWetBulb; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum != 0) { + OutdoorDryBulb = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Temp; + OutdoorHumRat = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).HumRat; + OutdoorPressure = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).Press; + OutdoorWetBulb = Node(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserInletNodeNum).OutAirWetBulb; } else { OutdoorDryBulb = OutDryBulbTemp; OutdoorHumRat = OutHumRat; OutdoorPressure = OutBaroPress; OutdoorWetBulb = OutWetBulbTemp; } - SourceSideMassFlowRate = 1.0; // not used and avoid divided by zero - SourceSideInletTemp = OutdoorDryBulb; - SourceSideInletEnth = PsyHFnTdbW(OutdoorDryBulb, OutdoorHumRat); + state.dataVariableSpeedCoils->SourceSideMassFlowRate = 1.0; // not used and avoid divided by zero + state.dataVariableSpeedCoils->SourceSideInletTemp = OutdoorDryBulb; + state.dataVariableSpeedCoils->SourceSideInletEnth = PsyHFnTdbW(OutdoorDryBulb, OutdoorHumRat); CpSource = PsyCpAirFnW(OutHumRat); // Initialize crankcase heater, operates below OAT defined in input deck for HP DX heating coil - if (OutdoorDryBulb < VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater) { - CrankcaseHeatingPower = VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity; + if (OutdoorDryBulb < state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater) { + CrankcaseHeatingPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity; } else { CrankcaseHeatingPower = 0.0; } } else { - SourceSideMassFlowRate = VarSpeedCoil(DXCoilNum).WaterMassFlowRate; - SourceSideInletTemp = VarSpeedCoil(DXCoilNum).InletWaterTemp; - SourceSideInletEnth = VarSpeedCoil(DXCoilNum).InletWaterEnthalpy; + state.dataVariableSpeedCoils->SourceSideMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate; + state.dataVariableSpeedCoils->SourceSideInletTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp; + state.dataVariableSpeedCoils->SourceSideInletEnth = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy; CpSource = GetSpecificHeatGlycol(state, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidName, - SourceSideInletTemp, - PlantLoop(VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataVariableSpeedCoils->SourceSideInletTemp, + PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSourceSideInletTemp); } // Check for flows, do not perform simulation if no flow in load side or source side. - if ((SourceSideMassFlowRate <= 0.0) || (LoadSideMassFlowRate <= 0.0)) { - VarSpeedCoil(DXCoilNum).SimFlag = false; + if ((state.dataVariableSpeedCoils->SourceSideMassFlowRate <= 0.0) || (state.dataVariableSpeedCoils->LoadSideMassFlowRate <= 0.0)) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = false; return; } else { - VarSpeedCoil(DXCoilNum).SimFlag = true; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = true; } - if ((VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) && - (OutdoorDryBulb < VarSpeedCoil(DXCoilNum).MinOATCompressor)) { - VarSpeedCoil(DXCoilNum).SimFlag = false; + if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) && + (OutdoorDryBulb < state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MinOATCompressor)) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = false; return; } if (CompOp == 0) { - VarSpeedCoil(DXCoilNum).SimFlag = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag = false; return; } @@ -6426,150 +6245,150 @@ namespace VariableSpeedCoils { } RuntimeFrac = 1.0; - VarSpeedCoil(DXCoilNum).RunFrac = 1.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 1.0; OnOffFanPartLoadFraction = 1.0; if ((SpeedNum == 1) && (PartLoadRatio < 1.0)) { - PLF = CurveValue(state, VarSpeedCoil(DXCoilNum).PLFFPLR, PartLoadRatio); + PLF = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PLFFPLR, PartLoadRatio); if (PLF < 0.7) { PLF = 0.7; } if (CyclingScheme == CycFanCycCoil) OnOffFanPartLoadFraction = PLF; // save PLF for fan model, don't change fan power for constant fan mode if coil is off // calculate the run time fraction - VarSpeedCoil(DXCoilNum).RunFrac = PartLoadRatio / PLF; - VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = PartLoadRatio / PLF; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; - if (VarSpeedCoil(DXCoilNum).RunFrac > 1.0) { - VarSpeedCoil(DXCoilNum).RunFrac = 1.0; // Reset coil runtime fraction to 1.0 - } else if (VarSpeedCoil(DXCoilNum).RunFrac < 0.0) { - VarSpeedCoil(DXCoilNum).RunFrac = 0.0; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac > 1.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 1.0; // Reset coil runtime fraction to 1.0 + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac < 0.0) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 0.0; } - RuntimeFrac = VarSpeedCoil(DXCoilNum).RunFrac; + RuntimeFrac = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac; } if ((SpeedNum == 1) || (SpeedNum > MaxSpeed) || (SpeedRatio == 1.0)) { - AirMassFlowRatio = LoadSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; + AirMassFlowRatio = state.dataVariableSpeedCoils->LoadSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { WaterMassFlowRatio = 1.0; } else { - WaterMassFlowRatio = SourceSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; + WaterMassFlowRatio = state.dataVariableSpeedCoils->SourceSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; } - TotCapTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), LoadSideInletDBTemp, SourceSideInletTemp); - TotCapAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); + TotCapTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + TotCapAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { TotCapWaterFFModFac = 1.0; } else { - TotCapWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); + TotCapWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); } - QLoadTotal = VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac; - VarSpeedCoil(DXCoilNum).capModFacTotal = TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac; - TotRatedCapacity = VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal); // for defrosting power cal + state.dataVariableSpeedCoils->QLoadTotal = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).capModFacTotal = TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac; + TotRatedCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal); // for defrosting power cal - EIRTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), LoadSideInletDBTemp, SourceSideInletTemp); - EIRAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); + EIRTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + EIRAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { EIRWaterFFModFac = 1.0; } else { - EIRWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); + EIRWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); } - EIR = (1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; - Winput = QLoadTotal * EIR; + EIR = (1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; + state.dataVariableSpeedCoils->Winput = state.dataVariableSpeedCoils->QLoadTotal * EIR; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { QWasteHeat = 0.0; } else { - QWasteHeat = Winput * VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); - QWasteHeat *= CurveValue(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), LoadSideInletDBTemp, SourceSideInletTemp); + QWasteHeat = state.dataVariableSpeedCoils->Winput * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); + QWasteHeat *= CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); } } else { - AirMassFlowRatio = LoadSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; + AirMassFlowRatio = state.dataVariableSpeedCoils->LoadSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignAirMassFlowRate; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { WaterMassFlowRatio = 1.0; } else { - WaterMassFlowRatio = SourceSideMassFlowRate / VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; + WaterMassFlowRatio = state.dataVariableSpeedCoils->SourceSideMassFlowRate / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DesignWaterMassFlowRate; } SpeedCal = SpeedNum - 1; - TotCapTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), LoadSideInletDBTemp, SourceSideInletTemp); - TotCapAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); + TotCapTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + TotCapAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { TotCapWaterFFModFac = 1.0; } else { - TotCapWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); + TotCapWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); } - QLoadTotal1 = VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac; + QLoadTotal1 = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac; - EIRTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), LoadSideInletDBTemp, SourceSideInletTemp); - EIRAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); + EIRTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + EIRAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { EIRWaterFFModFac = 1.0; } else { - EIRWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); + EIRWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); } - EIR = (1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; + EIR = (1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; Winput1 = QLoadTotal1 * EIR; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { QWasteHeat1 = 0.0; } else { - QWasteHeat1 = Winput1 * VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); - QWasteHeat1 *= CurveValue(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), LoadSideInletDBTemp, SourceSideInletTemp); + QWasteHeat1 = Winput1 * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); + QWasteHeat1 *= CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); } SpeedCal = SpeedNum; - TotCapTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), LoadSideInletDBTemp, SourceSideInletTemp); - TotCapAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); + TotCapTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapFTemp(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + TotCapAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapAirFFlow(SpeedCal), AirMassFlowRatio); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { TotCapWaterFFModFac = 1.0; } else { - TotCapWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); + TotCapWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSCCapWaterFFlow(SpeedCal), WaterMassFlowRatio); } - QLoadTotal2 = VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac; + QLoadTotal2 = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac; - EIRTempModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), LoadSideInletDBTemp, SourceSideInletTemp); - EIRAirFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); + EIRTempModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRFTemp(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); + EIRAirFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRAirFFlow(SpeedCal), AirMassFlowRatio); - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { EIRWaterFFModFac = 1.0; } else { - EIRWaterFFModFac = CurveValue(state, VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); + EIRWaterFFModFac = CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSEIRWaterFFlow(SpeedCal), WaterMassFlowRatio); } - EIR = (1.0 / VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; + EIR = (1.0 / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac; Winput2 = QLoadTotal2 * EIR; - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { QWasteHeat2 = 0.0; } else { - QWasteHeat2 = Winput2 * VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); - QWasteHeat2 *= CurveValue(state, VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), LoadSideInletDBTemp, SourceSideInletTemp); + QWasteHeat2 = Winput2 * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeatFrac(SpeedCal); + QWasteHeat2 *= CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSWasteHeat(SpeedCal), state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->SourceSideInletTemp); } - QLoadTotal = QLoadTotal2 * SpeedRatio + (1.0 - SpeedRatio) * QLoadTotal1; - Winput = Winput2 * SpeedRatio + (1.0 - SpeedRatio) * Winput1; + state.dataVariableSpeedCoils->QLoadTotal = QLoadTotal2 * SpeedRatio + (1.0 - SpeedRatio) * QLoadTotal1; + state.dataVariableSpeedCoils->Winput = Winput2 * SpeedRatio + (1.0 - SpeedRatio) * Winput1; QWasteHeat = QWasteHeat2 * SpeedRatio + (1.0 - SpeedRatio) * QWasteHeat1; - TotRatedCapacity = VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * SpeedRatio + - (1.0 - SpeedRatio) * VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal - 1); + TotRatedCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal) * SpeedRatio + + (1.0 - SpeedRatio) * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(SpeedCal - 1); } - VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = 0.0; // necessary to clear zero for water source coils - VarSpeedCoil(DXCoilNum).DefrostPower = 0.0; // clear the defrost power - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = 0.0; // necessary to clear zero for water source coils + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostPower = 0.0; // clear the defrost power + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { // Calculating adjustment factors for defrost // Calculate delta w through outdoor coil by assuming a coil temp of 0.82*DBT-9.7(F) per DOE2.1E OutdoorCoilT = 0.82 * OutdoorDryBulb - 8.589; @@ -6581,10 +6400,10 @@ namespace VariableSpeedCoils { FractionalDefrostTime = 0.0; InputPowerMultiplier = 1.0; // Check outdoor temperature to determine of defrost is active - if (OutdoorDryBulb <= VarSpeedCoil(DXCoilNum).MaxOATDefrost) { + if (OutdoorDryBulb <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATDefrost) { // Calculate defrost adjustment factors depending on defrost control type - if (VarSpeedCoil(DXCoilNum).DefrostControl == Timed) { - FractionalDefrostTime = VarSpeedCoil(DXCoilNum).DefrostTime; + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl == state.dataVariableSpeedCoils->Timed) { + FractionalDefrostTime = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostTime; HeatingCapacityMultiplier = 0.909 - 107.33 * OutdoorCoildw; InputPowerMultiplier = 0.90 - 36.45 * OutdoorCoildw; } else { // else defrost control is on-demand @@ -6597,20 +6416,20 @@ namespace VariableSpeedCoils { if (FractionalDefrostTime > 0.0) { // Calculate defrost adjustment factors depending on defrost control strategy - if (VarSpeedCoil(DXCoilNum).DefrostStrategy == ReverseCycle) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy == state.dataVariableSpeedCoils->ReverseCycle) { LoadDueToDefrost = (0.01 * FractionalDefrostTime) * (7.222 - OutdoorDryBulb) * (TotRatedCapacity / 1.01667); DefrostEIRTempModFac = - CurveValue(state, VarSpeedCoil(DXCoilNum).DefrostEIRFT, max(15.555, LoadSideInletWBTemp), max(15.555, OutdoorDryBulb)); - VarSpeedCoil(DXCoilNum).DefrostPower = DefrostEIRTempModFac * (TotRatedCapacity / 1.01667) * FractionalDefrostTime; + CurveValue(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostEIRFT, max(15.555, state.dataVariableSpeedCoils->LoadSideInletWBTemp), max(15.555, OutdoorDryBulb)); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostPower = DefrostEIRTempModFac * (TotRatedCapacity / 1.01667) * FractionalDefrostTime; } else { // Defrost strategy is resistive - VarSpeedCoil(DXCoilNum).DefrostPower = VarSpeedCoil(DXCoilNum).DefrostCapacity * FractionalDefrostTime; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostCapacity * FractionalDefrostTime; } - } else { // Defrost is not active because (OutDryBulbTemp > VarSpeedCoil(DXCoilNum).MaxOATDefrost) - VarSpeedCoil(DXCoilNum).DefrostPower = 0.0; + } else { // Defrost is not active because (OutDryBulbTemp > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATDefrost) + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostPower = 0.0; } } - VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = CrankcaseHeatingPower * (1.0 - RuntimeFrac); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower = CrankcaseHeatingPower * (1.0 - RuntimeFrac); //! Modify total heating capacity based on defrost heating capacity multiplier //! MaxHeatCap passed from parent object VRF Condenser and is used to limit capacity of TU's to that available from condenser // IF(PRESENT(MaxHeatCap))THEN @@ -6618,85 +6437,85 @@ namespace VariableSpeedCoils { // ELSE // TotCap = TotCap * HeatingCapacityMultiplier // END IF - QLoadTotal = QLoadTotal * HeatingCapacityMultiplier - LoadDueToDefrost; + state.dataVariableSpeedCoils->QLoadTotal = state.dataVariableSpeedCoils->QLoadTotal * HeatingCapacityMultiplier - LoadDueToDefrost; // count the powr separately - Winput *= InputPowerMultiplier; //+ VarSpeedCoil(DXCoilNum)%DefrostPower + state.dataVariableSpeedCoils->Winput *= InputPowerMultiplier; //+ state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%DefrostPower } - QSource = QLoadTotal + QWasteHeat - Winput; - QSensible = QLoadTotal; + state.dataVariableSpeedCoils->QSource = state.dataVariableSpeedCoils->QLoadTotal + QWasteHeat - state.dataVariableSpeedCoils->Winput; + state.dataVariableSpeedCoils->QSensible = state.dataVariableSpeedCoils->QLoadTotal; - if (QSource < 0) { - QSource = 0.0; - QWasteHeat = Winput - QLoadTotal; + if ( state.dataVariableSpeedCoils->QSource < 0) { + state.dataVariableSpeedCoils->QSource = 0.0; + QWasteHeat = state.dataVariableSpeedCoils->Winput - state.dataVariableSpeedCoils->QLoadTotal; } // calculate coil outlet state variables - LoadSideOutletEnth = LoadSideInletEnth + QLoadTotal / LoadSideMassFlowRate; - LoadSideOutletDBTemp = LoadSideInletDBTemp + QSensible / (LoadSideMassFlowRate * CpAir); - LoadSideOutletHumRat = PsyWFnTdbH(LoadSideOutletDBTemp, LoadSideOutletEnth, RoutineName); + state.dataVariableSpeedCoils->LoadSideOutletEnth = state.dataVariableSpeedCoils->LoadSideInletEnth + state.dataVariableSpeedCoils->QLoadTotal / state.dataVariableSpeedCoils->LoadSideMassFlowRate; + state.dataVariableSpeedCoils->LoadSideOutletDBTemp = state.dataVariableSpeedCoils->LoadSideInletDBTemp + state.dataVariableSpeedCoils->QSensible / (state.dataVariableSpeedCoils->LoadSideMassFlowRate * CpAir); + state.dataVariableSpeedCoils->LoadSideOutletHumRat = PsyWFnTdbH( state.dataVariableSpeedCoils->LoadSideOutletDBTemp, state.dataVariableSpeedCoils->LoadSideOutletEnth, RoutineName); // Actual outlet conditions are "average" for time step if (CyclingScheme == ContFanCycCoil) { // continuous fan, cycling compressor - VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = PartLoadRatio * LoadSideOutletEnth + (1.0 - PartLoadRatio) * LoadSideInletEnth; - VarSpeedCoil(DXCoilNum).OutletAirHumRat = PartLoadRatio * LoadSideOutletHumRat + (1.0 - PartLoadRatio) * LoadSideInletHumRat; - VarSpeedCoil(DXCoilNum).OutletAirDBTemp = PsyTdbFnHW(VarSpeedCoil(DXCoilNum).OutletAirEnthalpy, VarSpeedCoil(DXCoilNum).OutletAirHumRat); - PLRCorrLoadSideMdot = LoadSideMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = PartLoadRatio * state.dataVariableSpeedCoils->LoadSideOutletEnth + (1.0 - PartLoadRatio) * state.dataVariableSpeedCoils->LoadSideInletEnth; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat = PartLoadRatio * state.dataVariableSpeedCoils->LoadSideOutletHumRat + (1.0 - PartLoadRatio) * state.dataVariableSpeedCoils->LoadSideInletHumRat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp = PsyTdbFnHW(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat); + state.dataVariableSpeedCoils->PLRCorrLoadSideMdot = state.dataVariableSpeedCoils->LoadSideMassFlowRate; } else { // default to cycling fan, cycling compressor - VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = LoadSideOutletEnth; - VarSpeedCoil(DXCoilNum).OutletAirHumRat = LoadSideOutletHumRat; - VarSpeedCoil(DXCoilNum).OutletAirDBTemp = LoadSideOutletDBTemp; - PLRCorrLoadSideMdot = LoadSideMassFlowRate * PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = state.dataVariableSpeedCoils->LoadSideOutletEnth; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat = state.dataVariableSpeedCoils->LoadSideOutletHumRat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp = state.dataVariableSpeedCoils->LoadSideOutletDBTemp; + state.dataVariableSpeedCoils->PLRCorrLoadSideMdot = state.dataVariableSpeedCoils->LoadSideMassFlowRate * PartLoadRatio; } // scale heat transfer rates to PLR and power to RTF - QLoadTotal *= PartLoadRatio; - QSensible *= PartLoadRatio; + state.dataVariableSpeedCoils->QLoadTotal *= PartLoadRatio; + state.dataVariableSpeedCoils->QSensible *= PartLoadRatio; // count the powr separately - Winput *= RuntimeFrac; //+ VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower - QSource *= PartLoadRatio; + state.dataVariableSpeedCoils->Winput *= RuntimeFrac; //+ state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower + state.dataVariableSpeedCoils->QSource *= PartLoadRatio; QWasteHeat *= PartLoadRatio; // Add power to global variable so power can be summed by parent object - DXElecHeatingPower = Winput; + DXElecHeatingPower = state.dataVariableSpeedCoils->Winput; ReportingConstant = TimeStepSys * SecInHour; // Update heat pump data structure - VarSpeedCoil(DXCoilNum).Power = Winput; - VarSpeedCoil(DXCoilNum).QLoadTotal = QLoadTotal; - VarSpeedCoil(DXCoilNum).QSensible = QSensible; - VarSpeedCoil(DXCoilNum).QSource = QSource; - VarSpeedCoil(DXCoilNum).Energy = Winput * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergyLoadTotal = QLoadTotal * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergySensible = QSensible * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; - VarSpeedCoil(DXCoilNum).EnergySource = QSource * ReportingConstant; - VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower * ReportingConstant; - VarSpeedCoil(DXCoilNum).DefrostConsumption = VarSpeedCoil(DXCoilNum).DefrostPower * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = state.dataVariableSpeedCoils->Winput; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal = state.dataVariableSpeedCoils->QLoadTotal; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible = state.dataVariableSpeedCoils->QSensible; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource = state.dataVariableSpeedCoils->QSource; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy = state.dataVariableSpeedCoils->Winput * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal = state.dataVariableSpeedCoils->QLoadTotal * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible = state.dataVariableSpeedCoils->QSensible * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource = state.dataVariableSpeedCoils->QSource * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterConsumption = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterPower * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostConsumption = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostPower * ReportingConstant; if (RuntimeFrac == 0.0) { - VarSpeedCoil(DXCoilNum).COP = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).COP = 0.0; } else { - VarSpeedCoil(DXCoilNum).COP = QLoadTotal / Winput; - } - VarSpeedCoil(DXCoilNum).RunFrac = RuntimeFrac; - VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; - VarSpeedCoil(DXCoilNum).AirMassFlowRate = PLRCorrLoadSideMdot; - rhoair = PsyRhoAirFnPbTdbW(OutBaroPress, LoadSideInletDBTemp, LoadSideInletHumRat, RoutineName); - VarSpeedCoil(DXCoilNum).AirVolFlowRate = VarSpeedCoil(DXCoilNum).AirMassFlowRate / rhoair; - - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; - VarSpeedCoil(DXCoilNum).OutletWaterTemp = 0.0; - VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).COP = state.dataVariableSpeedCoils->QLoadTotal / state.dataVariableSpeedCoils->Winput; + } + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = RuntimeFrac; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio = PartLoadRatio; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate = state.dataVariableSpeedCoils->PLRCorrLoadSideMdot; + rhoair = PsyRhoAirFnPbTdbW(OutBaroPress, state.dataVariableSpeedCoils->LoadSideInletDBTemp, state.dataVariableSpeedCoils->LoadSideInletHumRat, RoutineName); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirMassFlowRate / rhoair; + + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = 0.0; } else { - VarSpeedCoil(DXCoilNum).WaterMassFlowRate = SourceSideMassFlowRate; - VarSpeedCoil(DXCoilNum).OutletWaterTemp = SourceSideInletTemp - QSource / (SourceSideMassFlowRate * CpSource); - VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = SourceSideInletEnth - QSource / SourceSideMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = state.dataVariableSpeedCoils->SourceSideMassFlowRate; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp = state.dataVariableSpeedCoils->SourceSideInletTemp - state.dataVariableSpeedCoils->QSource / (state.dataVariableSpeedCoils->SourceSideMassFlowRate * CpSource); + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = state.dataVariableSpeedCoils->SourceSideInletEnth - state.dataVariableSpeedCoils->QSource / state.dataVariableSpeedCoils->SourceSideMassFlowRate; } - VarSpeedCoil(DXCoilNum).QWasteHeat = QWasteHeat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QWasteHeat = QWasteHeat; } Real64 GetCoilCapacityVariableSpeed(EnergyPlusData &state, @@ -6727,10 +6546,10 @@ namespace VariableSpeedCoils { int WhichCoil; // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); // WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } if (UtilityRoutines::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || @@ -6738,15 +6557,15 @@ namespace VariableSpeedCoils { UtilityRoutines::SameString(CoilType, "COIL:COOLING:DX:VARIABLESPEED") || UtilityRoutines::SameString(CoilType, "COIL:HEATING:DX:VARIABLESPEED") || UtilityRoutines::SameString(CoilType, "COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED")) { - WhichCoil = UtilityRoutines::FindItemInList(CoilName, VarSpeedCoil); + WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { if (UtilityRoutines::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || UtilityRoutines::SameString(CoilType, "COIL:HEATING:DX:VARIABLESPEED")) { - CoilCapacity = VarSpeedCoil(WhichCoil).RatedCapHeat; + CoilCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedCapHeat; } else if (UtilityRoutines::SameString(CoilType, "COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED")) { - CoilCapacity = VarSpeedCoil(WhichCoil).RatedCapWH; + CoilCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedCapWH; } else { - CoilCapacity = VarSpeedCoil(WhichCoil).RatedCapCoolTotal; + CoilCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedCapCoolTotal; } } } else { @@ -6787,13 +6606,13 @@ namespace VariableSpeedCoils { int IndexNum; // returned index of matched coil // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); // WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - IndexNum = UtilityRoutines::FindItemInList(CoilName, VarSpeedCoil); + IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (IndexNum == 0) { ShowSevereError("GetCoilIndexVariableSpeed: Could not find CoilType=\"" + CoilType + "\" with Name=\"" + CoilName + "\""); @@ -6828,10 +6647,10 @@ namespace VariableSpeedCoils { int WhichCoil; // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); // WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } if (UtilityRoutines::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || @@ -6839,15 +6658,15 @@ namespace VariableSpeedCoils { UtilityRoutines::SameString(CoilType, "COIL:COOLING:DX:VARIABLESPEED") || UtilityRoutines::SameString(CoilType, "COIL:HEATING:DX:VARIABLESPEED") || UtilityRoutines::SameString(CoilType, "COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED")) { - WhichCoil = UtilityRoutines::FindItemInList(CoilName, VarSpeedCoil); + WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { // CoilAirFlowRate=VarSpeedCoil(WhichCoil)%RatedAirVolFlowRate - if (VarSpeedCoil(WhichCoil).RatedAirVolFlowRate == AutoSize) { // means autosize - CoilAirFlowRate = VarSpeedCoil(WhichCoil).RatedAirVolFlowRate; + if (state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedAirVolFlowRate == AutoSize) { // means autosize + CoilAirFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedAirVolFlowRate; } else { - CoilAirFlowRate = VarSpeedCoil(WhichCoil).MSRatedAirVolFlowRate(VarSpeedCoil(WhichCoil).NumOfSpeeds) / - VarSpeedCoil(WhichCoil).MSRatedAirVolFlowRate(VarSpeedCoil(WhichCoil).NormSpedLevel) * - VarSpeedCoil(WhichCoil).RatedAirVolFlowRate; + CoilAirFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).NumOfSpeeds) / + state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).NormSpedLevel) * + state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedAirVolFlowRate; } // use largest air flow rate } } else { @@ -6888,15 +6707,15 @@ namespace VariableSpeedCoils { int WhichCoil; // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); // WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, VarSpeedCoil); + WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { - PLRNumber = VarSpeedCoil(WhichCoil).PLFFPLR; + PLRNumber = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).PLFFPLR; } if (WhichCoil == 0) { @@ -6927,9 +6746,9 @@ namespace VariableSpeedCoils { int CapFTIndex; // returned CapFT curve index of matched coil // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } if (CoilIndex == 0) { @@ -6937,7 +6756,7 @@ namespace VariableSpeedCoils { ErrorsFound = true; CapFTIndex = 0; } else { - CapFTIndex = VarSpeedCoil(CoilIndex).MSCCapFTemp(VarSpeedCoil(CoilIndex).NumOfSpeeds); + CapFTIndex = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).MSCCapFTemp(state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).NumOfSpeeds); } return CapFTIndex; @@ -6971,15 +6790,15 @@ namespace VariableSpeedCoils { int WhichCoil; // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); // WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, VarSpeedCoil); + WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { - NodeNumber = VarSpeedCoil(WhichCoil).AirInletNodeNum; + NodeNumber = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).AirInletNodeNum; } if (WhichCoil == 0) { @@ -7019,15 +6838,15 @@ namespace VariableSpeedCoils { int WhichCoil; // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); // WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, VarSpeedCoil); + WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { - NodeNumber = VarSpeedCoil(WhichCoil).AirOutletNodeNum; + NodeNumber = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).AirOutletNodeNum; } if (WhichCoil == 0) { @@ -7062,15 +6881,15 @@ namespace VariableSpeedCoils { int WhichCoil; // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); // WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, VarSpeedCoil); + WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { - CondNode = VarSpeedCoil(WhichCoil).CondenserInletNodeNum; + CondNode = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).CondenserInletNodeNum; } else { ShowSevereError("GetCoilCondenserInletNode: Invalid VS DX Coil, Type= VS DX Cooling Name=\"" + CoilName + "\""); ErrorsFound = true; @@ -7103,15 +6922,15 @@ namespace VariableSpeedCoils { int WhichCoil; // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); // WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, VarSpeedCoil); + WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { - MinOAT = VarSpeedCoil(WhichCoil).MinOATCompressor; + MinOAT = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).MinOATCompressor; } else { ShowSevereError("GetVSCoilMinOATCompressor: Invalid VS DX Coil, Type= VS DX Coil Name=\"" + CoilName + "\""); ErrorsFound = true; @@ -7140,9 +6959,9 @@ namespace VariableSpeedCoils { Real64 MinOAT; // returned min oa temperature of matched coil // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } if (CoilIndex == 0) { @@ -7154,7 +6973,7 @@ namespace VariableSpeedCoils { } else { - MinOAT = VarSpeedCoil(CoilIndex).MinOATCompressor; + MinOAT = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).MinOATCompressor; } return MinOAT; @@ -7183,14 +7002,14 @@ namespace VariableSpeedCoils { int WhichCoil; // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, VarSpeedCoil); + WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { - Speeds = VarSpeedCoil(WhichCoil).NumOfSpeeds; + Speeds = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).NumOfSpeeds; } else { ShowSevereError("GetVSCoilNumOfSpeeds: Invalid VS DX Coil, Type= VS DX Coil Name=\"" + CoilName + "\""); ErrorsFound = true; @@ -7224,36 +7043,36 @@ namespace VariableSpeedCoils { using General::TrimSigDigits; // Obtains and Allocates WatertoAirHP related parameters from input file - if (GetCoilsInputFlag) { // First time subroutine has been entered + if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered GetVarSpeedCoilInput(state); // WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once - GetCoilsInputFlag = false; + state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - if (WSHPNum <= 0 || WSHPNum > NumVarSpeedCoils) { + if (WSHPNum <= 0 || WSHPNum > state.dataVariableSpeedCoils->NumVarSpeedCoils) { ShowSevereError("SetVarSpeedCoilData: called with VS WSHP Coil Number out of range=" + TrimSigDigits(WSHPNum) + " should be >0 and <" + - TrimSigDigits(NumVarSpeedCoils)); + TrimSigDigits(state.dataVariableSpeedCoils->NumVarSpeedCoils)); ErrorsFound = true; return; } if (present(CompanionCoolingCoilNum)) { - VarSpeedCoil(WSHPNum).CompanionCoolingCoilNum = CompanionCoolingCoilNum; - VarSpeedCoil(WSHPNum).FindCompanionUpStreamCoil = true; - VarSpeedCoil(CompanionCoolingCoilNum).CompanionHeatingCoilNum = WSHPNum; + state.dataVariableSpeedCoils->VarSpeedCoil(WSHPNum).CompanionCoolingCoilNum = CompanionCoolingCoilNum; + state.dataVariableSpeedCoils->VarSpeedCoil(WSHPNum).FindCompanionUpStreamCoil = true; + state.dataVariableSpeedCoils->VarSpeedCoil(CompanionCoolingCoilNum).CompanionHeatingCoilNum = WSHPNum; } if (present(CompanionHeatingCoilNum)) { - VarSpeedCoil(WSHPNum).CompanionHeatingCoilNum = CompanionHeatingCoilNum; - VarSpeedCoil(CompanionHeatingCoilNum).CompanionCoolingCoilNum = WSHPNum; + state.dataVariableSpeedCoils->VarSpeedCoil(WSHPNum).CompanionHeatingCoilNum = CompanionHeatingCoilNum; + state.dataVariableSpeedCoils->VarSpeedCoil(CompanionHeatingCoilNum).CompanionCoolingCoilNum = WSHPNum; } if (present(MSHPDesignSpecIndex)) { - VarSpeedCoil(WSHPNum).MSHPDesignSpecIndex = MSHPDesignSpecIndex; + state.dataVariableSpeedCoils->VarSpeedCoil(WSHPNum).MSHPDesignSpecIndex = MSHPDesignSpecIndex; } } - void UpdateVarSpeedCoil(int const DXCoilNum) + void UpdateVarSpeedCoil(EnergyPlusData &state, int const DXCoilNum) { // SUBROUTINE INFORMATION: // AUTHOR Bo Shen, based on WaterToAirHeatPumpSimple:UpdateSimpleWSHP @@ -7280,92 +7099,92 @@ namespace VariableSpeedCoils { Real64 ReportingConstant; // WatertoAirHP(DXCoilNum)%SimFlag=.FALSE. - if (!VarSpeedCoil(DXCoilNum).SimFlag) { + if (!state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).SimFlag) { // Heatpump is off; just pass through conditions - VarSpeedCoil(DXCoilNum).Power = 0.0; - VarSpeedCoil(DXCoilNum).QLoadTotal = 0.0; - VarSpeedCoil(DXCoilNum).QSensible = 0.0; - VarSpeedCoil(DXCoilNum).QLatent = 0.0; - VarSpeedCoil(DXCoilNum).QSource = 0.0; - VarSpeedCoil(DXCoilNum).Energy = 0.0; - VarSpeedCoil(DXCoilNum).EnergyLoadTotal = 0.0; - VarSpeedCoil(DXCoilNum).EnergySensible = 0.0; - VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; - VarSpeedCoil(DXCoilNum).EnergySource = 0.0; - VarSpeedCoil(DXCoilNum).COP = 0.0; - VarSpeedCoil(DXCoilNum).RunFrac = 0.0; - VarSpeedCoil(DXCoilNum).PartLoadRatio = 0.0; - - VarSpeedCoil(DXCoilNum).OutletAirDBTemp = VarSpeedCoil(DXCoilNum).InletAirDBTemp; - VarSpeedCoil(DXCoilNum).OutletAirHumRat = VarSpeedCoil(DXCoilNum).InletAirHumRat; - VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = VarSpeedCoil(DXCoilNum).InletAirEnthalpy; - VarSpeedCoil(DXCoilNum).OutletWaterTemp = VarSpeedCoil(DXCoilNum).InletWaterTemp; - VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = VarSpeedCoil(DXCoilNum).InletWaterEnthalpy; - } - - AirInletNode = VarSpeedCoil(DXCoilNum).AirInletNodeNum; - WaterInletNode = VarSpeedCoil(DXCoilNum).WaterInletNodeNum; - AirOutletNode = VarSpeedCoil(DXCoilNum).AirOutletNodeNum; - WaterOutletNode = VarSpeedCoil(DXCoilNum).WaterOutletNodeNum; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).COP = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RunFrac = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio = 0.0; + + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirEnthalpy; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy; + } + + AirInletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirInletNodeNum; + WaterInletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum; + AirOutletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirOutletNodeNum; + WaterOutletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterOutletNodeNum; // Set the air outlet nodes of the WatertoAirHPSimple - Node(AirOutletNode).MassFlowRate = Node(AirInletNode).MassFlowRate; // LoadSideMassFlowRate - Node(AirOutletNode).Temp = VarSpeedCoil(DXCoilNum).OutletAirDBTemp; - Node(AirOutletNode).HumRat = VarSpeedCoil(DXCoilNum).OutletAirHumRat; - Node(AirOutletNode).Enthalpy = VarSpeedCoil(DXCoilNum).OutletAirEnthalpy; + Node(AirOutletNode).MassFlowRate = Node(AirInletNode).MassFlowRate; // state.dataVariableSpeedCoils->LoadSideMassFlowRate + Node(AirOutletNode).Temp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp; + Node(AirOutletNode).HumRat = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat; + Node(AirOutletNode).Enthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy; // Set the air outlet nodes for properties that just pass through & not used Node(AirOutletNode).Quality = Node(AirInletNode).Quality; Node(AirOutletNode).Press = Node(AirInletNode).Press; Node(AirOutletNode).MassFlowRateMin = Node(AirInletNode).MassFlowRateMin; - Node(AirOutletNode).MassFlowRateMax = Node(AirInletNode).MassFlowRateMax; // LoadSideMassFlowRate + Node(AirOutletNode).MassFlowRateMax = Node(AirInletNode).MassFlowRateMax; // state.dataVariableSpeedCoils->LoadSideMassFlowRate Node(AirOutletNode).MassFlowRateMinAvail = Node(AirInletNode).MassFlowRateMinAvail; - Node(AirOutletNode).MassFlowRateMaxAvail = Node(AirInletNode).MassFlowRateMaxAvail; // LoadSideMassFlowRate + Node(AirOutletNode).MassFlowRateMaxAvail = Node(AirInletNode).MassFlowRateMaxAvail; // state.dataVariableSpeedCoils->LoadSideMassFlowRate // Set the water outlet node of the WatertoAirHPSimple // Set the water outlet nodes for properties that just pass through & not used if (WaterInletNode != 0 && WaterOutletNode != 0) { SafeCopyPlantNode(WaterInletNode, WaterOutletNode); - Node(WaterOutletNode).Temp = VarSpeedCoil(DXCoilNum).OutletWaterTemp; - Node(WaterOutletNode).Enthalpy = VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy; + Node(WaterOutletNode).Temp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp; + Node(WaterOutletNode).Enthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy; } ReportingConstant = TimeStepSys * SecInHour; - VarSpeedCoil(DXCoilNum).Energy = VarSpeedCoil(DXCoilNum).Power * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergyLoadTotal = VarSpeedCoil(DXCoilNum).QLoadTotal * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergySensible = VarSpeedCoil(DXCoilNum).QSensible * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergyLatent = VarSpeedCoil(DXCoilNum).QLatent * ReportingConstant; - VarSpeedCoil(DXCoilNum).EnergySource = VarSpeedCoil(DXCoilNum).QSource * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLatent = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLatent * ReportingConstant; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySource = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSource * ReportingConstant; if (Contaminant.CO2Simulation) { Node(AirOutletNode).CO2 = Node(AirInletNode).CO2; } - if (VarSpeedCoil(DXCoilNum).reportCoilFinalSizes) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).reportCoilFinalSizes) { if (!DataGlobals::WarmupFlag && !DataGlobals::DoingHVACSizingSimulations && !DataGlobals::DoingSizing) { - if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit || - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { // cooling coil - coilSelectionReportObj->setCoilFinalSizes(VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).RatedCapCoolTotal, - VarSpeedCoil(DXCoilNum).RatedCapCoolSens, - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate, - VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate); - } else if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit || - VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { // heating coil - coilSelectionReportObj->setCoilFinalSizes(VarSpeedCoil(DXCoilNum).Name, - VarSpeedCoil(DXCoilNum).VarSpeedCoilType, - VarSpeedCoil(DXCoilNum).RatedCapHeat, - VarSpeedCoil(DXCoilNum).RatedCapHeat, - VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate, - VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingWaterToAirHPVSEquationFit || + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_CoolingAirToAirVariableSpeed) { // cooling coil + coilSelectionReportObj->setCoilFinalSizes(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate); + } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingWaterToAirHPVSEquationFit || + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { // heating coil + coilSelectionReportObj->setCoilFinalSizes(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterMassFlowRate); } - VarSpeedCoil(DXCoilNum).reportCoilFinalSizes = false; + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).reportCoilFinalSizes = false; } } } - Real64 CalcEffectiveSHR(int const DXCoilNum, // Index number for cooling coil + Real64 CalcEffectiveSHR(EnergyPlusData &state, int const DXCoilNum, // Index number for cooling coil Real64 const SHRss, // Steady-state sensible heat ratio int const CyclingScheme, // Fan/compressor cycling scheme indicator Real64 const RTF, // Compressor run-time fraction @@ -7424,11 +7243,11 @@ namespace VariableSpeedCoils { Real64 Error; // Error for iteration (DO) loop Real64 LHRmult; // Latent Heat Ratio (LHR) multiplier. The effective latent heat ratio LHR = (1-SHRss)*LHRmult - Twet_Rated = VarSpeedCoil(DXCoilNum).Twet_Rated; - Gamma_Rated = VarSpeedCoil(DXCoilNum).Gamma_Rated; - MaxONOFFCyclesperHour = VarSpeedCoil(DXCoilNum).MaxONOFFCyclesperHour; - HPTimeConstant = VarSpeedCoil(DXCoilNum).HPTimeConstant; - FanDelayTime = VarSpeedCoil(DXCoilNum).FanDelayTime; + Twet_Rated = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Twet_Rated; + Gamma_Rated = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Gamma_Rated; + MaxONOFFCyclesperHour = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxONOFFCyclesperHour; + HPTimeConstant = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPTimeConstant; + FanDelayTime = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).FanDelayTime; // No moisture evaporation (latent degradation) occurs for runtime fraction of 1.0 // All latent degradation model parameters cause divide by 0.0 if not greater than 0.0 @@ -7649,9 +7468,9 @@ namespace VariableSpeedCoils { InletWetBulb = InletWetBulbCalc; } - Real64 getVarSpeedPartLoadRatio(int const DXCoilNum) + Real64 getVarSpeedPartLoadRatio(EnergyPlusData &state, int const DXCoilNum) { - return VarSpeedCoil(DXCoilNum).PartLoadRatio; + return state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio; } } // namespace VariableSpeedCoils diff --git a/src/EnergyPlus/VariableSpeedCoils.hh b/src/EnergyPlus/VariableSpeedCoils.hh index 19520557f37..1ad037672ff 100644 --- a/src/EnergyPlus/VariableSpeedCoils.hh +++ b/src/EnergyPlus/VariableSpeedCoils.hh @@ -53,6 +53,8 @@ #include // EnergyPlus Headers +#include +#include #include namespace EnergyPlus { @@ -62,101 +64,9 @@ struct EnergyPlusData; namespace VariableSpeedCoils { - // Using/Aliasing - - // Data - // MODULE PARAMETER DEFINITIONS - - extern Real64 const RatedInletAirTemp; // 26.6667C or 80F - extern Real64 const RatedInletWetBulbTemp; // 19.44 or 67F, cooling mode - extern Real64 const RatedInletAirHumRat; // Humidity ratio corresponding to 80F dry bulb/67F wet bulb - extern Real64 const RatedInletWaterTemp; // 85 F cooling mode - extern Real64 const RatedAmbAirTemp; // 95 F cooling mode - extern Real64 const RatedInletAirTempHeat; // 21.11C or 70F, heating mode - extern Real64 const RatedInletWaterTempHeat; // 21.11C or 70F, heating mode - extern Real64 const RatedAmbAirTempHeat; // 8.33 or 47F, heating mode - extern Real64 const RatedAmbAirWBHeat; // 8.33 or 43F, heating mode, rated wet bulb temperature - - // Airflow per total capacity range - extern Real64 const MaxRatedVolFlowPerRatedTotCap; // m3/s per watt = 450 cfm/ton - extern Real64 const MinRatedVolFlowPerRatedTotCap; // m3/s per watt = 300 cfm/ton - extern Real64 const MaxHeatVolFlowPerRatedTotCap; // m3/s per watt = 600 cfm/ton - extern Real64 const MaxCoolVolFlowPerRatedTotCap; // m3/s per watt = 500 cfm/ton - extern Real64 const MinOperVolFlowPerRatedTotCap; // m3/s per watt = 200 cfm/ton - - // Water Systems - extern int const CondensateDiscarded; // default mode where water is "lost" - extern int const CondensateToTank; // collect coil condensate from air and store in water storage tank - - extern int const WaterSupplyFromMains; - extern int const WaterSupplyFromTank; - - // Curve Types - extern int const Linear; - extern int const BiLinear; - extern int const Quadratic; - extern int const BiQuadratic; - extern int const Cubic; - - // Defrost strategy (heat pump only) - extern int const ReverseCycle; // uses reverse cycle defrost strategy - extern int const Resistive; // uses electric resistance heater for defrost - // Defrost control (heat pump only) - extern int const Timed; // defrost cycle is timed - extern int const OnDemand; // defrost cycle occurs only when required - - extern int const MaxSpedLevels; // Maximum number of speed that supports - - // DERIVED TYPE DEFINITIONS - - // MODULE VARIABLE DECLARATIONS: - // Identifier is VarSpeedCoil - extern int NumVarSpeedCoils; // The Number of variable speed Water to Air Heat Pumps and variable dx coils found in the Input - - extern bool GetCoilsInputFlag; // Flag set to make sure you get input once - // LOGICAL, ALLOCATABLE, DIMENSION(:) :: MySizeFlag - - extern Real64 SourceSideMassFlowRate; // Source Side Mass flow rate [Kg/s] - extern Real64 SourceSideInletTemp; // Source Side Inlet Temperature [C] - extern Real64 SourceSideInletEnth; // Source Side Inlet Enthalpy [J/kg] - extern Real64 LoadSideMassFlowRate; // Load Side Mass flow rate [Kg/s] - extern Real64 LoadSideInletDBTemp; // Load Side Inlet Dry Bulb Temp [C] - extern Real64 LoadSideInletWBTemp; // Load Side Inlet Wet Bulb Temp [C] - extern Real64 LoadSideInletHumRat; // Load Side Outlet Humidity ratio - extern Real64 LoadSideInletEnth; // Load Side Inlet Enthalpy [J/kg] - extern Real64 LoadSideOutletDBTemp; // Load Side Outlet Dry Bulb Temp [C] - extern Real64 LoadSideOutletHumRat; // Load Side Outlet Humidity ratio - extern Real64 LoadSideOutletEnth; // Load Side Outlet Enthalpy [J/kg] - extern Real64 QSensible; // Load side sensible heat transfer rate [W] - extern Real64 QLoadTotal; // Load side total heat transfer rate [W] - extern Real64 QLatRated; // Latent Capacity [W] rated at entering air conditions [Tdb=26.7C Twb=19.4C] - extern Real64 QLatActual; // Actual Latent Capacity [W] - extern Real64 QSource; // Source side heat transfer rate [W] - extern Real64 Winput; // Power Consumption [W] - extern Real64 PLRCorrLoadSideMdot; // Load Side Mdot corrected for Part Load Ratio of the unit - - extern Real64 VSHPWHHeatingCapacity; // Used by Heat Pump:Water Heater object as total water heating capacity [W] - extern Real64 VSHPWHHeatingCOP; // Used by Heat Pump:Water Heater object as water heating COP [W/W] - - // SUBROUTINE SPECIFICATIONS FOR MODULE - - // Driver/Manager Routines - - // Get Input routines for module - - // Initialization routines for module - - // Update routines to check convergence and update nodes - - // Update routine - - // Utility routines - // SHR, bypass factor routines - - // Types - struct VariableSpeedCoilData // variable speed coil { + int MaxSpedLevels = 10; // Members std::string Name; // Name of the Coil std::string VarSpeedCoilType; // type of coil @@ -366,15 +276,65 @@ namespace VariableSpeedCoils { Real64 capModFacTotal; // coil TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac, for result for simulation peak reporting // Default Constructor - VariableSpeedCoilData(); + VariableSpeedCoilData() + : NumOfSpeeds(2), NormSpedLevel(MaxSpedLevels), RatedWaterVolFlowRate(DataSizing::AutoSize), RatedWaterMassFlowRate(DataSizing::AutoSize), + RatedAirVolFlowRate(DataSizing::AutoSize), RatedCapHeat(DataSizing::AutoSize), RatedCapCoolTotal(DataSizing::AutoSize), MaxONOFFCyclesperHour(0.0), Twet_Rated(0.0), + Gamma_Rated(0.0), HOTGASREHEATFLG(0), HPTimeConstant(0.0), PLFFPLR(0), VSCoilTypeOfNum(0), SimFlag(false), DesignWaterMassFlowRate(0.0), + DesignWaterVolFlowRate(0.0), DesignAirMassFlowRate(0.0), DesignAirVolFlowRate(0.0), AirVolFlowRate(0.0), AirMassFlowRate(0.0), + InletAirPressure(0.0), InletAirDBTemp(0.0), InletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirDBTemp(0.0), OutletAirHumRat(0.0), + OutletAirEnthalpy(0.0), WaterVolFlowRate(0.0), WaterMassFlowRate(0.0), InletWaterTemp(0.0), InletWaterEnthalpy(0.0), OutletWaterTemp(0.0), + OutletWaterEnthalpy(0.0), Power(0.0), QLoadTotal(0.0), QSensible(0.0), QLatent(0.0), QSource(0.0), QWasteHeat(0.0), Energy(0.0), + EnergyLoadTotal(0.0), EnergySensible(0.0), EnergyLatent(0.0), EnergySource(0.0), COP(0.0), RunFrac(0.0), PartLoadRatio(0.0), + RatedPowerHeat(0.0), RatedCOPHeat(0.0), RatedCapCoolSens(0.0), RatedPowerCool(0.0), RatedCOPCool(0.0), AirInletNodeNum(0), + AirOutletNodeNum(0), WaterInletNodeNum(0), WaterOutletNodeNum(0), LoopNum(0), LoopSide(0), BranchNum(0), CompNum(0), + FindCompanionUpStreamCoil(true), IsDXCoilInZone(false), CompanionCoolingCoilNum(0), CompanionHeatingCoilNum(0), FanDelayTime(0.0), + // This one calls into a std::vector, so it's 0-indexed, so we initialize it to -1 + MSHPDesignSpecIndex(-1), MSErrIndex(MaxSpedLevels, 0), MSRatedPercentTotCap(MaxSpedLevels, 0.0), MSRatedTotCap(MaxSpedLevels, 0.0), + MSRatedSHR(MaxSpedLevels, 0.0), MSRatedCOP(MaxSpedLevels, 0.0), MSRatedAirVolFlowPerRatedTotCap(MaxSpedLevels, 0.0), + MSRatedAirVolFlowRate(MaxSpedLevels, 0.0), MSRatedAirMassFlowRate(MaxSpedLevels, 0.0), + MSRatedWaterVolFlowPerRatedTotCap(MaxSpedLevels, 0.0), MSRatedWaterVolFlowRate(MaxSpedLevels, 0.0), + MSRatedWaterMassFlowRate(MaxSpedLevels, 0.0), MSRatedCBF(MaxSpedLevels, 0.0), MSEffectiveAo(MaxSpedLevels, 0.0), + MSCCapFTemp(MaxSpedLevels, 0), MSCCapAirFFlow(MaxSpedLevels, 0), MSCCapWaterFFlow(MaxSpedLevels, 0), MSEIRFTemp(MaxSpedLevels, 0), + MSEIRAirFFlow(MaxSpedLevels, 0), MSEIRWaterFFlow(MaxSpedLevels, 0), MSWasteHeat(MaxSpedLevels, 0), MSWasteHeatFrac(MaxSpedLevels, 0.0), + MSWHPumpPower(MaxSpedLevels, 0.0), MSWHPumpPowerPerRatedTotCap(MaxSpedLevels, 0.0), SpeedNumReport(0.0), SpeedRatioReport(0.0), + DefrostStrategy(0), DefrostControl(0), EIRFPLR(0), DefrostEIRFT(0), MinOATCompressor(0.0), OATempCompressorOn(0.0), MaxOATDefrost(0.0), + DefrostTime(0.0), DefrostCapacity(0.0), HPCompressorRuntime(0.0), HPCompressorRuntimeLast(0.0), TimeLeftToDefrost(0.0), DefrostPower(0.0), + DefrostConsumption(0.0), ReportCoolingCoilCrankcasePower(true), CrankcaseHeaterCapacity(0.0), CrankcaseHeaterPower(0.0), + MaxOATCrankcaseHeater(0.0), CrankcaseHeaterConsumption(0.0), CondenserInletNodeNum(0), CondenserType(DataHVACGlobals::AirCooled), ReportEvapCondVars(false), + EvapCondPumpElecNomPower(0.0), EvapCondPumpElecPower(0.0), EvapWaterConsumpRate(0.0), EvapCondPumpElecConsumption(0.0), + EvapWaterConsump(0.0), BasinHeaterConsumption(0.0), BasinHeaterPowerFTempDiff(0.0), BasinHeaterSetPointTemp(0.0), BasinHeaterPower(0.0), + BasinHeaterSchedulePtr(0), EvapCondAirFlow(MaxSpedLevels, 0.0), EvapCondEffect(MaxSpedLevels, 0.0), + MSRatedEvapCondVolFlowPerRatedTotCap(MaxSpedLevels, 0.0), EvapWaterSupplyMode(101), EvapWaterSupTankID(0), + EvapWaterTankDemandARRID(0), CondensateCollectMode(1001), CondensateTankID(0), CondensateTankSupplyARRID(0), + CondensateVdot(0.0), CondensateVol(0.0), CondInletTemp(0.0), SupplyFanIndex(0), SupplyFan_TypeNum(0), SourceAirMassFlowRate(0.0), + InletSourceAirTemp(0.0), InletSourceAirEnthalpy(0.0), + // begin varibles for HPWH + RatedCapWH(0.0), // Rated water heating Capacity [W] + InletAirTemperatureType(0), // Specifies to use either air wet-bulb or dry-bulb temp for curve objects + WHRatedInletDBTemp(0.0), // Rated inlet air dry-bulb temperature [C] + WHRatedInletWBTemp(0.0), // Rated inlet air wet-bulb temperature [C] + WHRatedInletWaterTemp(0.0), // Rated condenser water inlet temperature [C] + HPWHCondPumpElecNomPower(0.0), // Nominal power input to the condenser water circulation pump [W] + HPWHCondPumpFracToWater(1.0), // Nominal power fraction to water for the condenser water circulation pump + RatedHPWHCondWaterFlow(0.0), // Rated water flow rate through the condenser of the HPWH DX coil [m3/s] + ElecWaterHeatingPower(0.0), // Total electric power consumed by compressor and condenser pump [W] + ElecWaterHeatingConsumption(0.0), // Total electric consumption by compressor and condenser pump [J] + FanPowerIncludedInCOP(false), // Indicates that fan heat is included in heating capacity and COP + CondPumpHeatInCapacity(false), // Indicates that condenser pump heat is included in heating capacity + CondPumpPowerInCOP(false), // Indicates that condenser pump power is included in heating COP + AirVolFlowAutoSized(false), // Used to report autosizing info for the HPWH DX coil + WaterVolFlowAutoSized(false), // Used to report autosizing info for the HPWH DX coil + TotalHeatingEnergy(0.0), // total water heating energy + TotalHeatingEnergyRate(0.0), // total WH energy rate + bIsDesuperheater(false), // whether the coil is used for a desuperheater, i.e. zero all the cooling capacity and power + // end variables for HPWH + reportCoilFinalSizes(true), // coil report + capModFacTotal(0.0) // coil report + + { + } }; - // Object Data - extern Array1D VarSpeedCoil; - - // Functions - void clear_state(); - void SimVariableSpeedCoils(EnergyPlusData &state, std::string const &CompName, // Coil Name int &CompIndex, // Index for Component name int const CyclingScheme, // Continuous fan OR cycling compressor @@ -503,9 +463,9 @@ namespace VariableSpeedCoils { Optional_int MSHPDesignSpecIndex = _ // index to UnitarySystemPerformance:Multispeed object ); - void UpdateVarSpeedCoil(int const DXCoilNum); + void UpdateVarSpeedCoil(EnergyPlusData &state, int const DXCoilNum); - Real64 CalcEffectiveSHR(int const DXCoilNum, // Index number for cooling coil + Real64 CalcEffectiveSHR(EnergyPlusData &state, int const DXCoilNum, // Index number for cooling coil Real64 const SHRss, // Steady-state sensible heat ratio int const CyclingScheme, // Fan/compressor cycling scheme indicator Real64 const RTF, // Compressor run-time fraction @@ -552,16 +512,113 @@ namespace VariableSpeedCoils { int const CyclingScheme // Continuous fan OR cycling compressor ); - Real64 getVarSpeedPartLoadRatio(int const DXCoilNum); // the number of the DX coil to mined for current PLR + Real64 getVarSpeedPartLoadRatio(EnergyPlusData &state, int const DXCoilNum); // the number of the DX coil to mined for current PLR - void setVarSpeedHPWHFanTypeNum(int const dXCoilNum, int const fanTypeNum); + void setVarSpeedHPWHFanTypeNum(EnergyPlusData &state, int const dXCoilNum, int const fanTypeNum); - void setVarSpeedHPWHFanIndex(int const dXCoilNum, int const fanIndex); + void setVarSpeedHPWHFanIndex(EnergyPlusData &state, int const dXCoilNum, int const fanIndex); - void setVarSpeedFanInfo(int const dXCoilNum, std::string const fanName, int const fanIndex, int const fanTypeNum); + void setVarSpeedFanInfo(EnergyPlusData &state, int const dXCoilNum, std::string const fanName, int const fanIndex, int const fanTypeNum); } // namespace VariableSpeedCoils +struct VariableSpeedCoilsData : BaseGlobalStruct { + + Real64 const RatedInletAirTemp = 26.6667; // 26.6667C or 80F + Real64 const RatedInletWetBulbTemp = 19.4444; // 19.44 or 67F, cooling mode + Real64 const RatedInletAirHumRat = 0.0111847; // Humidity ratio corresponding to 80F dry bulb/67F wet bulb + Real64 const RatedInletWaterTemp = 29.4444; // 85 F cooling mode + Real64 const RatedAmbAirTemp = 35.0; // 95 F cooling mode + Real64 const RatedInletAirTempHeat = 21.1111; // 21.11C or 70F, heating mode + Real64 const RatedInletWaterTempHeat = 21.1111; // 21.11C or 70F, heating mode + Real64 const RatedAmbAirTempHeat = 8.3333; // 8.33 or 47F, heating mode + Real64 const RatedAmbAirWBHeat = 6.1111; // 8.33 or 43F, heating mode, rated wet bulb temperature + // Water Systems + int const CondensateDiscarded = 1001; // default mode where water is "lost" + int const CondensateToTank = 1002; // collect coil condensate from air and store in water storage tank + + int const WaterSupplyFromMains = 101; + int const WaterSupplyFromTank = 102; + + // Curve Types + int const Linear = 1; + int const BiLinear = 2; + int const Quadratic = 3; + int const BiQuadratic = 4; + int const Cubic = 5; + + // Defrost strategy (heat pump only) + int const ReverseCycle = 1; // uses reverse cycle defrost strategy + int const Resistive = 2; // uses electric resistance heater for defrost + // Defrost control (heat pump only) + int const Timed = 1; // defrost cycle is timed + int const OnDemand = 2; // defrost cycle occurs only when required + + int const MaxSpedLevels = 10; // Maximum number of speed that supports + + int NumVarSpeedCoils = 0; // The Number of Water to Air Heat Pumps found in the Input + + bool MyOneTimeFlag = true; // one time allocation flag + bool GetCoilsInputFlag = true; // Flag set to make sure you get input once + // LOGICAL, ALLOCATABLE, DIMENSION(:) :: MySizeFlag + + Real64 SourceSideMassFlowRate = 0.0; // Source Side Mass flow rate [Kg/s] + Real64 SourceSideInletTemp = 0.0; // Source Side Inlet Temperature [C] + Real64 SourceSideInletEnth = 0.0; // Source Side Inlet Enthalpy [J/kg] + Real64 LoadSideMassFlowRate = 0.0; // Load Side Mass flow rate [Kg/s] + Real64 LoadSideInletDBTemp = 0.0; // Load Side Inlet Dry Bulb Temp [C] + Real64 LoadSideInletWBTemp = 0.0; // Load Side Inlet Wet Bulb Temp [C] + Real64 LoadSideInletHumRat = 0.0; // Load Side Outlet Humidity ratio + Real64 LoadSideInletEnth = 0.0; // Load Side Inlet Enthalpy [J/kg] + Real64 LoadSideOutletDBTemp = 0.0; // Load Side Outlet Dry Bulb Temp [C] + Real64 LoadSideOutletHumRat = 0.0; // Load Side Outlet Humidity ratio + Real64 LoadSideOutletEnth = 0.0; // Load Side Outlet Enthalpy [J/kg] + Real64 QSensible = 0.0; // Load side sensible heat transfer rate [W] + Real64 QLoadTotal = 0.0; // Load side total heat transfer rate [W] + Real64 QLatRated = 0.0; // Latent Capacity [W] rated at entering air conditions [Tdb=26.7C Twb=19.4C] + Real64 QLatActual = 0.0; // Actual Latent Capacity [W] + Real64 QSource = 0.0; // Source side heat transfer rate [W] + Real64 Winput = 0.0; // Power Consumption [W] + Real64 PLRCorrLoadSideMdot = 0.0; // Load Side Mdot corrected for Part Load Ratio of the unit + + Real64 VSHPWHHeatingCapacity = 0.0; // Used by Heat Pump:Water Heater object as total water heating capacity [W] + Real64 VSHPWHHeatingCOP = 0.0; // Used by Heat Pump:Water Heater object as water heating COP [W/W] + + Array1D VarSpeedCoil; + bool firstTime = true; + + void clear_state() override + { + NumVarSpeedCoils = 0; + MyOneTimeFlag = true; + GetCoilsInputFlag = true; + SourceSideMassFlowRate = 0.0; + SourceSideInletTemp = 0.0; + SourceSideInletEnth = 0.0; + LoadSideMassFlowRate = 0.0; + LoadSideInletDBTemp = 0.0; + LoadSideInletWBTemp = 0.0; + LoadSideInletHumRat = 0.0; + LoadSideInletEnth = 0.0; + LoadSideOutletDBTemp = 0.0; + LoadSideOutletHumRat = 0.0; + LoadSideOutletEnth = 0.0; + QSensible = 0.0; + QLoadTotal = 0.0; + QLatRated = 0.0; + QLatActual = 0.0; + QSource = 0.0; + Winput = 0.0; + PLRCorrLoadSideMdot = 0.0; + VSHPWHHeatingCapacity = 0.0; + VSHPWHHeatingCOP = 0.0; + VarSpeedCoil.deallocate(); + firstTime = true; + } + + // Default Constructor + VariableSpeedCoilsData() = default; +}; } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 8940ac19622..338a9a7e650 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -137,100 +137,12 @@ namespace VentilatedSlab { using namespace FluidProperties; // Module Object - std::string const cMO_VentilatedSlab("ZoneHVAC:VentilatedSlab"); - static std::string const BlankString; - // Parameters for outside air control types: - int const Heating_ElectricCoilType(1); - int const Heating_GasCoilType(2); - int const Heating_WaterCoilType(3); - int const Heating_SteamCoilType(4); - int const Cooling_CoilWaterCooling(1); - int const Cooling_CoilDetailedCooling(2); - int const Cooling_CoilHXAssisted(3); - int const VariablePercent(1); - int const FixedTemperature(2); - int const FixedOAControl(3); - int const NotOperating(0); // Parameter for use with OperatingMode variable, set for no heating/cooling - int const HeatingMode(1); // Parameter for use with OperatingMode variable, set for heating - int const CoolingMode(2); // Parameter for use with OperatingMode variable, set for cooling - // Ventilated Slab Configurations - int const SlabOnly(1); // Air circulate through cores of slab only - int const SlabAndZone(2); // Circulated Air is introduced to zone - int const SeriesSlabs(3); - // Control Types - int const MATControl(1); // Controls system using mean air temperature - int const MRTControl(2); // Controls system using mean radiant temperature - int const OPTControl(3); // Controls system using operative temperature - int const ODBControl(4); // Controls system using outside air dry-bulb temperature - int const OWBControl(5); // Controls system using outside air wet-bulb temperature - int const SURControl(6); // Controls system using surface temperature !Phase2-A - int const DPTZControl(7); // Controls system using dew-point temperature of zone!Phase2-A - - // coil operation - int const On(1); // normal coil operation - int const Off(0); // signal coil shouldn't run - int const NoneOption(0); - int const BothOption(1); - int const HeatingOption(2); - int const CoolingOption(3); - int OperatingMode(0); // Used to keep track of whether system is in heating or cooling mode + static std::string const BlankString; static std::string const fluidNameSteam("STEAM"); static std::string const fluidNameWater("WATER"); - // DERIVED TYPE DEFINITIONS - - // MODULE VARIABLE DECLARATIONS: - bool HCoilOn(false); // TRUE if the heating coil (gas or electric especially) should be running - int NumOfVentSlabs(0); // Number of ventilated slab in the input file - Real64 OAMassFlowRate(0.0); // Outside air mass flow rate for the ventilated slab - Array1D_double QRadSysSrcAvg; // Average source over the time step for a particular radiant surfaceD - Array1D ZeroSourceSumHATsurf; // Equal to SumHATsurf for all the walls in a zone with no source - int MaxCloNumOfSurfaces(0); // Used to set allocate size in CalcClo routine - Real64 QZnReq(0.0); // heating or cooling needed by system [watts] - - // Record keeping variables used to calculate QRadSysSrcAvg locally - - Array1D_double LastQRadSysSrc; // Need to keep the last value in case we are still iterating - Array1D LastSysTimeElapsed; // Need to keep the last value in case we are still iterating - Array1D LastTimeStepSys; // Need to keep the last value in case we are still iterating - Array1D_bool CheckEquipName; - - // Autosizing variables - bool GetInputFlag(true); - bool MyOneTimeFlag(true); - Array1D_bool MySizeFlag; - - // SUBROUTINE SPECIFICATIONS FOR MODULE VentilatedSlab - // PRIVATE UpdateVentilatedSlabValAvg - - // Object Data - Array1D VentSlab; - Array1D VentSlabNumericFields; - - // Functions - - void clear_state() - { - MyOneTimeFlag = true; - GetInputFlag = true; - HCoilOn = false; - NumOfVentSlabs = 0; - OAMassFlowRate = 0.0; - MaxCloNumOfSurfaces = 0; - QZnReq = 0.0; - QRadSysSrcAvg.deallocate(); - ZeroSourceSumHATsurf.deallocate(); - LastQRadSysSrc.deallocate(); - LastSysTimeElapsed.deallocate(); - LastTimeStepSys.deallocate(); - CheckEquipName.deallocate(); - MySizeFlag.deallocate(); - VentSlab.deallocate(); - VentSlabNumericFields.deallocate(); - } - void SimVentilatedSlab(EnergyPlusData &state, std::string const &CompName, // name of the fan coil unit int const ZoneNum, // number of zone being served @@ -261,30 +173,30 @@ namespace VentilatedSlab { int Item; // index of ventilated slab being simulated // FLOW: - if (GetInputFlag) { + if (state.dataVentilatedSlab->GetInputFlag) { GetVentilatedSlabInput(state); - GetInputFlag = false; + state.dataVentilatedSlab->GetInputFlag = false; } // Find the correct VentilatedSlabInput if (CompIndex == 0) { - Item = UtilityRoutines::FindItemInList(CompName, VentSlab); + Item = UtilityRoutines::FindItemInList(CompName, state.dataVentilatedSlab->VentSlab); if (Item == 0) { ShowFatalError("SimVentilatedSlab: system not found=" + CompName); } CompIndex = Item; } else { Item = CompIndex; - if (Item > NumOfVentSlabs || Item < 1) { + if (Item > state.dataVentilatedSlab->NumOfVentSlabs || Item < 1) { ShowFatalError("SimVentilatedSlab: Invalid CompIndex passed=" + TrimSigDigits(Item) + - ", Number of Systems=" + TrimSigDigits(NumOfVentSlabs) + ", Entered System name=" + CompName); + ", Number of Systems=" + TrimSigDigits(state.dataVentilatedSlab->NumOfVentSlabs) + ", Entered System name=" + CompName); } - if (CheckEquipName(Item)) { - if (CompName != VentSlab(Item).Name) { + if (state.dataVentilatedSlab->CheckEquipName(Item)) { + if (CompName != state.dataVentilatedSlab->VentSlab(Item).Name ) { ShowFatalError("SimVentilatedSlab: Invalid CompIndex passed=" + TrimSigDigits(Item) + ", System name=" + CompName + - ", stored System Name for that index=" + VentSlab(Item).Name); + ", stored System Name for that index=" + state.dataVentilatedSlab->VentSlab(Item).Name); } - CheckEquipName(Item) = false; + state.dataVentilatedSlab->CheckEquipName(Item) = false; } } @@ -294,9 +206,9 @@ namespace VentilatedSlab { CalcVentilatedSlab(state, Item, ZoneNum, FirstHVACIteration, PowerMet, LatOutputProvided); - UpdateVentilatedSlab(Item, FirstHVACIteration); + UpdateVentilatedSlab(state, Item, FirstHVACIteration); - ReportVentilatedSlab(Item); + ReportVentilatedSlab(state, Item); ZoneEqVentedSlab = false; } @@ -389,14 +301,14 @@ namespace VentilatedSlab { // make sure data is gotten for surface lists BaseNum = GetNumberOfSurfListVentSlab(state); - NumOfVentSlabs = inputProcessor->getNumObjectsFound(CurrentModuleObject); + state.dataVentilatedSlab->NumOfVentSlabs = inputProcessor->getNumObjectsFound(CurrentModuleObject); // Allocate the local derived type and do one-time initializations for all parts of it - VentSlab.allocate(NumOfVentSlabs); - CheckEquipName.dimension(NumOfVentSlabs, true); - VentSlabNumericFields.allocate(NumOfVentSlabs); + state.dataVentilatedSlab->VentSlab.allocate(state.dataVentilatedSlab->NumOfVentSlabs); + state.dataVentilatedSlab->CheckEquipName.dimension(state.dataVentilatedSlab->NumOfVentSlabs, true); + state.dataVentilatedSlab->VentSlabNumericFields.allocate(state.dataVentilatedSlab->NumOfVentSlabs); - for (Item = 1; Item <= NumOfVentSlabs; ++Item) { // Begin looping over the entire ventilated slab systems found in the input file... + for (Item = 1; Item <= state.dataVentilatedSlab->NumOfVentSlabs; ++Item) { // Begin looping over the entire ventilated slab systems found in the input file... inputProcessor->getObjectItem(state, CurrentModuleObject, @@ -411,26 +323,26 @@ namespace VentilatedSlab { cAlphaFields, cNumericFields); - VentSlabNumericFields(Item).FieldNames.allocate(NumNumbers); - VentSlabNumericFields(Item).FieldNames = cNumericFields; + state.dataVentilatedSlab->VentSlabNumericFields(Item).FieldNames.allocate(NumNumbers); + state.dataVentilatedSlab->VentSlabNumericFields(Item).FieldNames = cNumericFields; UtilityRoutines::IsNameEmpty(cAlphaArgs(1), CurrentModuleObject, ErrorsFound); - VentSlab(Item).Name = cAlphaArgs(1); - VentSlab(Item).SchedName = cAlphaArgs(2); + state.dataVentilatedSlab->VentSlab(Item).Name = cAlphaArgs(1); + state.dataVentilatedSlab->VentSlab(Item).SchedName = cAlphaArgs(2); if (lAlphaBlanks(2)) { - VentSlab(Item).SchedPtr = ScheduleAlwaysOn; + state.dataVentilatedSlab->VentSlab(Item).SchedPtr = ScheduleAlwaysOn; } else { - VentSlab(Item).SchedPtr = GetScheduleIndex(state, cAlphaArgs(2)); // convert schedule name to pointer - if (VentSlab(Item).SchedPtr == 0) { + state.dataVentilatedSlab->VentSlab(Item).SchedPtr = GetScheduleIndex(state, cAlphaArgs(2)); // convert schedule name to pointer + if (state.dataVentilatedSlab->VentSlab(Item).SchedPtr == 0) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(2) + "=\"" + cAlphaArgs(2) + "\" not found."); ErrorsFound = true; } } - VentSlab(Item).ZoneName = cAlphaArgs(3); - VentSlab(Item).ZonePtr = UtilityRoutines::FindItemInList(cAlphaArgs(3), Zone); - if (VentSlab(Item).ZonePtr == 0) { + state.dataVentilatedSlab->VentSlab(Item).ZoneName = cAlphaArgs(3); + state.dataVentilatedSlab->VentSlab(Item).ZonePtr = UtilityRoutines::FindItemInList(cAlphaArgs(3), Zone); + if (state.dataVentilatedSlab->VentSlab(Item).ZonePtr == 0) { if (lAlphaBlanks(3)) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(3) + " is required but input is blank."); @@ -441,60 +353,60 @@ namespace VentilatedSlab { ErrorsFound = true; } - VentSlab(Item).SurfListName = cAlphaArgs(4); + state.dataVentilatedSlab->VentSlab(Item).SurfListName = cAlphaArgs(4); SurfListNum = 0; // IF (NumOfSlabLists > 0) SurfListNum = UtilityRoutines::FindItemInList(VentSlab(Item)%SurfListName, SlabList%Name, NumOfSlabLists) - if (NumOfSurfListVentSlab > 0) SurfListNum = UtilityRoutines::FindItemInList(VentSlab(Item).SurfListName, SlabList); + if (NumOfSurfListVentSlab > 0) SurfListNum = UtilityRoutines::FindItemInList(state.dataVentilatedSlab->VentSlab(Item).SurfListName, SlabList); if (SurfListNum > 0) { // Found a valid surface list - VentSlab(Item).NumOfSurfaces = SlabList(SurfListNum).NumOfSurfaces; - VentSlab(Item).ZName.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).ZPtr.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).SurfaceName.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).SurfacePtr.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).CDiameter.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).CLength.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).CNumbers.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).SlabIn.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).SlabOut.allocate(VentSlab(Item).NumOfSurfaces); - - MaxCloNumOfSurfaces = max(MaxCloNumOfSurfaces, VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces = SlabList(SurfListNum).NumOfSurfaces; + state.dataVentilatedSlab->VentSlab(Item).ZName.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).ZPtr.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).SurfaceName.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).SurfacePtr.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).CDiameter.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).CLength.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).CNumbers.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).SlabIn.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).SlabOut.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + + state.dataVentilatedSlab->MaxCloNumOfSurfaces = max(state.dataVentilatedSlab->MaxCloNumOfSurfaces, state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); for (SurfNum = 1; SurfNum <= SlabList(SurfListNum).NumOfSurfaces; ++SurfNum) { - VentSlab(Item).ZName(SurfNum) = SlabList(SurfListNum).ZoneName(SurfNum); - VentSlab(Item).ZPtr(SurfNum) = SlabList(SurfListNum).ZonePtr(SurfNum); - VentSlab(Item).SurfaceName(SurfNum) = SlabList(SurfListNum).SurfName(SurfNum); - VentSlab(Item).SurfacePtr(SurfNum) = SlabList(SurfListNum).SurfPtr(SurfNum); - VentSlab(Item).CDiameter(SurfNum) = SlabList(SurfListNum).CoreDiameter(SurfNum); - VentSlab(Item).CLength(SurfNum) = SlabList(SurfListNum).CoreLength(SurfNum); - VentSlab(Item).CNumbers(SurfNum) = SlabList(SurfListNum).CoreNumbers(SurfNum); - VentSlab(Item).SlabIn(SurfNum) = SlabList(SurfListNum).SlabInNodeName(SurfNum); - VentSlab(Item).SlabOut(SurfNum) = SlabList(SurfListNum).SlabOutNodeName(SurfNum); - if (VentSlab(Item).SurfacePtr(SurfNum) != 0) { - Surface(VentSlab(Item).SurfacePtr(SurfNum)).IntConvSurfHasActiveInIt = true; + state.dataVentilatedSlab->VentSlab(Item).ZName(SurfNum) = SlabList(SurfListNum).ZoneName(SurfNum); + state.dataVentilatedSlab->VentSlab(Item).ZPtr(SurfNum) = SlabList(SurfListNum).ZonePtr(SurfNum); + state.dataVentilatedSlab->VentSlab(Item).SurfaceName(SurfNum) = SlabList(SurfListNum).SurfName(SurfNum); + state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum) = SlabList(SurfListNum).SurfPtr(SurfNum); + state.dataVentilatedSlab->VentSlab(Item).CDiameter(SurfNum) = SlabList(SurfListNum).CoreDiameter(SurfNum); + state.dataVentilatedSlab->VentSlab(Item).CLength(SurfNum) = SlabList(SurfListNum).CoreLength(SurfNum); + state.dataVentilatedSlab->VentSlab(Item).CNumbers(SurfNum) = SlabList(SurfListNum).CoreNumbers(SurfNum); + state.dataVentilatedSlab->VentSlab(Item).SlabIn(SurfNum) = SlabList(SurfListNum).SlabInNodeName(SurfNum); + state.dataVentilatedSlab->VentSlab(Item).SlabOut(SurfNum) = SlabList(SurfListNum).SlabOutNodeName(SurfNum); + if (state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum) != 0) { + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).IntConvSurfHasActiveInIt = true; } } } else { // User entered a single surface name rather than a surface list - VentSlab(Item).NumOfSurfaces = 1; - VentSlab(Item).SurfacePtr.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).SurfaceName.allocate(VentSlab(Item).NumOfSurfaces); - VentSlab(Item).SurfaceFlowFrac.allocate(VentSlab(Item).NumOfSurfaces); - MaxCloNumOfSurfaces = max(MaxCloNumOfSurfaces, VentSlab(Item).NumOfSurfaces); - VentSlab(Item).SurfaceName(1) = VentSlab(Item).SurfListName; - VentSlab(Item).SurfacePtr(1) = UtilityRoutines::FindItemInList(VentSlab(Item).SurfaceName(1), Surface); - VentSlab(Item).SurfaceFlowFrac(1) = 1.0; + state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces = 1; + state.dataVentilatedSlab->VentSlab(Item).SurfacePtr.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).SurfaceName.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).SurfaceFlowFrac.allocate(state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->MaxCloNumOfSurfaces = max(state.dataVentilatedSlab->MaxCloNumOfSurfaces, state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces); + state.dataVentilatedSlab->VentSlab(Item).SurfaceName(1) = state.dataVentilatedSlab->VentSlab(Item).SurfListName; + state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1) = UtilityRoutines::FindItemInList(state.dataVentilatedSlab->VentSlab(Item).SurfaceName(1), Surface); + state.dataVentilatedSlab->VentSlab(Item).SurfaceFlowFrac(1) = 1.0; // Error checking for single surfaces - if (VentSlab(Item).SurfacePtr(1) == 0) { + if (state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1) == 0) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(4) + "=\"" + cAlphaArgs(4) + "\" not found."); ErrorsFound = true; - } else if (Surface(VentSlab(Item).SurfacePtr(1)).IsRadSurfOrVentSlabOrPool) { + } else if (Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)).IsRadSurfOrVentSlabOrPool) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid Surface"); ShowContinueError(cAlphaFields(4) + "=\"" + cAlphaArgs(4) + "\" has been used in another radiant system or ventilated slab."); ErrorsFound = true; } - if (VentSlab(Item).SurfacePtr(1) != 0) { - Surface(VentSlab(Item).SurfacePtr(1)).IntConvSurfHasActiveInIt = true; - Surface(VentSlab(Item).SurfacePtr(1)).IsRadSurfOrVentSlabOrPool = true; + if (state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1) != 0) { + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)).IntConvSurfHasActiveInIt = true; + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)).IsRadSurfOrVentSlabOrPool = true; } } @@ -502,87 +414,87 @@ namespace VentilatedSlab { if (SurfListNum > 0) { - for (SurfNum = 1; SurfNum <= VentSlab(Item).NumOfSurfaces; ++SurfNum) { + for (SurfNum = 1; SurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++SurfNum) { - if (VentSlab(Item).SurfacePtr(SurfNum) == 0) continue; // invalid surface -- detected earlier - if (VentSlab(Item).ZPtr(SurfNum) == 0) continue; // invalid zone -- detected earlier - // IF (Surface(VentSlab(Item)%SurfacePtr(SurfNum))%Zone /= VentSlab(Item)%ZPtr(SurfNum)) THEN + if (state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum) == 0) continue; // invalid surface -- detected earlier + if (state.dataVentilatedSlab->VentSlab(Item).ZPtr(SurfNum) == 0) continue; // invalid zone -- detected earlier + // IF (Surface(VentSlab(Item)%SurfacePtr(SurfNum))%Zone /= state.dataVentilatedSlab->VentSlab(Item)%ZPtr(SurfNum)) THEN // CALL ShowSevereError(TRIM(CurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'" invalid '// & // 'surface="'//TRIM(Surface(VentSlab(Item)%SurfacePtr(SurfNum))%Name)//'".') // CALL ShowContinueError('Surface in Zone='//TRIM(Zone(Surface(VentSlab(Item)%SurfacePtr(SurfNum))%Zone)%Name)//' '// & // CurrentModuleObject//' in Zone='//TRIM(cAlphaArgs(3))) // ErrorsFound=.TRUE. // END IF - if (Surface(VentSlab(Item).SurfacePtr(SurfNum)).Construction == 0) continue; // invalid construction, detected earlier - if (!state.dataConstruction->Construct(Surface(VentSlab(Item).SurfacePtr(SurfNum)).Construction).SourceSinkPresent) { + if (Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Construction == 0) continue; // invalid construction, detected earlier + if (!state.dataConstruction->Construct(Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Construction).SourceSinkPresent) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid surface=\"" + - Surface(VentSlab(Item).SurfacePtr(SurfNum)).Name + "\"."); + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Name + "\"."); ShowContinueError("Surface Construction does not have a source/sink, Construction name= \"" + - state.dataConstruction->Construct(Surface(VentSlab(Item).SurfacePtr(SurfNum)).Construction).Name + "\"."); + state.dataConstruction->Construct(Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Construction).Name + "\"."); ErrorsFound = true; } } } else { - for (SurfNum = 1; SurfNum <= VentSlab(Item).NumOfSurfaces; ++SurfNum) { - if (VentSlab(Item).SurfacePtr(SurfNum) == 0) continue; // invalid surface -- detected earlier - if (VentSlab(Item).ZonePtr == 0) continue; // invalid zone -- detected earlier - if (Surface(VentSlab(Item).SurfacePtr(SurfNum)).Zone != VentSlab(Item).ZonePtr) { + for (SurfNum = 1; SurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++SurfNum) { + if (state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum) == 0) continue; // invalid surface -- detected earlier + if (state.dataVentilatedSlab->VentSlab(Item).ZonePtr == 0) continue; // invalid zone -- detected earlier + if (Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Zone != state.dataVentilatedSlab->VentSlab(Item).ZonePtr) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid surface=\"" + - Surface(VentSlab(Item).SurfacePtr(SurfNum)).Name + "\"."); - ShowContinueError("Surface in Zone=" + Zone(Surface(VentSlab(Item).SurfacePtr(SurfNum)).Zone).Name + ' ' + + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Name + "\"."); + ShowContinueError("Surface in Zone=" + Zone(Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Zone).Name + ' ' + CurrentModuleObject + " in Zone=" + cAlphaArgs(3)); ErrorsFound = true; } - if (Surface(VentSlab(Item).SurfacePtr(SurfNum)).Construction == 0) continue; // invalid construction, detected earlier - if (!state.dataConstruction->Construct(Surface(VentSlab(Item).SurfacePtr(SurfNum)).Construction).SourceSinkPresent) { + if (Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Construction == 0) continue; // invalid construction, detected earlier + if (!state.dataConstruction->Construct(Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Construction).SourceSinkPresent) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid surface=\"" + - Surface(VentSlab(Item).SurfacePtr(SurfNum)).Name + "\"."); + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Name + "\"."); ShowContinueError("Surface Construction does not have a source/sink, Construction name= \"" + - state.dataConstruction->Construct(Surface(VentSlab(Item).SurfacePtr(SurfNum)).Construction).Name + "\"."); + state.dataConstruction->Construct(Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).Construction).Name + "\"."); ErrorsFound = true; } } } - VentSlab(Item).MaxAirVolFlow = rNumericArgs(1); + state.dataVentilatedSlab->VentSlab(Item).MaxAirVolFlow = rNumericArgs(1); // Outside air information: - VentSlab(Item).MinOutAirVolFlow = rNumericArgs(2); - VentSlab(Item).OutAirVolFlow = rNumericArgs(3); + state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow = rNumericArgs(2); + state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow = rNumericArgs(3); { auto const SELECT_CASE_var(cAlphaArgs(5)); if (SELECT_CASE_var == "VARIABLEPERCENT") { - VentSlab(Item).OAControlType = VariablePercent; - VentSlab(Item).MaxOASchedName = cAlphaArgs(6); - VentSlab(Item).MaxOASchedPtr = GetScheduleIndex(state, cAlphaArgs(7)); // convert schedule name to pointer - if (VentSlab(Item).MaxOASchedPtr == 0) { + state.dataVentilatedSlab->VentSlab(Item).OAControlType = state.dataVentilatedSlab->VariablePercent; + state.dataVentilatedSlab->VentSlab(Item).MaxOASchedName = cAlphaArgs(6); + state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr = GetScheduleIndex(state, cAlphaArgs(7)); // convert schedule name to pointer + if (state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr == 0) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(7) + "=\"" + cAlphaArgs(7) + "\" not found."); ErrorsFound = true; - } else if (!CheckScheduleValueMinMax(VentSlab(Item).MaxOASchedPtr, ">=0", 0.0, "<=", 1.0)) { + } else if (!CheckScheduleValueMinMax(state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr, ">=0", 0.0, "<=", 1.0)) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(7) + "=\"" + cAlphaArgs(7) + "\" values out of range [0,1]."); ErrorsFound = true; } } else if (SELECT_CASE_var == "FIXEDAMOUNT") { - VentSlab(Item).OAControlType = FixedOAControl; - VentSlab(Item).MaxOASchedName = cAlphaArgs(7); - VentSlab(Item).MaxOASchedPtr = GetScheduleIndex(state, cAlphaArgs(7)); // convert schedule name to pointer - if (VentSlab(Item).MaxOASchedPtr == 0) { + state.dataVentilatedSlab->VentSlab(Item).OAControlType = state.dataVentilatedSlab->FixedOAControl; + state.dataVentilatedSlab->VentSlab(Item).MaxOASchedName = cAlphaArgs(7); + state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr = GetScheduleIndex(state, cAlphaArgs(7)); // convert schedule name to pointer + if (state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr == 0) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(7) + "=\"" + cAlphaArgs(7) + "\" not found."); ErrorsFound = true; - } else if (!CheckScheduleValueMinMax(VentSlab(Item).MaxOASchedPtr, ">=0", 0.0)) { + } else if (!CheckScheduleValueMinMax(state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr, ">=0", 0.0)) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(7) + "=\"" + cAlphaArgs(7) + "\" values out of range (must be >=0)."); ErrorsFound = true; } } else if (SELECT_CASE_var == "FIXEDTEMPERATURE") { - VentSlab(Item).OAControlType = FixedTemperature; - VentSlab(Item).TempSchedName = cAlphaArgs(7); - VentSlab(Item).TempSchedPtr = GetScheduleIndex(state, cAlphaArgs(7)); // convert schedule name to pointer - if (VentSlab(Item).TempSchedPtr == 0) { + state.dataVentilatedSlab->VentSlab(Item).OAControlType = state.dataVentilatedSlab->FixedTemperature; + state.dataVentilatedSlab->VentSlab(Item).TempSchedName = cAlphaArgs(7); + state.dataVentilatedSlab->VentSlab(Item).TempSchedPtr = GetScheduleIndex(state, cAlphaArgs(7)); // convert schedule name to pointer + if (state.dataVentilatedSlab->VentSlab(Item).TempSchedPtr == 0) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(7) + "=\"" + cAlphaArgs(7) + "\" not found."); ErrorsFound = true; @@ -592,9 +504,9 @@ namespace VentilatedSlab { } } - VentSlab(Item).MinOASchedName = cAlphaArgs(6); - VentSlab(Item).MinOASchedPtr = GetScheduleIndex(state, cAlphaArgs(6)); // convert schedule name to pointer - if (VentSlab(Item).MinOASchedPtr == 0) { + state.dataVentilatedSlab->VentSlab(Item).MinOASchedName = cAlphaArgs(6); + state.dataVentilatedSlab->VentSlab(Item).MinOASchedPtr = GetScheduleIndex(state, cAlphaArgs(6)); // convert schedule name to pointer + if (state.dataVentilatedSlab->VentSlab(Item).MinOASchedPtr == 0) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(6) + "=\"" + cAlphaArgs(6) + "\" not found."); ErrorsFound = true; @@ -602,21 +514,21 @@ namespace VentilatedSlab { // System Configuration: if (UtilityRoutines::SameString(cAlphaArgs(8), "SlabOnly")) { - VentSlab(Item).SysConfg = SlabOnly; + state.dataVentilatedSlab->VentSlab(Item).SysConfg = state.dataVentilatedSlab->SlabOnly; } else if (UtilityRoutines::SameString(cAlphaArgs(8), "SlabAndZone")) { - VentSlab(Item).SysConfg = SlabAndZone; + state.dataVentilatedSlab->VentSlab(Item).SysConfg = state.dataVentilatedSlab->SlabAndZone; } else if (UtilityRoutines::SameString(cAlphaArgs(8), "SeriesSlabs")) { - VentSlab(Item).SysConfg = SeriesSlabs; + state.dataVentilatedSlab->VentSlab(Item).SysConfg = state.dataVentilatedSlab->SeriesSlabs; } else { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(8) + "=\"" + cAlphaArgs(8) + "\"."); ShowContinueError("Control reset to SLAB ONLY Configuration."); - VentSlab(Item).SysConfg = SlabOnly; + state.dataVentilatedSlab->VentSlab(Item).SysConfg = state.dataVentilatedSlab->SlabOnly; } // Hollow Core information : - VentSlab(Item).CoreDiameter = rNumericArgs(4); - VentSlab(Item).CoreLength = rNumericArgs(5); - VentSlab(Item).CoreNumbers = rNumericArgs(6); + state.dataVentilatedSlab->VentSlab(Item).CoreDiameter = rNumericArgs(4); + state.dataVentilatedSlab->VentSlab(Item).CoreLength = rNumericArgs(5); + state.dataVentilatedSlab->VentSlab(Item).CoreNumbers = rNumericArgs(6); if (UtilityRoutines::SameString(cAlphaArgs(8), "SurfaceListNames")) { if (!lNumericBlanks(4)) { @@ -644,31 +556,31 @@ namespace VentilatedSlab { // Process the temperature control type if (UtilityRoutines::SameString(cAlphaArgs(9), OutsideAirDryBulbTemperature)) { - VentSlab(Item).ControlType = ODBControl; + state.dataVentilatedSlab->VentSlab(Item).ControlType = state.dataVentilatedSlab->ODBControl; } else if (UtilityRoutines::SameString(cAlphaArgs(9), OutsideAirWetBulbTemperature)) { - VentSlab(Item).ControlType = OWBControl; + state.dataVentilatedSlab->VentSlab(Item).ControlType = state.dataVentilatedSlab->OWBControl; } else if (UtilityRoutines::SameString(cAlphaArgs(9), OperativeTemperature)) { - VentSlab(Item).ControlType = OPTControl; + state.dataVentilatedSlab->VentSlab(Item).ControlType = state.dataVentilatedSlab->OPTControl; } else if (UtilityRoutines::SameString(cAlphaArgs(9), MeanAirTemperature)) { - VentSlab(Item).ControlType = MATControl; + state.dataVentilatedSlab->VentSlab(Item).ControlType = state.dataVentilatedSlab->MATControl; } else if (UtilityRoutines::SameString(cAlphaArgs(9), MeanRadiantTemperature)) { - VentSlab(Item).ControlType = MRTControl; + state.dataVentilatedSlab->VentSlab(Item).ControlType = state.dataVentilatedSlab->MRTControl; } else if (UtilityRoutines::SameString(cAlphaArgs(9), SlabSurfaceTemperature)) { - VentSlab(Item).ControlType = SURControl; + state.dataVentilatedSlab->VentSlab(Item).ControlType = state.dataVentilatedSlab->SURControl; } else if (UtilityRoutines::SameString(cAlphaArgs(9), SlabSurfaceDewPointTemperature)) { - VentSlab(Item).ControlType = DPTZControl; + state.dataVentilatedSlab->VentSlab(Item).ControlType = state.dataVentilatedSlab->DPTZControl; } else { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(9) + "=\"" + cAlphaArgs(9) + "\"."); ShowContinueError("Control reset to ODB control."); - VentSlab(Item).ControlType = ODBControl; + state.dataVentilatedSlab->VentSlab(Item).ControlType = state.dataVentilatedSlab->ODBControl; } // Heating User Input Data For Ventilated Slab Control : // High Air Temp : - VentSlab(Item).HotAirHiTempSched = cAlphaArgs(10); - VentSlab(Item).HotAirHiTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(10)); - if ((VentSlab(Item).HotAirHiTempSchedPtr == 0) && (!lAlphaBlanks(10))) { + state.dataVentilatedSlab->VentSlab(Item).HotAirHiTempSched = cAlphaArgs(10); + state.dataVentilatedSlab->VentSlab(Item).HotAirHiTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(10)); + if ((state.dataVentilatedSlab->VentSlab(Item).HotAirHiTempSchedPtr == 0) && (!lAlphaBlanks(10))) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(10) + "=\"" + cAlphaArgs(10) + "\" not found."); ErrorsFound = true; @@ -676,25 +588,25 @@ namespace VentilatedSlab { // Low Air Temp : - VentSlab(Item).HotAirLoTempSched = cAlphaArgs(11); - VentSlab(Item).HotAirLoTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(11)); - if ((VentSlab(Item).HotAirLoTempSchedPtr == 0) && (!lAlphaBlanks(11))) { + state.dataVentilatedSlab->VentSlab(Item).HotAirLoTempSched = cAlphaArgs(11); + state.dataVentilatedSlab->VentSlab(Item).HotAirLoTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(11)); + if ((state.dataVentilatedSlab->VentSlab(Item).HotAirLoTempSchedPtr == 0) && (!lAlphaBlanks(11))) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(11) + "=\"" + cAlphaArgs(11) + "\" not found."); ErrorsFound = true; } - VentSlab(Item).HotCtrlHiTempSched = cAlphaArgs(12); - VentSlab(Item).HotCtrlHiTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(12)); - if ((VentSlab(Item).HotCtrlHiTempSchedPtr == 0) && (!lAlphaBlanks(12))) { + state.dataVentilatedSlab->VentSlab(Item).HotCtrlHiTempSched = cAlphaArgs(12); + state.dataVentilatedSlab->VentSlab(Item).HotCtrlHiTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(12)); + if ((state.dataVentilatedSlab->VentSlab(Item).HotCtrlHiTempSchedPtr == 0) && (!lAlphaBlanks(12))) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(12) + "=\"" + cAlphaArgs(12) + "\" not found."); ErrorsFound = true; } - VentSlab(Item).HotCtrlLoTempSched = cAlphaArgs(13); - VentSlab(Item).HotCtrlLoTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(13)); - if ((VentSlab(Item).HotCtrlLoTempSchedPtr == 0) && (!lAlphaBlanks(13))) { + state.dataVentilatedSlab->VentSlab(Item).HotCtrlLoTempSched = cAlphaArgs(13); + state.dataVentilatedSlab->VentSlab(Item).HotCtrlLoTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(13)); + if ((state.dataVentilatedSlab->VentSlab(Item).HotCtrlLoTempSchedPtr == 0) && (!lAlphaBlanks(13))) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(13) + "=\"" + cAlphaArgs(13) + "\" not found."); ErrorsFound = true; @@ -702,9 +614,9 @@ namespace VentilatedSlab { // Cooling User Input Data For Ventilated Slab Control : // Cooling High Temp Sch. - VentSlab(Item).ColdAirHiTempSched = cAlphaArgs(13); - VentSlab(Item).ColdAirHiTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(14)); - if ((VentSlab(Item).ColdAirHiTempSchedPtr == 0) && (!lAlphaBlanks(14))) { + state.dataVentilatedSlab->VentSlab(Item).ColdAirHiTempSched = cAlphaArgs(13); + state.dataVentilatedSlab->VentSlab(Item).ColdAirHiTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(14)); + if ((state.dataVentilatedSlab->VentSlab(Item).ColdAirHiTempSchedPtr == 0) && (!lAlphaBlanks(14))) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(14) + "=\"" + cAlphaArgs(14) + "\" not found."); ErrorsFound = true; @@ -712,9 +624,9 @@ namespace VentilatedSlab { // Cooling Low Temp Sch. - VentSlab(Item).ColdAirLoTempSched = cAlphaArgs(15); - VentSlab(Item).ColdAirLoTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(15)); - if ((VentSlab(Item).ColdAirLoTempSchedPtr == 0) && (!lAlphaBlanks(15))) { + state.dataVentilatedSlab->VentSlab(Item).ColdAirLoTempSched = cAlphaArgs(15); + state.dataVentilatedSlab->VentSlab(Item).ColdAirLoTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(15)); + if ((state.dataVentilatedSlab->VentSlab(Item).ColdAirLoTempSchedPtr == 0) && (!lAlphaBlanks(15))) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(15) + "=\"" + cAlphaArgs(15) + "\" not found."); ErrorsFound = true; @@ -722,9 +634,9 @@ namespace VentilatedSlab { // Cooling Control High Sch. - VentSlab(Item).ColdCtrlHiTempSched = cAlphaArgs(16); - VentSlab(Item).ColdCtrlHiTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(16)); - if ((VentSlab(Item).ColdCtrlHiTempSchedPtr == 0) && (!lAlphaBlanks(16))) { + state.dataVentilatedSlab->VentSlab(Item).ColdCtrlHiTempSched = cAlphaArgs(16); + state.dataVentilatedSlab->VentSlab(Item).ColdCtrlHiTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(16)); + if ((state.dataVentilatedSlab->VentSlab(Item).ColdCtrlHiTempSchedPtr == 0) && (!lAlphaBlanks(16))) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(16) + "=\"" + cAlphaArgs(16) + "\" not found."); ErrorsFound = true; @@ -732,9 +644,9 @@ namespace VentilatedSlab { // Cooling Control Low Sch. - VentSlab(Item).ColdCtrlLoTempSched = cAlphaArgs(17); - VentSlab(Item).ColdCtrlLoTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(17)); - if ((VentSlab(Item).ColdCtrlLoTempSchedPtr == 0) && (!lAlphaBlanks(17))) { + state.dataVentilatedSlab->VentSlab(Item).ColdCtrlLoTempSched = cAlphaArgs(17); + state.dataVentilatedSlab->VentSlab(Item).ColdCtrlLoTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(17)); + if ((state.dataVentilatedSlab->VentSlab(Item).ColdCtrlLoTempSchedPtr == 0) && (!lAlphaBlanks(17))) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(17) + "=\"" + cAlphaArgs(17) + "\" not found."); ErrorsFound = true; @@ -773,9 +685,9 @@ namespace VentilatedSlab { // %OutsideAirNode is the outdoor air inlet to the OA mixer // For all types of ventilated slab, this is NodeConnectionType_Inlet,ObjectIsNotParent, -OA MIXER - if (VentSlab(Item).SysConfg == SlabOnly) { + if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabOnly) { - VentSlab(Item).ReturnAirNode = GetOnlySingleNode(state, cAlphaArgs(18), + state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode = GetOnlySingleNode(state, cAlphaArgs(18), ErrorsFound, CurrentModuleObject + "-OA MIXER", cAlphaArgs(1) + "-OA MIXER", @@ -783,10 +695,10 @@ namespace VentilatedSlab { NodeConnectionType_Internal, 1, ObjectIsNotParent); - VentSlab(Item).RadInNode = GetOnlySingleNode(state, + state.dataVentilatedSlab->VentSlab(Item).RadInNode = GetOnlySingleNode(state, cAlphaArgs(19), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - VentSlab(Item).OAMixerOutNode = GetOnlySingleNode(state, cAlphaArgs(23), + state.dataVentilatedSlab->VentSlab(Item).OAMixerOutNode = GetOnlySingleNode(state, cAlphaArgs(23), ErrorsFound, CurrentModuleObject + "-OA MIXER", cAlphaArgs(1) + "-OA MIXER", @@ -794,12 +706,12 @@ namespace VentilatedSlab { NodeConnectionType_Outlet, 1, ObjectIsNotParent); - VentSlab(Item).FanOutletNode = GetOnlySingleNode(state, + state.dataVentilatedSlab->VentSlab(Item).FanOutletNode = GetOnlySingleNode(state, cAlphaArgs(24), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Internal, 1, ObjectIsParent); - } else if (VentSlab(Item).SysConfg == SeriesSlabs) { + } else if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SeriesSlabs) { - VentSlab(Item).ReturnAirNode = GetOnlySingleNode(state, cAlphaArgs(18), + state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode = GetOnlySingleNode(state, cAlphaArgs(18), ErrorsFound, CurrentModuleObject + "-OA MIXER", cAlphaArgs(1) + "-OA MIXER", @@ -807,10 +719,10 @@ namespace VentilatedSlab { NodeConnectionType_Internal, 1, ObjectIsNotParent); - VentSlab(Item).RadInNode = GetOnlySingleNode(state, + state.dataVentilatedSlab->VentSlab(Item).RadInNode = GetOnlySingleNode(state, cAlphaArgs(19), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - VentSlab(Item).OAMixerOutNode = GetOnlySingleNode(state, cAlphaArgs(23), + state.dataVentilatedSlab->VentSlab(Item).OAMixerOutNode = GetOnlySingleNode(state, cAlphaArgs(23), ErrorsFound, CurrentModuleObject + "-OA MIXER", cAlphaArgs(1) + "-OA MIXER", @@ -818,12 +730,12 @@ namespace VentilatedSlab { NodeConnectionType_Outlet, 1, ObjectIsNotParent); - VentSlab(Item).FanOutletNode = GetOnlySingleNode(state, + state.dataVentilatedSlab->VentSlab(Item).FanOutletNode = GetOnlySingleNode(state, cAlphaArgs(24), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Internal, 1, ObjectIsParent); - } else if (VentSlab(Item).SysConfg == SlabAndZone) { + } else if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabAndZone) { - VentSlab(Item).ReturnAirNode = GetOnlySingleNode(state, cAlphaArgs(18), + state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode = GetOnlySingleNode(state, cAlphaArgs(18), ErrorsFound, CurrentModuleObject + "-SYSTEM", cAlphaArgs(1) + "-SYSTEM", @@ -831,7 +743,7 @@ namespace VentilatedSlab { NodeConnectionType_Inlet, 1, ObjectIsParent); - VentSlab(Item).ReturnAirNode = GetOnlySingleNode(state, cAlphaArgs(18), + state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode = GetOnlySingleNode(state, cAlphaArgs(18), ErrorsFound, CurrentModuleObject + "-OA MIXER", cAlphaArgs(1) + "-OA MIXER", @@ -839,9 +751,9 @@ namespace VentilatedSlab { NodeConnectionType_Inlet, 1, ObjectIsNotParent); - VentSlab(Item).RadInNode = GetOnlySingleNode(state, + state.dataVentilatedSlab->VentSlab(Item).RadInNode = GetOnlySingleNode(state, cAlphaArgs(19), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - VentSlab(Item).OAMixerOutNode = GetOnlySingleNode(state, cAlphaArgs(23), + state.dataVentilatedSlab->VentSlab(Item).OAMixerOutNode = GetOnlySingleNode(state, cAlphaArgs(23), ErrorsFound, CurrentModuleObject + "-OA MIXER", cAlphaArgs(1) + "-OA MIXER", @@ -849,25 +761,25 @@ namespace VentilatedSlab { NodeConnectionType_Outlet, 1, ObjectIsNotParent); - VentSlab(Item).FanOutletNode = GetOnlySingleNode(state, + state.dataVentilatedSlab->VentSlab(Item).FanOutletNode = GetOnlySingleNode(state, cAlphaArgs(24), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Internal, 1, ObjectIsParent); } - if (VentSlab(Item).SysConfg == SlabOnly) { + if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabOnly) { if (!lAlphaBlanks(20)) { ShowWarningError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" " + cAlphaFields(20) + "=\"" + cAlphaArgs(20) + "\" not needed - ignored."); ShowContinueError("It is used for \"SlabAndZone\" only"); } - } else if (VentSlab(Item).SysConfg == SlabAndZone) { + } else if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabAndZone) { if (lAlphaBlanks(20)) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(20) + " is blank and must be entered."); ErrorsFound = true; } - VentSlab(Item).ZoneAirInNode = GetOnlySingleNode(state, cAlphaArgs(20), + state.dataVentilatedSlab->VentSlab(Item).ZoneAirInNode = GetOnlySingleNode(state, cAlphaArgs(20), ErrorsFound, CurrentModuleObject + "-SYSTEM", cAlphaArgs(1) + "-SYSTEM", @@ -876,12 +788,12 @@ namespace VentilatedSlab { 1, ObjectIsParent); - VentSlab(Item).ZoneAirInNode = GetOnlySingleNode(state, + state.dataVentilatedSlab->VentSlab(Item).ZoneAirInNode = GetOnlySingleNode(state, cAlphaArgs(20), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent); } // Set connection type to 'Inlet', because it now uses an OA node - VentSlab(Item).OutsideAirNode = GetOnlySingleNode(state, cAlphaArgs(21), + state.dataVentilatedSlab->VentSlab(Item).OutsideAirNode = GetOnlySingleNode(state, cAlphaArgs(21), ErrorsFound, CurrentModuleObject + "-OA MIXER", cAlphaArgs(1) + "-OA MIXER", @@ -891,13 +803,13 @@ namespace VentilatedSlab { ObjectIsNotParent); if (!lAlphaBlanks(21)) { - CheckAndAddAirNodeNumber(state, VentSlab(Item).OutsideAirNode, IsValid); + CheckAndAddAirNodeNumber(state, state.dataVentilatedSlab->VentSlab(Item).OutsideAirNode, IsValid); if (!IsValid) { ShowWarningError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", Adding OutdoorAir:Node=" + cAlphaArgs(21)); } } - VentSlab(Item).AirReliefNode = GetOnlySingleNode(state, cAlphaArgs(22), + state.dataVentilatedSlab->VentSlab(Item).AirReliefNode = GetOnlySingleNode(state, cAlphaArgs(22), ErrorsFound, CurrentModuleObject + "-OA MIXER", cAlphaArgs(1) + "-OA MIXER", @@ -907,51 +819,51 @@ namespace VentilatedSlab { ObjectIsNotParent); // Fan information: - VentSlab(Item).FanName = cAlphaArgs(25); + state.dataVentilatedSlab->VentSlab(Item).FanName = cAlphaArgs(25); - if (HVACFan::checkIfFanNameIsAFanSystem(state, VentSlab(Item).FanName)) { - VentSlab(Item).FanType_Num = DataHVACGlobals::FanType_SystemModelObject; - HVACFan::fanObjs.emplace_back(new HVACFan::FanSystem(state, VentSlab(Item).FanName)); - VentSlab(Item).Fan_Index = HVACFan::getFanObjectVectorIndex(VentSlab(Item).FanName); + if (HVACFan::checkIfFanNameIsAFanSystem(state, state.dataVentilatedSlab->VentSlab(Item).FanName)) { + state.dataVentilatedSlab->VentSlab(Item).FanType_Num = DataHVACGlobals::FanType_SystemModelObject; + HVACFan::fanObjs.emplace_back(new HVACFan::FanSystem(state, state.dataVentilatedSlab->VentSlab(Item).FanName)); + state.dataVentilatedSlab->VentSlab(Item).Fan_Index = HVACFan::getFanObjectVectorIndex(state.dataVentilatedSlab->VentSlab(Item).FanName); } else { bool isNotOkay(false); - ValidateComponent(state, "FAN:CONSTANTVOLUME", VentSlab(Item).FanName, isNotOkay, "GetPIUs"); + ValidateComponent(state, "FAN:CONSTANTVOLUME", state.dataVentilatedSlab->VentSlab(Item).FanName, isNotOkay, "GetPIUs"); if (isNotOkay) { - ShowContinueError("In " + CurrentModuleObject + " = " + VentSlab(Item).Name); + ShowContinueError("In " + CurrentModuleObject + " = " + state.dataVentilatedSlab->VentSlab(Item).Name); ErrorsFound = true; } - VentSlab(Item).FanType_Num = DataHVACGlobals::FanType_SimpleConstVolume; + state.dataVentilatedSlab->VentSlab(Item).FanType_Num = DataHVACGlobals::FanType_SimpleConstVolume; } - if (VentSlab(Item).OAControlType == FixedOAControl) { - VentSlab(Item).OutAirVolFlow = VentSlab(Item).MinOutAirVolFlow; - VentSlab(Item).MaxOASchedName = VentSlab(Item).MinOASchedName; - VentSlab(Item).MaxOASchedPtr = GetScheduleIndex(state, VentSlab(Item).MinOASchedName); + if (state.dataVentilatedSlab->VentSlab(Item).OAControlType == state.dataVentilatedSlab->FixedOAControl) { + state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow = state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow; + state.dataVentilatedSlab->VentSlab(Item).MaxOASchedName = state.dataVentilatedSlab->VentSlab(Item).MinOASchedName; + state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr = GetScheduleIndex(state, state.dataVentilatedSlab->VentSlab(Item).MinOASchedName); } // Add fan to component sets array SetUpCompSets( - CurrentModuleObject + "-SYSTEM", VentSlab(Item).Name + "-SYSTEM", "UNDEFINED", cAlphaArgs(25), cAlphaArgs(23), cAlphaArgs(24)); + CurrentModuleObject + "-SYSTEM", state.dataVentilatedSlab->VentSlab(Item).Name + "-SYSTEM", "UNDEFINED", cAlphaArgs(25), cAlphaArgs(23), cAlphaArgs(24)); // Coil options assign { auto const SELECT_CASE_var(cAlphaArgs(26)); if (SELECT_CASE_var == "HEATINGANDCOOLING") { - VentSlab(Item).CoilOption = BothOption; + state.dataVentilatedSlab->VentSlab(Item).CoilOption = state.dataVentilatedSlab->BothOption; } else if (SELECT_CASE_var == "HEATING") { - VentSlab(Item).CoilOption = HeatingOption; + state.dataVentilatedSlab->VentSlab(Item).CoilOption = state.dataVentilatedSlab->HeatingOption; } else if (SELECT_CASE_var == "COOLING") { - VentSlab(Item).CoilOption = CoolingOption; + state.dataVentilatedSlab->VentSlab(Item).CoilOption = state.dataVentilatedSlab->CoolingOption; } else if (SELECT_CASE_var == "NONE") { - VentSlab(Item).CoilOption = NoneOption; + state.dataVentilatedSlab->VentSlab(Item).CoilOption = state.dataVentilatedSlab->NoneOption; } else { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(26) + "=\"" + cAlphaArgs(26) + "\"."); ErrorsFound = true; } } - if (VentSlab(Item).CoilOption == BothOption || VentSlab(Item).CoilOption == HeatingOption) { + if (state.dataVentilatedSlab->VentSlab(Item).CoilOption == state.dataVentilatedSlab->BothOption || state.dataVentilatedSlab->VentSlab(Item).CoilOption == state.dataVentilatedSlab->HeatingOption) { // Heating coil information: // A27, \field Heating Coil Object Type // \type choice @@ -965,29 +877,29 @@ namespace VentilatedSlab { // Heating coil information: if (!lAlphaBlanks(28)) { - VentSlab(Item).HCoilPresent = true; - VentSlab(Item).HCoilTypeCh = cAlphaArgs(27); + state.dataVentilatedSlab->VentSlab(Item).HCoilPresent = true; + state.dataVentilatedSlab->VentSlab(Item).HCoilTypeCh = cAlphaArgs(27); errFlag = false; { auto const SELECT_CASE_var(cAlphaArgs(27)); if (SELECT_CASE_var == "COIL:HEATING:WATER") { - VentSlab(Item).HCoilType = Heating_WaterCoilType; - VentSlab(Item).HCoil_PlantTypeNum = TypeOf_CoilWaterSimpleHeating; + state.dataVentilatedSlab->VentSlab(Item).HCoilType = state.dataVentilatedSlab->Heating_WaterCoilType; + state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum = TypeOf_CoilWaterSimpleHeating; } else if (SELECT_CASE_var == "COIL:HEATING:STEAM") { - VentSlab(Item).HCoilType = Heating_SteamCoilType; - VentSlab(Item).HCoil_PlantTypeNum = TypeOf_CoilSteamAirHeating; - VentSlab(Item).HCoil_FluidIndex = FindRefrigerant(state, "Steam"); - if (VentSlab(Item).HCoil_FluidIndex == 0) { + state.dataVentilatedSlab->VentSlab(Item).HCoilType = state.dataVentilatedSlab->Heating_SteamCoilType; + state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum = TypeOf_CoilSteamAirHeating; + state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex = FindRefrigerant(state, "Steam"); + if (state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex == 0) { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "Steam Properties not found."); if (SteamMessageNeeded) ShowContinueError("Steam Fluid Properties should have been included in the input file."); ErrorsFound = true; SteamMessageNeeded = false; } } else if (SELECT_CASE_var == "COIL:HEATING:ELECTRIC") { - VentSlab(Item).HCoilType = Heating_ElectricCoilType; + state.dataVentilatedSlab->VentSlab(Item).HCoilType = state.dataVentilatedSlab->Heating_ElectricCoilType; } else if (SELECT_CASE_var == "COIL:HEATING:FUEL") { - VentSlab(Item).HCoilType = Heating_GasCoilType; + state.dataVentilatedSlab->VentSlab(Item).HCoilType = state.dataVentilatedSlab->Heating_GasCoilType; } else { ShowSevereError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(27) + "=\"" + cAlphaArgs(27) + "\"."); @@ -996,8 +908,8 @@ namespace VentilatedSlab { } } if (!errFlag) { - VentSlab(Item).HCoilName = cAlphaArgs(28); - ValidateComponent(state, cAlphaArgs(27), VentSlab(Item).HCoilName, IsNotOK, CurrentModuleObject); + state.dataVentilatedSlab->VentSlab(Item).HCoilName = cAlphaArgs(28); + ValidateComponent(state, cAlphaArgs(27), state.dataVentilatedSlab->VentSlab(Item).HCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { ShowContinueError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(28) + "=\"" + cAlphaArgs(28) + "\"."); @@ -1006,12 +918,12 @@ namespace VentilatedSlab { } } - VentSlab(Item).MinVolHotWaterFlow = 0.0; - VentSlab(Item).MinVolHotSteamFlow = 0.0; + state.dataVentilatedSlab->VentSlab(Item).MinVolHotWaterFlow = 0.0; + state.dataVentilatedSlab->VentSlab(Item).MinVolHotSteamFlow = 0.0; // The heating coil control node is necessary for a hot water coil, but not necessary for an // electric or gas coil. - if (VentSlab(Item).HCoilType == Heating_GasCoilType || VentSlab(Item).HCoilType == Heating_ElectricCoilType) { + if (state.dataVentilatedSlab->VentSlab(Item).HCoilType == state.dataVentilatedSlab->Heating_GasCoilType || state.dataVentilatedSlab->VentSlab(Item).HCoilType == state.dataVentilatedSlab->Heating_ElectricCoilType) { if (!lAlphaBlanks(29)) { ShowWarningError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" " + cAlphaFields(29) + "=\"" + cAlphaArgs(29) + "\" not needed - ignored."); @@ -1023,7 +935,7 @@ namespace VentilatedSlab { " is blank and must be entered."); ErrorsFound = true; } - VentSlab(Item).HotControlNode = GetOnlySingleNode(state, cAlphaArgs(29), + state.dataVentilatedSlab->VentSlab(Item).HotControlNode = GetOnlySingleNode(state, cAlphaArgs(29), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), @@ -1032,14 +944,14 @@ namespace VentilatedSlab { 1, ObjectIsParent); } - VentSlab(Item).HotControlOffset = 0.001; - - if (VentSlab(Item).HCoilType == Heating_WaterCoilType) { - VentSlab(Item).MaxVolHotWaterFlow = GetWaterCoilMaxFlowRate(state, "Coil:Heating:Water", VentSlab(Item).HCoilName, ErrorsFound); - VentSlab(Item).MaxVolHotSteamFlow = GetWaterCoilMaxFlowRate(state, "Coil:Heating:Water", VentSlab(Item).HCoilName, ErrorsFound); - } else if (VentSlab(Item).HCoilType == Heating_SteamCoilType) { - VentSlab(Item).MaxVolHotWaterFlow = GetSteamCoilMaxFlowRate(state, "Coil:Heating:Steam", VentSlab(Item).HCoilName, ErrorsFound); - VentSlab(Item).MaxVolHotSteamFlow = GetSteamCoilMaxFlowRate(state, "Coil:Heating:Steam", VentSlab(Item).HCoilName, ErrorsFound); + state.dataVentilatedSlab->VentSlab(Item).HotControlOffset = 0.001; + + if (state.dataVentilatedSlab->VentSlab(Item).HCoilType == state.dataVentilatedSlab->Heating_WaterCoilType) { + state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow = GetWaterCoilMaxFlowRate(state, "Coil:Heating:Water", state.dataVentilatedSlab->VentSlab(Item).HCoilName, ErrorsFound); + state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow = GetWaterCoilMaxFlowRate(state, "Coil:Heating:Water", state.dataVentilatedSlab->VentSlab(Item).HCoilName, ErrorsFound); + } else if (state.dataVentilatedSlab->VentSlab(Item).HCoilType == state.dataVentilatedSlab->Heating_SteamCoilType) { + state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow = GetSteamCoilMaxFlowRate(state, "Coil:Heating:Steam", state.dataVentilatedSlab->VentSlab(Item).HCoilName, ErrorsFound); + state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow = GetSteamCoilMaxFlowRate(state, "Coil:Heating:Steam", state.dataVentilatedSlab->VentSlab(Item).HCoilName, ErrorsFound); } } else { // no heating coil @@ -1049,7 +961,7 @@ namespace VentilatedSlab { } } - if (VentSlab(Item).CoilOption == BothOption || VentSlab(Item).CoilOption == CoolingOption) { + if (state.dataVentilatedSlab->VentSlab(Item).CoilOption == state.dataVentilatedSlab->BothOption || state.dataVentilatedSlab->VentSlab(Item).CoilOption == state.dataVentilatedSlab->CoolingOption) { // Cooling coil information (if one is present): // A30, \field Cooling Coil Object Type // \type choice @@ -1061,32 +973,32 @@ namespace VentilatedSlab { // \object-list CoolingCoilsWater // Cooling coil information (if one is present): if (!lAlphaBlanks(31)) { - VentSlab(Item).CCoilPresent = true; - VentSlab(Item).CCoilTypeCh = cAlphaArgs(30); + state.dataVentilatedSlab->VentSlab(Item).CCoilPresent = true; + state.dataVentilatedSlab->VentSlab(Item).CCoilTypeCh = cAlphaArgs(30); errFlag = false; { auto const SELECT_CASE_var(cAlphaArgs(30)); if (SELECT_CASE_var == "COIL:COOLING:WATER") { - VentSlab(Item).CCoilType = Cooling_CoilWaterCooling; - VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterCooling; - VentSlab(Item).CCoilPlantName = cAlphaArgs(31); + state.dataVentilatedSlab->VentSlab(Item).CCoilType = state.dataVentilatedSlab->Cooling_CoilWaterCooling; + state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterCooling; + state.dataVentilatedSlab->VentSlab(Item).CCoilPlantName = cAlphaArgs(31); } else if (SELECT_CASE_var == "COIL:COOLING:WATER:DETAILEDGEOMETRY") { - VentSlab(Item).CCoilType = Cooling_CoilDetailedCooling; - VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterDetailedFlatCooling; - VentSlab(Item).CCoilPlantName = cAlphaArgs(31); + state.dataVentilatedSlab->VentSlab(Item).CCoilType = state.dataVentilatedSlab->Cooling_CoilDetailedCooling; + state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterDetailedFlatCooling; + state.dataVentilatedSlab->VentSlab(Item).CCoilPlantName = cAlphaArgs(31); } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED") { - VentSlab(Item).CCoilType = Cooling_CoilHXAssisted; + state.dataVentilatedSlab->VentSlab(Item).CCoilType = state.dataVentilatedSlab->Cooling_CoilHXAssisted; GetHXCoilTypeAndName( - state, cAlphaArgs(30), cAlphaArgs(31), ErrorsFound, VentSlab(Item).CCoilPlantType, VentSlab(Item).CCoilPlantName); - if (UtilityRoutines::SameString(VentSlab(Item).CCoilPlantType, "Coil:Cooling:Water")) { - VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterCooling; - } else if (UtilityRoutines::SameString(VentSlab(Item).CCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { - VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterDetailedFlatCooling; + state, cAlphaArgs(30), cAlphaArgs(31), ErrorsFound, state.dataVentilatedSlab->VentSlab(Item).CCoilPlantType, state.dataVentilatedSlab->VentSlab(Item).CCoilPlantName); + if (UtilityRoutines::SameString(state.dataVentilatedSlab->VentSlab(Item).CCoilPlantType, "Coil:Cooling:Water")) { + state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterCooling; + } else if (UtilityRoutines::SameString(state.dataVentilatedSlab->VentSlab(Item).CCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { + state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterDetailedFlatCooling; } else { - ShowSevereError("GetVentilatedSlabInput: " + CurrentModuleObject + "=\"" + VentSlab(Item).Name + "\", invalid"); + ShowSevereError("GetVentilatedSlabInput: " + CurrentModuleObject + "=\"" + state.dataVentilatedSlab->VentSlab(Item).Name + "\", invalid"); ShowContinueError("For: " + cAlphaFields(30) + "=\"" + cAlphaArgs(30) + "\"."); - ShowContinueError("Invalid Coil Type=" + VentSlab(Item).CCoilPlantType + ", Name=" + VentSlab(Item).CCoilPlantName); + ShowContinueError("Invalid Coil Type=" + state.dataVentilatedSlab->VentSlab(Item).CCoilPlantType + ", Name=" + state.dataVentilatedSlab->VentSlab(Item).CCoilPlantName); ShowContinueError("must be \"Coil:Cooling:Water\" or \"Coil:Cooling:Water:DetailedGeometry\""); ErrorsFound = true; } @@ -1099,8 +1011,8 @@ namespace VentilatedSlab { } if (!errFlag) { - VentSlab(Item).CCoilName = cAlphaArgs(31); - ValidateComponent(state, cAlphaArgs(30), VentSlab(Item).CCoilName, IsNotOK, "ZoneHVAC:VentilatedSlab "); + state.dataVentilatedSlab->VentSlab(Item).CCoilName = cAlphaArgs(31); + ValidateComponent(state, cAlphaArgs(30), state.dataVentilatedSlab->VentSlab(Item).CCoilName, IsNotOK, "ZoneHVAC:VentilatedSlab "); if (IsNotOK) { ShowContinueError(CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cAlphaFields(31) + "=\"" + cAlphaArgs(31) + "\"."); @@ -1109,9 +1021,9 @@ namespace VentilatedSlab { } } - VentSlab(Item).MinVolColdWaterFlow = 0.0; + state.dataVentilatedSlab->VentSlab(Item).MinVolColdWaterFlow = 0.0; - VentSlab(Item).ColdControlNode = GetOnlySingleNode(state, cAlphaArgs(32), + state.dataVentilatedSlab->VentSlab(Item).ColdControlNode = GetOnlySingleNode(state, cAlphaArgs(32), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), @@ -1126,16 +1038,16 @@ namespace VentilatedSlab { ErrorsFound = true; } - VentSlab(Item).ColdControlOffset = 0.001; + state.dataVentilatedSlab->VentSlab(Item).ColdControlOffset = 0.001; - if (VentSlab(Item).CCoilType == Cooling_CoilWaterCooling) { - VentSlab(Item).MaxVolColdWaterFlow = GetWaterCoilMaxFlowRate(state, "Coil:Cooling:Water", VentSlab(Item).CCoilName, ErrorsFound); - } else if (VentSlab(Item).CCoilType == Cooling_CoilDetailedCooling) { - VentSlab(Item).MaxVolColdWaterFlow = - GetWaterCoilMaxFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", VentSlab(Item).CCoilName, ErrorsFound); - } else if (VentSlab(Item).CCoilType == Cooling_CoilHXAssisted) { - VentSlab(Item).MaxVolColdWaterFlow = - GetHXAssistedCoilFlowRate(state, "CoilSystem:Cooling:Water:HeatExchangerAssisted", VentSlab(Item).CCoilName, ErrorsFound); + if (state.dataVentilatedSlab->VentSlab(Item).CCoilType == state.dataVentilatedSlab->Cooling_CoilWaterCooling) { + state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow = GetWaterCoilMaxFlowRate(state, "Coil:Cooling:Water", state.dataVentilatedSlab->VentSlab(Item).CCoilName, ErrorsFound); + } else if (state.dataVentilatedSlab->VentSlab(Item).CCoilType == state.dataVentilatedSlab->Cooling_CoilDetailedCooling) { + state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow = + GetWaterCoilMaxFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", state.dataVentilatedSlab->VentSlab(Item).CCoilName, ErrorsFound); + } else if (state.dataVentilatedSlab->VentSlab(Item).CCoilType == state.dataVentilatedSlab->Cooling_CoilHXAssisted) { + state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow = + GetHXAssistedCoilFlowRate(state, "CoilSystem:Cooling:Water:HeatExchangerAssisted", state.dataVentilatedSlab->VentSlab(Item).CCoilName, ErrorsFound); } } else { // No Cooling Coil @@ -1145,25 +1057,25 @@ namespace VentilatedSlab { } } if (!lAlphaBlanks(33)) { - VentSlab(Item).AvailManagerListName = cAlphaArgs(33); + state.dataVentilatedSlab->VentSlab(Item).AvailManagerListName = cAlphaArgs(33); } - VentSlab(Item).HVACSizingIndex = 0; + state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex = 0; if (!lAlphaBlanks(34)) { - VentSlab(Item).HVACSizingIndex = UtilityRoutines::FindItemInList(cAlphaArgs(34), ZoneHVACSizing); - if (VentSlab(Item).HVACSizingIndex == 0) { + state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex = UtilityRoutines::FindItemInList(cAlphaArgs(34), ZoneHVACSizing); + if (state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex == 0) { ShowSevereError(cAlphaFields(34) + " = " + cAlphaArgs(34) + " not found."); - ShowContinueError("Occurs in " + cMO_VentilatedSlab + " = " + VentSlab(Item).Name); + ShowContinueError("Occurs in " + state.dataVentilatedSlab->cMO_VentilatedSlab + " = " + state.dataVentilatedSlab->VentSlab(Item).Name); ErrorsFound = true; } } { - auto const SELECT_CASE_var(VentSlab(Item).CoilOption); - if (SELECT_CASE_var == BothOption) { // 'HeatingAndCooling' + auto const SELECT_CASE_var(state.dataVentilatedSlab->VentSlab(Item).CoilOption); + if (SELECT_CASE_var == state.dataVentilatedSlab->BothOption) { // 'HeatingAndCooling' // Add cooling coil to component sets array when present SetUpCompSets(CurrentModuleObject + "-SYSTEM", - VentSlab(Item).Name + "-SYSTEM", + state.dataVentilatedSlab->VentSlab(Item).Name + "-SYSTEM", cAlphaArgs(30), cAlphaArgs(31), cAlphaArgs(24), @@ -1171,31 +1083,31 @@ namespace VentilatedSlab { // Add heating coil to component sets array when cooling coil present SetUpCompSets(CurrentModuleObject + "-SYSTEM", - VentSlab(Item).Name + "-SYSTEM", + state.dataVentilatedSlab->VentSlab(Item).Name + "-SYSTEM", cAlphaArgs(27), cAlphaArgs(28), "UNDEFINED", cAlphaArgs(19)); - } else if (SELECT_CASE_var == HeatingOption) { // 'Heating' + } else if (SELECT_CASE_var == state.dataVentilatedSlab->HeatingOption) { // 'Heating' // Add heating coil to component sets array when no cooling coil present SetUpCompSets(CurrentModuleObject + "-SYSTEM", - VentSlab(Item).Name + "-SYSTEM", + state.dataVentilatedSlab->VentSlab(Item).Name + "-SYSTEM", cAlphaArgs(27), cAlphaArgs(28), cAlphaArgs(24), cAlphaArgs(19)); - } else if (SELECT_CASE_var == CoolingOption) { // 'Cooling' + } else if (SELECT_CASE_var == state.dataVentilatedSlab->CoolingOption) { // 'Cooling' // Add cooling coil to component sets array when no heating coil present SetUpCompSets(CurrentModuleObject + "-SYSTEM", - VentSlab(Item).Name + "-SYSTEM", + state.dataVentilatedSlab->VentSlab(Item).Name + "-SYSTEM", cAlphaArgs(30), cAlphaArgs(31), cAlphaArgs(24), cAlphaArgs(19)); - } else if (SELECT_CASE_var == NoneOption) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->NoneOption) { } else { } @@ -1213,146 +1125,146 @@ namespace VentilatedSlab { if (ErrorsFound) ShowFatalError(CurrentModuleObject + " errors occurred in input. Program terminates."); // Setup Report variables for the VENTILATED SLAB - for (Item = 1; Item <= NumOfVentSlabs; ++Item) { + for (Item = 1; Item <= state.dataVentilatedSlab->NumOfVentSlabs; ++Item) { // CALL SetupOutputVariable(state, 'Ventilated Slab Direct Heat Loss Rate [W]', & - // VentSlab(Item)%DirectHeatLossRate,'System', & - // 'Average', VentSlab(Item)%Name) + // state.dataVentilatedSlab->VentSlab(Item)%DirectHeatLossRate,'System', & + // 'Average', state.dataVentilatedSlab->VentSlab(Item)%Name) // CALL SetupOutputVariable(state, 'Ventilated Slab Direct Heat Loss [W]', & - // VentSlab(Item)%DirectHeatLoss,'System', & - // 'Sum', VentSlab(Item)%Name) + // state.dataVentilatedSlab->VentSlab(Item)%DirectHeatLoss,'System', & + // 'Sum', state.dataVentilatedSlab->VentSlab(Item)%Name) // CALL SetupOutputVariable(state, 'Ventilated Slab Direct Heat Gain Rate [W]', & - // VentSlab(Item)%DirectHeatGainRate,'System', & - // 'Average', VentSlab(Item)%Name) + // state.dataVentilatedSlab->VentSlab(Item)%DirectHeatGainRate,'System', & + // 'Average', state.dataVentilatedSlab->VentSlab(Item)%Name) // CALL SetupOutputVariable(state, 'Ventilated Slab Direct Heat Gain [J]', & - // VentSlab(Item)%DirectHeatGain,'System', & - // 'Sum', VentSlab(Item)%Name) + // state.dataVentilatedSlab->VentSlab(Item)%DirectHeatGain,'System', & + // 'Sum', state.dataVentilatedSlab->VentSlab(Item)%Name) SetupOutputVariable(state, "Zone Ventilated Slab Radiant Heating Rate", OutputProcessor::Unit::W, - VentSlab(Item).RadHeatingPower, + state.dataVentilatedSlab->VentSlab(Item).RadHeatingPower, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Radiant Heating Energy", OutputProcessor::Unit::J, - VentSlab(Item).RadHeatingEnergy, + state.dataVentilatedSlab->VentSlab(Item).RadHeatingEnergy, "System", "Sum", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Radiant Cooling Rate", OutputProcessor::Unit::W, - VentSlab(Item).RadCoolingPower, + state.dataVentilatedSlab->VentSlab(Item).RadCoolingPower, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Radiant Cooling Energy", OutputProcessor::Unit::J, - VentSlab(Item).RadCoolingEnergy, + state.dataVentilatedSlab->VentSlab(Item).RadCoolingEnergy, "System", "Sum", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Coil Heating Rate", OutputProcessor::Unit::W, - VentSlab(Item).HeatCoilPower, + state.dataVentilatedSlab->VentSlab(Item).HeatCoilPower, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Coil Heating Energy", OutputProcessor::Unit::J, - VentSlab(Item).HeatCoilEnergy, + state.dataVentilatedSlab->VentSlab(Item).HeatCoilEnergy, "System", "Sum", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Coil Total Cooling Rate", OutputProcessor::Unit::W, - VentSlab(Item).TotCoolCoilPower, + state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilPower, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Coil Total Cooling Energy", OutputProcessor::Unit::J, - VentSlab(Item).TotCoolCoilEnergy, + state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilEnergy, "System", "Sum", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Coil Sensible Cooling Rate", OutputProcessor::Unit::W, - VentSlab(Item).SensCoolCoilPower, + state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Coil Sensible Cooling Energy", OutputProcessor::Unit::J, - VentSlab(Item).SensCoolCoilEnergy, + state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilEnergy, "System", "Sum", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Coil Latent Cooling Rate", OutputProcessor::Unit::W, - VentSlab(Item).LateCoolCoilPower, + state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilPower, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Coil Latent Cooling Energy", OutputProcessor::Unit::J, - VentSlab(Item).LateCoolCoilEnergy, + state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilEnergy, "System", "Sum", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Air Mass Flow Rate", OutputProcessor::Unit::kg_s, - VentSlab(Item).AirMassFlowRate, + state.dataVentilatedSlab->VentSlab(Item).AirMassFlowRate, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Fan Electricity Rate", OutputProcessor::Unit::W, - VentSlab(Item).ElecFanPower, + state.dataVentilatedSlab->VentSlab(Item).ElecFanPower, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); //! Note that the ventilated slab fan electric is NOT metered because this value is already metered through the fan component SetupOutputVariable(state, "Zone Ventilated Slab Fan Electricity Energy", OutputProcessor::Unit::J, - VentSlab(Item).ElecFanEnergy, + state.dataVentilatedSlab->VentSlab(Item).ElecFanEnergy, "System", "Sum", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Inlet Air Temperature", OutputProcessor::Unit::C, - VentSlab(Item).SlabInTemp, + state.dataVentilatedSlab->VentSlab(Item).SlabInTemp, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Outlet Air Temperature", OutputProcessor::Unit::C, - VentSlab(Item).SlabOutTemp, + state.dataVentilatedSlab->VentSlab(Item).SlabOutTemp, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Zone Inlet Air Temperature", OutputProcessor::Unit::C, - VentSlab(Item).ZoneInletTemp, + state.dataVentilatedSlab->VentSlab(Item).ZoneInletTemp, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Return Air Temperature", OutputProcessor::Unit::C, - VentSlab(Item).ReturnAirTemp, + state.dataVentilatedSlab->VentSlab(Item).ReturnAirTemp, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Fan Outlet Air Temperature", OutputProcessor::Unit::C, - VentSlab(Item).FanOutletTemp, + state.dataVentilatedSlab->VentSlab(Item).FanOutletTemp, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); SetupOutputVariable(state, "Zone Ventilated Slab Fan Availability Status", OutputProcessor::Unit::None, - VentSlab(Item).AvailStatus, + state.dataVentilatedSlab->VentSlab(Item).AvailStatus, "System", "Average", - VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).Name); } } @@ -1443,51 +1355,51 @@ namespace VentilatedSlab { // Do the one time initializations - if (MyOneTimeFlag) { - MyEnvrnFlag.allocate(NumOfVentSlabs); - MySizeFlag.allocate(NumOfVentSlabs); - MyPlantScanFlag.allocate(NumOfVentSlabs); - MyZoneEqFlag.allocate(NumOfVentSlabs); - ZeroSourceSumHATsurf.dimension(NumOfZones, 0.0); - QRadSysSrcAvg.dimension(TotSurfaces, 0.0); - LastQRadSysSrc.dimension(TotSurfaces, 0.0); - LastSysTimeElapsed.dimension(TotSurfaces, 0.0); - LastTimeStepSys.dimension(TotSurfaces, 0.0); + if (state.dataVentilatedSlab->MyOneTimeFlag) { + MyEnvrnFlag.allocate(state.dataVentilatedSlab->NumOfVentSlabs); + state.dataVentilatedSlab->MySizeFlag.allocate(state.dataVentilatedSlab->NumOfVentSlabs); + MyPlantScanFlag.allocate(state.dataVentilatedSlab->NumOfVentSlabs); + MyZoneEqFlag.allocate(state.dataVentilatedSlab->NumOfVentSlabs); + state.dataVentilatedSlab->ZeroSourceSumHATsurf.dimension(NumOfZones, 0.0); + state.dataVentilatedSlab->QRadSysSrcAvg.dimension(TotSurfaces, 0.0); + state.dataVentilatedSlab->LastQRadSysSrc.dimension(TotSurfaces, 0.0); + state.dataVentilatedSlab->LastSysTimeElapsed.dimension(TotSurfaces, 0.0); + state.dataVentilatedSlab->LastTimeStepSys.dimension(TotSurfaces, 0.0); // Initialize total areas for all radiant systems - for (RadNum = 1; RadNum <= NumOfVentSlabs; ++RadNum) { - VentSlab(RadNum).TotalSurfaceArea = 0.0; - for (SurfNum = 1; SurfNum <= VentSlab(RadNum).NumOfSurfaces; ++SurfNum) { - VentSlab(RadNum).TotalSurfaceArea += Surface(VentSlab(RadNum).SurfacePtr(SurfNum)).Area; + for (RadNum = 1; RadNum <= state.dataVentilatedSlab->NumOfVentSlabs; ++RadNum) { + state.dataVentilatedSlab->VentSlab(RadNum).TotalSurfaceArea = 0.0; + for (SurfNum = 1; SurfNum <= state.dataVentilatedSlab->VentSlab(RadNum).NumOfSurfaces; ++SurfNum) { + state.dataVentilatedSlab->VentSlab(RadNum).TotalSurfaceArea += Surface(state.dataVentilatedSlab->VentSlab(RadNum).SurfacePtr(SurfNum)).Area; } } MyEnvrnFlag = true; - MySizeFlag = true; + state.dataVentilatedSlab->MySizeFlag = true; MyPlantScanFlag = true; MyZoneEqFlag = true; - MyOneTimeFlag = false; + state.dataVentilatedSlab->MyOneTimeFlag = false; } if (allocated(ZoneComp)) { if (MyZoneEqFlag(Item)) { // initialize the name of each availability manager list and zone number - ZoneComp(VentilatedSlab_Num).ZoneCompAvailMgrs(Item).AvailManagerListName = VentSlab(Item).AvailManagerListName; + ZoneComp(VentilatedSlab_Num).ZoneCompAvailMgrs(Item).AvailManagerListName = state.dataVentilatedSlab->VentSlab(Item).AvailManagerListName; ZoneComp(VentilatedSlab_Num).ZoneCompAvailMgrs(Item).ZoneNum = VentSlabZoneNum; MyZoneEqFlag(Item) = false; } - VentSlab(Item).AvailStatus = ZoneComp(VentilatedSlab_Num).ZoneCompAvailMgrs(Item).AvailStatus; + state.dataVentilatedSlab->VentSlab(Item).AvailStatus = ZoneComp(VentilatedSlab_Num).ZoneCompAvailMgrs(Item).AvailStatus; } if (MyPlantScanFlag(Item) && allocated(PlantLoop)) { - if ((VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || - (VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { + if ((state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || + (state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { errFlag = false; ScanPlantLoopsForObject(state, - VentSlab(Item).HCoilName, - VentSlab(Item).HCoil_PlantTypeNum, - VentSlab(Item).HWLoopNum, - VentSlab(Item).HWLoopSide, - VentSlab(Item).HWBranchNum, - VentSlab(Item).HWCompNum, + state.dataVentilatedSlab->VentSlab(Item).HCoilName, + state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum, + state.dataVentilatedSlab->VentSlab(Item).HWLoopNum, + state.dataVentilatedSlab->VentSlab(Item).HWLoopSide, + state.dataVentilatedSlab->VentSlab(Item).HWBranchNum, + state.dataVentilatedSlab->VentSlab(Item).HWCompNum, errFlag, _, _, @@ -1495,39 +1407,39 @@ namespace VentilatedSlab { _, _); if (errFlag) { - ShowContinueError("Reference Unit=\"" + VentSlab(Item).Name + "\", type=ZoneHVAC:VentilatedSlab"); + ShowContinueError("Reference Unit=\"" + state.dataVentilatedSlab->VentSlab(Item).Name + "\", type=ZoneHVAC:VentilatedSlab"); ShowFatalError("InitVentilatedSlab: Program terminated due to previous condition(s)."); } - VentSlab(Item).HotCoilOutNodeNum = PlantLoop(VentSlab(Item).HWLoopNum) - .LoopSide(VentSlab(Item).HWLoopSide) - .Branch(VentSlab(Item).HWBranchNum) - .Comp(VentSlab(Item).HWCompNum) + state.dataVentilatedSlab->VentSlab(Item).HotCoilOutNodeNum = PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum) + .LoopSide(state.dataVentilatedSlab->VentSlab(Item).HWLoopSide) + .Branch(state.dataVentilatedSlab->VentSlab(Item).HWBranchNum) + .Comp(state.dataVentilatedSlab->VentSlab(Item).HWCompNum) .NodeNumOut; } - if ((VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling) || - (VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling)) { + if ((state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling) || + (state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling)) { errFlag = false; ScanPlantLoopsForObject(state, - VentSlab(Item).CCoilPlantName, - VentSlab(Item).CCoil_PlantTypeNum, - VentSlab(Item).CWLoopNum, - VentSlab(Item).CWLoopSide, - VentSlab(Item).CWBranchNum, - VentSlab(Item).CWCompNum, + state.dataVentilatedSlab->VentSlab(Item).CCoilPlantName, + state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum, + state.dataVentilatedSlab->VentSlab(Item).CWLoopNum, + state.dataVentilatedSlab->VentSlab(Item).CWLoopSide, + state.dataVentilatedSlab->VentSlab(Item).CWBranchNum, + state.dataVentilatedSlab->VentSlab(Item).CWCompNum, errFlag); if (errFlag) { - ShowContinueError("Reference Unit=\"" + VentSlab(Item).Name + "\", type=ZoneHVAC:VentilatedSlab"); + ShowContinueError("Reference Unit=\"" + state.dataVentilatedSlab->VentSlab(Item).Name + "\", type=ZoneHVAC:VentilatedSlab"); ShowFatalError("InitVentilatedSlab: Program terminated due to previous condition(s)."); } - VentSlab(Item).ColdCoilOutNodeNum = PlantLoop(VentSlab(Item).CWLoopNum) - .LoopSide(VentSlab(Item).CWLoopSide) - .Branch(VentSlab(Item).CWBranchNum) - .Comp(VentSlab(Item).CWCompNum) + state.dataVentilatedSlab->VentSlab(Item).ColdCoilOutNodeNum = PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum) + .LoopSide(state.dataVentilatedSlab->VentSlab(Item).CWLoopSide) + .Branch(state.dataVentilatedSlab->VentSlab(Item).CWBranchNum) + .Comp(state.dataVentilatedSlab->VentSlab(Item).CWCompNum) .NodeNumOut; } else { - if (VentSlab(Item).CCoilPresent) - ShowFatalError("InitVentilatedSlab: Unit=" + VentSlab(Item).Name + ", invalid cooling coil type. Program terminated."); + if (state.dataVentilatedSlab->VentSlab(Item).CCoilPresent) + ShowFatalError("InitVentilatedSlab: Unit=" + state.dataVentilatedSlab->VentSlab(Item).Name + ", invalid cooling coil type. Program terminated."); } MyPlantScanFlag(Item) = false; } else if (MyPlantScanFlag(Item) && !AnyPlantInModel) { @@ -1537,39 +1449,39 @@ namespace VentilatedSlab { // need to check all Ventilated Slab units to see if they are on Zone Equipment List or issue warning if (!ZoneEquipmentListChecked && ZoneEquipInputsFilled) { ZoneEquipmentListChecked = true; - for (RadNum = 1; RadNum <= NumOfVentSlabs; ++RadNum) { - if (CheckZoneEquipmentList(cMO_VentilatedSlab, VentSlab(RadNum).Name)) continue; - ShowSevereError("InitVentilatedSlab: Ventilated Slab Unit=[" + cMO_VentilatedSlab + ',' + VentSlab(RadNum).Name + + for (RadNum = 1; RadNum <= state.dataVentilatedSlab->NumOfVentSlabs; ++RadNum) { + if (CheckZoneEquipmentList(state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(RadNum).Name)) continue; + ShowSevereError("InitVentilatedSlab: Ventilated Slab Unit=[" + state.dataVentilatedSlab->cMO_VentilatedSlab + ',' + state.dataVentilatedSlab->VentSlab(RadNum).Name + "] is not on any ZoneHVAC:EquipmentList. It will not be simulated."); } } - if (!SysSizingCalc && MySizeFlag(Item) && !MyPlantScanFlag(Item)) { + if (!SysSizingCalc && state.dataVentilatedSlab->MySizeFlag(Item) && !MyPlantScanFlag(Item)) { SizeVentilatedSlab(state, Item); - MySizeFlag(Item) = false; + state.dataVentilatedSlab->MySizeFlag(Item) = false; } // Do the one time initializations if (BeginEnvrnFlag && MyEnvrnFlag(Item) && !MyPlantScanFlag(Item)) { // Coil Part - InNode = VentSlab(Item).ReturnAirNode; - OutNode = VentSlab(Item).RadInNode; - HotConNode = VentSlab(Item).HotControlNode; - ColdConNode = VentSlab(Item).ColdControlNode; - OutsideAirNode = VentSlab(Item).OutsideAirNode; + InNode = state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode; + OutNode = state.dataVentilatedSlab->VentSlab(Item).RadInNode; + HotConNode = state.dataVentilatedSlab->VentSlab(Item).HotControlNode; + ColdConNode = state.dataVentilatedSlab->VentSlab(Item).ColdControlNode; + OutsideAirNode = state.dataVentilatedSlab->VentSlab(Item).OutsideAirNode; RhoAir = StdRhoAir; // Radiation Panel Part - ZeroSourceSumHATsurf = 0.0; - QRadSysSrcAvg = 0.0; - LastQRadSysSrc = 0.0; - LastSysTimeElapsed = 0.0; - LastTimeStepSys = 0.0; - if (NumOfVentSlabs > 0) { - for (auto &e : VentSlab) { + state.dataVentilatedSlab->ZeroSourceSumHATsurf = 0.0; + state.dataVentilatedSlab->QRadSysSrcAvg = 0.0; + state.dataVentilatedSlab->LastQRadSysSrc = 0.0; + state.dataVentilatedSlab->LastSysTimeElapsed = 0.0; + state.dataVentilatedSlab->LastTimeStepSys = 0.0; + if (state.dataVentilatedSlab->NumOfVentSlabs > 0) { + for (auto &e : state.dataVentilatedSlab->VentSlab) { e.RadHeatingPower = 0.0; e.RadHeatingEnergy = 0.0; e.RadCoolingPower = 0.0; @@ -1580,78 +1492,78 @@ namespace VentilatedSlab { // set the initial Temperature of Return Air // set the mass flow rates from the input volume flow rates - VentSlab(Item).MaxAirMassFlow = RhoAir * VentSlab(Item).MaxAirVolFlow; - VentSlab(Item).OutAirMassFlow = RhoAir * VentSlab(Item).OutAirVolFlow; - VentSlab(Item).MinOutAirMassFlow = RhoAir * VentSlab(Item).MinOutAirVolFlow; - if (VentSlab(Item).OutAirMassFlow > VentSlab(Item).MaxAirMassFlow) { - VentSlab(Item).OutAirMassFlow = VentSlab(Item).MaxAirMassFlow; - VentSlab(Item).MinOutAirMassFlow = VentSlab(Item).OutAirMassFlow * (VentSlab(Item).MinOutAirVolFlow / VentSlab(Item).OutAirVolFlow); - ShowWarningError("Outdoor air mass flow rate higher than unit flow rate, reset to unit flow rate for " + VentSlab(Item).Name); + state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow = RhoAir * state.dataVentilatedSlab->VentSlab(Item).MaxAirVolFlow; + state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow = RhoAir * state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow; + state.dataVentilatedSlab->VentSlab(Item).MinOutAirMassFlow = RhoAir * state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow; + if (state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow > state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow) { + state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow = state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow; + state.dataVentilatedSlab->VentSlab(Item).MinOutAirMassFlow = state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow * (state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow / state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow); + ShowWarningError("Outdoor air mass flow rate higher than unit flow rate, reset to unit flow rate for " + state.dataVentilatedSlab->VentSlab(Item).Name); } // set the node max and min mass flow rates - Node(OutsideAirNode).MassFlowRateMax = VentSlab(Item).OutAirMassFlow; + Node(OutsideAirNode).MassFlowRateMax = state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow; Node(OutsideAirNode).MassFlowRateMin = 0.0; - Node(OutNode).MassFlowRateMax = VentSlab(Item).MaxAirMassFlow; + Node(OutNode).MassFlowRateMax = state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow; Node(OutNode).MassFlowRateMin = 0.0; - Node(InNode).MassFlowRateMax = VentSlab(Item).MaxAirMassFlow; + Node(InNode).MassFlowRateMax = state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow; Node(InNode).MassFlowRateMin = 0.0; - if (VentSlab(Item).HCoilPresent) { // Only initialize these if a heating coil is actually present + if (state.dataVentilatedSlab->VentSlab(Item).HCoilPresent) { // Only initialize these if a heating coil is actually present - if (VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating && !MyPlantScanFlag(Item)) { + if (state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating && !MyPlantScanFlag(Item)) { rho = GetDensityGlycol( - state, PlantLoop(VentSlab(Item).HWLoopNum).FluidName, HWInitConvTemp, PlantLoop(VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); - - VentSlab(Item).MaxHotWaterFlow = rho * VentSlab(Item).MaxVolHotWaterFlow; - VentSlab(Item).MinHotWaterFlow = rho * VentSlab(Item).MinVolHotWaterFlow; - - InitComponentNodes(VentSlab(Item).MinHotWaterFlow, - VentSlab(Item).MaxHotWaterFlow, - VentSlab(Item).HotControlNode, - VentSlab(Item).HotCoilOutNodeNum, - VentSlab(Item).HWLoopNum, - VentSlab(Item).HWLoopSide, - VentSlab(Item).HWBranchNum, - VentSlab(Item).HWCompNum); + state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, HWInitConvTemp, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); + + state.dataVentilatedSlab->VentSlab(Item).MaxHotWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow; + state.dataVentilatedSlab->VentSlab(Item).MinHotWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MinVolHotWaterFlow; + + InitComponentNodes(state.dataVentilatedSlab->VentSlab(Item).MinHotWaterFlow, + state.dataVentilatedSlab->VentSlab(Item).MaxHotWaterFlow, + state.dataVentilatedSlab->VentSlab(Item).HotControlNode, + state.dataVentilatedSlab->VentSlab(Item).HotCoilOutNodeNum, + state.dataVentilatedSlab->VentSlab(Item).HWLoopNum, + state.dataVentilatedSlab->VentSlab(Item).HWLoopSide, + state.dataVentilatedSlab->VentSlab(Item).HWBranchNum, + state.dataVentilatedSlab->VentSlab(Item).HWCompNum); } - if (VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating && !MyPlantScanFlag(Item)) { + if (state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating && !MyPlantScanFlag(Item)) { TempSteamIn = 100.00; - SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, VentSlab(Item).HCoil_FluidIndex, RoutineName); - VentSlab(Item).MaxHotSteamFlow = SteamDensity * VentSlab(Item).MaxVolHotSteamFlow; - VentSlab(Item).MinHotSteamFlow = SteamDensity * VentSlab(Item).MinVolHotSteamFlow; - - InitComponentNodes(VentSlab(Item).MinHotSteamFlow, - VentSlab(Item).MaxHotSteamFlow, - VentSlab(Item).HotControlNode, - VentSlab(Item).HotCoilOutNodeNum, - VentSlab(Item).HWLoopNum, - VentSlab(Item).HWLoopSide, - VentSlab(Item).HWBranchNum, - VentSlab(Item).HWCompNum); + SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex, RoutineName); + state.dataVentilatedSlab->VentSlab(Item).MaxHotSteamFlow = SteamDensity * state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow; + state.dataVentilatedSlab->VentSlab(Item).MinHotSteamFlow = SteamDensity * state.dataVentilatedSlab->VentSlab(Item).MinVolHotSteamFlow; + + InitComponentNodes(state.dataVentilatedSlab->VentSlab(Item).MinHotSteamFlow, + state.dataVentilatedSlab->VentSlab(Item).MaxHotSteamFlow, + state.dataVentilatedSlab->VentSlab(Item).HotControlNode, + state.dataVentilatedSlab->VentSlab(Item).HotCoilOutNodeNum, + state.dataVentilatedSlab->VentSlab(Item).HWLoopNum, + state.dataVentilatedSlab->VentSlab(Item).HWLoopSide, + state.dataVentilatedSlab->VentSlab(Item).HWBranchNum, + state.dataVentilatedSlab->VentSlab(Item).HWCompNum); } - } //(VentSlab(Item)%HCoilPresent) + } //(state.dataVentilatedSlab->VentSlab(Item)%HCoilPresent) - if (VentSlab(Item).CCoilPresent && !MyPlantScanFlag(Item)) { + if (state.dataVentilatedSlab->VentSlab(Item).CCoilPresent && !MyPlantScanFlag(Item)) { // Only initialize these if a cooling coil is actually present - if ((VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling) || - (VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling)) { - rho = GetDensityGlycol(state, PlantLoop(VentSlab(Item).CWLoopNum).FluidName, + if ((state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling) || + (state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling)) { + rho = GetDensityGlycol(state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - PlantLoop(VentSlab(Item).CWLoopNum).FluidIndex, + PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); - VentSlab(Item).MaxColdWaterFlow = rho * VentSlab(Item).MaxVolColdWaterFlow; - VentSlab(Item).MinColdWaterFlow = rho * VentSlab(Item).MinVolColdWaterFlow; - InitComponentNodes(VentSlab(Item).MinColdWaterFlow, - VentSlab(Item).MaxColdWaterFlow, - VentSlab(Item).ColdControlNode, - VentSlab(Item).ColdCoilOutNodeNum, - VentSlab(Item).CWLoopNum, - VentSlab(Item).CWLoopSide, - VentSlab(Item).CWBranchNum, - VentSlab(Item).CWCompNum); + state.dataVentilatedSlab->VentSlab(Item).MaxColdWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow; + state.dataVentilatedSlab->VentSlab(Item).MinColdWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MinVolColdWaterFlow; + InitComponentNodes(state.dataVentilatedSlab->VentSlab(Item).MinColdWaterFlow, + state.dataVentilatedSlab->VentSlab(Item).MaxColdWaterFlow, + state.dataVentilatedSlab->VentSlab(Item).ColdControlNode, + state.dataVentilatedSlab->VentSlab(Item).ColdCoilOutNodeNum, + state.dataVentilatedSlab->VentSlab(Item).CWLoopNum, + state.dataVentilatedSlab->VentSlab(Item).CWLoopSide, + state.dataVentilatedSlab->VentSlab(Item).CWBranchNum, + state.dataVentilatedSlab->VentSlab(Item).CWCompNum); } } @@ -1665,33 +1577,33 @@ namespace VentilatedSlab { } // These initializations are done every iteration... - InNode = VentSlab(Item).ReturnAirNode; - OutNode = VentSlab(Item).RadInNode; - OutsideAirNode = VentSlab(Item).OutsideAirNode; - AirRelNode = VentSlab(Item).AirReliefNode; - ZoneAirInNode = VentSlab(Item).ZoneAirInNode; - MixOut = VentSlab(Item).OAMixerOutNode; + InNode = state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode; + OutNode = state.dataVentilatedSlab->VentSlab(Item).RadInNode; + OutsideAirNode = state.dataVentilatedSlab->VentSlab(Item).OutsideAirNode; + AirRelNode = state.dataVentilatedSlab->VentSlab(Item).AirReliefNode; + ZoneAirInNode = state.dataVentilatedSlab->VentSlab(Item).ZoneAirInNode; + MixOut = state.dataVentilatedSlab->VentSlab(Item).OAMixerOutNode; // First, set the flow conditions up so that there is flow through the ventilated // slab system(this will be shut down if the system is not available or there // is no load - Node(InNode).MassFlowRate = VentSlab(Item).MaxAirMassFlow; - Node(InNode).MassFlowRateMaxAvail = VentSlab(Item).MaxAirMassFlow; - Node(InNode).MassFlowRateMinAvail = VentSlab(Item).MaxAirMassFlow; - Node(OutNode).MassFlowRate = VentSlab(Item).MaxAirMassFlow; - Node(OutNode).MassFlowRateMaxAvail = VentSlab(Item).MaxAirMassFlow; - Node(OutNode).MassFlowRateMinAvail = VentSlab(Item).MaxAirMassFlow; - Node(OutsideAirNode).MassFlowRate = VentSlab(Item).OutAirMassFlow; - Node(OutsideAirNode).MassFlowRateMaxAvail = VentSlab(Item).OutAirMassFlow; - Node(OutsideAirNode).MassFlowRateMinAvail = VentSlab(Item).OutAirMassFlow; - Node(AirRelNode).MassFlowRate = VentSlab(Item).OutAirMassFlow; - Node(AirRelNode).MassFlowRateMaxAvail = VentSlab(Item).OutAirMassFlow; - Node(AirRelNode).MassFlowRateMinAvail = VentSlab(Item).OutAirMassFlow; + Node(InNode).MassFlowRate = state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow; + Node(InNode).MassFlowRateMaxAvail = state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow; + Node(InNode).MassFlowRateMinAvail = state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow; + Node(OutNode).MassFlowRate = state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow; + Node(OutNode).MassFlowRateMaxAvail = state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow; + Node(OutNode).MassFlowRateMinAvail = state.dataVentilatedSlab->VentSlab(Item).MaxAirMassFlow; + Node(OutsideAirNode).MassFlowRate = state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow; + Node(OutsideAirNode).MassFlowRateMaxAvail = state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow; + Node(OutsideAirNode).MassFlowRateMinAvail = state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow; + Node(AirRelNode).MassFlowRate = state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow; + Node(AirRelNode).MassFlowRateMaxAvail = state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow; + Node(AirRelNode).MassFlowRateMinAvail = state.dataVentilatedSlab->VentSlab(Item).OutAirMassFlow; // Initialize the relief air (same as inlet conditions to the Ventilated Slab .. // Note that mass flow rates will be taken care of later. Node(AirRelNode) = Node(InNode); - OAMassFlowRate = 0.0; + state.dataVentilatedSlab->OAMassFlowRate = 0.0; // Just in case the system is off and conditions do not get sent through // the system for some reason, set the outlet conditions equal to the inlet @@ -1709,14 +1621,14 @@ namespace VentilatedSlab { Node(OutsideAirNode).Press = OutBaroPress; // The first pass through in a particular time step - ZoneNum = VentSlab(Item).ZonePtr; - ZeroSourceSumHATsurf(ZoneNum) = SumHATsurf(ZoneNum); // Set this to figure what part of the load the radiant system meets - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); - QRadSysSrcAvg(SurfNum) = 0.0; // Initialize this variable to zero (radiant system defaults to off) - LastQRadSysSrc(SurfNum) = 0.0; // At the start of a time step, reset to zero so average calculation can begin again - LastSysTimeElapsed(SurfNum) = 0.0; // At the start of a time step, reset to zero so average calculation can begin again - LastTimeStepSys(SurfNum) = 0.0; // At the start of a time step, reset to zero so average calculation can begin again + ZoneNum = state.dataVentilatedSlab->VentSlab(Item).ZonePtr; + state.dataVentilatedSlab->ZeroSourceSumHATsurf(ZoneNum) = SumHATsurf(ZoneNum); // Set this to figure what part of the load the radiant system meets + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); + state.dataVentilatedSlab->QRadSysSrcAvg(SurfNum) = 0.0; // Initialize this variable to zero (radiant system defaults to off) + state.dataVentilatedSlab->LastQRadSysSrc(SurfNum) = 0.0; // At the start of a time step, reset to zero so average calculation can begin again + state.dataVentilatedSlab->LastSysTimeElapsed(SurfNum) = 0.0; // At the start of a time step, reset to zero so average calculation can begin again + state.dataVentilatedSlab->LastTimeStepSys(SurfNum) = 0.0; // At the start of a time step, reset to zero so average calculation can begin again } } } @@ -1831,24 +1743,24 @@ namespace VentilatedSlab { HeatingAirVolFlowScalable = 0.0; DataScalableSizingON = false; DataScalableCapSizingON = false; - CompType = cMO_VentilatedSlab; - CompName = VentSlab(Item).Name; - DataZoneNumber = VentSlab(Item).ZonePtr; - if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { + CompType = state.dataVentilatedSlab->cMO_VentilatedSlab; + CompName = state.dataVentilatedSlab->VentSlab(Item).Name; + DataZoneNumber = state.dataVentilatedSlab->VentSlab(Item).ZonePtr; + if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { DataSizing::DataFanEnumType = DataAirSystems::objectVectorOOFanSystemModel; } else { DataSizing::DataFanEnumType = DataAirSystems::structArrayLegacyFanModels; } - DataSizing::DataFanIndex = VentSlab(Item).Fan_Index; + DataSizing::DataFanIndex = state.dataVentilatedSlab->VentSlab(Item).Fan_Index; // ventilated slab unit is always blow thru DataSizing::DataFanPlacement = DataSizing::zoneFanPlacement::zoneBlowThru; - if (VentSlab(Item).HVACSizingIndex > 0) { - zoneHVACIndex = VentSlab(Item).HVACSizingIndex; + if (state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex > 0) { + zoneHVACIndex = state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex; // N1 , \field Maximum Supply Air Flow Rate FieldNum = 1; PrintFlag = true; - SizingString = VentSlabNumericFields(Item).FieldNames(FieldNum) + " [m3/s]"; + SizingString = state.dataVentilatedSlab->VentSlabNumericFields(Item).FieldNames(FieldNum) + " [m3/s]"; if (ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod > 0) { SizingMethod = DataHVACGlobals::CoolingAirflowSizing; SAFMethod = ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod; @@ -1954,44 +1866,44 @@ namespace VentilatedSlab { } } // DataScalableSizingON = false; - VentSlab(Item).MaxAirVolFlow = max(CoolingAirVolFlowScalable, HeatingAirVolFlowScalable); + state.dataVentilatedSlab->VentSlab(Item).MaxAirVolFlow = max(CoolingAirVolFlowScalable, HeatingAirVolFlowScalable); } else { // no scalble sizing method has been specified. Sizing proceeds using the method // specified in the zoneHVAC object // N1 , \field Maximum Supply Air Flow Rate FieldNum = 1; PrintFlag = true; - SizingString = VentSlabNumericFields(Item).FieldNames(FieldNum) + " [m3/s]"; - TempSize = VentSlab(Item).MaxAirVolFlow; + SizingString = state.dataVentilatedSlab->VentSlabNumericFields(Item).FieldNames(FieldNum) + " [m3/s]"; + TempSize = state.dataVentilatedSlab->VentSlab(Item).MaxAirVolFlow; SystemAirFlowSizer sizerSystemAirFlow; sizerSystemAirFlow.overrideSizingString(SizingString); // sizerSystemAirFlow.setHVACSizingIndexData(FanCoil(FanCoilNum).HVACSizingIndex); sizerSystemAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); - VentSlab(Item).MaxAirVolFlow = sizerSystemAirFlow.size(state, TempSize, ErrorsFound); + state.dataVentilatedSlab->VentSlab(Item).MaxAirVolFlow = sizerSystemAirFlow.size(state, TempSize, ErrorsFound); } IsAutoSize = false; - if (VentSlab(Item).OutAirVolFlow == AutoSize) { + if (state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow == AutoSize) { IsAutoSize = true; } if (CurZoneEqNum > 0) { if (!IsAutoSize && !ZoneSizingRunDone) { - if (VentSlab(Item).OutAirVolFlow > 0.0) { + if (state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow > 0.0) { BaseSizer::reportSizerOutput( - cMO_VentilatedSlab, VentSlab(Item).Name, "User-Specified Maximum Outdoor Air Flow Rate [m3/s]", VentSlab(Item).OutAirVolFlow); + state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name, "User-Specified Maximum Outdoor Air Flow Rate [m3/s]", state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow); } } else { // Autosize or hard-size with sizing run - CheckZoneSizing(cMO_VentilatedSlab, VentSlab(Item).Name); - OutAirVolFlowDes = VentSlab(Item).MaxAirVolFlow; + CheckZoneSizing(state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name); + OutAirVolFlowDes = state.dataVentilatedSlab->VentSlab(Item).MaxAirVolFlow; if (IsAutoSize) { - VentSlab(Item).OutAirVolFlow = OutAirVolFlowDes; + state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow = OutAirVolFlowDes; BaseSizer::reportSizerOutput( - cMO_VentilatedSlab, VentSlab(Item).Name, "Design Size Maximum Outdoor Air Flow Rate [m3/s]", OutAirVolFlowDes); + state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Maximum Outdoor Air Flow Rate [m3/s]", OutAirVolFlowDes); } else { - if (VentSlab(Item).OutAirVolFlow > 0.0 && OutAirVolFlowDes > 0.0) { - OutAirVolFlowUser = VentSlab(Item).OutAirVolFlow; - BaseSizer::reportSizerOutput(cMO_VentilatedSlab, - VentSlab(Item).Name, + if (state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow > 0.0 && OutAirVolFlowDes > 0.0) { + OutAirVolFlowUser = state.dataVentilatedSlab->VentSlab(Item).OutAirVolFlow; + BaseSizer::reportSizerOutput(state.dataVentilatedSlab->cMO_VentilatedSlab, + state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Maximum Outdoor Air Flow Rate [m3/s]", OutAirVolFlowDes, "User-Specified Maximum Outdoor Air Flow Rate [m3/s]", @@ -1999,7 +1911,7 @@ namespace VentilatedSlab { if (DisplayExtraWarnings) { if ((std::abs(OutAirVolFlowDes - OutAirVolFlowUser) / OutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage("SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + - VentSlab(Item).Name + "\"."); + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); ShowContinueError("User-Specified Maximum Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Maximum Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowDes, 5) + @@ -2014,32 +1926,32 @@ namespace VentilatedSlab { } IsAutoSize = false; - if (VentSlab(Item).MinOutAirVolFlow == AutoSize) { + if (state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow == AutoSize) { IsAutoSize = true; } if (CurZoneEqNum > 0) { if (!IsAutoSize && !ZoneSizingRunDone) { - if (VentSlab(Item).MinOutAirVolFlow > 0.0) { - BaseSizer::reportSizerOutput(cMO_VentilatedSlab, - VentSlab(Item).Name, + if (state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow > 0.0) { + BaseSizer::reportSizerOutput(state.dataVentilatedSlab->cMO_VentilatedSlab, + state.dataVentilatedSlab->VentSlab(Item).Name, "User-Specified Minimum Outdoor Air Flow Rate [m3/s]", - VentSlab(Item).MinOutAirVolFlow); + state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow); } } else { - CheckZoneSizing(cMO_VentilatedSlab, VentSlab(Item).Name); - MinOutAirVolFlowDes = min(FinalZoneSizing(CurZoneEqNum).MinOA, VentSlab(Item).MaxAirVolFlow); + CheckZoneSizing(state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name); + MinOutAirVolFlowDes = min(FinalZoneSizing(CurZoneEqNum).MinOA, state.dataVentilatedSlab->VentSlab(Item).MaxAirVolFlow); if (MinOutAirVolFlowDes < SmallAirVolFlow) { MinOutAirVolFlowDes = 0.0; } if (IsAutoSize) { - VentSlab(Item).MinOutAirVolFlow = MinOutAirVolFlowDes; + state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow = MinOutAirVolFlowDes; BaseSizer::reportSizerOutput( - cMO_VentilatedSlab, VentSlab(Item).Name, "Design Size Minimum Outdoor Air Flow Rate [m3/s]", MinOutAirVolFlowDes); + state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Minimum Outdoor Air Flow Rate [m3/s]", MinOutAirVolFlowDes); } else { // Hard-size with sizing data - if (VentSlab(Item).MinOutAirVolFlow > 0.0 && MinOutAirVolFlowDes > 0.0) { - MinOutAirVolFlowUser = VentSlab(Item).MinOutAirVolFlow; - BaseSizer::reportSizerOutput(cMO_VentilatedSlab, - VentSlab(Item).Name, + if (state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow > 0.0 && MinOutAirVolFlowDes > 0.0) { + MinOutAirVolFlowUser = state.dataVentilatedSlab->VentSlab(Item).MinOutAirVolFlow; + BaseSizer::reportSizerOutput(state.dataVentilatedSlab->cMO_VentilatedSlab, + state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Minimum Outdoor Air Flow Rate [m3/s]", MinOutAirVolFlowDes, "User-Specified Minimum Outdoor Air Flow Rate [m3/s]", @@ -2047,7 +1959,7 @@ namespace VentilatedSlab { if (DisplayExtraWarnings) { if ((std::abs(MinOutAirVolFlowDes - MinOutAirVolFlowUser) / MinOutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage("SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + - VentSlab(Item).Name + "\"."); + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); ShowContinueError("User-Specified Minimum Outdoor Air Flow Rate of " + RoundSigDigits(MinOutAirVolFlowUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Minimum Outdoor Air Flow Rate of " + @@ -2062,28 +1974,28 @@ namespace VentilatedSlab { } IsAutoSize = false; - if (VentSlab(Item).MaxVolHotWaterFlow == AutoSize) { + if (state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow == AutoSize) { IsAutoSize = true; } - if (VentSlab(Item).HCoilType == Heating_WaterCoilType) { + if (state.dataVentilatedSlab->VentSlab(Item).HCoilType == state.dataVentilatedSlab->Heating_WaterCoilType) { if (CurZoneEqNum > 0) { if (!IsAutoSize && !ZoneSizingRunDone) { - if (VentSlab(Item).MaxVolHotWaterFlow > 0.0) { - BaseSizer::reportSizerOutput(cMO_VentilatedSlab, - VentSlab(Item).Name, + if (state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow > 0.0) { + BaseSizer::reportSizerOutput(state.dataVentilatedSlab->cMO_VentilatedSlab, + state.dataVentilatedSlab->VentSlab(Item).Name, "User-Specified Maximum Hot Water Flow [m3/s]", - VentSlab(Item).MaxVolHotWaterFlow); + state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow); } } else { // Autosize or hard-size with sizing run - CheckZoneSizing(cMO_VentilatedSlab, VentSlab(Item).Name); + CheckZoneSizing(state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name); - CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", VentSlab(Item).HCoilName, ErrorsFound); - CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, "Coil:Heating:Water", VentSlab(Item).HCoilName, ErrorsFound); + CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", state.dataVentilatedSlab->VentSlab(Item).HCoilName, ErrorsFound); + CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, "Coil:Heating:Water", state.dataVentilatedSlab->VentSlab(Item).HCoilName, ErrorsFound); if (IsAutoSize) { PltSizHeatNum = - MyPlantSizingIndex("Coil:Heating:Water", VentSlab(Item).HCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); - CoilNum = WaterCoils::GetWaterCoilIndex(state, "COIL:HEATING:WATER", VentSlab(Item).HCoilName, ErrorsFound); + MyPlantSizingIndex("Coil:Heating:Water", state.dataVentilatedSlab->VentSlab(Item).HCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); + CoilNum = WaterCoils::GetWaterCoilIndex(state, "COIL:HEATING:WATER", state.dataVentilatedSlab->VentSlab(Item).HCoilName, ErrorsFound); if (state.dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp) { WaterCoilSizDeltaT = state.dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp; DoWaterCoilSizing = true; @@ -2095,15 +2007,15 @@ namespace VentilatedSlab { DoWaterCoilSizing = false; // If there is no heating Plant Sizing object and autosizing was requested, issue fatal error message ShowSevereError("Autosizing of water flow requires a heating loop Sizing:Plant object"); - ShowContinueError("Occurs in " + cMO_VentilatedSlab + " Object=" + VentSlab(Item).Name); + ShowContinueError("Occurs in " + state.dataVentilatedSlab->cMO_VentilatedSlab + " Object=" + state.dataVentilatedSlab->VentSlab(Item).Name); ErrorsFound = true; } } if (DoWaterCoilSizing) { if (FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= SmallAirVolFlow) { SizingMethod = HeatingCapacitySizing; - if (VentSlab(Item).HVACSizingIndex > 0) { - zoneHVACIndex = VentSlab(Item).HVACSizingIndex; + if (state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex > 0) { + zoneHVACIndex = state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex; CapSizingMethod = ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || @@ -2144,13 +2056,13 @@ namespace VentilatedSlab { sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); DesCoilLoad = sizerHeatingCapacity.size(state, TempSize, ErrorsFound); } - rho = GetDensityGlycol(state, PlantLoop(VentSlab(Item).HWLoopNum).FluidName, + rho = GetDensityGlycol(state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, HWInitConvTemp, - PlantLoop(VentSlab(Item).HWLoopNum).FluidIndex, + PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(state, PlantLoop(VentSlab(Item).HWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, HWInitConvTemp, - PlantLoop(VentSlab(Item).HWLoopNum).FluidIndex, + PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); MaxVolHotWaterFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); } else { @@ -2160,14 +2072,14 @@ namespace VentilatedSlab { } if (IsAutoSize) { - VentSlab(Item).MaxVolHotWaterFlow = MaxVolHotWaterFlowDes; + state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow = MaxVolHotWaterFlowDes; BaseSizer::reportSizerOutput( - cMO_VentilatedSlab, VentSlab(Item).Name, "Design Size Maximum Hot Water Flow [m3/s]", MaxVolHotWaterFlowDes); + state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Maximum Hot Water Flow [m3/s]", MaxVolHotWaterFlowDes); } else { // Hard-size with sizing data - if (VentSlab(Item).MaxVolHotWaterFlow > 0.0 && MaxVolHotWaterFlowDes > 0.0) { - MaxVolHotWaterFlowUser = VentSlab(Item).MaxVolHotWaterFlow; - BaseSizer::reportSizerOutput(cMO_VentilatedSlab, - VentSlab(Item).Name, + if (state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow > 0.0 && MaxVolHotWaterFlowDes > 0.0) { + MaxVolHotWaterFlowUser = state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow; + BaseSizer::reportSizerOutput(state.dataVentilatedSlab->cMO_VentilatedSlab, + state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Maximum Hot Water Flow [m3/s]", MaxVolHotWaterFlowDes, "User-Specified Maximum Hot Water Flow [m3/s]", @@ -2175,7 +2087,7 @@ namespace VentilatedSlab { if (DisplayExtraWarnings) { if ((std::abs(MaxVolHotWaterFlowDes - MaxVolHotWaterFlowUser) / MaxVolHotWaterFlowUser) > AutoVsHardSizingThreshold) { ShowMessage("SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + - VentSlab(Item).Name + "\"."); + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); ShowContinueError("User-Specified Maximum Hot Water Flow of " + RoundSigDigits(MaxVolHotWaterFlowUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Maximum Hot Water Flow of " + @@ -2189,34 +2101,34 @@ namespace VentilatedSlab { } } } else { - VentSlab(Item).MaxVolHotWaterFlow = 0.0; + state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow = 0.0; } IsAutoSize = false; - if (VentSlab(Item).MaxVolHotSteamFlow == AutoSize) { + if (state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow == AutoSize) { IsAutoSize = true; } - if (VentSlab(Item).HCoilType == Heating_SteamCoilType) { + if (state.dataVentilatedSlab->VentSlab(Item).HCoilType == state.dataVentilatedSlab->Heating_SteamCoilType) { if (CurZoneEqNum > 0) { if (!IsAutoSize && !ZoneSizingRunDone) { - if (VentSlab(Item).MaxVolHotSteamFlow > 0.0) { + if (state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow > 0.0) { BaseSizer::reportSizerOutput( - cMO_VentilatedSlab, VentSlab(Item).Name, "User-Specified Maximum Steam Flow [m3/s]", VentSlab(Item).MaxVolHotSteamFlow); + state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name, "User-Specified Maximum Steam Flow [m3/s]", state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow); } } else { // Autosize or hard-size with sizing run - CheckZoneSizing("ZoneHVAC:VentilatedSlab", VentSlab(Item).Name); + CheckZoneSizing("ZoneHVAC:VentilatedSlab", state.dataVentilatedSlab->VentSlab(Item).Name); - CoilSteamInletNode = GetCoilSteamInletNode(state, "Coil:Heating:Steam", VentSlab(Item).HCoilName, ErrorsFound); - CoilSteamOutletNode = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", VentSlab(Item).HCoilName, ErrorsFound); + CoilSteamInletNode = GetCoilSteamInletNode(state, "Coil:Heating:Steam", state.dataVentilatedSlab->VentSlab(Item).HCoilName, ErrorsFound); + CoilSteamOutletNode = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", state.dataVentilatedSlab->VentSlab(Item).HCoilName, ErrorsFound); if (IsAutoSize) { PltSizHeatNum = - MyPlantSizingIndex("Coil:Heating:Steam", VentSlab(Item).HCoilName, CoilSteamInletNode, CoilSteamOutletNode, ErrorsFound); + MyPlantSizingIndex("Coil:Heating:Steam", state.dataVentilatedSlab->VentSlab(Item).HCoilName, CoilSteamInletNode, CoilSteamOutletNode, ErrorsFound); if (PltSizHeatNum > 0) { if (FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= SmallAirVolFlow) { SizingMethod = HeatingCapacitySizing; - if (VentSlab(Item).HVACSizingIndex > 0) { - zoneHVACIndex = VentSlab(Item).HVACSizingIndex; + if (state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex > 0) { + zoneHVACIndex = state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex; CapSizingMethod = ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || @@ -2258,11 +2170,11 @@ namespace VentilatedSlab { DesCoilLoad = sizerHeatingCapacity.size(state, TempSize, ErrorsFound); } TempSteamIn = 100.00; - EnthSteamInDry = GetSatEnthalpyRefrig(state, fluidNameSteam, TempSteamIn, 1.0, VentSlab(Item).HCoil_FluidIndex, RoutineName); + EnthSteamInDry = GetSatEnthalpyRefrig(state, fluidNameSteam, TempSteamIn, 1.0, state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex, RoutineName); EnthSteamOutWet = - GetSatEnthalpyRefrig(state, fluidNameSteam, TempSteamIn, 0.0, VentSlab(Item).HCoil_FluidIndex, RoutineName); + GetSatEnthalpyRefrig(state, fluidNameSteam, TempSteamIn, 0.0, state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex, RoutineName); LatentHeatSteam = EnthSteamInDry - EnthSteamOutWet; - SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, VentSlab(Item).HCoil_FluidIndex, RoutineName); + SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, fluidNameWater, HWInitConvTemp, DummyWaterIndex, RoutineName); rho = GetDensityGlycol(state, fluidNameWater, HWInitConvTemp, DummyWaterIndex, RoutineName); MaxVolHotSteamFlowDes = @@ -2272,19 +2184,19 @@ namespace VentilatedSlab { } } else { ShowSevereError("Autosizing of Steam flow requires a heating loop Sizing:Plant object"); - ShowContinueError("Occurs in ZoneHVAC:VentilatedSlab Object=" + VentSlab(Item).Name); + ShowContinueError("Occurs in ZoneHVAC:VentilatedSlab Object=" + state.dataVentilatedSlab->VentSlab(Item).Name); ErrorsFound = true; } } if (IsAutoSize) { - VentSlab(Item).MaxVolHotSteamFlow = MaxVolHotSteamFlowDes; + state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow = MaxVolHotSteamFlowDes; BaseSizer::reportSizerOutput( - cMO_VentilatedSlab, VentSlab(Item).Name, "Design Size Maximum Steam Flow [m3/s]", MaxVolHotSteamFlowDes); + state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Maximum Steam Flow [m3/s]", MaxVolHotSteamFlowDes); } else { - if (VentSlab(Item).MaxVolHotSteamFlow > 0.0 && MaxVolHotSteamFlowDes > 0.0) { - MaxVolHotSteamFlowUser = VentSlab(Item).MaxVolHotSteamFlow; - BaseSizer::reportSizerOutput(cMO_VentilatedSlab, - VentSlab(Item).Name, + if (state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow > 0.0 && MaxVolHotSteamFlowDes > 0.0) { + MaxVolHotSteamFlowUser = state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow; + BaseSizer::reportSizerOutput(state.dataVentilatedSlab->cMO_VentilatedSlab, + state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Maximum Steam Flow [m3/s]", MaxVolHotSteamFlowDes, "User-Specified Maximum Steam Flow [m3/s]", @@ -2292,7 +2204,7 @@ namespace VentilatedSlab { if (DisplayExtraWarnings) { if ((std::abs(MaxVolHotSteamFlowDes - MaxVolHotSteamFlowUser) / MaxVolHotSteamFlowUser) > AutoVsHardSizingThreshold) { ShowMessage("SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + - VentSlab(Item).Name + "\"."); + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); ShowContinueError("User-Specified Maximum Steam Flow of " + RoundSigDigits(MaxVolHotSteamFlowUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Maximum Steam Flow of " + RoundSigDigits(MaxVolHotSteamFlowDes, 5) + @@ -2306,27 +2218,27 @@ namespace VentilatedSlab { } } } else { - VentSlab(Item).MaxVolHotSteamFlow = 0.0; + state.dataVentilatedSlab->VentSlab(Item).MaxVolHotSteamFlow = 0.0; } IsAutoSize = false; - if (VentSlab(Item).MaxVolColdWaterFlow == AutoSize) { + if (state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow == AutoSize) { IsAutoSize = true; } if (CurZoneEqNum > 0) { if (!IsAutoSize && !ZoneSizingRunDone) { - if (VentSlab(Item).MaxVolColdWaterFlow > 0.0) { + if (state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow > 0.0) { BaseSizer::reportSizerOutput( - cMO_VentilatedSlab, VentSlab(Item).Name, "User-Specified Maximum Cold Water Flow [m3/s]", VentSlab(Item).MaxVolColdWaterFlow); + state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name, "User-Specified Maximum Cold Water Flow [m3/s]", state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow); } } else { - CheckZoneSizing(cMO_VentilatedSlab, VentSlab(Item).Name); - if (VentSlab(Item).CCoilType == Cooling_CoilHXAssisted) { - CoolingCoilName = GetHXDXCoilName(state, VentSlab(Item).CCoilTypeCh, VentSlab(Item).CCoilName, ErrorsFound); - CoolingCoilType = GetHXCoilType(state, VentSlab(Item).CCoilTypeCh, VentSlab(Item).CCoilName, ErrorsFound); + CheckZoneSizing(state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name); + if (state.dataVentilatedSlab->VentSlab(Item).CCoilType == state.dataVentilatedSlab->Cooling_CoilHXAssisted) { + CoolingCoilName = GetHXDXCoilName(state, state.dataVentilatedSlab->VentSlab(Item).CCoilTypeCh, state.dataVentilatedSlab->VentSlab(Item).CCoilName, ErrorsFound); + CoolingCoilType = GetHXCoilType(state, state.dataVentilatedSlab->VentSlab(Item).CCoilTypeCh, state.dataVentilatedSlab->VentSlab(Item).CCoilName, ErrorsFound); } else { - CoolingCoilName = VentSlab(Item).CCoilName; - CoolingCoilType = VentSlab(Item).CCoilTypeCh; + CoolingCoilName = state.dataVentilatedSlab->VentSlab(Item).CCoilName; + CoolingCoilType = state.dataVentilatedSlab->VentSlab(Item).CCoilTypeCh; } CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); @@ -2344,15 +2256,15 @@ namespace VentilatedSlab { DoWaterCoilSizing = false; // If there is no cooling Plant Sizing object and autosizing was requested, issue fatal error message ShowSevereError("Autosizing of water flow requires a cooling loop Sizing:Plant object"); - ShowContinueError("Occurs in " + cMO_VentilatedSlab + " Object=" + VentSlab(Item).Name); + ShowContinueError("Occurs in " + state.dataVentilatedSlab->cMO_VentilatedSlab + " Object=" + state.dataVentilatedSlab->VentSlab(Item).Name); ErrorsFound = true; } } if (DoWaterCoilSizing) { if (FinalZoneSizing(CurZoneEqNum).DesCoolMassFlow >= SmallAirVolFlow) { SizingMethod = CoolingCapacitySizing; - if (VentSlab(Item).HVACSizingIndex > 0) { - zoneHVACIndex = VentSlab(Item).HVACSizingIndex; + if (state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex > 0) { + zoneHVACIndex = state.dataVentilatedSlab->VentSlab(Item).HVACSizingIndex; CapSizingMethod = ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod; ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == CoolingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || @@ -2395,9 +2307,9 @@ namespace VentilatedSlab { DesCoilLoad = sizerCoolingCapacity.size(state, TempSize, ErrorsFound); } rho = GetDensityGlycol( - state, PlantLoop(VentSlab(Item).CWLoopNum).FluidName, 5., PlantLoop(VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); + state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, 5., PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol( - state, PlantLoop(VentSlab(Item).CWLoopNum).FluidName, 5., PlantLoop(VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); + state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, 5., PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); MaxVolColdWaterFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); } else { MaxVolColdWaterFlowDes = 0.0; @@ -2405,14 +2317,14 @@ namespace VentilatedSlab { } } if (IsAutoSize) { - VentSlab(Item).MaxVolColdWaterFlow = MaxVolColdWaterFlowDes; + state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow = MaxVolColdWaterFlowDes; BaseSizer::reportSizerOutput( - cMO_VentilatedSlab, VentSlab(Item).Name, "Design Size Maximum Cold Water Flow [m3/s]", MaxVolColdWaterFlowDes); + state.dataVentilatedSlab->cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Maximum Cold Water Flow [m3/s]", MaxVolColdWaterFlowDes); } else { - if (VentSlab(Item).MaxVolColdWaterFlow > 0.0 && MaxVolColdWaterFlowDes > 0.0) { - MaxVolColdWaterFlowUser = VentSlab(Item).MaxVolColdWaterFlow; - BaseSizer::reportSizerOutput(cMO_VentilatedSlab, - VentSlab(Item).Name, + if (state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow > 0.0 && MaxVolColdWaterFlowDes > 0.0) { + MaxVolColdWaterFlowUser = state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow; + BaseSizer::reportSizerOutput(state.dataVentilatedSlab->cMO_VentilatedSlab, + state.dataVentilatedSlab->VentSlab(Item).Name, "Design Size Maximum Cold Water Flow [m3/s]", MaxVolColdWaterFlowDes, "User-Specified Maximum Cold Water Flow [m3/s]", @@ -2420,7 +2332,7 @@ namespace VentilatedSlab { if (DisplayExtraWarnings) { if ((std::abs(MaxVolColdWaterFlowDes - MaxVolColdWaterFlowUser) / MaxVolColdWaterFlowUser) > AutoVsHardSizingThreshold) { ShowMessage("SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + - VentSlab(Item).Name + "\"."); + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); ShowContinueError("User-Specified Maximum Cold Water Flow of " + RoundSigDigits(MaxVolColdWaterFlowUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Maximum Cold Water Flow of " + RoundSigDigits(MaxVolColdWaterFlowDes, 5) + @@ -2434,19 +2346,19 @@ namespace VentilatedSlab { } } - if (VentSlab(Item).CCoilType == Cooling_CoilHXAssisted) { - CoolingCoilName = GetHXDXCoilName(state, VentSlab(Item).CCoilTypeCh, VentSlab(Item).CCoilName, ErrorsFound); - CoolingCoilType = GetHXCoilType(state, VentSlab(Item).CCoilTypeCh, VentSlab(Item).CCoilName, ErrorsFound); + if (state.dataVentilatedSlab->VentSlab(Item).CCoilType == state.dataVentilatedSlab->Cooling_CoilHXAssisted) { + CoolingCoilName = GetHXDXCoilName(state, state.dataVentilatedSlab->VentSlab(Item).CCoilTypeCh, state.dataVentilatedSlab->VentSlab(Item).CCoilName, ErrorsFound); + CoolingCoilType = GetHXCoilType(state, state.dataVentilatedSlab->VentSlab(Item).CCoilTypeCh, state.dataVentilatedSlab->VentSlab(Item).CCoilName, ErrorsFound); } else { - CoolingCoilName = VentSlab(Item).CCoilName; - CoolingCoilType = VentSlab(Item).CCoilTypeCh; + CoolingCoilName = state.dataVentilatedSlab->VentSlab(Item).CCoilName; + CoolingCoilType = state.dataVentilatedSlab->VentSlab(Item).CCoilTypeCh; } - WaterCoils::SetCoilDesFlow(state, CoolingCoilType, CoolingCoilName, VentSlab(Item).MaxAirVolFlow, ErrorsFound); - WaterCoils::SetCoilDesFlow(state, VentSlab(Item).HCoilTypeCh, VentSlab(Item).HCoilName, VentSlab(Item).MaxAirVolFlow, ErrorsFound); + WaterCoils::SetCoilDesFlow(state, CoolingCoilType, CoolingCoilName, state.dataVentilatedSlab->VentSlab(Item).MaxAirVolFlow, ErrorsFound); + WaterCoils::SetCoilDesFlow(state, state.dataVentilatedSlab->VentSlab(Item).HCoilTypeCh, state.dataVentilatedSlab->VentSlab(Item).HCoilName, state.dataVentilatedSlab->VentSlab(Item).MaxAirVolFlow, ErrorsFound); if (CurZoneEqNum > 0) { - ZoneEqSizing(CurZoneEqNum).MaxHWVolFlow = VentSlab(Item).MaxVolHotWaterFlow; - ZoneEqSizing(CurZoneEqNum).MaxCWVolFlow = VentSlab(Item).MaxVolColdWaterFlow; + ZoneEqSizing(CurZoneEqNum).MaxHWVolFlow = state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow; + ZoneEqSizing(CurZoneEqNum).MaxCWVolFlow = state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow; } if (ErrorsFound) { @@ -2588,90 +2500,90 @@ namespace VentilatedSlab { static std::string const CurrentModuleObject("ZoneHVAC:VentilatedSlab"); { - auto const SELECT_CASE_var(VentSlab(Item).CoilOption); - if (SELECT_CASE_var == BothOption) { + auto const SELECT_CASE_var(state.dataVentilatedSlab->VentSlab(Item).CoilOption); + if (SELECT_CASE_var == state.dataVentilatedSlab->BothOption) { { - auto const SELECT_CASE_var1(VentSlab(Item).HCoilType); + auto const SELECT_CASE_var1(state.dataVentilatedSlab->VentSlab(Item).HCoilType); - if (SELECT_CASE_var1 == Heating_WaterCoilType) { - CheckWaterCoilSchedule(state, "Coil:Heating:Water", VentSlab(Item).HCoilName, VentSlab(Item).HCoilSchedValue, VentSlab(Item).HCoil_Index); - } else if (SELECT_CASE_var1 == Heating_SteamCoilType) { + if (SELECT_CASE_var1 == state.dataVentilatedSlab->Heating_WaterCoilType) { + CheckWaterCoilSchedule(state, "Coil:Heating:Water", state.dataVentilatedSlab->VentSlab(Item).HCoilName, state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Heating_SteamCoilType) { CheckSteamCoilSchedule(state, - "Coil:Heating:Steam", VentSlab(Item).HCoilName, VentSlab(Item).HCoilSchedValue, VentSlab(Item).HCoil_Index); - } else if (SELECT_CASE_var1 == Heating_ElectricCoilType) { + "Coil:Heating:Steam", state.dataVentilatedSlab->VentSlab(Item).HCoilName, state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Heating_ElectricCoilType) { CheckHeatingCoilSchedule( - state, "Coil:Heating:Electric", VentSlab(Item).HCoilName, VentSlab(Item).HCoilSchedValue, VentSlab(Item).HCoil_Index); - } else if (SELECT_CASE_var1 == Heating_GasCoilType) { + state, "Coil:Heating:Electric", state.dataVentilatedSlab->VentSlab(Item).HCoilName, state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Heating_GasCoilType) { CheckHeatingCoilSchedule( - state, "Coil:Heating:Fuel", VentSlab(Item).HCoilName, VentSlab(Item).HCoilSchedValue, VentSlab(Item).HCoil_Index); + state, "Coil:Heating:Fuel", state.dataVentilatedSlab->VentSlab(Item).HCoilName, state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); } else { } } { - auto const SELECT_CASE_var1(VentSlab(Item).CCoilType); + auto const SELECT_CASE_var1(state.dataVentilatedSlab->VentSlab(Item).CCoilType); - if (SELECT_CASE_var1 == Cooling_CoilWaterCooling) { - CheckWaterCoilSchedule(state, "Coil:Cooling:Water", VentSlab(Item).CCoilName, VentSlab(Item).CCoilSchedValue, VentSlab(Item).CCoil_Index); - } else if (SELECT_CASE_var1 == Cooling_CoilDetailedCooling) { + if (SELECT_CASE_var1 == state.dataVentilatedSlab->Cooling_CoilWaterCooling) { + CheckWaterCoilSchedule(state, "Coil:Cooling:Water", state.dataVentilatedSlab->VentSlab(Item).CCoilName, state.dataVentilatedSlab->VentSlab(Item).CCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).CCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Cooling_CoilDetailedCooling) { CheckWaterCoilSchedule(state, "Coil:Cooling:Water:DetailedGeometry", - VentSlab(Item).CCoilName, - VentSlab(Item).CCoilSchedValue, - VentSlab(Item).CCoil_Index); - } else if (SELECT_CASE_var1 == Cooling_CoilHXAssisted) { + state.dataVentilatedSlab->VentSlab(Item).CCoilName, + state.dataVentilatedSlab->VentSlab(Item).CCoilSchedValue, + state.dataVentilatedSlab->VentSlab(Item).CCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Cooling_CoilHXAssisted) { CheckHXAssistedCoolingCoilSchedule(state, "CoilSystem:Cooling:Water:HeatExchangerAssisted", - VentSlab(Item).CCoilName, - VentSlab(Item).CCoilSchedValue, - VentSlab(Item).CCoil_Index); + state.dataVentilatedSlab->VentSlab(Item).CCoilName, + state.dataVentilatedSlab->VentSlab(Item).CCoilSchedValue, + state.dataVentilatedSlab->VentSlab(Item).CCoil_Index); } else { } } - } else if (SELECT_CASE_var == HeatingOption) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->HeatingOption) { { - auto const SELECT_CASE_var1(VentSlab(Item).HCoilType); + auto const SELECT_CASE_var1(state.dataVentilatedSlab->VentSlab(Item).HCoilType); - if (SELECT_CASE_var1 == Heating_WaterCoilType) { - CheckWaterCoilSchedule(state, "Coil:Heating:Water", VentSlab(Item).HCoilName, VentSlab(Item).HCoilSchedValue, VentSlab(Item).HCoil_Index); - } else if (SELECT_CASE_var1 == Heating_SteamCoilType) { + if (SELECT_CASE_var1 == state.dataVentilatedSlab->Heating_WaterCoilType) { + CheckWaterCoilSchedule(state, "Coil:Heating:Water", state.dataVentilatedSlab->VentSlab(Item).HCoilName, state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Heating_SteamCoilType) { CheckSteamCoilSchedule(state, - "Coil:Heating:Steam", VentSlab(Item).HCoilName, VentSlab(Item).HCoilSchedValue, VentSlab(Item).HCoil_Index); - } else if (SELECT_CASE_var1 == Heating_ElectricCoilType) { + "Coil:Heating:Steam", state.dataVentilatedSlab->VentSlab(Item).HCoilName, state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Heating_ElectricCoilType) { CheckHeatingCoilSchedule( - state, "Coil:Heating:Electric", VentSlab(Item).HCoilName, VentSlab(Item).HCoilSchedValue, VentSlab(Item).HCoil_Index); - } else if (SELECT_CASE_var1 == Heating_GasCoilType) { + state, "Coil:Heating:Electric", state.dataVentilatedSlab->VentSlab(Item).HCoilName, state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Heating_GasCoilType) { CheckHeatingCoilSchedule( - state, "Coil:Heating:Fuel", VentSlab(Item).HCoilName, VentSlab(Item).HCoilSchedValue, VentSlab(Item).HCoil_Index); + state, "Coil:Heating:Fuel", state.dataVentilatedSlab->VentSlab(Item).HCoilName, state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); } else { } } - } else if (SELECT_CASE_var == CoolingOption) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->CoolingOption) { { - auto const SELECT_CASE_var1(VentSlab(Item).CCoilType); + auto const SELECT_CASE_var1(state.dataVentilatedSlab->VentSlab(Item).CCoilType); - if (SELECT_CASE_var1 == Cooling_CoilWaterCooling) { - CheckWaterCoilSchedule(state, "Coil:Cooling:Water", VentSlab(Item).CCoilName, VentSlab(Item).CCoilSchedValue, VentSlab(Item).CCoil_Index); - } else if (SELECT_CASE_var1 == Cooling_CoilDetailedCooling) { + if (SELECT_CASE_var1 == state.dataVentilatedSlab->Cooling_CoilWaterCooling) { + CheckWaterCoilSchedule(state, "Coil:Cooling:Water", state.dataVentilatedSlab->VentSlab(Item).CCoilName, state.dataVentilatedSlab->VentSlab(Item).CCoilSchedValue, state.dataVentilatedSlab->VentSlab(Item).CCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Cooling_CoilDetailedCooling) { CheckWaterCoilSchedule(state, "Coil:Cooling:Water:DetailedGeometry", - VentSlab(Item).CCoilName, - VentSlab(Item).CCoilSchedValue, - VentSlab(Item).CCoil_Index); - } else if (SELECT_CASE_var1 == Cooling_CoilHXAssisted) { + state.dataVentilatedSlab->VentSlab(Item).CCoilName, + state.dataVentilatedSlab->VentSlab(Item).CCoilSchedValue, + state.dataVentilatedSlab->VentSlab(Item).CCoil_Index); + } else if (SELECT_CASE_var1 == state.dataVentilatedSlab->Cooling_CoilHXAssisted) { CheckHXAssistedCoolingCoilSchedule(state, "CoilSystem:Cooling:Water:HeatExchangerAssisted", - VentSlab(Item).CCoilName, - VentSlab(Item).CCoilSchedValue, - VentSlab(Item).CCoil_Index); + state.dataVentilatedSlab->VentSlab(Item).CCoilName, + state.dataVentilatedSlab->VentSlab(Item).CCoilSchedValue, + state.dataVentilatedSlab->VentSlab(Item).CCoil_Index); } else { } } - } else if (SELECT_CASE_var == NoneOption) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->NoneOption) { } } @@ -2684,49 +2596,49 @@ namespace VentilatedSlab { MaxWaterFlow = 0.0; MinWaterFlow = 0.0; AirMassFlow = 0.0; - InletNode = VentSlab(Item).ReturnAirNode; - OutletNode = VentSlab(Item).RadInNode; - FanOutletNode = VentSlab(Item).FanOutletNode; - ZoneAirInNode = VentSlab(Item).ZoneAirInNode; - OutsideAirNode = VentSlab(Item).OutsideAirNode; - AirRelNode = VentSlab(Item).AirReliefNode; - MixoutNode = VentSlab(Item).OAMixerOutNode; - ReturnAirNode = VentSlab(Item).ReturnAirNode; - ZoneRadNum = VentSlab(Item).ZonePtr; - RadSurfNum = VentSlab(Item).NumOfSurfaces; + InletNode = state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode; + OutletNode = state.dataVentilatedSlab->VentSlab(Item).RadInNode; + FanOutletNode = state.dataVentilatedSlab->VentSlab(Item).FanOutletNode; + ZoneAirInNode = state.dataVentilatedSlab->VentSlab(Item).ZoneAirInNode; + OutsideAirNode = state.dataVentilatedSlab->VentSlab(Item).OutsideAirNode; + AirRelNode = state.dataVentilatedSlab->VentSlab(Item).AirReliefNode; + MixoutNode = state.dataVentilatedSlab->VentSlab(Item).OAMixerOutNode; + ReturnAirNode = state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode; + ZoneRadNum = state.dataVentilatedSlab->VentSlab(Item).ZonePtr; + RadSurfNum = state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; Tinlet = Node(InletNode).Temp; Toutdoor = Node(OutsideAirNode).Temp; // Control Type Check { - auto const SELECT_CASE_var(VentSlab(Item).ControlType); - if (SELECT_CASE_var == MATControl) { + auto const SELECT_CASE_var(state.dataVentilatedSlab->VentSlab(Item).ControlType); + if (SELECT_CASE_var == state.dataVentilatedSlab->MATControl) { SetPointTemp = MAT(ZoneNum); - } else if (SELECT_CASE_var == MRTControl) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->MRTControl) { SetPointTemp = MRT(ZoneNum); - } else if (SELECT_CASE_var == OPTControl) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->OPTControl) { SetPointTemp = 0.5 * (MAT(ZoneNum) + MRT(ZoneNum)); - } else if (SELECT_CASE_var == ODBControl) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->ODBControl) { SetPointTemp = OutDryBulbTemp; - } else if (SELECT_CASE_var == OWBControl) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->OWBControl) { SetPointTemp = OutWetBulbTemp; - } else if (SELECT_CASE_var == SURControl) { - SetPointTemp = TH(2, 1, VentSlab(Item).SurfacePtr(RadSurfNum)); - } else if (SELECT_CASE_var == DPTZControl) { - SetPointTemp = PsyTdpFnWPb(ZoneAirHumRat(VentSlab(Item).ZonePtr), OutBaroPress); + } else if (SELECT_CASE_var == state.dataVentilatedSlab->SURControl) { + SetPointTemp = TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum)); + } else if (SELECT_CASE_var == state.dataVentilatedSlab->DPTZControl) { + SetPointTemp = PsyTdpFnWPb(ZoneAirHumRat(state.dataVentilatedSlab->VentSlab(Item).ZonePtr), OutBaroPress); } else { // Should never get here SetPointTemp = 0.0; // Suppress uninitialized warning - ShowSevereError("Illegal control type in low temperature radiant system: " + VentSlab(Item).Name); + ShowSevereError("Illegal control type in low temperature radiant system: " + state.dataVentilatedSlab->VentSlab(Item).Name); ShowFatalError("Preceding condition causes termination."); } } // Load Check - AirTempHeatHi = GetCurrentScheduleValue(VentSlab(Item).HotCtrlHiTempSchedPtr); - AirTempCoolLo = GetCurrentScheduleValue(VentSlab(Item).ColdCtrlLoTempSchedPtr); + AirTempHeatHi = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).HotCtrlHiTempSchedPtr); + AirTempCoolLo = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).ColdCtrlLoTempSchedPtr); - if (((SetPointTemp >= AirTempHeatHi) && (SetPointTemp <= AirTempCoolLo)) || (GetCurrentScheduleValue(VentSlab(Item).SchedPtr) <= 0)) { + if (((SetPointTemp >= AirTempHeatHi) && (SetPointTemp <= AirTempCoolLo)) || (GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).SchedPtr) <= 0)) { // System is off or has no load upon it; set the flow rates to zero and then // simulate the components with the no flow conditions @@ -2752,25 +2664,25 @@ namespace VentilatedSlab { Node(FanOutletNode).MassFlowRateMaxAvail = 0.0; Node(FanOutletNode).MassFlowRateMinAvail = 0.0; AirMassFlow = 0.0; - HCoilOn = false; + state.dataVentilatedSlab->HCoilOn = false; // Node condition - Node(InletNode).Temp = TH(2, 1, VentSlab(Item).SurfacePtr(1)); + Node(InletNode).Temp = TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)); Node(FanOutletNode).Temp = Node(InletNode).Temp; Node(OutletNode).Temp = Node(FanOutletNode).Temp; // Node condition - if (VentSlab(Item).SysConfg == SeriesSlabs) { - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - SlabName = VentSlab(Item).SurfaceName(RadSurfNum); - MSlabIn = VentSlab(Item).SlabIn(RadSurfNum); - MSlabOut = VentSlab(Item).SlabOut(RadSurfNum); - VentSlab(Item).MSlabInNode = GetOnlySingleNode(state, + if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SeriesSlabs) { + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + SlabName = state.dataVentilatedSlab->VentSlab(Item).SurfaceName(RadSurfNum); + MSlabIn = state.dataVentilatedSlab->VentSlab(Item).SlabIn(RadSurfNum); + MSlabOut = state.dataVentilatedSlab->VentSlab(Item).SlabOut(RadSurfNum); + state.dataVentilatedSlab->VentSlab(Item).MSlabInNode = GetOnlySingleNode(state, MSlabIn, ErrorsFound, CurrentModuleObject, SlabName, NodeType_Air, NodeConnectionType_Internal, 1, ObjectIsNotParent); - VentSlab(Item).MSlabOutNode = GetOnlySingleNode(state, + state.dataVentilatedSlab->VentSlab(Item).MSlabOutNode = GetOnlySingleNode(state, MSlabOut, ErrorsFound, CurrentModuleObject, SlabName, NodeType_Air, NodeConnectionType_Internal, 1, ObjectIsNotParent); - MSlabInletNode = VentSlab(Item).MSlabInNode; - MSlabOutletNode = VentSlab(Item).MSlabOutNode; + MSlabInletNode = state.dataVentilatedSlab->VentSlab(Item).MSlabInNode; + MSlabOutletNode = state.dataVentilatedSlab->VentSlab(Item).MSlabOutNode; Node(MSlabInletNode).Temp = Node(InletNode).Temp; Node(MSlabOutletNode).Temp = Node(MSlabInletNode).Temp; @@ -2782,21 +2694,21 @@ namespace VentilatedSlab { } else { // System On if (SetPointTemp < AirTempHeatHi) { // HEATING MODE - OperatingMode = HeatingMode; + state.dataVentilatedSlab->OperatingMode = state.dataVentilatedSlab->HeatingMode; // Check the setpoint and temperature span - SetPointTempHi = GetCurrentScheduleValue(VentSlab(Item).HotCtrlHiTempSchedPtr); - SetPointTempLo = GetCurrentScheduleValue(VentSlab(Item).HotCtrlLoTempSchedPtr); + SetPointTempHi = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).HotCtrlHiTempSchedPtr); + SetPointTempLo = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).HotCtrlLoTempSchedPtr); if (SetPointTempHi < SetPointTempLo) { - ShowSevereError("Heating setpoint temperature mismatch in" + VentSlab(Item).Name); + ShowSevereError("Heating setpoint temperature mismatch in" + state.dataVentilatedSlab->VentSlab(Item).Name); ShowContinueError("High setpoint temperature is less than low setpoint temperature--check your schedule input"); ShowFatalError("Preceding condition causes termination."); } - AirTempHi = GetCurrentScheduleValue(VentSlab(Item).HotAirHiTempSchedPtr); - AirTempLo = GetCurrentScheduleValue(VentSlab(Item).HotAirLoTempSchedPtr); + AirTempHi = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).HotAirHiTempSchedPtr); + AirTempLo = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).HotAirLoTempSchedPtr); if (AirTempHi < AirTempLo) { - ShowSevereError("Heating Air temperature mismatch in" + VentSlab(Item).Name); + ShowSevereError("Heating Air temperature mismatch in" + state.dataVentilatedSlab->VentSlab(Item).Name); ShowContinueError("High Air temperature is less than low Air temperature--check your schedule input"); ShowFatalError("Preceding condition causes termination."); } @@ -2813,39 +2725,39 @@ namespace VentilatedSlab { RadInTemp = AirTempHi - (AirTempHi - AirTempLo) * (SetPointTemp - SetPointTempLo) / (SetPointTempHi - SetPointTempLo); } - Node(VentSlab(Item).RadInNode).Temp = RadInTemp; + Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).Temp = RadInTemp; - ControlNode = VentSlab(Item).HotControlNode; - MaxWaterFlow = VentSlab(Item).MaxHotWaterFlow; - MinWaterFlow = VentSlab(Item).MinHotWaterFlow; - MaxSteamFlow = VentSlab(Item).MaxHotSteamFlow; - MinSteamFlow = VentSlab(Item).MinHotSteamFlow; + ControlNode = state.dataVentilatedSlab->VentSlab(Item).HotControlNode; + MaxWaterFlow = state.dataVentilatedSlab->VentSlab(Item).MaxHotWaterFlow; + MinWaterFlow = state.dataVentilatedSlab->VentSlab(Item).MinHotWaterFlow; + MaxSteamFlow = state.dataVentilatedSlab->VentSlab(Item).MaxHotSteamFlow; + MinSteamFlow = state.dataVentilatedSlab->VentSlab(Item).MinHotSteamFlow; // On the first HVAC iteration the system values are given to the controller, but after that // the demand limits are in place and there needs to be feedback to the Zone Equipment - if (!FirstHVACIteration && VentSlab(Item).HCoilType == Heating_WaterCoilType) { + if (!FirstHVACIteration && state.dataVentilatedSlab->VentSlab(Item).HCoilType == state.dataVentilatedSlab->Heating_WaterCoilType) { MaxWaterFlow = Node(ControlNode).MassFlowRateMaxAvail; MinWaterFlow = Node(ControlNode).MassFlowRateMinAvail; } - if (!FirstHVACIteration && VentSlab(Item).HCoilType == Heating_SteamCoilType) { + if (!FirstHVACIteration && state.dataVentilatedSlab->VentSlab(Item).HCoilType == state.dataVentilatedSlab->Heating_SteamCoilType) { MaxSteamFlow = Node(ControlNode).MassFlowRateMaxAvail; MinSteamFlow = Node(ControlNode).MassFlowRateMinAvail; } - HCoilOn = true; + state.dataVentilatedSlab->HCoilOn = true; if (Node(OutsideAirNode).MassFlowRate > 0.0) { - MinOAFrac = GetCurrentScheduleValue(VentSlab(Item).MinOASchedPtr) * - (VentSlab(Item).MinOutAirMassFlow / Node(OutsideAirNode).MassFlowRate); + MinOAFrac = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).MinOASchedPtr) * + (state.dataVentilatedSlab->VentSlab(Item).MinOutAirMassFlow / Node(OutsideAirNode).MassFlowRate); } else { MinOAFrac = 0.0; } MinOAFrac = min(1.0, max(0.0, MinOAFrac)); - if ((!VentSlab(Item).HCoilPresent) || (VentSlab(Item).HCoilSchedValue <= 0.0)) { + if ((!state.dataVentilatedSlab->VentSlab(Item).HCoilPresent) || (state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue <= 0.0)) { // In heating mode, but there is no coil to provide heating. This is handled // differently than if there was a heating coil present. Fixed temperature // will still try to vary the amount of outside air to meet the desired @@ -2857,14 +2769,14 @@ namespace VentilatedSlab { OutletNode = FanOutletNode; { - auto const SELECT_CASE_var(VentSlab(Item).OAControlType); + auto const SELECT_CASE_var(state.dataVentilatedSlab->VentSlab(Item).OAControlType); - if (SELECT_CASE_var == FixedOAControl) { + if (SELECT_CASE_var == state.dataVentilatedSlab->FixedOAControl) { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; - } else if (SELECT_CASE_var == VariablePercent) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->VariablePercent) { // This algorithm is probably a bit simplistic in that it just bounces // back and forth between the maximum outside air and the minimum. In // reality, a system *might* vary between the two based on the load in @@ -2876,50 +2788,50 @@ namespace VentilatedSlab { if (Tinlet >= Toutdoor) { - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Tinlet < Toutdoor - MaxOAFrac = GetCurrentScheduleValue(VentSlab(Item).MaxOASchedPtr); - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + MaxOAFrac = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr); + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } - } else if (SELECT_CASE_var == FixedTemperature) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->FixedTemperature) { // This is basically the same algorithm as for the heating case... - Tdesired = GetCurrentScheduleValue(VentSlab(Item).TempSchedPtr); + Tdesired = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).TempSchedPtr); MaxOAFrac = 1.0; if (std::abs(Tinlet - Toutdoor) <= LowTempDiff) { // no difference in indoor and outdoor conditions-->set OA to minimum - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else if (std::abs(MaxOAFrac - MinOAFrac) <= LowOAFracDiff) { // no difference in outside air fractions - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else if (((Tdesired <= Tinlet) && (Tdesired >= Toutdoor)) || ((Tdesired >= Tinlet) && (Tdesired <= Toutdoor))) { // Desired temperature is between the inlet and outdoor temperatures // so vary the flow rate between no outside air and no recirculation air // then applying the maximum and minimum limits the user has scheduled // to make sure too much/little outside air is being introduced - OAMassFlowRate = ((Tdesired - Tinlet) / (Toutdoor - Tinlet)) * Node(InletNode).MassFlowRate; - OAMassFlowRate = max(OAMassFlowRate, (MinOAFrac * Node(OutsideAirNode).MassFlowRate)); - OAMassFlowRate = min(OAMassFlowRate, (MaxOAFrac * Node(OutsideAirNode).MassFlowRate)); + state.dataVentilatedSlab->OAMassFlowRate = ((Tdesired - Tinlet) / (Toutdoor - Tinlet)) * Node(InletNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = max(state.dataVentilatedSlab->OAMassFlowRate, (MinOAFrac * Node(OutsideAirNode).MassFlowRate)); + state.dataVentilatedSlab->OAMassFlowRate = min(state.dataVentilatedSlab->OAMassFlowRate, (MaxOAFrac * Node(OutsideAirNode).MassFlowRate)); } else if ((Tdesired < Tinlet) && (Tdesired < Toutdoor)) { // Desired temperature is below both the inlet and outdoor temperatures // so use whichever flow rate (max or min) that will get closer if (Tinlet < Toutdoor) { // Tinlet closer to Tdesired so use minimum outside air - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Toutdoor closer to Tdesired so use maximum outside air - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } } else if ((Tdesired > Tinlet) && (Tdesired > Toutdoor)) { // Desired temperature is above both the inlet and outdoor temperatures // so use whichever flow rate (max or min) that will get closer if (Tinlet > Toutdoor) { // Tinlet closer to Tdesired so use minimum outside air - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Toutdoor closer to Tdesired so use maximum outside air - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } } else { // It should NEVER get to this point, but just in case... - ShowFatalError("Ventilated Slab simulation control: illogical condition for " + VentSlab(Item).Name); + ShowFatalError("Ventilated Slab simulation control: illogical condition for " + state.dataVentilatedSlab->VentSlab(Item).Name); } } } @@ -2929,72 +2841,72 @@ namespace VentilatedSlab { } else { // Heating Coil present { - auto const SELECT_CASE_var(VentSlab(Item).OAControlType); + auto const SELECT_CASE_var(state.dataVentilatedSlab->VentSlab(Item).OAControlType); - if (SELECT_CASE_var == FixedOAControl) { + if (SELECT_CASE_var == state.dataVentilatedSlab->FixedOAControl) { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. if (Node(OutsideAirNode).MassFlowRate > 0.0) { - MaxOAFrac = GetCurrentScheduleValue(VentSlab(Item).MaxOASchedPtr); + MaxOAFrac = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr); } else { MaxOAFrac = 0.0; } MaxOAFrac = min(1.0, max(0.0, MinOAFrac)); - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; - } else if (SELECT_CASE_var == VariablePercent) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->VariablePercent) { // In heating mode, the ouside air for "variable percent" control // is set to the minimum value - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; - } else if (SELECT_CASE_var == FixedTemperature) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->FixedTemperature) { // This is basically the same algorithm as for the heating case... - Tdesired = GetCurrentScheduleValue(VentSlab(Item).TempSchedPtr); + Tdesired = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).TempSchedPtr); MaxOAFrac = 1.0; if (std::abs(Tinlet - Toutdoor) <= LowTempDiff) { // no difference in indoor and outdoor conditions-->set OA to minimum - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else if (std::abs(MaxOAFrac - MinOAFrac) <= LowOAFracDiff) { // no difference in outside air fractions - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else if (((Tdesired <= Tinlet) && (Tdesired >= Toutdoor)) || ((Tdesired >= Tinlet) && (Tdesired <= Toutdoor))) { // Desired temperature is between the inlet and outdoor temperatures // so vary the flow rate between no outside air and no recirculation air // then applying the maximum and minimum limits the user has scheduled // to make sure too much/little outside air is being introduced - OAMassFlowRate = ((Tdesired - Tinlet) / (Toutdoor - Tinlet)) * Node(InletNode).MassFlowRate; - OAMassFlowRate = max(OAMassFlowRate, (MinOAFrac * Node(OutsideAirNode).MassFlowRate)); - OAMassFlowRate = min(OAMassFlowRate, (MaxOAFrac * Node(OutsideAirNode).MassFlowRate)); + state.dataVentilatedSlab->OAMassFlowRate = ((Tdesired - Tinlet) / (Toutdoor - Tinlet)) * Node(InletNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = max(state.dataVentilatedSlab->OAMassFlowRate, (MinOAFrac * Node(OutsideAirNode).MassFlowRate)); + state.dataVentilatedSlab->OAMassFlowRate = min(state.dataVentilatedSlab->OAMassFlowRate, (MaxOAFrac * Node(OutsideAirNode).MassFlowRate)); } else if ((Tdesired < Tinlet) && (Tdesired < Toutdoor)) { // Desired temperature is below both the inlet and outdoor temperatures // so use whichever flow rate (max or min) that will get closer if (Tinlet < Toutdoor) { // Tinlet closer to Tdesired so use minimum outside air - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Toutdoor closer to Tdesired so use maximum outside air - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } } else if ((Tdesired > Tinlet) && (Tdesired > Toutdoor)) { // Desired temperature is above both the inlet and outdoor temperatures // so use whichever flow rate (max or min) that will get closer if (Tinlet > Toutdoor) { // Tinlet closer to Tdesired so use minimum outside air - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Toutdoor closer to Tdesired so use maximum outside air - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } } else { // It should NEVER get to this point, but just in case... - ShowFatalError("Ventilated Slab simulation control: illogical condition for " + VentSlab(Item).Name); + ShowFatalError("Ventilated Slab simulation control: illogical condition for " + state.dataVentilatedSlab->VentSlab(Item).Name); } } } - SimVentSlabOAMixer(Item); + SimVentSlabOAMixer(state, Item); - if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { - HVACFan::fanObjs[VentSlab(Item).Fan_Index]->simulate(state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); - } else if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SimpleConstVolume) { + if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { + HVACFan::fanObjs[state.dataVentilatedSlab->VentSlab(Item).Fan_Index]->simulate(state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); + } else if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SimpleConstVolume) { Fans::SimulateFanComponents( - state, VentSlab(Item).FanName, FirstHVACIteration, VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); + state, state.dataVentilatedSlab->VentSlab(Item).FanName, FirstHVACIteration, state.dataVentilatedSlab->VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); } CpFan = PsyCpAirFnW(Node(FanOutletNode).HumRat); @@ -3002,14 +2914,14 @@ namespace VentilatedSlab { // Setup the coil configuration { - auto const SELECT_CASE_var(VentSlab(Item).HCoilType); + auto const SELECT_CASE_var(state.dataVentilatedSlab->VentSlab(Item).HCoilType); - if (SELECT_CASE_var == Heating_WaterCoilType) { + if (SELECT_CASE_var == state.dataVentilatedSlab->Heating_WaterCoilType) { // control water flow to obtain output matching QZnReq ControlCompOutput(state, - VentSlab(Item).Name, - cMO_VentilatedSlab, + state.dataVentilatedSlab->VentSlab(Item).Name, + state.dataVentilatedSlab->cMO_VentilatedSlab, Item, FirstHVACIteration, QZnReq, @@ -3017,19 +2929,19 @@ namespace VentilatedSlab { MaxWaterFlow, MinWaterFlow, 0.001, - VentSlab(Item).ControlCompTypeNum, - VentSlab(Item).CompErrIndex, + state.dataVentilatedSlab->VentSlab(Item).ControlCompTypeNum, + state.dataVentilatedSlab->VentSlab(Item).CompErrIndex, _, _, _, _, _, - VentSlab(Item).HWLoopNum, - VentSlab(Item).HWLoopSide, - VentSlab(Item).HWBranchNum); + state.dataVentilatedSlab->VentSlab(Item).HWLoopNum, + state.dataVentilatedSlab->VentSlab(Item).HWLoopSide, + state.dataVentilatedSlab->VentSlab(Item).HWBranchNum); - } else if ((SELECT_CASE_var == Heating_GasCoilType) || (SELECT_CASE_var == Heating_ElectricCoilType) || - (SELECT_CASE_var == Heating_SteamCoilType)) { + } else if ((SELECT_CASE_var == state.dataVentilatedSlab->Heating_GasCoilType) || (SELECT_CASE_var == state.dataVentilatedSlab->Heating_ElectricCoilType) || + (SELECT_CASE_var == state.dataVentilatedSlab->Heating_SteamCoilType)) { CalcVentilatedSlabComps(state, Item, FirstHVACIteration, QUnitOut); } @@ -3039,20 +2951,20 @@ namespace VentilatedSlab { } else if (SetPointTemp > AirTempCoolLo) { // Cooling Mode - OperatingMode = CoolingMode; + state.dataVentilatedSlab->OperatingMode = state.dataVentilatedSlab->CoolingMode; - SetPointTempHi = GetCurrentScheduleValue(VentSlab(Item).ColdCtrlHiTempSchedPtr); - SetPointTempLo = GetCurrentScheduleValue(VentSlab(Item).ColdCtrlLoTempSchedPtr); + SetPointTempHi = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).ColdCtrlHiTempSchedPtr); + SetPointTempLo = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).ColdCtrlLoTempSchedPtr); if (SetPointTempHi < SetPointTempLo) { - ShowSevereError("Cooling setpoint temperature mismatch in" + VentSlab(Item).Name); + ShowSevereError("Cooling setpoint temperature mismatch in" + state.dataVentilatedSlab->VentSlab(Item).Name); ShowContinueError("High setpoint temperature is less than low setpoint temperature--check your schedule input"); ShowFatalError("Preceding condition causes termination."); } - AirTempHi = GetCurrentScheduleValue(VentSlab(Item).ColdAirHiTempSchedPtr); - AirTempLo = GetCurrentScheduleValue(VentSlab(Item).ColdAirLoTempSchedPtr); + AirTempHi = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).ColdAirHiTempSchedPtr); + AirTempLo = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).ColdAirLoTempSchedPtr); if (AirTempHi < AirTempLo) { - ShowSevereError("Cooling Air temperature mismatch in" + VentSlab(Item).Name); + ShowSevereError("Cooling Air temperature mismatch in" + state.dataVentilatedSlab->VentSlab(Item).Name); ShowContinueError("High Air temperature is less than low Air temperature--check your schedule input"); ShowFatalError("Preceding condition causes termination."); } @@ -3068,27 +2980,27 @@ namespace VentilatedSlab { RadInTemp = AirTempHi - (AirTempHi - AirTempLo) * (SetPointTemp - SetPointTempLo) / (SetPointTempHi - SetPointTempLo); } - ControlNode = VentSlab(Item).ColdControlNode; - MaxWaterFlow = VentSlab(Item).MaxColdWaterFlow; - MinWaterFlow = VentSlab(Item).MinColdWaterFlow; + ControlNode = state.dataVentilatedSlab->VentSlab(Item).ColdControlNode; + MaxWaterFlow = state.dataVentilatedSlab->VentSlab(Item).MaxColdWaterFlow; + MinWaterFlow = state.dataVentilatedSlab->VentSlab(Item).MinColdWaterFlow; // On the first HVAC iteration the system values are given to the controller, but after that // the demand limits are in place and there needs to be feedback to the Zone Equipment - if ((!FirstHVACIteration) && (ControlNode > 0) && (VentSlab(Item).CCoilPresent)) { + if ((!FirstHVACIteration) && (ControlNode > 0) && (state.dataVentilatedSlab->VentSlab(Item).CCoilPresent)) { MaxWaterFlow = Node(ControlNode).MassFlowRateMaxAvail; MinWaterFlow = Node(ControlNode).MassFlowRateMinAvail; } - HCoilOn = false; + state.dataVentilatedSlab->HCoilOn = false; if (Node(OutsideAirNode).MassFlowRate > 0.0) { - MinOAFrac = GetCurrentScheduleValue(VentSlab(Item).MinOASchedPtr) * - (VentSlab(Item).MinOutAirMassFlow / Node(OutsideAirNode).MassFlowRate); + MinOAFrac = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).MinOASchedPtr) * + (state.dataVentilatedSlab->VentSlab(Item).MinOutAirMassFlow / Node(OutsideAirNode).MassFlowRate); } else { MinOAFrac = 0.0; } MinOAFrac = min(1.0, max(0.0, MinOAFrac)); - if ((!VentSlab(Item).CCoilPresent) || (VentSlab(Item).CCoilSchedValue <= 0.0)) { + if ((!state.dataVentilatedSlab->VentSlab(Item).CCoilPresent) || (state.dataVentilatedSlab->VentSlab(Item).CCoilSchedValue <= 0.0)) { // In cooling mode, but there is no coil to provide cooling. This is handled // differently than if there was a cooling coil present. Fixed temperature // will still try to vary the amount of outside air to meet the desired @@ -3099,20 +3011,20 @@ namespace VentilatedSlab { OutletNode = FanOutletNode; { - auto const SELECT_CASE_var(VentSlab(Item).OAControlType); + auto const SELECT_CASE_var(state.dataVentilatedSlab->VentSlab(Item).OAControlType); - if (SELECT_CASE_var == FixedOAControl) { + if (SELECT_CASE_var == state.dataVentilatedSlab->FixedOAControl) { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. if (Node(OutsideAirNode).MassFlowRate > 0.0) { - MaxOAFrac = GetCurrentScheduleValue(VentSlab(Item).MaxOASchedPtr); + MaxOAFrac = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr); } else { MaxOAFrac = 0.0; } MaxOAFrac = min(1.0, max(0.0, MinOAFrac)); - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; - } else if (SELECT_CASE_var == VariablePercent) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->VariablePercent) { // This algorithm is probably a bit simplistic in that it just bounces // back and forth between the maximum outside air and the minimum. In // reality, a system *might* vary between the two based on the load in @@ -3125,50 +3037,50 @@ namespace VentilatedSlab { if (Tinlet <= Toutdoor) { - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Tinlet > Toutdoor - MaxOAFrac = GetCurrentScheduleValue(VentSlab(Item).MaxOASchedPtr); - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + MaxOAFrac = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr); + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } - } else if (SELECT_CASE_var == FixedTemperature) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->FixedTemperature) { // This is basically the same algorithm as for the heating case... - Tdesired = GetCurrentScheduleValue(VentSlab(Item).TempSchedPtr); + Tdesired = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).TempSchedPtr); MaxOAFrac = 1.0; if (std::abs(Tinlet - Toutdoor) <= LowTempDiff) { // no difference in indoor and outdoor conditions-->set OA to minimum - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else if (std::abs(MaxOAFrac - MinOAFrac) <= LowOAFracDiff) { // no difference in outside air fractions - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else if (((Tdesired <= Tinlet) && (Tdesired >= Toutdoor)) || ((Tdesired >= Tinlet) && (Tdesired <= Toutdoor))) { // Desired temperature is between the inlet and outdoor temperatures // so vary the flow rate between no outside air and no recirculation air // then applying the maximum and minimum limits the user has scheduled // to make sure too much/little outside air is being introduced - OAMassFlowRate = ((Tdesired - Tinlet) / (Toutdoor - Tinlet)) * Node(InletNode).MassFlowRate; - OAMassFlowRate = max(OAMassFlowRate, (MinOAFrac * Node(OutsideAirNode).MassFlowRate)); - OAMassFlowRate = min(OAMassFlowRate, (MaxOAFrac * Node(OutsideAirNode).MassFlowRate)); + state.dataVentilatedSlab->OAMassFlowRate = ((Tdesired - Tinlet) / (Toutdoor - Tinlet)) * Node(InletNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = max(state.dataVentilatedSlab->OAMassFlowRate, (MinOAFrac * Node(OutsideAirNode).MassFlowRate)); + state.dataVentilatedSlab->OAMassFlowRate = min(state.dataVentilatedSlab->OAMassFlowRate, (MaxOAFrac * Node(OutsideAirNode).MassFlowRate)); } else if ((Tdesired < Tinlet) && (Tdesired < Toutdoor)) { // Desired temperature is below both the inlet and outdoor temperatures // so use whichever flow rate (max or min) that will get closer if (Tinlet < Toutdoor) { // Tinlet closer to Tdesired so use minimum outside air - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Toutdoor closer to Tdesired so use maximum outside air - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } } else if ((Tdesired > Tinlet) && (Tdesired > Toutdoor)) { // Desired temperature is above both the inlet and outdoor temperatures // so use whichever flow rate (max or min) that will get closer if (Tinlet > Toutdoor) { // Tinlet closer to Tdesired so use minimum outside air - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Toutdoor closer to Tdesired so use maximum outside air - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } } else { // It should NEVER get to this point, but just in case... - ShowFatalError(cMO_VentilatedSlab + " simulation control: illogical condition for " + VentSlab(Item).Name); + ShowFatalError(state.dataVentilatedSlab->cMO_VentilatedSlab + " simulation control: illogical condition for " + state.dataVentilatedSlab->VentSlab(Item).Name); } } } @@ -3182,81 +3094,81 @@ namespace VentilatedSlab { // the desired mixed air temperature. { - auto const SELECT_CASE_var(VentSlab(Item).OAControlType); + auto const SELECT_CASE_var(state.dataVentilatedSlab->VentSlab(Item).OAControlType); - if (SELECT_CASE_var == FixedOAControl) { + if (SELECT_CASE_var == state.dataVentilatedSlab->FixedOAControl) { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. if (Node(OutsideAirNode).MassFlowRate > 0.0) { - MaxOAFrac = GetCurrentScheduleValue(VentSlab(Item).MaxOASchedPtr); + MaxOAFrac = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).MaxOASchedPtr); } else { MaxOAFrac = 0.0; } MaxOAFrac = min(1.0, max(0.0, MinOAFrac)); - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; - } else if (SELECT_CASE_var == VariablePercent) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->VariablePercent) { // A cooling coil is present so let it try to do the cooling... - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; - } else if (SELECT_CASE_var == FixedTemperature) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->FixedTemperature) { // This is basically the same algorithm as for the heating case... - Tdesired = GetCurrentScheduleValue(VentSlab(Item).TempSchedPtr); + Tdesired = GetCurrentScheduleValue(state.dataVentilatedSlab->VentSlab(Item).TempSchedPtr); MaxOAFrac = 1.0; if (std::abs(Tinlet - Toutdoor) <= LowTempDiff) { // no difference in indoor and outdoor conditions-->set OA to minimum - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else if (std::abs(MaxOAFrac - MinOAFrac) <= LowOAFracDiff) { // no difference in outside air fractions - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else if (((Tdesired <= Tinlet) && (Tdesired >= Toutdoor)) || ((Tdesired >= Tinlet) && (Tdesired <= Toutdoor))) { // Desired temperature is between the inlet and outdoor temperatures // so vary the flow rate between no outside air and no recirculation air // then applying the maximum and minimum limits the user has scheduled // to make sure too much/little outside air is being introduced - OAMassFlowRate = ((Tdesired - Tinlet) / (Toutdoor - Tinlet)) * Node(InletNode).MassFlowRate; - OAMassFlowRate = max(OAMassFlowRate, (MinOAFrac * Node(OutsideAirNode).MassFlowRate)); - OAMassFlowRate = min(OAMassFlowRate, (MaxOAFrac * Node(OutsideAirNode).MassFlowRate)); + state.dataVentilatedSlab->OAMassFlowRate = ((Tdesired - Tinlet) / (Toutdoor - Tinlet)) * Node(InletNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = max(state.dataVentilatedSlab->OAMassFlowRate, (MinOAFrac * Node(OutsideAirNode).MassFlowRate)); + state.dataVentilatedSlab->OAMassFlowRate = min(state.dataVentilatedSlab->OAMassFlowRate, (MaxOAFrac * Node(OutsideAirNode).MassFlowRate)); } else if ((Tdesired < Tinlet) && (Tdesired < Toutdoor)) { // Desired temperature is below both the inlet and outdoor temperatures // so use whichever flow rate (max or min) that will get closer if (Tinlet < Toutdoor) { // Tinlet closer to Tdesired so use minimum outside air - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Toutdoor closer to Tdesired so use maximum outside air - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } } else if ((Tdesired > Tinlet) && (Tdesired > Toutdoor)) { // Desired temperature is above both the inlet and outdoor temperatures // so use whichever flow rate (max or min) that will get closer if (Tinlet > Toutdoor) { // Tinlet closer to Tdesired so use minimum outside air - OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else { // Toutdoor closer to Tdesired so use maximum outside air - OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; + state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * Node(OutsideAirNode).MassFlowRate; } } else { // It should NEVER get to this point, but just in case... - ShowFatalError(cMO_VentilatedSlab + " simulation control: illogical condition for " + VentSlab(Item).Name); + ShowFatalError(state.dataVentilatedSlab->cMO_VentilatedSlab + " simulation control: illogical condition for " + state.dataVentilatedSlab->VentSlab(Item).Name); } } } // control water flow to obtain output matching Low Setpoint Temperateure - HCoilOn = false; + state.dataVentilatedSlab->HCoilOn = false; - SimVentSlabOAMixer(Item); - if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { - HVACFan::fanObjs[VentSlab(Item).Fan_Index]->simulate(state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); - } else if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SimpleConstVolume) { + SimVentSlabOAMixer(state, Item); + if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { + HVACFan::fanObjs[state.dataVentilatedSlab->VentSlab(Item).Fan_Index]->simulate(state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); + } else if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SimpleConstVolume) { Fans::SimulateFanComponents( - state, VentSlab(Item).FanName, FirstHVACIteration, VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); + state, state.dataVentilatedSlab->VentSlab(Item).FanName, FirstHVACIteration, state.dataVentilatedSlab->VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); } CpFan = PsyCpAirFnW(Node(FanOutletNode).HumRat); QZnReq = (Node(OutletNode).MassFlowRate) * CpFan * (RadInTemp - Node(FanOutletNode).Temp); ControlCompOutput(state, - VentSlab(Item).Name, - cMO_VentilatedSlab, + state.dataVentilatedSlab->VentSlab(Item).Name, + state.dataVentilatedSlab->cMO_VentilatedSlab, Item, FirstHVACIteration, QZnReq, @@ -3264,16 +3176,16 @@ namespace VentilatedSlab { MaxWaterFlow, MinWaterFlow, 0.001, - VentSlab(Item).ControlCompTypeNum, - VentSlab(Item).CompErrIndex, + state.dataVentilatedSlab->VentSlab(Item).ControlCompTypeNum, + state.dataVentilatedSlab->VentSlab(Item).CompErrIndex, _, _, _, _, _, - VentSlab(Item).CWLoopNum, - VentSlab(Item).CWLoopSide, - VentSlab(Item).CWBranchNum); + state.dataVentilatedSlab->VentSlab(Item).CWLoopNum, + state.dataVentilatedSlab->VentSlab(Item).CWLoopSide, + state.dataVentilatedSlab->VentSlab(Item).CWBranchNum); } } // ...end of HEATING/COOLING IF-THEN block @@ -3286,10 +3198,10 @@ namespace VentilatedSlab { // in CalcVentilatedSlabRadComps AirMassFlow = Node(OutletNode).MassFlowRate; Real64 locFanElecPower = 0.0; - if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { - locFanElecPower = HVACFan::fanObjs[VentSlab(Item).Fan_Index]->fanPower(); + if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { + locFanElecPower = HVACFan::fanObjs[state.dataVentilatedSlab->VentSlab(Item).Fan_Index]->fanPower(); } else { - locFanElecPower = Fans::GetFanPower(VentSlab(Item).Fan_Index); + locFanElecPower = Fans::GetFanPower(state.dataVentilatedSlab->VentSlab(Item).Fan_Index); } if ((AirMassFlow <= 0.0) && (locFanElecPower > 0.0)) { Node(MixoutNode).MassFlowRate = 0.0; @@ -3298,15 +3210,15 @@ namespace VentilatedSlab { Node(FanOutletNode).MassFlowRate = 0.0; Node(FanOutletNode).MassFlowRateMaxAvail = 0.0; Node(FanOutletNode).MassFlowRateMinAvail = 0.0; - if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { - HVACFan::fanObjs[VentSlab(Item).Fan_Index]->simulate(state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); - } else if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SimpleConstVolume) { + if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { + HVACFan::fanObjs[state.dataVentilatedSlab->VentSlab(Item).Fan_Index]->simulate(state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); + } else if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SimpleConstVolume) { Fans::SimulateFanComponents( - state, VentSlab(Item).FanName, FirstHVACIteration, VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); + state, state.dataVentilatedSlab->VentSlab(Item).FanName, FirstHVACIteration, state.dataVentilatedSlab->VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); } } - CalcVentilatedSlabCoilOutput(Item, PowerMet, LatOutputProvided); + CalcVentilatedSlabCoilOutput(state, Item, PowerMet, LatOutputProvided); } void CalcVentilatedSlabComps(EnergyPlusData &state, @@ -3334,9 +3246,6 @@ namespace VentilatedSlab { // that a cooling coil must be present in order to call a cooling coil // simulation. Other than that, the subroutine is very straightforward. - // REFERENCES: - // na - // Using/Aliasing using DataHVACGlobals::ZoneCompTurnFansOff; using DataHVACGlobals::ZoneCompTurnFansOn; @@ -3345,18 +3254,6 @@ namespace VentilatedSlab { using SteamCoils::SimulateSteamCoilComponents; using WaterCoils::SimulateWaterCoilComponents; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 AirMassFlow; // total mass flow through the system Real64 CpAirZn; // specific heat of dry air at zone conditions (zone conditions same as system inlet) @@ -3369,73 +3266,71 @@ namespace VentilatedSlab { Real64 HCoilInAirTemp; // unused1208 REAL(r64) :: RadInTemp ! Set temperature for "Slab In Node" - // FLOW: - - SimVentSlabOAMixer(Item); - if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { - HVACFan::fanObjs[VentSlab(Item).Fan_Index]->simulate(state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); - } else if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SimpleConstVolume) { + SimVentSlabOAMixer(state, Item); + if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { + HVACFan::fanObjs[state.dataVentilatedSlab->VentSlab(Item).Fan_Index]->simulate(state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); + } else if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SimpleConstVolume) { Fans::SimulateFanComponents( - state, VentSlab(Item).FanName, FirstHVACIteration, VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); + state, state.dataVentilatedSlab->VentSlab(Item).FanName, FirstHVACIteration, state.dataVentilatedSlab->VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); } - if ((VentSlab(Item).CCoilPresent) && (VentSlab(Item).CCoilSchedValue >= 0.0)) { - if (VentSlab(Item).CCoilType == Cooling_CoilHXAssisted) { - SimHXAssistedCoolingCoil(state, VentSlab(Item).CCoilName, FirstHVACIteration, On, 0.0, VentSlab(Item).CCoil_Index, ContFanCycCoil); + if ((state.dataVentilatedSlab->VentSlab(Item).CCoilPresent) && (state.dataVentilatedSlab->VentSlab(Item).CCoilSchedValue >= 0.0)) { + if (state.dataVentilatedSlab->VentSlab(Item).CCoilType == state.dataVentilatedSlab->Cooling_CoilHXAssisted) { + SimHXAssistedCoolingCoil(state, state.dataVentilatedSlab->VentSlab(Item).CCoilName, FirstHVACIteration, state.dataVentilatedSlab->On, 0.0, state.dataVentilatedSlab->VentSlab(Item).CCoil_Index, ContFanCycCoil); } else { - SimulateWaterCoilComponents(state, VentSlab(Item).CCoilName, FirstHVACIteration, VentSlab(Item).CCoil_Index); + SimulateWaterCoilComponents(state, state.dataVentilatedSlab->VentSlab(Item).CCoilName, FirstHVACIteration, state.dataVentilatedSlab->VentSlab(Item).CCoil_Index); } } - if ((VentSlab(Item).HCoilPresent) && (VentSlab(Item).HCoilSchedValue >= 0.0)) { + if ((state.dataVentilatedSlab->VentSlab(Item).HCoilPresent) && (state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue >= 0.0)) { { - auto const SELECT_CASE_var(VentSlab(Item).HCoilType); + auto const SELECT_CASE_var(state.dataVentilatedSlab->VentSlab(Item).HCoilType); - if (SELECT_CASE_var == Heating_WaterCoilType) { + if (SELECT_CASE_var == state.dataVentilatedSlab->Heating_WaterCoilType) { - SimulateWaterCoilComponents(state, VentSlab(Item).HCoilName, FirstHVACIteration, VentSlab(Item).HCoil_Index); + SimulateWaterCoilComponents(state, state.dataVentilatedSlab->VentSlab(Item).HCoilName, FirstHVACIteration, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); - } else if (SELECT_CASE_var == Heating_SteamCoilType) { + } else if (SELECT_CASE_var == state.dataVentilatedSlab->Heating_SteamCoilType) { - if (!HCoilOn) { + if (!state.dataVentilatedSlab->HCoilOn) { QCoilReq = 0.0; } else { - HCoilInAirNode = VentSlab(Item).FanOutletNode; + HCoilInAirNode = state.dataVentilatedSlab->VentSlab(Item).FanOutletNode; CpAirZn = PsyCpAirFnW(Node(HCoilInAirNode).HumRat); - QCoilReq = Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(VentSlab(Item).RadInNode).Temp) - (Node(HCoilInAirNode).Temp); + QCoilReq = Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).Temp) - (Node(HCoilInAirNode).Temp); } if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool - SimulateSteamCoilComponents(state, VentSlab(Item).HCoilName, FirstHVACIteration, VentSlab(Item).HCoil_Index, QCoilReq); + SimulateSteamCoilComponents(state, state.dataVentilatedSlab->VentSlab(Item).HCoilName, FirstHVACIteration, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index, QCoilReq); - } else if ((SELECT_CASE_var == Heating_ElectricCoilType) || (SELECT_CASE_var == Heating_GasCoilType)) { + } else if ((SELECT_CASE_var == state.dataVentilatedSlab->Heating_ElectricCoilType) || (SELECT_CASE_var == state.dataVentilatedSlab->Heating_GasCoilType)) { - if (!HCoilOn) { + if (!state.dataVentilatedSlab->HCoilOn) { QCoilReq = 0.0; } else { - HCoilInAirTemp = Node(VentSlab(Item).FanOutletNode).Temp; - HCoilOutAirTemp = Node(VentSlab(Item).RadInNode).Temp; - CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); - QCoilReq = Node(VentSlab(Item).FanOutletNode).MassFlowRate * CpAirZn * (HCoilOutAirTemp - HCoilInAirTemp); + HCoilInAirTemp = Node(state.dataVentilatedSlab->VentSlab(Item).FanOutletNode).Temp; + HCoilOutAirTemp = Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).Temp; + CpAirZn = PsyCpAirFnW(Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).HumRat); + QCoilReq = Node(state.dataVentilatedSlab->VentSlab(Item).FanOutletNode).MassFlowRate * CpAirZn * (HCoilOutAirTemp - HCoilInAirTemp); } if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool - SimulateHeatingCoilComponents(state, VentSlab(Item).HCoilName, FirstHVACIteration, QCoilReq, VentSlab(Item).HCoil_Index); + SimulateHeatingCoilComponents(state, state.dataVentilatedSlab->VentSlab(Item).HCoilName, FirstHVACIteration, QCoilReq, state.dataVentilatedSlab->VentSlab(Item).HCoil_Index); } } } - InletNode = VentSlab(Item).FanOutletNode; - OutletNode = VentSlab(Item).RadInNode; + InletNode = state.dataVentilatedSlab->VentSlab(Item).FanOutletNode; + OutletNode = state.dataVentilatedSlab->VentSlab(Item).RadInNode; AirMassFlow = Node(OutletNode).MassFlowRate; LoadMet = AirMassFlow * (PsyHFnTdbW(Node(OutletNode).Temp, Node(InletNode).HumRat) - PsyHFnTdbW(Node(InletNode).Temp, Node(InletNode).HumRat)); } - void CalcVentilatedSlabCoilOutput(int const Item, // system index in ventilated slab array + void CalcVentilatedSlabCoilOutput(EnergyPlusData &state, int const Item, // system index in ventilated slab array Real64 &PowerMet, // power supplied (W) Real64 &LatOutputProvided // latent capacity supplied (kg/s) ) @@ -3464,8 +3359,8 @@ namespace VentilatedSlab { // FLOW: - OutletNode = VentSlab(Item).RadInNode; - FanOutletNode = VentSlab(Item).FanOutletNode; + OutletNode = state.dataVentilatedSlab->VentSlab(Item).RadInNode; + FanOutletNode = state.dataVentilatedSlab->VentSlab(Item).FanOutletNode; AirMassFlow = Node(OutletNode).MassFlowRate; // QTotUnitOut = AirMassFlow * ( Node( OutletNode ).Enthalpy - Node( FanOutletNode ).Enthalpy ); @@ -3477,16 +3372,16 @@ namespace VentilatedSlab { QUnitOut = max(QUnitOut, QTotUnitOut); // Report variables... - VentSlab(Item).HeatCoilPower = max(0.0, QUnitOut); - VentSlab(Item).SensCoolCoilPower = std::abs(min(0.0, QUnitOut)); - VentSlab(Item).TotCoolCoilPower = std::abs(min(0.0, QTotUnitOut)); - VentSlab(Item).LateCoolCoilPower = VentSlab(Item).TotCoolCoilPower - VentSlab(Item).SensCoolCoilPower; - if (VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { - VentSlab(Item).ElecFanPower = HVACFan::fanObjs[VentSlab(Item).Fan_Index]->fanPower(); + state.dataVentilatedSlab->VentSlab(Item).HeatCoilPower = max(0.0, QUnitOut); + state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower = std::abs(min(0.0, QUnitOut)); + state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilPower = std::abs(min(0.0, QTotUnitOut)); + state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilPower = state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilPower - state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower; + if (state.dataVentilatedSlab->VentSlab(Item).FanType_Num == DataHVACGlobals::FanType_SystemModelObject) { + state.dataVentilatedSlab->VentSlab(Item).ElecFanPower = HVACFan::fanObjs[state.dataVentilatedSlab->VentSlab(Item).Fan_Index]->fanPower(); } else { - VentSlab(Item).ElecFanPower = Fans::GetFanPower(VentSlab(Item).Fan_Index); + state.dataVentilatedSlab->VentSlab(Item).ElecFanPower = Fans::GetFanPower(state.dataVentilatedSlab->VentSlab(Item).Fan_Index); } - VentSlab(Item).AirMassFlowRate = AirMassFlow; + state.dataVentilatedSlab->VentSlab(Item).AirMassFlowRate = AirMassFlow; SpecHumOut = Node(OutletNode).HumRat; SpecHumIn = Node(FanOutletNode).HumRat; @@ -3607,31 +3502,29 @@ namespace VentilatedSlab { static int EnergyImbalanceErrorCount(0); // Counts for # times a temperature mismatch is found in the energy balance check static bool FirstTimeFlag(true); // for setting size of Ckj, Cmj, AirTempOut arrays - // FLOW: - if (FirstTimeFlag) { - AirTempOut.allocate(MaxCloNumOfSurfaces); + AirTempOut.allocate(state.dataVentilatedSlab->MaxCloNumOfSurfaces); FirstTimeFlag = false; } Ckj = 0.0; Cmj = 0.0; - SlabInNode = VentSlab(Item).RadInNode; - FanOutletNode = VentSlab(Item).FanOutletNode; - OAInletNode = VentSlab(Item).OutsideAirNode; - MixoutNode = VentSlab(Item).OAMixerOutNode; - ReturnAirNode = VentSlab(Item).ReturnAirNode; - ZoneAirInNode = VentSlab(Item).ZoneAirInNode; + SlabInNode = state.dataVentilatedSlab->VentSlab(Item).RadInNode; + FanOutletNode = state.dataVentilatedSlab->VentSlab(Item).FanOutletNode; + OAInletNode = state.dataVentilatedSlab->VentSlab(Item).OutsideAirNode; + MixoutNode = state.dataVentilatedSlab->VentSlab(Item).OAMixerOutNode; + ReturnAirNode = state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode; + ZoneAirInNode = state.dataVentilatedSlab->VentSlab(Item).ZoneAirInNode; // Set the conditions on the air side inlet - ZoneNum = VentSlab(Item).ZonePtr; + ZoneNum = state.dataVentilatedSlab->VentSlab(Item).ZonePtr; ZoneMult = double(Zone(ZoneNum).Multiplier * Zone(ZoneNum).ListMultiplier); - AirMassFlow = Node(VentSlab(Item).RadInNode).MassFlowRate / ZoneMult; + AirMassFlow = Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).MassFlowRate / ZoneMult; - if (OperatingMode == HeatingMode) { + if (state.dataVentilatedSlab->OperatingMode == state.dataVentilatedSlab->HeatingMode) { - if ((!VentSlab(Item).HCoilPresent) || (VentSlab(Item).HCoilSchedValue <= 0.0)) { + if ((!state.dataVentilatedSlab->VentSlab(Item).HCoilPresent) || (state.dataVentilatedSlab->VentSlab(Item).HCoilSchedValue <= 0.0)) { AirTempIn = Node(FanOutletNode).Temp; Node(SlabInNode).Temp = Node(FanOutletNode).Temp; // If coil not available or running, then coil in and out temps same @@ -3642,9 +3535,9 @@ namespace VentilatedSlab { } } - if (OperatingMode == CoolingMode) { + if (state.dataVentilatedSlab->OperatingMode == state.dataVentilatedSlab->CoolingMode) { - if ((!VentSlab(Item).CCoilPresent) || (VentSlab(Item).CCoilSchedValue <= 0.0)) { + if ((!state.dataVentilatedSlab->VentSlab(Item).CCoilPresent) || (state.dataVentilatedSlab->VentSlab(Item).CCoilSchedValue <= 0.0)) { AirTempIn = Node(FanOutletNode).Temp; Node(SlabInNode).Temp = Node(FanOutletNode).Temp; // If coil not available or running, then coil in and out temps same @@ -3661,14 +3554,14 @@ namespace VentilatedSlab { // or a slight mismatch between zone and system controls. This is not // necessarily a "problem" so this exception is necessary in the code. - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); QRadSysSource(SurfNum) = 0.0; if (Surface(SurfNum).ExtBoundCond > 0 && Surface(SurfNum).ExtBoundCond != SurfNum) QRadSysSource(Surface(SurfNum).ExtBoundCond) = 0.0; // Also zero the other side of an interzone } - VentSlab(Item).SlabOutTemp = VentSlab(Item).SlabInTemp; + state.dataVentilatedSlab->VentSlab(Item).SlabOutTemp = state.dataVentilatedSlab->VentSlab(Item).SlabInTemp; // zero out node flows Node(SlabInNode).MassFlowRate = 0.0; @@ -3682,18 +3575,18 @@ namespace VentilatedSlab { if (AirMassFlow > 0.0) { - if ((VentSlab(Item).SysConfg == SlabOnly) || (VentSlab(Item).SysConfg == SlabAndZone)) { + if ((state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabOnly) || (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabAndZone)) { - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); // Determine the heat exchanger "effectiveness" term - EpsMdotCpAirZn = CalcVentSlabHXEffectTerm(Item, + EpsMdotCpAirZn = CalcVentSlabHXEffectTerm(state, Item, AirTempIn, AirMassFlow, - VentSlab(Item).SurfaceFlowFrac(RadSurfNum), - VentSlab(Item).CoreLength, - VentSlab(Item).CoreDiameter, - VentSlab(Item).CoreNumbers); + state.dataVentilatedSlab->VentSlab(Item).SurfaceFlowFrac(RadSurfNum), + state.dataVentilatedSlab->VentSlab(Item).CoreLength, + state.dataVentilatedSlab->VentSlab(Item).CoreDiameter, + state.dataVentilatedSlab->VentSlab(Item).CoreNumbers); // Obtain the heat balance coefficients and calculate the intermediate coefficients // linking the inlet air temperature to the heat source/sink to the radiant system. @@ -3717,11 +3610,11 @@ namespace VentilatedSlab { Ck = Cg + ((Ci * (Ca + Cb * Cd) + Cj * (Cd + Ce * Ca)) / (1.0 - Ce * Cb)); Cl = Ch + ((Ci * (Cc + Cb * Cf) + Cj * (Cf + Ce * Cc)) / (1.0 - Ce * Cb)); - Mdot = AirMassFlow * VentSlab(Item).SurfaceFlowFrac(RadSurfNum); - CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); + Mdot = AirMassFlow * state.dataVentilatedSlab->VentSlab(Item).SurfaceFlowFrac(RadSurfNum); + CpAirZn = PsyCpAirFnW(Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).HumRat); QRadSysSource(SurfNum) = - VentSlab(Item).CoreNumbers * EpsMdotCpAirZn * (AirTempIn - Ck) / (1.0 + (EpsMdotCpAirZn * Cl / Surface(SurfNum).Area)); + state.dataVentilatedSlab->VentSlab(Item).CoreNumbers * EpsMdotCpAirZn * (AirTempIn - Ck) / (1.0 + (EpsMdotCpAirZn * Cl / Surface(SurfNum).Area)); if (Surface(SurfNum).ExtBoundCond > 0 && Surface(SurfNum).ExtBoundCond != SurfNum) QRadSysSource(Surface(SurfNum).ExtBoundCond) = QRadSysSource(SurfNum); @@ -3736,8 +3629,8 @@ namespace VentilatedSlab { // is set to zero to avoid heating in cooling mode or cooling in heating // mode. - if (((OperatingMode == HeatingMode) && (QRadSysSource(SurfNum) <= 0.0)) || - ((OperatingMode == CoolingMode) && (QRadSysSource(SurfNum) >= 0.0))) { + if (((state.dataVentilatedSlab->OperatingMode == state.dataVentilatedSlab->HeatingMode) && (QRadSysSource(SurfNum) <= 0.0)) || + ((state.dataVentilatedSlab->OperatingMode == state.dataVentilatedSlab->CoolingMode) && (QRadSysSource(SurfNum) >= 0.0))) { // IF (.not. WarmupFlag) THEN // TempComparisonErrorCount = TempComparisonErrorCount + 1 @@ -3753,7 +3646,7 @@ namespace VentilatedSlab { // ELSE // CALL ShowRecurringWarningErrorAtEnd('Ventilated Slab ['//TRIM(VentSlab(Item)%Name)// & // '] Temperature Comparison Error shut-off occurrence continues.', & - // VentSlab(Item)%CondErrCount) + // state.dataVentilatedSlab->VentSlab(Item)%CondErrCount) // END IF // END IF @@ -3764,18 +3657,18 @@ namespace VentilatedSlab { Node(ReturnAirNode).MassFlowRate = 0.0; AirMassFlow = 0.0; - for (RadSurfNum2 = 1; RadSurfNum2 <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum2) { - SurfNum2 = VentSlab(Item).SurfacePtr(RadSurfNum2); + for (RadSurfNum2 = 1; RadSurfNum2 <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum2) { + SurfNum2 = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2); QRadSysSource(SurfNum2) = 0.0; if (Surface(SurfNum2).ExtBoundCond > 0 && Surface(SurfNum2).ExtBoundCond != SurfNum2) QRadSysSource(Surface(SurfNum2).ExtBoundCond) = 0.0; // Also zero the other side of an interzone - if (VentSlab(Item).SysConfg == SlabOnly) { + if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabOnly) { // Node(Returnairnode)%Temp = MAT(Zonenum) - Node(ReturnAirNode).Temp = TH(2, 1, VentSlab(Item).SurfacePtr(RadSurfNum)); + Node(ReturnAirNode).Temp = TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum)); Node(FanOutletNode).Temp = Node(ReturnAirNode).Temp; Node(SlabInNode).Temp = Node(FanOutletNode).Temp; - } else if (VentSlab(Item).SysConfg == SlabAndZone) { + } else if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabAndZone) { Node(ReturnAirNode).Temp = MAT(ZoneNum); Node(SlabInNode).Temp = Node(ReturnAirNode).Temp; Node(FanOutletNode).Temp = Node(SlabInNode).Temp; @@ -3791,10 +3684,10 @@ namespace VentilatedSlab { // A safety parameter is added (hardwired parameter) to avoid getting too close to condensation // conditions. - if (OperatingMode == CoolingMode) { - DewPointTemp = PsyTdpFnWPb(ZoneAirHumRat(VentSlab(Item).ZonePtr), OutBaroPress); - for (RadSurfNum2 = 1; RadSurfNum2 <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum2) { - if (TH(2, 1, VentSlab(Item).SurfacePtr(RadSurfNum2)) < (DewPointTemp + CondDeltaTemp)) { + if (state.dataVentilatedSlab->OperatingMode == state.dataVentilatedSlab->CoolingMode) { + DewPointTemp = PsyTdpFnWPb(ZoneAirHumRat(state.dataVentilatedSlab->VentSlab(Item).ZonePtr), OutBaroPress); + for (RadSurfNum2 = 1; RadSurfNum2 <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum2) { + if (TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)) < (DewPointTemp + CondDeltaTemp)) { // Condensation warning--must shut off radiant system Node(SlabInNode).MassFlowRate = 0.0; Node(FanOutletNode).MassFlowRate = 0.0; @@ -3803,8 +3696,8 @@ namespace VentilatedSlab { Node(ReturnAirNode).MassFlowRate = 0.0; Node(FanOutletNode).Temp = Node(SlabInNode).Temp; AirMassFlow = 0.0; - for (RadSurfNum3 = 1; RadSurfNum3 <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum3) { - SurfNum2 = VentSlab(Item).SurfacePtr(RadSurfNum3); + for (RadSurfNum3 = 1; RadSurfNum3 <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum3) { + SurfNum2 = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum3); QRadSysSource(SurfNum2) = 0.0; if (Surface(SurfNum2).ExtBoundCond > 0 && Surface(SurfNum2).ExtBoundCond != SurfNum2) QRadSysSource(Surface(SurfNum2).ExtBoundCond) = 0.0; // Also zero the other side of an interzone @@ -3813,13 +3706,13 @@ namespace VentilatedSlab { if (!WarmupFlag) { ++CondensationErrorCount; - if (VentSlab(Item).CondErrIndex == 0) { - ShowWarningMessage(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + ']'); - ShowContinueError("Surface [" + Surface(VentSlab(Item).SurfacePtr(RadSurfNum2)).Name + + if (state.dataVentilatedSlab->VentSlab(Item).CondErrIndex == 0) { + ShowWarningMessage(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + ']'); + ShowContinueError("Surface [" + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)).Name + "] temperature below dew-point temperature--potential for condensation exists"); ShowContinueError("Flow to the ventilated slab system will be shut-off to avoid condensation"); ShowContinueError("Predicted radiant system surface temperature = " + - RoundSigDigits(TH(2, 1, VentSlab(Item).SurfacePtr(RadSurfNum2)), 2)); + RoundSigDigits(TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)), 2)); ShowContinueError("Zone dew-point temperature + safety factor delta= " + RoundSigDigits(DewPointTemp + CondDeltaTemp, 2)); ShowContinueErrorTimeStamp(""); @@ -3829,9 +3722,9 @@ namespace VentilatedSlab { " C safety built-in to the shut-off criteria"); ShowContinueError("Note also that this affects all surfaces that are part of this system"); } - ShowRecurringWarningErrorAtEnd(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + + ShowRecurringWarningErrorAtEnd(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + "] condensation shut-off occurrence continues.", - VentSlab(Item).CondErrIndex, + state.dataVentilatedSlab->VentSlab(Item).CondErrIndex, DewPointTemp, DewPointTemp, _, @@ -3847,25 +3740,25 @@ namespace VentilatedSlab { // Total Radiant Power AirOutletTempCheck = 0.0; TotalVentSlabRadPower = 0.0; - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); TotalVentSlabRadPower += QRadSysSource(SurfNum); - AirOutletTempCheck += (VentSlab(Item).SurfaceFlowFrac(RadSurfNum) * AirTempOut(RadSurfNum)); + AirOutletTempCheck += (state.dataVentilatedSlab->VentSlab(Item).SurfaceFlowFrac(RadSurfNum) * AirTempOut(RadSurfNum)); } TotalVentSlabRadPower *= ZoneMult; // Return Air temp Check - if (VentSlab(Item).SysConfg == SlabOnly) { + if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabOnly) { if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).HumRat); Node(ReturnAirNode).Temp = Node(SlabInNode).Temp - (TotalVentSlabRadPower / (AirMassFlow * CpAirZn)); if ((std::abs(Node(ReturnAirNode).Temp - AirOutletTempCheck) > TempCheckLimit) && (std::abs(TotalVentSlabRadPower) > ZeroSystemResp)) { if (!WarmupFlag) { ++EnergyImbalanceErrorCount; - if (VentSlab(Item).EnrgyImbalErrIndex == 0) { - ShowWarningMessage(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + ']'); + if (state.dataVentilatedSlab->VentSlab(Item).EnrgyImbalErrIndex == 0) { + ShowWarningMessage(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + ']'); ShowContinueError("Ventilated Slab (slab only type) air outlet temperature calculation mismatch."); ShowContinueError("This should not happen as it indicates a potential energy imbalance in the calculations."); ShowContinueError("However, it could also result from improper input for the ventilated slab or"); @@ -3879,9 +3772,9 @@ namespace VentilatedSlab { RoundSigDigits(TotalVentSlabRadPower, 4)); ShowContinueErrorTimeStamp(""); } - ShowRecurringWarningErrorAtEnd(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + + ShowRecurringWarningErrorAtEnd(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + "] temperature calculation mismatch occurrence continues.", - VentSlab(Item).EnrgyImbalErrIndex); + state.dataVentilatedSlab->VentSlab(Item).EnrgyImbalErrIndex); } } } else { @@ -3889,7 +3782,7 @@ namespace VentilatedSlab { } } - if (VentSlab(Item).SysConfg == SlabAndZone) { + if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabAndZone) { if (AirMassFlow > 0.0) { Node(ZoneAirInNode).Temp = Node(SlabInNode).Temp - (TotalVentSlabRadPower / (AirMassFlow * CpAirZn)); if ((std::abs(Node(ZoneAirInNode).Temp - AirOutletTempCheck) > TempCheckLimit) && @@ -3897,8 +3790,8 @@ namespace VentilatedSlab { if (!WarmupFlag) { ++EnergyImbalanceErrorCount; - if (VentSlab(Item).EnrgyImbalErrIndex == 0) { - ShowWarningMessage(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + ']'); + if (state.dataVentilatedSlab->VentSlab(Item).EnrgyImbalErrIndex == 0) { + ShowWarningMessage(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + ']'); ShowContinueError("Ventilated Slab (slab only type) air outlet temperature calculation mismatch."); ShowContinueError("This should not happen as it indicates a potential energy imbalance in the calculations."); ShowContinueError("However, it could also result from improper input for the ventilated slab or"); @@ -3912,13 +3805,13 @@ namespace VentilatedSlab { RoundSigDigits(TotalVentSlabRadPower, 4)); ShowContinueErrorTimeStamp(""); } - ShowRecurringWarningErrorAtEnd(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + + ShowRecurringWarningErrorAtEnd(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + "] temperature calculation mismatch occurrence continues.", - VentSlab(Item).EnrgyImbalErrIndex); + state.dataVentilatedSlab->VentSlab(Item).EnrgyImbalErrIndex); } } // IF ((.NOT. FirstHVACIteration) .AND. & - // (ABS(Node(ReturnAirNode)%Temp-MAT(Zonenum)) > VentSlabAirTempToler))THEN + // (ABS(Node(ReturnAirNode)%Temp-MAT(Zonenum)) > state.dataVentilatedSlab->VentSlabAirTempToler))THEN // NeedtoIterate = .TRUE. // END IF // Node(ReturnAirNode)%Temp = MAT(Zonenum) @@ -3937,19 +3830,19 @@ namespace VentilatedSlab { } // SYSCONFIG. SLABONLY&SLABANDZONE - if (VentSlab(Item).SysConfg == SeriesSlabs) { + if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SeriesSlabs) { - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - CNumDS = VentSlab(Item).CNumbers(RadSurfNum); - CLengDS = VentSlab(Item).CLength(RadSurfNum); // for check - CDiaDS = VentSlab(Item).CDiameter(RadSurfNum); // for check + CNumDS = state.dataVentilatedSlab->VentSlab(Item).CNumbers(RadSurfNum); + CLengDS = state.dataVentilatedSlab->VentSlab(Item).CLength(RadSurfNum); // for check + CDiaDS = state.dataVentilatedSlab->VentSlab(Item).CDiameter(RadSurfNum); // for check FlowFrac = 1.0; - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); // Determine the heat exchanger "effectiveness" term - EpsMdotCpAirZn = CalcVentSlabHXEffectTerm(Item, AirTempIn, AirMassFlow, FlowFrac, CLengDS, CDiaDS, CNumDS); + EpsMdotCpAirZn = CalcVentSlabHXEffectTerm(state, Item, AirTempIn, AirMassFlow, FlowFrac, CLengDS, CDiaDS, CNumDS); // Obtain the heat balance coefficients and calculate the intermediate coefficients // linking the inlet air temperature to the heat source/sink to the radiant system. @@ -3974,7 +3867,7 @@ namespace VentilatedSlab { Cl = Ch + ((Ci * (Cc + Cb * Cf) + Cj * (Cf + Ce * Cc)) / (1.0 - Ce * Cb)); Mdot = AirMassFlow * FlowFrac; - CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).HumRat); QRadSysSource(SurfNum) = CNumDS * EpsMdotCpAirZn * (AirTempIn - Ck) / (1.0 + (EpsMdotCpAirZn * Cl / Surface(SurfNum).Area)); @@ -3993,8 +3886,8 @@ namespace VentilatedSlab { // mode. if (RadSurfNum == 1) { - if (((OperatingMode == HeatingMode) && (QRadSysSource(SurfNum) <= 0.0)) || - ((OperatingMode == CoolingMode) && (QRadSysSource(SurfNum) >= 0.0))) { + if (((state.dataVentilatedSlab->OperatingMode == state.dataVentilatedSlab->HeatingMode) && (QRadSysSource(SurfNum) <= 0.0)) || + ((state.dataVentilatedSlab->OperatingMode == state.dataVentilatedSlab->CoolingMode) && (QRadSysSource(SurfNum) >= 0.0))) { // IF (.not. WarmupFlag) THEN // TempComparisonErrorCount = TempComparisonErrorCount + 1 // IF (TempComparisonErrorCount <= NumOfVentSlabs) THEN @@ -4010,7 +3903,7 @@ namespace VentilatedSlab { // ELSE // CALL ShowRecurringWarningErrorAtEnd('Ventilated Slab ['//TRIM(VentSlab(Item)%Name)// & // '] shut-off occurrence continues due to temperature comparison error.', & - // VentSlab(Item)%CondErrCount) + // state.dataVentilatedSlab->VentSlab(Item)%CondErrCount) // END IF // END IF @@ -4021,13 +3914,13 @@ namespace VentilatedSlab { Node(ReturnAirNode).MassFlowRate = 0.0; AirMassFlow = 0.0; - for (RadSurfNum2 = 1; RadSurfNum2 <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum2) { - SurfNum2 = VentSlab(Item).SurfacePtr(RadSurfNum2); + for (RadSurfNum2 = 1; RadSurfNum2 <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum2) { + SurfNum2 = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2); QRadSysSource(SurfNum2) = 0.0; if (Surface(SurfNum2).ExtBoundCond > 0 && Surface(SurfNum2).ExtBoundCond != SurfNum2) QRadSysSource(Surface(SurfNum2).ExtBoundCond) = 0.0; // Also zero the other side of an interzone } - Node(ReturnAirNode).Temp = TH(2, 1, VentSlab(Item).SurfacePtr(1)); + Node(ReturnAirNode).Temp = TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)); Node(FanOutletNode).Temp = Node(ReturnAirNode).Temp; Node(SlabInNode).Temp = Node(FanOutletNode).Temp; // Each Internal node is reseted at the surface temperature @@ -4041,10 +3934,10 @@ namespace VentilatedSlab { // A safety parameter is added (hardwired parameter) to avoid getting too close to condensation // conditions. - if (OperatingMode == CoolingMode) { - DewPointTemp = PsyTdpFnWPb(ZoneAirHumRat(VentSlab(Item).ZPtr(RadSurfNum)), OutBaroPress); - for (RadSurfNum2 = 1; RadSurfNum2 <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum2) { - if (TH(2, 1, VentSlab(Item).SurfacePtr(RadSurfNum2)) < (DewPointTemp + CondDeltaTemp)) { + if (state.dataVentilatedSlab->OperatingMode == state.dataVentilatedSlab->CoolingMode) { + DewPointTemp = PsyTdpFnWPb(ZoneAirHumRat(state.dataVentilatedSlab->VentSlab(Item).ZPtr(RadSurfNum)), OutBaroPress); + for (RadSurfNum2 = 1; RadSurfNum2 <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum2) { + if (TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)) < (DewPointTemp + CondDeltaTemp)) { // Condensation warning--must shut off radiant system Node(SlabInNode).MassFlowRate = 0.0; Node(FanOutletNode).MassFlowRate = 0.0; @@ -4053,8 +3946,8 @@ namespace VentilatedSlab { Node(ReturnAirNode).MassFlowRate = 0.0; Node(FanOutletNode).Temp = Node(SlabInNode).Temp; AirMassFlow = 0.0; - for (RadSurfNum3 = 1; RadSurfNum3 <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum3) { - SurfNum2 = VentSlab(Item).SurfacePtr(RadSurfNum3); + for (RadSurfNum3 = 1; RadSurfNum3 <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum3) { + SurfNum2 = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum3); QRadSysSource(SurfNum2) = 0.0; if (Surface(SurfNum2).ExtBoundCond > 0 && Surface(SurfNum2).ExtBoundCond != SurfNum2) QRadSysSource(Surface(SurfNum2).ExtBoundCond) = 0.0; // Also zero the other side of an interzone @@ -4062,13 +3955,13 @@ namespace VentilatedSlab { // Produce a warning message so that user knows the system was shut-off due to potential for condensation if (!WarmupFlag) { ++CondensationErrorCount; - if (VentSlab(Item).CondErrIndex == 0) { - ShowWarningMessage(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + ']'); - ShowContinueError("Surface [" + Surface(VentSlab(Item).SurfacePtr(RadSurfNum2)).Name + + if (state.dataVentilatedSlab->VentSlab(Item).CondErrIndex == 0) { + ShowWarningMessage(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + ']'); + ShowContinueError("Surface [" + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)).Name + "] temperature below dew-point temperature--potential for condensation exists"); ShowContinueError("Flow to the ventilated slab system will be shut-off to avoid condensation"); ShowContinueError("Predicted radiant system surface temperature = " + - RoundSigDigits(TH(2, 1, VentSlab(Item).SurfacePtr(RadSurfNum2)), 2)); + RoundSigDigits(TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)), 2)); ShowContinueError("Zone dew-point temperature + safety factor delta= " + RoundSigDigits(DewPointTemp + CondDeltaTemp, 2)); ShowContinueErrorTimeStamp(""); @@ -4078,9 +3971,9 @@ namespace VentilatedSlab { " C safety built-in to the shut-off criteria"); ShowContinueError("Note also that this affects all surfaces that are part of this system"); } - ShowRecurringWarningErrorAtEnd(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + + ShowRecurringWarningErrorAtEnd(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + "] condensation shut-off occurrence continues.", - VentSlab(Item).CondErrIndex, + state.dataVentilatedSlab->VentSlab(Item).CondErrIndex, DewPointTemp, DewPointTemp, _, @@ -4096,8 +3989,8 @@ namespace VentilatedSlab { // Total Radiant Power AirOutletTempCheck = 0.0; TotalVentSlabRadPower = 0.0; - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); TotalVentSlabRadPower += QRadSysSource(SurfNum); AirOutletTempCheck = AirTempOut(RadSurfNum); } @@ -4107,21 +4000,21 @@ namespace VentilatedSlab { MSlabAirInTemp = Node(SlabInNode).Temp; - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - SlabName = VentSlab(Item).SurfaceName(RadSurfNum); - MSlabIn = VentSlab(Item).SlabIn(RadSurfNum); - MSlabOut = VentSlab(Item).SlabOut(RadSurfNum); - VentSlab(Item).MSlabInNode = GetOnlySingleNode(state, + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + SlabName = state.dataVentilatedSlab->VentSlab(Item).SurfaceName(RadSurfNum); + MSlabIn = state.dataVentilatedSlab->VentSlab(Item).SlabIn(RadSurfNum); + MSlabOut = state.dataVentilatedSlab->VentSlab(Item).SlabOut(RadSurfNum); + state.dataVentilatedSlab->VentSlab(Item).MSlabInNode = GetOnlySingleNode(state, MSlabIn, ErrorsFound, CurrentModuleObject, SlabName, NodeType_Air, NodeConnectionType_Internal, 1, ObjectIsNotParent); - VentSlab(Item).MSlabOutNode = GetOnlySingleNode(state, + state.dataVentilatedSlab->VentSlab(Item).MSlabOutNode = GetOnlySingleNode(state, MSlabOut, ErrorsFound, CurrentModuleObject, SlabName, NodeType_Air, NodeConnectionType_Internal, 1, ObjectIsNotParent); - MSlabInletNode = VentSlab(Item).MSlabInNode; - MSlabOutletNode = VentSlab(Item).MSlabOutNode; - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); + MSlabInletNode = state.dataVentilatedSlab->VentSlab(Item).MSlabInNode; + MSlabOutletNode = state.dataVentilatedSlab->VentSlab(Item).MSlabOutNode; + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).HumRat); Node(MSlabInletNode).Temp = MSlabAirInTemp; Node(MSlabOutletNode).Temp = Node(MSlabInletNode).Temp - (QRadSysSource(SurfNum) / (AirMassFlow * CpAirZn)); @@ -4135,7 +4028,7 @@ namespace VentilatedSlab { // Return Air temp Check if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).HumRat); Node(ReturnAirNode).Temp = Node(SlabInNode).Temp - (TotalVentSlabRadPower / (AirMassFlow * CpAirZn)); if ((std::abs(Node(ReturnAirNode).Temp - AirOutletTempCheck) > TempCheckLimit) && @@ -4143,8 +4036,8 @@ namespace VentilatedSlab { if (!WarmupFlag) { ++EnergyImbalanceErrorCount; - if (VentSlab(Item).EnrgyImbalErrIndex == 0) { - ShowWarningMessage(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + ']'); + if (state.dataVentilatedSlab->VentSlab(Item).EnrgyImbalErrIndex == 0) { + ShowWarningMessage(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + ']'); ShowContinueError("Ventilated Slab (slab only type) air outlet temperature calculation mismatch."); ShowContinueError("This should not happen as it indicates a potential energy imbalance in the calculations."); ShowContinueError("However, it could also result from improper input for the ventilated slab or"); @@ -4157,9 +4050,9 @@ namespace VentilatedSlab { ShowContinueError("Total energy rate (power) [W] added to the slab = " + RoundSigDigits(TotalVentSlabRadPower, 4)); ShowContinueErrorTimeStamp(""); } - ShowRecurringWarningErrorAtEnd(cMO_VentilatedSlab + " [" + VentSlab(Item).Name + + ShowRecurringWarningErrorAtEnd(state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + "] temperature calculation mismatch occurrence continues.", - VentSlab(Item).EnrgyImbalErrIndex); + state.dataVentilatedSlab->VentSlab(Item).EnrgyImbalErrIndex); } } @@ -4180,7 +4073,7 @@ namespace VentilatedSlab { } //(AirMassFlow > 0.0d0) } - void SimVentSlabOAMixer(int const Item) // System index in Ventilated Slab array + void SimVentSlabOAMixer(EnergyPlusData &state, int const Item) // System index in Ventilated Slab array { // SUBROUTINE INFORMATION: @@ -4206,24 +4099,6 @@ namespace VentilatedSlab { // rates and perform an energy balance on the mixing of the return and // outdoor air streams. - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int AirRelNode; // relief air node number in ventilated slab loop int InletNode; // inlet node number for ventilated slab loop @@ -4232,20 +4107,20 @@ namespace VentilatedSlab { int OutsideAirNode; // outside air node number in ventilated slab loop // FLOW: - AirRelNode = VentSlab(Item).AirReliefNode; - InletNode = VentSlab(Item).ReturnAirNode; - OAMixOutNode = VentSlab(Item).OAMixerOutNode; - OutsideAirNode = VentSlab(Item).OutsideAirNode; + AirRelNode = state.dataVentilatedSlab->VentSlab(Item).AirReliefNode; + InletNode = state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode; + OAMixOutNode = state.dataVentilatedSlab->VentSlab(Item).OAMixerOutNode; + OutsideAirNode = state.dataVentilatedSlab->VentSlab(Item).OutsideAirNode; // "Resolve" the air flow rates... - Node(OutsideAirNode).MassFlowRate = OAMassFlowRate; - Node(OutsideAirNode).MassFlowRateMinAvail = OAMassFlowRate; - Node(OutsideAirNode).MassFlowRateMaxAvail = OAMassFlowRate; + Node(OutsideAirNode).MassFlowRate = state.dataVentilatedSlab->OAMassFlowRate; + Node(OutsideAirNode).MassFlowRateMinAvail = state.dataVentilatedSlab->OAMassFlowRate; + Node(OutsideAirNode).MassFlowRateMaxAvail = state.dataVentilatedSlab->OAMassFlowRate; - Node(AirRelNode).MassFlowRate = OAMassFlowRate; - Node(AirRelNode).MassFlowRateMinAvail = OAMassFlowRate; - Node(AirRelNode).MassFlowRateMaxAvail = OAMassFlowRate; + Node(AirRelNode).MassFlowRate = state.dataVentilatedSlab->OAMassFlowRate; + Node(AirRelNode).MassFlowRateMinAvail = state.dataVentilatedSlab->OAMassFlowRate; + Node(AirRelNode).MassFlowRateMaxAvail = state.dataVentilatedSlab->OAMassFlowRate; Node(OAMixOutNode).MassFlowRate = Node(InletNode).MassFlowRate; Node(OAMixOutNode).MassFlowRateMinAvail = Node(InletNode).MassFlowRate; @@ -4277,7 +4152,7 @@ namespace VentilatedSlab { Node(OAMixOutNode).Press = Node(InletNode).Press; } - void UpdateVentilatedSlab(int const Item, // Index for the ventilated slab under consideration within the derived types + void UpdateVentilatedSlab(EnergyPlusData &state, int const Item, // Index for the ventilated slab under consideration within the derived types bool const EP_UNUSED(FirstHVACIteration) // TRUE if 1st HVAC simulation of system timestep !unused1208 ) { @@ -4304,9 +4179,6 @@ namespace VentilatedSlab { // time step elapsed is different, then we just need to add the new // values to the running average. - // REFERENCES: - // na - // Using/Aliasing using DataGlobals::TimeStepZone; using DataHeatBalance::Zone; @@ -4315,18 +4187,6 @@ namespace VentilatedSlab { using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 CpAppAir; // Specific heat of air int RadSurfNum; // DO loop counter for radiant surfaces in the ventilated slab @@ -4345,42 +4205,42 @@ namespace VentilatedSlab { int ZoneInletNode; // Node number for the air side inlet of the ventilated slab // FLOW: - ZoneNum = VentSlab(Item).ZonePtr; - TotRadSurfaces = VentSlab(Item).NumOfSurfaces; - MixOutNode = VentSlab(Item).OAMixerOutNode; - OANode = VentSlab(Item).OutsideAirNode; - AirOutletNode = VentSlab(Item).RadInNode; - FanOutNode = VentSlab(Item).FanOutletNode; + ZoneNum = state.dataVentilatedSlab->VentSlab(Item).ZonePtr; + TotRadSurfaces = state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; + MixOutNode = state.dataVentilatedSlab->VentSlab(Item).OAMixerOutNode; + OANode = state.dataVentilatedSlab->VentSlab(Item).OutsideAirNode; + AirOutletNode = state.dataVentilatedSlab->VentSlab(Item).RadInNode; + FanOutNode = state.dataVentilatedSlab->VentSlab(Item).FanOutletNode; AirMassFlow = Node(AirOutletNode).MassFlowRate; - ZoneInletNode = VentSlab(Item).ZoneAirInNode; + ZoneInletNode = state.dataVentilatedSlab->VentSlab(Item).ZoneAirInNode; CpAppAir = PsyCpAirFnW(Node(AirOutletNode).HumRat); - AirInletNode = VentSlab(Item).ReturnAirNode; + AirInletNode = state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode; for (RadSurfNum = 1; RadSurfNum <= TotRadSurfaces; ++RadSurfNum) { - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); - if (LastSysTimeElapsed(SurfNum) == SysTimeElapsed) { + if (state.dataVentilatedSlab->LastSysTimeElapsed(SurfNum) == SysTimeElapsed) { // Still iterating or reducing system time step, so subtract old values which were // not valid - QRadSysSrcAvg(SurfNum) -= LastQRadSysSrc(SurfNum) * LastTimeStepSys(SurfNum) / TimeStepZone; + state.dataVentilatedSlab->QRadSysSrcAvg(SurfNum) -= state.dataVentilatedSlab->LastQRadSysSrc(SurfNum) * state.dataVentilatedSlab->LastTimeStepSys(SurfNum) / TimeStepZone; } // Update the running average and the "last" values with the current values of the appropriate variables - QRadSysSrcAvg(SurfNum) += QRadSysSource(SurfNum) * TimeStepSys / TimeStepZone; + state.dataVentilatedSlab->QRadSysSrcAvg(SurfNum) += QRadSysSource(SurfNum) * TimeStepSys / TimeStepZone; - LastQRadSysSrc(SurfNum) = QRadSysSource(SurfNum); - LastSysTimeElapsed(SurfNum) = SysTimeElapsed; - LastTimeStepSys(SurfNum) = TimeStepSys; + state.dataVentilatedSlab->LastQRadSysSrc(SurfNum) = QRadSysSource(SurfNum); + state.dataVentilatedSlab->LastSysTimeElapsed(SurfNum) = SysTimeElapsed; + state.dataVentilatedSlab->LastTimeStepSys(SurfNum) = TimeStepSys; } // First sum up all of the heat sources/sinks associated with this system TotalHeatSource = 0.0; - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); TotalHeatSource += QRadSysSource(SurfNum); } - ZoneNum = VentSlab(Item).ZonePtr; + ZoneNum = state.dataVentilatedSlab->VentSlab(Item).ZonePtr; ZoneMult = double(Zone(ZoneNum).Multiplier * Zone(ZoneNum).ListMultiplier); TotalHeatSource *= ZoneMult; @@ -4388,26 +4248,26 @@ namespace VentilatedSlab { if ((CpAppAir > 0.0) && (AirMassFlow > 0.0)) { - if ((VentSlab(Item).SysConfg == SlabOnly) || (VentSlab(Item).SysConfg == SeriesSlabs)) { + if ((state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabOnly) || (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SeriesSlabs)) { Node(AirInletNode) = Node(AirInletNode); Node(AirInletNode).Temp = Node(AirOutletNode).Temp - TotalHeatSource / AirMassFlow / CpAppAir; Node(AirInletNode).MassFlowRate = Node(AirOutletNode).MassFlowRate; Node(AirInletNode).HumRat = Node(AirOutletNode).HumRat; - } else if (VentSlab(Item).SysConfg == SlabAndZone) { + } else if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabAndZone) { Node(ZoneInletNode) = Node(ZoneInletNode); Node(ZoneInletNode).Temp = Node(AirOutletNode).Temp - TotalHeatSource / AirMassFlow / CpAppAir; Node(ZoneInletNode).MassFlowRate = Node(AirOutletNode).MassFlowRate; Node(ZoneInletNode).HumRat = Node(AirOutletNode).HumRat; - Node(VentSlab(Item).ReturnAirNode).Temp = MAT(ZoneNum); + Node(state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode).Temp = MAT(ZoneNum); } } else { - if ((VentSlab(Item).SysConfg == SlabOnly) || (VentSlab(Item).SysConfg == SeriesSlabs)) { + if ((state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabOnly) || (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SeriesSlabs)) { Node(FanOutNode) = Node(AirOutletNode); QRadSysSource(SurfNum) = 0.0; - } else if (VentSlab(Item).SysConfg == SlabAndZone) { + } else if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabAndZone) { Node(ZoneInletNode) = Node(AirInletNode); Node(FanOutNode) = Node(AirOutletNode); // Fan Resolve QRadSysSource(SurfNum) = 0.0; @@ -4438,7 +4298,7 @@ namespace VentilatedSlab { } } - Real64 CalcVentSlabHXEffectTerm(int const Item, // Index number of radiant system under consideration + Real64 CalcVentSlabHXEffectTerm(EnergyPlusData &state, int const Item, // Index number of radiant system under consideration Real64 const Temperature, // Temperature of air entering the radiant system, in C Real64 const AirMassFlow, // Mass flow rate of water in the radiant system, in kg/s Real64 const FlowFraction, // Mass flow rate fraction for this surface in the radiant system @@ -4480,10 +4340,6 @@ namespace VentilatedSlab { // Return value Real64 CalcVentSlabHXEffectTerm; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: Real64 const MaxLaminarRe(2300.0); // Maximum Reynolds number for laminar flow int const NumOfPropDivisions(13); Real64 const MaxExpPower(50.0); // Maximum power after which EXP argument would be zero for DP variables @@ -4508,12 +4364,6 @@ namespace VentilatedSlab { {0.01275, 0.0255, 0.0258, 0.0261, 0.0264, 0.0267, 0.02705, 0.0274, 0.02775, 0.0281, 0.0284, 0.0287, 0.01435}); // Conductivity, in W/mK static Array1D const Pr(NumOfPropDivisions, 0.69); // Prandtl number (dimensionless) - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Index; Real64 InterpFrac; @@ -4551,7 +4401,7 @@ namespace VentilatedSlab { PRactual = Pr(Index - 1) + InterpFrac * (Pr(Index) - Pr(Index - 1)); } // arguments are glycol name, temperature, and concentration - CpAppAir = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); + CpAppAir = PsyCpAirFnW(Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).HumRat); SysAirMassFlow = AirMassFlow / CoreNumbers; // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) @@ -4652,7 +4502,7 @@ namespace VentilatedSlab { return SumHATsurf; } - void ReportVentilatedSlab(int const Item) // Index for the ventilated slab under consideration within the derived types + void ReportVentilatedSlab(EnergyPlusData &state, int const Item) // Index for the ventilated slab under consideration within the derived types { // SUBROUTINE INFORMATION: @@ -4667,9 +4517,6 @@ namespace VentilatedSlab { // METHODOLOGY EMPLOYED: // Standard EnergyPlus methodology. - // REFERENCES: - // na - // Using/Aliasing using DataGlobals::SecInHour; using DataHeatBalance::Zone; @@ -4678,73 +4525,58 @@ namespace VentilatedSlab { using DataSurfaces::Surface; // unused-12/12/08 USE FluidProperties, ONLY : GetSpecificHeatGlycol - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int RadSurfNum; // DO loop counter for radiant surfaces in the system int SurfNum; // Surface number (index) in Surface derived type Real64 TotalVentSlabRadPower; // Total source/sink power for the radiant system (sum of all surfaces of the system) Real64 ZoneMult; // Total zone multiplier to apply to the system level variables - // FLOW: - // Slab Part TotalVentSlabRadPower = 0.0; ZoneMult = 1.0; - for (RadSurfNum = 1; RadSurfNum <= VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { - SurfNum = VentSlab(Item).SurfacePtr(RadSurfNum); + for (RadSurfNum = 1; RadSurfNum <= state.dataVentilatedSlab->VentSlab(Item).NumOfSurfaces; ++RadSurfNum) { + SurfNum = state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum); TotalVentSlabRadPower += QRadSysSource(SurfNum); } - ZoneMult = double(Zone(VentSlab(Item).ZonePtr).Multiplier * Zone(VentSlab(Item).ZonePtr).ListMultiplier); + ZoneMult = double(Zone(state.dataVentilatedSlab->VentSlab(Item).ZonePtr).Multiplier * Zone(state.dataVentilatedSlab->VentSlab(Item).ZonePtr).ListMultiplier); TotalVentSlabRadPower *= ZoneMult; - VentSlab(Item).RadHeatingPower = 0.0; - VentSlab(Item).RadCoolingPower = 0.0; + state.dataVentilatedSlab->VentSlab(Item).RadHeatingPower = 0.0; + state.dataVentilatedSlab->VentSlab(Item).RadCoolingPower = 0.0; if (TotalVentSlabRadPower >= 0.01) { - VentSlab(Item).RadHeatingPower = +TotalVentSlabRadPower; + state.dataVentilatedSlab->VentSlab(Item).RadHeatingPower = +TotalVentSlabRadPower; } else { - VentSlab(Item).RadCoolingPower = -TotalVentSlabRadPower; + state.dataVentilatedSlab->VentSlab(Item).RadCoolingPower = -TotalVentSlabRadPower; } - VentSlab(Item).RadHeatingEnergy = VentSlab(Item).RadHeatingPower * TimeStepSys * SecInHour; - VentSlab(Item).RadCoolingEnergy = VentSlab(Item).RadCoolingPower * TimeStepSys * SecInHour; + state.dataVentilatedSlab->VentSlab(Item).RadHeatingEnergy = state.dataVentilatedSlab->VentSlab(Item).RadHeatingPower * TimeStepSys * SecInHour; + state.dataVentilatedSlab->VentSlab(Item).RadCoolingEnergy = state.dataVentilatedSlab->VentSlab(Item).RadCoolingPower * TimeStepSys * SecInHour; // Coil Part - VentSlab(Item).HeatCoilEnergy = VentSlab(Item).HeatCoilPower * TimeStepSys * SecInHour; - VentSlab(Item).SensCoolCoilEnergy = VentSlab(Item).SensCoolCoilPower * TimeStepSys * SecInHour; - VentSlab(Item).LateCoolCoilEnergy = VentSlab(Item).LateCoolCoilPower * TimeStepSys * SecInHour; - VentSlab(Item).TotCoolCoilEnergy = VentSlab(Item).TotCoolCoilPower * TimeStepSys * SecInHour; - VentSlab(Item).ElecFanEnergy = VentSlab(Item).ElecFanPower * TimeStepSys * SecInHour; - - if ((VentSlab(Item).SysConfg == SlabOnly) || (VentSlab(Item).SysConfg == SeriesSlabs)) { - VentSlab(Item).SlabInTemp = Node(VentSlab(Item).RadInNode).Temp; - VentSlab(Item).SlabOutTemp = Node(VentSlab(Item).ReturnAirNode).Temp; - - } else if (VentSlab(Item).SysConfg == SlabAndZone) { - VentSlab(Item).SlabInTemp = Node(VentSlab(Item).RadInNode).Temp; - VentSlab(Item).ZoneInletTemp = Node(VentSlab(Item).ZoneAirInNode).Temp; - VentSlab(Item).SlabOutTemp = Node(VentSlab(Item).ReturnAirNode).Temp; + state.dataVentilatedSlab->VentSlab(Item).HeatCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).HeatCoilPower * TimeStepSys * SecInHour; + state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower * TimeStepSys * SecInHour; + state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilPower * TimeStepSys * SecInHour; + state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilPower * TimeStepSys * SecInHour; + state.dataVentilatedSlab->VentSlab(Item).ElecFanEnergy = state.dataVentilatedSlab->VentSlab(Item).ElecFanPower * TimeStepSys * SecInHour; + + if ((state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabOnly) || (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SeriesSlabs)) { + state.dataVentilatedSlab->VentSlab(Item).SlabInTemp = Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).Temp; + state.dataVentilatedSlab->VentSlab(Item).SlabOutTemp = Node(state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode).Temp; + + } else if (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabAndZone) { + state.dataVentilatedSlab->VentSlab(Item).SlabInTemp = Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).Temp; + state.dataVentilatedSlab->VentSlab(Item).ZoneInletTemp = Node(state.dataVentilatedSlab->VentSlab(Item).ZoneAirInNode).Temp; + state.dataVentilatedSlab->VentSlab(Item).SlabOutTemp = Node(state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode).Temp; } - VentSlab(Item).ReturnAirTemp = Node(VentSlab(Item).ReturnAirNode).Temp; - VentSlab(Item).FanOutletTemp = Node(VentSlab(Item).FanOutletNode).Temp; + state.dataVentilatedSlab->VentSlab(Item).ReturnAirTemp = Node(state.dataVentilatedSlab->VentSlab(Item).ReturnAirNode).Temp; + state.dataVentilatedSlab->VentSlab(Item).FanOutletTemp = Node(state.dataVentilatedSlab->VentSlab(Item).FanOutletNode).Temp; - if (VentSlab(Item).FirstPass) { // reset sizing flags so other zone equipment can size normally + if (state.dataVentilatedSlab->VentSlab(Item).FirstPass) { // reset sizing flags so other zone equipment can size normally if (!DataGlobals::SysSizingCalc) { - DataSizing::resetHVACSizingGlobals(DataSizing::CurZoneEqNum, 0, VentSlab(Item).FirstPass); + DataSizing::resetHVACSizingGlobals(DataSizing::CurZoneEqNum, 0, state.dataVentilatedSlab->VentSlab(Item).FirstPass); } } } diff --git a/src/EnergyPlus/VentilatedSlab.hh b/src/EnergyPlus/VentilatedSlab.hh index 35a7a434966..27883000fcc 100644 --- a/src/EnergyPlus/VentilatedSlab.hh +++ b/src/EnergyPlus/VentilatedSlab.hh @@ -62,76 +62,6 @@ struct EnergyPlusData; namespace VentilatedSlab { - // Using/Aliasing - - // Data - // MODULE PARAMETER DEFINITIONS - - // Module Object - extern std::string const cMO_VentilatedSlab; - - // Parameters for outside air control types: - extern int const Heating_ElectricCoilType; - extern int const Heating_GasCoilType; - extern int const Heating_WaterCoilType; - extern int const Heating_SteamCoilType; - extern int const Cooling_CoilWaterCooling; - extern int const Cooling_CoilDetailedCooling; - extern int const Cooling_CoilHXAssisted; - extern int const VariablePercent; - extern int const FixedTemperature; - extern int const FixedOAControl; - extern int const NotOperating; // Parameter for use with OperatingMode variable, set for no heating/cooling - extern int const HeatingMode; // Parameter for use with OperatingMode variable, set for heating - extern int const CoolingMode; // Parameter for use with OperatingMode variable, set for cooling - // Ventilated Slab Configurations - extern int const SlabOnly; // Air circulate through cores of slab only - extern int const SlabAndZone; // Circulated Air is introduced to zone - extern int const SeriesSlabs; - // Control Types - extern int const MATControl; // Controls system using mean air temperature - extern int const MRTControl; // Controls system using mean radiant temperature - extern int const OPTControl; // Controls system using operative temperature - extern int const ODBControl; // Controls system using outside air dry-bulb temperature - extern int const OWBControl; // Controls system using outside air wet-bulb temperature - extern int const SURControl; // Controls system using surface temperature !Phase2-A - extern int const DPTZControl; // Controls system using dew-point temperature of zone!Phase2-A - - // coil operation - extern int const On; // normal coil operation - extern int const Off; // signal coil shouldn't run - extern int const NoneOption; - extern int const BothOption; - extern int const HeatingOption; - extern int const CoolingOption; - extern int OperatingMode; // Used to keep track of whether system is in heating or cooling mode - - // DERIVED TYPE DEFINITIONS - - // MODULE VARIABLE DECLARATIONS: - extern bool HCoilOn; // TRUE if the heating coil (gas or electric especially) should be running - extern int NumOfVentSlabs; // Number of ventilated slab in the input file - extern Real64 OAMassFlowRate; // Outside air mass flow rate for the ventilated slab - extern Array1D_double QRadSysSrcAvg; // Average source over the time step for a particular radiant surfaceD - extern Array1D ZeroSourceSumHATsurf; // Equal to SumHATsurf for all the walls in a zone with no source - extern int MaxCloNumOfSurfaces; // Used to set allocate size in CalcClo routine - extern Real64 QZnReq; // heating or cooling needed by system [watts] - - // Record keeping variables used to calculate QRadSysSrcAvg locally - - extern Array1D_double LastQRadSysSrc; // Need to keep the last value in case we are still iterating - extern Array1D LastSysTimeElapsed; // Need to keep the last value in case we are still iterating - extern Array1D LastTimeStepSys; // Need to keep the last value in case we are still iterating - extern Array1D_bool CheckEquipName; - - // Autosizing variables - extern Array1D_bool MySizeFlag; - - // SUBROUTINE SPECIFICATIONS FOR MODULE VentilatedSlab - // PRIVATE UpdateVentilatedSlabValAvg - - // Types - struct VentilatedSlabData { // Members @@ -337,14 +267,8 @@ namespace VentilatedSlab { } }; - // Object Data - extern Array1D VentSlab; - extern Array1D VentSlabNumericFields; - // Functions - void clear_state(); - void SimVentilatedSlab(EnergyPlusData &state, std::string const &CompName, // name of the fan coil unit int const ZoneNum, // number of zone being served bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep @@ -373,7 +297,7 @@ namespace VentilatedSlab { Real64 &LoadMet // load met by the system (watts) ); - void CalcVentilatedSlabCoilOutput(int const Item, // system index in ventilated slab array + void CalcVentilatedSlabCoilOutput(EnergyPlusData &state, int const Item, // system index in ventilated slab array Real64 &PowerMet, // power supplied (W) Real64 &LatOutputProvided // latent capacity supplied (kg/s) ); @@ -382,13 +306,13 @@ namespace VentilatedSlab { bool const FirstHVACIteration // flag for 1st HVAV iteration in the time step !unused1208 ); - void SimVentSlabOAMixer(int const Item); // System index in Ventilated Slab array + void SimVentSlabOAMixer(EnergyPlusData &state, int const Item); // System index in Ventilated Slab array - void UpdateVentilatedSlab(int const Item, // Index for the ventilated slab under consideration within the derived types + void UpdateVentilatedSlab(EnergyPlusData &state, int const Item, // Index for the ventilated slab under consideration within the derived types bool const FirstHVACIteration // TRUE if 1st HVAC simulation of system timestep !unused1208 ); - Real64 CalcVentSlabHXEffectTerm(int const Item, // Index number of radiant system under consideration + Real64 CalcVentSlabHXEffectTerm(EnergyPlusData &state, int const Item, // Index number of radiant system under consideration Real64 const Temperature, // Temperature of air entering the radiant system, in C Real64 const AirMassFlow, // Mass flow rate of water in the radiant system, in kg/s Real64 const FlowFraction, // Mass flow rate fraction for this surface in the radiant system @@ -398,12 +322,103 @@ namespace VentilatedSlab { Real64 SumHATsurf(int const ZoneNum); // Zone number - void ReportVentilatedSlab(int const Item); // Index for the ventilated slab under consideration within the derived types + void ReportVentilatedSlab(EnergyPlusData &state, int const Item); // Index for the ventilated slab under consideration within the derived types //***************************************************************************************** } // namespace VentilatedSlab +struct VentilatedSlabData : BaseGlobalStruct { + + std::string const cMO_VentilatedSlab = "ZoneHVAC:VentilatedSlab"; + + // Parameters for outside air control types: + int const Heating_ElectricCoilType = 1; + int const Heating_GasCoilType = 2; + int const Heating_WaterCoilType = 3; + int const Heating_SteamCoilType = 4; + int const Cooling_CoilWaterCooling = 1; + int const Cooling_CoilDetailedCooling = 2; + int const Cooling_CoilHXAssisted = 3; + int const VariablePercent = 1; + int const FixedTemperature = 2; + int const FixedOAControl = 3; + int const NotOperating = 0; // Parameter for use with OperatingMode variable, set for no heating/cooling + int const HeatingMode = 1; // Parameter for use with OperatingMode variable, set for heating + int const CoolingMode = 2; // Parameter for use with OperatingMode variable, set for cooling + // Ventilated Slab Configurations + int const SlabOnly = 1; // Air circulate through cores of slab only + int const SlabAndZone = 2; // Circulated Air is introduced to zone + int const SeriesSlabs = 3; + // Control Types + int const MATControl = 1; // Controls system using mean air temperature + int const MRTControl = 2; // Controls system using mean radiant temperature + int const OPTControl = 3; // Controls system using operative temperature + int const ODBControl = 4; // Controls system using outside air dry-bulb temperature + int const OWBControl = 5; // Controls system using outside air wet-bulb temperature + int const SURControl = 6; // Controls system using surface temperature !Phase2-A + int const DPTZControl = 7; // Controls system using dew-point temperature of zone!Phase2-A + + // coil operation + int const On = 1; // normal coil operation + int const Off = 0; // signal coil shouldn't run + int const NoneOption = 0; + int const BothOption = 1; + int const HeatingOption = 2; + int const CoolingOption = 3; + int OperatingMode = 0; // Used to keep track of whether system is in heating or cooling mode + + // MODULE VARIABLE DECLARATIONS: + bool HCoilOn = false; // TRUE if the heating coil (gas or electric especially) should be running + int NumOfVentSlabs = 0; // Number of ventilated slab in the input file + Real64 OAMassFlowRate = 0.0; // Outside air mass flow rate for the ventilated slab + Array1D_double QRadSysSrcAvg; // Average source over the time step for a particular radiant surfaceD + Array1D ZeroSourceSumHATsurf; // Equal to SumHATsurf for all the walls in a zone with no source + int MaxCloNumOfSurfaces = 0; // Used to set allocate size in CalcClo routine + Real64 QZnReq = 0.0; // heating or cooling needed by system [watts] + + // Record keeping variables used to calculate QRadSysSrcAvg locally + + Array1D_double LastQRadSysSrc; // Need to keep the last value in case we are still iterating + Array1D LastSysTimeElapsed; // Need to keep the last value in case we are still iterating + Array1D LastTimeStepSys; // Need to keep the last value in case we are still iterating + Array1D_bool CheckEquipName; + + // Autosizing variables + bool GetInputFlag = true; + bool MyOneTimeFlag = true; + Array1D_bool MySizeFlag; + + // Object Data + Array1D VentSlab; + Array1D VentSlabNumericFields; + + void clear_state() override + { + MyOneTimeFlag = true; + GetInputFlag = true; + HCoilOn = false; + NumOfVentSlabs = 0; + OAMassFlowRate = 0.0; + MaxCloNumOfSurfaces = 0; + QZnReq = 0.0; + QRadSysSrcAvg.deallocate(); + ZeroSourceSumHATsurf.deallocate(); + LastQRadSysSrc.deallocate(); + LastSysTimeElapsed.deallocate(); + LastTimeStepSys.deallocate(); + CheckEquipName.deallocate(); + MySizeFlag.deallocate(); + VentSlab.deallocate(); + VentSlabNumericFields.deallocate(); + } + + // Default Constructor + VentilatedSlabData() + { + } +}; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 0a4a7c69f51..b1a1e8cd18b 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -1388,7 +1388,7 @@ namespace WaterThermalTanks { if (HPWH.bIsIHP) { HPWH.DXCoilType = "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE"; } else { - HPWH.DXCoilType = VariableSpeedCoils::VarSpeedCoil(HPWH.DXCoilNum).VarSpeedCoilType; + HPWH.DXCoilType = state.dataVariableSpeedCoils->VarSpeedCoil(HPWH.DXCoilNum).VarSpeedCoilType; } } else { // this is a single speed coil @@ -1541,8 +1541,8 @@ namespace WaterThermalTanks { } // issue #5630, set fan info in coils. if (bIsVScoil) { - VariableSpeedCoils::setVarSpeedHPWHFanTypeNum(HPWH.DXCoilNum, HPWH.FanType_Num); - VariableSpeedCoils::setVarSpeedHPWHFanIndex(HPWH.DXCoilNum, HPWH.FanNum); + VariableSpeedCoils::setVarSpeedHPWHFanTypeNum(state, HPWH.DXCoilNum, HPWH.FanType_Num); + VariableSpeedCoils::setVarSpeedHPWHFanIndex(state, HPWH.DXCoilNum, HPWH.FanNum); } else { DXCoils::SetDXCoolingCoilData( state, HPWH.DXCoilNum, errFlag, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, HPWH.FanName); @@ -5991,7 +5991,7 @@ namespace WaterThermalTanks { // IntegratedHeatPump::SimIHP(modBlankString, HPWaterHeater(HPNum).DXCoilNum, // 0, EMP1, EMP2, EMP3, 0, 0.0, 1, 0.0, 0.0, 0.0, false, 0.0); //conduct the sizing operation in the IHP int VSCoilID = IntegratedHeatPump::IntegratedHeatPumps(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).SCWHCoilIndex; - state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed = VariableSpeedCoils::VarSpeedCoil(VSCoilID).NumOfSpeeds; + state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).NumOfSpeeds; } else if (UtilityRoutines::SameString(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilType, "Coil:WaterHeating:AirToWaterHeatPump:VariableSpeed") && (state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed == 0)) { @@ -6013,7 +6013,7 @@ namespace WaterThermalTanks { 0.0, 0.0); // conduct the sizing operation in the VS WSHP int VSCoilID = state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum; - state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed = VariableSpeedCoils::VarSpeedCoil(VSCoilID).NumOfSpeeds; + state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).NumOfSpeeds; // below pass the flow rates from the VS coil to the water heater object } @@ -6026,11 +6026,11 @@ namespace WaterThermalTanks { // scale air flow rates Real64 MulSpeedFlowScale = - VariableSpeedCoils::VarSpeedCoil(VSCoilID).RatedAirVolFlowRate / - VariableSpeedCoils::VarSpeedCoil(VSCoilID).MSRatedAirVolFlowRate(VariableSpeedCoils::VarSpeedCoil(VSCoilID).NormSpedLevel); + state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).RatedAirVolFlowRate / + state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).NormSpedLevel); for (int Iter = 1; Iter <= state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed; ++Iter) { state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHAirVolFlowRate(Iter) = - VariableSpeedCoils::VarSpeedCoil(VSCoilID).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale; + state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale; } // check fan flow rate, should be larger than the max flow rate of the VS coil @@ -6073,16 +6073,16 @@ namespace WaterThermalTanks { // scale water flow rates MulSpeedFlowScale = - VariableSpeedCoils::VarSpeedCoil(VSCoilID).RatedWaterVolFlowRate / - VariableSpeedCoils::VarSpeedCoil(VSCoilID).MSRatedWaterVolFlowRate(VariableSpeedCoils::VarSpeedCoil(VSCoilID).NormSpedLevel); + state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).RatedWaterVolFlowRate / + state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).MSRatedWaterVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).NormSpedLevel); for (int Iter = 1; Iter <= state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed; ++Iter) { state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHWaterVolFlowRate(Iter) = - VariableSpeedCoils::VarSpeedCoil(VSCoilID).MSRatedWaterVolFlowRate(Iter) * MulSpeedFlowScale; + state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).MSRatedWaterVolFlowRate(Iter) * MulSpeedFlowScale; state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHWaterMassFlowRate(Iter) = - VariableSpeedCoils::VarSpeedCoil(VSCoilID).MSRatedWaterMassFlowRate(Iter) * MulSpeedFlowScale; + state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).MSRatedWaterMassFlowRate(Iter) * MulSpeedFlowScale; state.dataWaterThermalTanks->HPWaterHeater(HPNum).MSWaterSpeedRatio(Iter) = - VariableSpeedCoils::VarSpeedCoil(VSCoilID).MSRatedWaterVolFlowRate(Iter) / - VariableSpeedCoils::VarSpeedCoil(VSCoilID).MSRatedWaterVolFlowRate(state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed); + state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).MSRatedWaterVolFlowRate(Iter) / + state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).MSRatedWaterVolFlowRate(state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed); } Real64 rhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::OutBaroPress, HPInletDryBulbTemp, HPInletHumRat); @@ -7050,7 +7050,7 @@ namespace WaterThermalTanks { Real64 CoilTotalHeatingEnergyRate; if (HPWH.NumofSpeed > 0) { // VSHPWH - VariableSpeedCoils::VariableSpeedCoilData const &Coil = VariableSpeedCoils::VarSpeedCoil(HPWH.DXCoilNum); + VariableSpeedCoils::VariableSpeedCoilData const &Coil = state.dataVariableSpeedCoils->VarSpeedCoil(HPWH.DXCoilNum); CoilTotalHeatingEnergyRate = Coil.TotalHeatingEnergyRate; } else { // Single speed HPWH @@ -7923,7 +7923,7 @@ namespace WaterThermalTanks { } else if (DesupHtr.ReclaimHeatingSource == CoilObjEnum::DXVariableCooling) { AverageWasteHeat = DataHeatBalance::HeatReclaimVS_DXCoil(SourceID).AvailCapacity - DataHeatBalance::HeatReclaimVS_DXCoil(SourceID).HVACDesuperheaterReclaimedHeatTotal; - DesupHtr.DXSysPLR = VariableSpeedCoils::VarSpeedCoil(SourceID).PartLoadRatio; + DesupHtr.DXSysPLR = state.dataVariableSpeedCoils->VarSpeedCoil(SourceID).PartLoadRatio; } else if (DesupHtr.ReclaimHeatingSource == CoilObjEnum::AirWaterHeatPumpEQ) { AverageWasteHeat = DataHeatBalance::HeatReclaimSimple_WAHPCoil(SourceID).AvailCapacity - DataHeatBalance::HeatReclaimSimple_WAHPCoil(SourceID).HVACDesuperheaterReclaimedHeatTotal; @@ -9763,14 +9763,14 @@ namespace WaterThermalTanks { } else { assert(this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified); // For a stratified tank, the PLR is applied to the Coil.TotalHeatingEnergyRate - // whether that's a VariableSpeedCoils::VarSpeedCoil or DXCoils::DXCoil. + // whether that's a state.dataVariableSpeedCoils->VarSpeedCoil or DXCoils::DXCoil. // Here we create a pointer to the TotalHeatingEnergyRate for the appropriate coil type. Real64 *CoilTotalHeatingEnergyRatePtr; if (isVariableSpeed) { if (HeatPump.bIsIHP) CoilTotalHeatingEnergyRatePtr = &IntegratedHeatPump::IntegratedHeatPumps(HeatPump.DXCoilNum).TotalWaterHeatingRate; else - CoilTotalHeatingEnergyRatePtr = &VariableSpeedCoils::VarSpeedCoil(HeatPump.DXCoilNum).TotalHeatingEnergyRate; + CoilTotalHeatingEnergyRatePtr = &state.dataVariableSpeedCoils->VarSpeedCoil(HeatPump.DXCoilNum).TotalHeatingEnergyRate; } else { CoilTotalHeatingEnergyRatePtr = &DXCoils::DXCoil(HeatPump.DXCoilNum).TotalHeatingEnergyRate; } @@ -11422,7 +11422,7 @@ namespace WaterThermalTanks { Real64 RhoWater = Psychrometrics::RhoH2O(this->TankTemp); auto &HPWH = state.dataWaterThermalTanks->HPWaterHeater(HPNum); this->SetVSHPWHFlowRates(state, - HPWH, VariableSpeedCoils::VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, 1.0, RhoWater, MdotWater, true); + HPWH, state.dataVariableSpeedCoils->VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, 1.0, RhoWater, MdotWater, true); // simulate the HPWH coil/fan to find heating capacity Real64 EMP1 = 0.0; Real64 EMP2 = 0.0; @@ -11443,7 +11443,7 @@ namespace WaterThermalTanks { EMP3, 1, 1.0, - VariableSpeedCoils::VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, + state.dataVariableSpeedCoils->VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, 1.0, 0.0, 0.0, @@ -11462,7 +11462,7 @@ namespace WaterThermalTanks { EMP3, 1, 1.0, - VariableSpeedCoils::VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, + state.dataVariableSpeedCoils->VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, 1.0, 0.0, 0.0, @@ -11478,7 +11478,7 @@ namespace WaterThermalTanks { EMP3, 1, 1.0, - VariableSpeedCoils::VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, + state.dataVariableSpeedCoils->VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, 1.0, 0.0, 0.0, @@ -11497,7 +11497,7 @@ namespace WaterThermalTanks { EMP3, 1, 1.0, - VariableSpeedCoils::VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, + state.dataVariableSpeedCoils->VarSpeedCoil(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).NormSpedLevel, 1.0, 0.0, 0.0, @@ -11509,9 +11509,9 @@ namespace WaterThermalTanks { } } - this->MaxCapacity = VariableSpeedCoils::VSHPWHHeatingCapacity; - this->MinCapacity = VariableSpeedCoils::VSHPWHHeatingCapacity; - this->Efficiency = VariableSpeedCoils::VSHPWHHeatingCOP; + this->MaxCapacity = state.dataVariableSpeedCoils->VSHPWHHeatingCapacity; + this->MinCapacity = state.dataVariableSpeedCoils->VSHPWHHeatingCapacity; + this->Efficiency = state.dataVariableSpeedCoils->VSHPWHHeatingCOP; } else { bIsVSCoil = false; // simulate the HPWH coil/fan to find heating capacity @@ -11659,7 +11659,7 @@ namespace WaterThermalTanks { OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchSWHType, equipName, state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).Type); OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchSWHVol, equipName, this->Volume); if (bIsVSCoil) { - OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchSWHHeatIn, equipName, VariableSpeedCoils::VSHPWHHeatingCapacity); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchSWHHeatIn, equipName, state.dataVariableSpeedCoils->VSHPWHHeatingCapacity); } else { OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchSWHHeatIn, equipName, DXCoils::HPWHHeatingCapacity); } diff --git a/src/EnergyPlus/WaterThermalTanks.hh b/src/EnergyPlus/WaterThermalTanks.hh index ba0416d06c7..0b0c16cfbbf 100644 --- a/src/EnergyPlus/WaterThermalTanks.hh +++ b/src/EnergyPlus/WaterThermalTanks.hh @@ -222,6 +222,7 @@ namespace WaterThermalTanks { struct HeatPumpWaterHeaterData : PlantComponent { + int MaxSpedLevels = 10; // Members std::string Name; // Name of heat pump water heater std::string Type; // Type of water heater (HEAT PUMP:WATER HEATER) @@ -374,10 +375,10 @@ namespace WaterThermalTanks { ShowSetPointWarning(true), HPWaterHeaterSensibleCapacity(0.0), HPWaterHeaterLatentCapacity(0.0), WrappedCondenserBottomLocation(0.0), WrappedCondenserTopLocation(0.0), ControlSensor1Height(-1.0), ControlSensor1Node(1), ControlSensor1Weight(1.0), ControlSensor2Height(-1.0), ControlSensor2Node(2), ControlSensor2Weight(0.0), ControlTempAvg(0.0), ControlTempFinal(0.0), - AllowHeatingElementAndHeatPumpToRunAtSameTime(true), NumofSpeed(0), HPWHAirVolFlowRate(VariableSpeedCoils::MaxSpedLevels, 0.0), - HPWHAirMassFlowRate(VariableSpeedCoils::MaxSpedLevels, 0.0), HPWHWaterVolFlowRate(VariableSpeedCoils::MaxSpedLevels, 0.0), - HPWHWaterMassFlowRate(VariableSpeedCoils::MaxSpedLevels, 0.0), MSAirSpeedRatio(VariableSpeedCoils::MaxSpedLevels, 0.0), - MSWaterSpeedRatio(VariableSpeedCoils::MaxSpedLevels, 0.0), bIsIHP(false), MyOneTimeFlagHP(true), MyTwoTimeFlagHP(true), + AllowHeatingElementAndHeatPumpToRunAtSameTime(true), NumofSpeed(0), HPWHAirVolFlowRate(MaxSpedLevels, 0.0), + HPWHAirMassFlowRate(MaxSpedLevels, 0.0), HPWHWaterVolFlowRate(MaxSpedLevels, 0.0), + HPWHWaterMassFlowRate(MaxSpedLevels, 0.0), MSAirSpeedRatio(MaxSpedLevels, 0.0), + MSWaterSpeedRatio(MaxSpedLevels, 0.0), bIsIHP(false), MyOneTimeFlagHP(true), MyTwoTimeFlagHP(true), CheckHPWHEquipName(true), myOneTimeInitFlag(true) { } diff --git a/tst/EnergyPlus/unit/HVACDXSystem.unit.cc b/tst/EnergyPlus/unit/HVACDXSystem.unit.cc index 2a2ed8b0bf1..ecdf87c131c 100644 --- a/tst/EnergyPlus/unit/HVACDXSystem.unit.cc +++ b/tst/EnergyPlus/unit/HVACDXSystem.unit.cc @@ -407,7 +407,7 @@ TEST_F(EnergyPlusFixture, VariableSpeedCoils_DOASDXCoilTest) HVACDXSystem::GetDXCoolingSystemInput(state); EXPECT_EQ(HVACDXSystem::DXCoolingSystem(1).Name, "DX COOLING COIL SYSTEM"); EXPECT_FALSE(HVACDXSystem::DXCoolingSystem(1).ISHundredPercentDOASDXCoil); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).Name, "VS DX COOLING COIL"); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).Name, "VS DX COOLING COIL"); } TEST_F(EnergyPlusFixture, VariableSpeedCoils_RHControl) @@ -530,7 +530,7 @@ TEST_F(EnergyPlusFixture, VariableSpeedCoils_RHControl) HVACDXSystem::GetDXCoolingSystemInput(state); EXPECT_EQ(HVACDXSystem::DXCoolingSystem(DXSystemNum).Name, "DX COOLING COIL SYSTEM"); EXPECT_FALSE(HVACDXSystem::DXCoolingSystem(DXSystemNum).ISHundredPercentDOASDXCoil); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(DXSystemNum).Name, "VS DX COOLING COIL"); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(DXSystemNum).Name, "VS DX COOLING COIL"); EXPECT_EQ(2, HVACDXSystem::DXCoolingSystem(DXSystemNum).DXSystemControlNodeNum); // set up outdoor environment @@ -708,19 +708,19 @@ TEST_F(EnergyPlusFixture, VariableSpeedCoils_LatentDegradation_Test) // test sensible control HVACDXSystem::ControlDXSystem(state, DXSystemNum, FirstHVACIteration, HXUnitOn); - Real64 SHR = VariableSpeedCoils::VarSpeedCoil(1).QSensible / VariableSpeedCoils::VarSpeedCoil(1).QLoadTotal; + Real64 SHR = state.dataVariableSpeedCoils->VarSpeedCoil(1).QSensible / state.dataVariableSpeedCoils->VarSpeedCoil(1).QLoadTotal; EXPECT_NEAR(SHR, 0.49605, 0.0001); - EXPECT_EQ(1, VariableSpeedCoils::VarSpeedCoil(1).SpeedNumReport); // latent degradation only works at low speed - EXPECT_NEAR(0.199, VariableSpeedCoils::VarSpeedCoil(1).PartLoadRatio, 0.001); // PLR is low + EXPECT_EQ(1, state.dataVariableSpeedCoils->VarSpeedCoil(1).SpeedNumReport); // latent degradation only works at low speed + EXPECT_NEAR(0.199, state.dataVariableSpeedCoils->VarSpeedCoil(1).PartLoadRatio, 0.001); // PLR is low // add latent degradation model - VariableSpeedCoils::VarSpeedCoil(1).Twet_Rated = 1000.0; - VariableSpeedCoils::VarSpeedCoil(1).Gamma_Rated = 1.5; + state.dataVariableSpeedCoils->VarSpeedCoil(1).Twet_Rated = 1000.0; + state.dataVariableSpeedCoils->VarSpeedCoil(1).Gamma_Rated = 1.5; HVACDXSystem::ControlDXSystem(state, DXSystemNum, FirstHVACIteration, HXUnitOn); - SHR = VariableSpeedCoils::VarSpeedCoil(1).QSensible / VariableSpeedCoils::VarSpeedCoil(1).QLoadTotal; + SHR = state.dataVariableSpeedCoils->VarSpeedCoil(1).QSensible / state.dataVariableSpeedCoils->VarSpeedCoil(1).QLoadTotal; EXPECT_NEAR(SHR, 1.0, 0.0001); // more sensible capacity so PLR should be lower - EXPECT_EQ(1, VariableSpeedCoils::VarSpeedCoil(1).SpeedNumReport); // latent degradation only works at low speed - EXPECT_NEAR(0.099, VariableSpeedCoils::VarSpeedCoil(1).PartLoadRatio, 0.001); // PLR is lower, latent capacity is 0 + EXPECT_EQ(1, state.dataVariableSpeedCoils->VarSpeedCoil(1).SpeedNumReport); // latent degradation only works at low speed + EXPECT_NEAR(0.099, state.dataVariableSpeedCoils->VarSpeedCoil(1).PartLoadRatio, 0.001); // PLR is lower, latent capacity is 0 // test more reasonable zone RH,about 50% DataLoopNode::Node(InletNode).HumRat = 0.0092994; @@ -729,23 +729,23 @@ TEST_F(EnergyPlusFixture, VariableSpeedCoils_LatentDegradation_Test) DataLoopNode::Node(ControlNode).TempSetPoint = HVACDXSystem::DXCoolingSystem(DXSystemNum).DesiredOutletTemp; // remove latent degradation model - VariableSpeedCoils::VarSpeedCoil(1).Twet_Rated = 0.0; - VariableSpeedCoils::VarSpeedCoil(1).Gamma_Rated = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(1).Twet_Rated = 0.0; + state.dataVariableSpeedCoils->VarSpeedCoil(1).Gamma_Rated = 0.0; HVACDXSystem::ControlDXSystem(state, DXSystemNum, FirstHVACIteration, HXUnitOn); - SHR = VariableSpeedCoils::VarSpeedCoil(1).QSensible / VariableSpeedCoils::VarSpeedCoil(1).QLoadTotal; + SHR = state.dataVariableSpeedCoils->VarSpeedCoil(1).QSensible / state.dataVariableSpeedCoils->VarSpeedCoil(1).QLoadTotal; EXPECT_NEAR(SHR, 0.7624, 0.0001); - EXPECT_EQ(1, VariableSpeedCoils::VarSpeedCoil(1).SpeedNumReport); // latent degradation only works at low speed - EXPECT_NEAR(0.143, VariableSpeedCoils::VarSpeedCoil(1).PartLoadRatio, 0.001); // PLR is low + EXPECT_EQ(1, state.dataVariableSpeedCoils->VarSpeedCoil(1).SpeedNumReport); // latent degradation only works at low speed + EXPECT_NEAR(0.143, state.dataVariableSpeedCoils->VarSpeedCoil(1).PartLoadRatio, 0.001); // PLR is low // add latent degradation model - VariableSpeedCoils::VarSpeedCoil(1).Twet_Rated = 1000.0; - VariableSpeedCoils::VarSpeedCoil(1).Gamma_Rated = 1.5; + state.dataVariableSpeedCoils->VarSpeedCoil(1).Twet_Rated = 1000.0; + state.dataVariableSpeedCoils->VarSpeedCoil(1).Gamma_Rated = 1.5; HVACDXSystem::ControlDXSystem(state, DXSystemNum, FirstHVACIteration, HXUnitOn); - SHR = VariableSpeedCoils::VarSpeedCoil(1).QSensible / VariableSpeedCoils::VarSpeedCoil(1).QLoadTotal; + SHR = state.dataVariableSpeedCoils->VarSpeedCoil(1).QSensible / state.dataVariableSpeedCoils->VarSpeedCoil(1).QLoadTotal; EXPECT_NEAR(SHR, 1.0, 0.0001); // more sensible capacity so PLR should be lower - EXPECT_EQ(1, VariableSpeedCoils::VarSpeedCoil(1).SpeedNumReport); // latent degradation only works at low speed - EXPECT_NEAR(0.109, VariableSpeedCoils::VarSpeedCoil(1).PartLoadRatio, 0.001); // PLR is lower, latent capacity is 0 + EXPECT_EQ(1, state.dataVariableSpeedCoils->VarSpeedCoil(1).SpeedNumReport); // latent degradation only works at low speed + EXPECT_NEAR(0.109, state.dataVariableSpeedCoils->VarSpeedCoil(1).PartLoadRatio, 0.001); // PLR is lower, latent capacity is 0 } } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/IntegratedHeatPump.unit.cc b/tst/EnergyPlus/unit/IntegratedHeatPump.unit.cc index cb280050467..dae0de4e753 100644 --- a/tst/EnergyPlus/unit/IntegratedHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/IntegratedHeatPump.unit.cc @@ -178,7 +178,7 @@ TEST_F(EnergyPlusFixture, ASIHP_GetMaxSpeedNumIHP) VariableSpeedCoils::VariableSpeedCoilData vsCoil; vsCoil.NumOfSpeeds = 999; - VariableSpeedCoils::VarSpeedCoil.push_back(vsCoil); + state.dataVariableSpeedCoils->VarSpeedCoil.push_back(vsCoil); IntegratedHeatPumpData IHP; IHP.Name = "ASIHP"; diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 954c070d77c..36a6ff6c8ef 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -8332,7 +8332,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherHeatGainReport) EnergyPlus::DataHeatBalance::ZoneWinHeatGainRepEnergy.allocate(1); EnergyPlus::DataHeatBalance::ZoneWinHeatLossRepEnergy.allocate(1); - GatherHeatGainReport(OutputProcessor::TimeStepType::TimeStepSystem); + GatherHeatGainReport(state, OutputProcessor::TimeStepType::TimeStepSystem); EXPECT_EQ(1.0*(EnergyPlus::DataHVACGlobals::TimeStepSys)*SecInHour, DataHeatBalance::ZonePreDefRep(1).SHGSAnZoneEqHt); EXPECT_EQ(0.0*(EnergyPlus::DataHVACGlobals::TimeStepSys)*SecInHour, DataHeatBalance::ZonePreDefRep(1).SHGSAnZoneEqCl); diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index d5e66ee7c6b..3d4f13eecf9 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -467,19 +467,19 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) PlantLoop(2).FluidName = "ChilledWater"; PlantLoop(2).FluidIndex = 1; PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = VarSpeedCoil(1).Name; + PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state.dataVariableSpeedCoils->VarSpeedCoil(1).Name; PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilVSWAHPCoolingEquationFit; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = VarSpeedCoil(1).WaterInletNodeNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = VarSpeedCoil(1).WaterOutletNodeNum; + PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state.dataVariableSpeedCoils->VarSpeedCoil(1).WaterInletNodeNum; + PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state.dataVariableSpeedCoils->VarSpeedCoil(1).WaterOutletNodeNum; PlantLoop(1).Name = "HotWaterLoop"; PlantLoop(1).FluidName = "HotWater"; PlantLoop(1).FluidIndex = 1; PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = VarSpeedCoil(2).Name; + PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state.dataVariableSpeedCoils->VarSpeedCoil(2).Name; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilVSWAHPHeatingEquationFit; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = VarSpeedCoil(2).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = VarSpeedCoil(2).WaterOutletNodeNum; + PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state.dataVariableSpeedCoils->VarSpeedCoil(2).WaterInletNodeNum; + PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state.dataVariableSpeedCoils->VarSpeedCoil(2).WaterOutletNodeNum; DataSizing::CurZoneEqNum = 1; DataSizing::ZoneSizingRunDone = true; @@ -501,40 +501,40 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) // For this reason, the parent object would size to an air flow that was different than the child. // identify coil - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).Name, "LOBBY_ZN_1_FLR_2 WSHP COOLING MODE"); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).Name, "LOBBY_ZN_1_FLR_2 WSHP COOLING MODE"); // expect coil air flow to equal PTUnit cooling air flow - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).RatedAirVolFlowRate, PTUnit(1).MaxCoolAirVolFlow); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(9), PTUnit(1).MaxCoolAirVolFlow); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).RatedAirVolFlowRate, PTUnit(1).MaxCoolAirVolFlow); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(9), PTUnit(1).MaxCoolAirVolFlow); // expect the ratio of air flow to capacity to be equal to the reference air flow and capacity ratio specified in coil input Real64 refAirflowCapacityRatio = 0.891980668 / 16092.825525; // speed 9 reference cooling data Real64 sizingAirflowCapacityRatio = - VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(9) / VariableSpeedCoils::VarSpeedCoil(1).MSRatedTotCap(9); + state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(9) / state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedTotCap(9); EXPECT_EQ(refAirflowCapacityRatio, sizingAirflowCapacityRatio); // this same ratio should also equal the internal flow per capacity variable used to back calculate operating air flow rate - EXPECT_EQ(sizingAirflowCapacityRatio, VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowPerRatedTotCap(9)); + EXPECT_EQ(sizingAirflowCapacityRatio, state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowPerRatedTotCap(9)); // identify coil - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).Name, "LOBBY_ZN_1_FLR_2 WSHP HEATING MODE"); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).Name, "LOBBY_ZN_1_FLR_2 WSHP HEATING MODE"); // expect coil air flow to equal PTUnit heating air flow - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).RatedAirVolFlowRate, ZoneEqSizing(CurZoneEqNum).HeatingAirVolFlow); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).RatedAirVolFlowRate, PTUnit(1).MaxHeatAirVolFlow); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(9), PTUnit(1).MaxHeatAirVolFlow); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).RatedAirVolFlowRate, ZoneEqSizing(CurZoneEqNum).HeatingAirVolFlow); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).RatedAirVolFlowRate, PTUnit(1).MaxHeatAirVolFlow); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(9), PTUnit(1).MaxHeatAirVolFlow); // expect the ratio of air flow to capacity to equal to the reference air flow and capacity specified in coil input refAirflowCapacityRatio = 0.891980668 / 20894.501936; // speed 9 reference heating data - sizingAirflowCapacityRatio = VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(9) / VariableSpeedCoils::VarSpeedCoil(2).MSRatedTotCap(9); + sizingAirflowCapacityRatio = state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(9) / state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedTotCap(9); EXPECT_EQ(refAirflowCapacityRatio, sizingAirflowCapacityRatio); // this same ratio should also equal the internal flow per capacity variable used to back calculate operating air flow rate - EXPECT_EQ(sizingAirflowCapacityRatio, VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowPerRatedTotCap(9)); + EXPECT_EQ(sizingAirflowCapacityRatio, state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowPerRatedTotCap(9)); SizeFan(state, 1); // the fan vol flow rate should equal the max of cooling and heating coil flow rates - Real64 maxCoilAirFlow = max(VariableSpeedCoils::VarSpeedCoil( 1 ).RatedAirVolFlowRate, VariableSpeedCoils::VarSpeedCoil( 2 ).RatedAirVolFlowRate); + Real64 maxCoilAirFlow = max(state.dataVariableSpeedCoils->VarSpeedCoil( 1 ).RatedAirVolFlowRate, state.dataVariableSpeedCoils->VarSpeedCoil( 2 ).RatedAirVolFlowRate); EXPECT_EQ(Fan(1).MaxAirFlowRate, maxCoilAirFlow); EXPECT_EQ(Fan(1).MaxAirFlowRate, max(PTUnit(1).MaxCoolAirVolFlow, PTUnit(1).MaxHeatAirVolFlow)); @@ -561,7 +561,7 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) // VS coils set SystemAirFlow to true and AirVolFlow to a value, all PTUnits set CoolingAirFlow and HeatingAirFlow, and CoolingAirVolFlow and // HeatingAirVolFlow EXPECT_TRUE(ZoneEqSizing(1).SystemAirFlow); - EXPECT_EQ(ZoneEqSizing(1).AirVolFlow, VariableSpeedCoils::VarSpeedCoil(1).RatedAirVolFlowRate); + EXPECT_EQ(ZoneEqSizing(1).AirVolFlow, state.dataVariableSpeedCoils->VarSpeedCoil(1).RatedAirVolFlowRate); EXPECT_TRUE(ZoneEqSizing(1).CoolingAirFlow); EXPECT_TRUE(ZoneEqSizing(1).HeatingAirFlow); EXPECT_EQ(ZoneEqSizing(1).CoolingAirVolFlow, PTUnit(1).MaxCoolAirVolFlow); diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 9e08d7b436b..449dc240209 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -2821,66 +2821,66 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_MultispeedPerformance) EXPECT_EQ(RatedSourceTempCool, 35.0); Real64 CoolCoolCapAtPeak = 32454.876753104443; Real64 TotCapTempModFac = CurveManager::CurveValue( - state, VariableSpeedCoils::VarSpeedCoil(1).MSCCapFTemp(VariableSpeedCoils::VarSpeedCoil(1).NormSpedLevel), 17.410329442560833, RatedSourceTempCool); + state, state.dataVariableSpeedCoils->VarSpeedCoil(1).MSCCapFTemp(state.dataVariableSpeedCoils->VarSpeedCoil(1).NormSpedLevel), 17.410329442560833, RatedSourceTempCool); EXPECT_NEAR(TotCapTempModFac, 0.930018048445091, 0.001); Real64 RatedCapCoolTotalDes = CoolCoolCapAtPeak / TotCapTempModFac; EXPECT_NEAR(RatedCapCoolTotalDes, 34897.0396944, 0.001); EXPECT_NEAR(thisSys->m_DesignCoolingCapacity, RatedCapCoolTotalDes, 0.001); - EXPECT_EQ(thisSys->m_DesignCoolingCapacity, VariableSpeedCoils::VarSpeedCoil(1).RatedCapCoolTotal); + EXPECT_EQ(thisSys->m_DesignCoolingCapacity, state.dataVariableSpeedCoils->VarSpeedCoil(1).RatedCapCoolTotal); EXPECT_NEAR(thisSys->m_DesignHeatingCapacity, RatedCapCoolTotalDes, 0.001); - EXPECT_EQ(thisSys->m_DesignHeatingCapacity, VariableSpeedCoils::VarSpeedCoil(2).RatedCapHeat); + EXPECT_EQ(thisSys->m_DesignHeatingCapacity, state.dataVariableSpeedCoils->VarSpeedCoil(2).RatedCapHeat); // variable speed coils size air flow differently than other models. The design air volume flow rate is back calculated from design capacity - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).RatedAirVolFlowRate, - VariableSpeedCoils::VarSpeedCoil(1).RatedCapCoolTotal * VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowPerRatedTotCap(10)); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).RatedAirVolFlowRate, + state.dataVariableSpeedCoils->VarSpeedCoil(1).RatedCapCoolTotal * state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowPerRatedTotCap(10)); Real64 fullFlow = 1.949442; - EXPECT_NEAR(VariableSpeedCoils::VarSpeedCoil(1).RatedAirVolFlowRate, fullFlow, 0.00001); // different than unitary system air volume flow rate - EXPECT_NEAR(VariableSpeedCoils::VarSpeedCoil(2).RatedAirVolFlowRate, 1.70, 0.01); // VS DX heating coil was not autosized + EXPECT_NEAR(state.dataVariableSpeedCoils->VarSpeedCoil(1).RatedAirVolFlowRate, fullFlow, 0.00001); // different than unitary system air volume flow rate + EXPECT_NEAR(state.dataVariableSpeedCoils->VarSpeedCoil(2).RatedAirVolFlowRate, 1.70, 0.01); // VS DX heating coil was not autosized // checks on autosized cooling air flow rates EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[1], fullFlow * 0.1, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(1), thisSys->m_CoolVolumeFlowRate[1]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(1), thisSys->m_CoolVolumeFlowRate[1]); EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[2], fullFlow * 0.2, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(2), thisSys->m_CoolVolumeFlowRate[2]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(2), thisSys->m_CoolVolumeFlowRate[2]); EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[3], fullFlow * 0.3, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(3), thisSys->m_CoolVolumeFlowRate[3]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(3), thisSys->m_CoolVolumeFlowRate[3]); EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[4], fullFlow * 0.4, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(4), thisSys->m_CoolVolumeFlowRate[4]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(4), thisSys->m_CoolVolumeFlowRate[4]); EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[5], fullFlow * 0.5, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(5), thisSys->m_CoolVolumeFlowRate[5]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(5), thisSys->m_CoolVolumeFlowRate[5]); EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[6], fullFlow * 0.6, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(6), thisSys->m_CoolVolumeFlowRate[6]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(6), thisSys->m_CoolVolumeFlowRate[6]); EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[7], fullFlow * 0.7, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(7), thisSys->m_CoolVolumeFlowRate[7]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(7), thisSys->m_CoolVolumeFlowRate[7]); EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[8], fullFlow * 0.8, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(8), thisSys->m_CoolVolumeFlowRate[8]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(8), thisSys->m_CoolVolumeFlowRate[8]); EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[9], fullFlow * 0.9, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(9), thisSys->m_CoolVolumeFlowRate[9]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(9), thisSys->m_CoolVolumeFlowRate[9]); EXPECT_NEAR(thisSys->m_CoolVolumeFlowRate[10], fullFlow * 1.0, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(10), thisSys->m_CoolVolumeFlowRate[10]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(10), thisSys->m_CoolVolumeFlowRate[10]); // checks on autosized heating air flow rates EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[1], 0.171700, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(1), thisSys->m_HeatVolumeFlowRate[1]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(1), thisSys->m_HeatVolumeFlowRate[1]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[2], 0.341700, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(2), thisSys->m_HeatVolumeFlowRate[2]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(2), thisSys->m_HeatVolumeFlowRate[2]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[3], 0.511699, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(3), thisSys->m_HeatVolumeFlowRate[3]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(3), thisSys->m_HeatVolumeFlowRate[3]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[4], 0.681699, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(4), thisSys->m_HeatVolumeFlowRate[4]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(4), thisSys->m_HeatVolumeFlowRate[4]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[5], 0.851700, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(5), thisSys->m_HeatVolumeFlowRate[5]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(5), thisSys->m_HeatVolumeFlowRate[5]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[6], 1.021699, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(6), thisSys->m_HeatVolumeFlowRate[6]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(6), thisSys->m_HeatVolumeFlowRate[6]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[7], 1.191700, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(7), thisSys->m_HeatVolumeFlowRate[7]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(7), thisSys->m_HeatVolumeFlowRate[7]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[8], 1.361700, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(8), thisSys->m_HeatVolumeFlowRate[8]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(8), thisSys->m_HeatVolumeFlowRate[8]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[9], 1.531700, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(9), thisSys->m_HeatVolumeFlowRate[9]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(9), thisSys->m_HeatVolumeFlowRate[9]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[10], 1.700000, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(10), thisSys->m_HeatVolumeFlowRate[10]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(10), thisSys->m_HeatVolumeFlowRate[10]); // spot check MSHP volume flow rate data. NOTE: design spec object is 0 based EXPECT_EQ(thisSys->m_CoolVolumeFlowRate[7], thisSys->m_CoolVolumeFlowRate[10] * UnitarySystems::designSpecMSHP[0].coolingVolFlowRatio[6]); @@ -7499,7 +7499,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_MultispeedDXCoilSizing) EXPECT_EQ(thisSys->m_DesignCoolingCapacity, DXCoils::DXCoil(thisSys->m_CoolingCoilIndex).MSRatedTotCap(thisSys->m_NumOfSpeedCooling)); // 64-bit MSVS shows these next variables as identical yet other compilers show diff's, changing ASSERT_EQ to EXPECT_NEAR EXPECT_NEAR(thisSys->m_DesignHeatingCapacity, - VariableSpeedCoils::VarSpeedCoil(thisSys->m_HeatingCoilIndex).MSRatedTotCap(thisSys->m_NumOfSpeedHeating), + state.dataVariableSpeedCoils->VarSpeedCoil(thisSys->m_HeatingCoilIndex).MSRatedTotCap(thisSys->m_NumOfSpeedHeating), 0.001); // 3 cooling speeds with autosized MSHP design spec yielding equally distributed air flow at 1/3 per speed @@ -7526,25 +7526,25 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_MultispeedDXCoilSizing) // 10 heating speeds with autosized MSHP design spec yielding equally distributed air flow at 1/10 per speed EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[1], 0.008237, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(1), thisSys->m_HeatVolumeFlowRate[1]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(1), thisSys->m_HeatVolumeFlowRate[1]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[2], 0.016473, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(2), thisSys->m_HeatVolumeFlowRate[2]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(2), thisSys->m_HeatVolumeFlowRate[2]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[3], 0.024710, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(3), thisSys->m_HeatVolumeFlowRate[3]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(3), thisSys->m_HeatVolumeFlowRate[3]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[4], 0.032946, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(4), thisSys->m_HeatVolumeFlowRate[4]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(4), thisSys->m_HeatVolumeFlowRate[4]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[5], 0.041183, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(5), thisSys->m_HeatVolumeFlowRate[5]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(5), thisSys->m_HeatVolumeFlowRate[5]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[6], 0.049420, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(6), thisSys->m_HeatVolumeFlowRate[6]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(6), thisSys->m_HeatVolumeFlowRate[6]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[7], 0.057656, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(7), thisSys->m_HeatVolumeFlowRate[7]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(7), thisSys->m_HeatVolumeFlowRate[7]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[8], 0.065892, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(8), thisSys->m_HeatVolumeFlowRate[8]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(8), thisSys->m_HeatVolumeFlowRate[8]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[9], 0.074129, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(9), thisSys->m_HeatVolumeFlowRate[9]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(9), thisSys->m_HeatVolumeFlowRate[9]); EXPECT_NEAR(thisSys->m_HeatVolumeFlowRate[10], 0.082366, 0.000001); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(10), thisSys->m_HeatVolumeFlowRate[10]); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(10), thisSys->m_HeatVolumeFlowRate[10]); } TEST_F(EnergyPlusFixture, UnitarySystemModel_WaterToAirHeatPump) @@ -14693,9 +14693,9 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_VariableSpeedDXCoilsNoLoadFlowRate EXPECT_EQ(1.500, thisSys->m_MaxHeatAirVolFlow); Real64 results_noLoadHeatingFlowRatio = - VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(1) / VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(5); + state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(1) / state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(5); Real64 results_noLoadCoolingFlowRatio = - VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(1) / VariableSpeedCoils::VarSpeedCoil(2).MSRatedAirVolFlowRate(5); + state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(1) / state.dataVariableSpeedCoils->VarSpeedCoil(2).MSRatedAirVolFlowRate(5); Real64 results_noLoadFlowRatioMin = min(results_noLoadHeatingFlowRatio, results_noLoadCoolingFlowRatio); EXPECT_NEAR(results_noLoadFlowRatioMin, thisSys->m_NoLoadAirFlowRateRatio, 0.00001); diff --git a/tst/EnergyPlus/unit/VariableSpeedCoils.unit.cc b/tst/EnergyPlus/unit/VariableSpeedCoils.unit.cc index ceb0ba14a5c..b11f2ceb3c5 100644 --- a/tst/EnergyPlus/unit/VariableSpeedCoils.unit.cc +++ b/tst/EnergyPlus/unit/VariableSpeedCoils.unit.cc @@ -2487,9 +2487,9 @@ TEST_F(EnergyPlusFixture, VariableSpeedCoils_mixedCoilTypesInput) VariableSpeedCoils::GetVarSpeedCoilInput(state); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(1).Name, "LOBBY_ZN_1_FLR_2 WSHP COOLING MODE"); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(1).Name, "LOBBY_ZN_1_FLR_2 WSHP COOLING MODE"); - EXPECT_EQ(VariableSpeedCoils::VarSpeedCoil(2).Name, "PSZ-AC_1:5_COOLC STANDARD 4-COMPRESSOR IPAK"); + EXPECT_EQ(state.dataVariableSpeedCoils->VarSpeedCoil(2).Name, "PSZ-AC_1:5_COOLC STANDARD 4-COMPRESSOR IPAK"); } TEST_F(EnergyPlusFixture, CoilHeatingDXVariableSpeed_MinOADBTempCompOperLimit) @@ -2656,8 +2656,8 @@ TEST_F(EnergyPlusFixture, CoilHeatingDXVariableSpeed_MinOADBTempCompOperLimit) VariableSpeedCoils::GetVarSpeedCoilInput(state); - ASSERT_EQ("HEATING COIL VARIABLESPEED", VariableSpeedCoils::VarSpeedCoil(1).Name); // Heating Coil Variable Speed - ASSERT_EQ(-60.0, VariableSpeedCoils::VarSpeedCoil(1).MinOATCompressor); // removed the minimum limit of -50.0C + ASSERT_EQ("HEATING COIL VARIABLESPEED", state.dataVariableSpeedCoils->VarSpeedCoil(1).Name); // Heating Coil Variable Speed + ASSERT_EQ(-60.0, state.dataVariableSpeedCoils->VarSpeedCoil(1).MinOATCompressor); // removed the minimum limit of -50.0C } TEST_F(EnergyPlusFixture, VariableSpeedCoils_Test_CalcTotCap_VSWSHP) @@ -2757,25 +2757,25 @@ TEST_F(EnergyPlusFixture, VariableSpeedCoils_Test_CalcTotCap_VSWSHP) Real64 LSInletHumRat = 0.013019367; Real64 LSInletEnth = 57256.90248; Real64 LSInletWBTemp = 20.0; - Real64 AirMassFlowRatio = VariableSpeedCoils::VarSpeedCoil(1).MSRatedAirVolFlowRate(1); + Real64 AirMassFlowRatio = state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedAirVolFlowRate(1); Real64 WaterMassFlowRatio = 0.0; Real64 LSMassFlowRate = 1.45; Real64 CBFSpeed = 0.000001; - Real64 MSRatedTotCap = VariableSpeedCoils::VarSpeedCoil(1).MSRatedTotCap(1); - int MSCapFTemp = VariableSpeedCoils::VarSpeedCoil(1).MSCCapFTemp(1); - int MSCapAirFFlow = VariableSpeedCoils::VarSpeedCoil(1).MSCCapAirFFlow(1); - int MSCapWaterFFlow = VariableSpeedCoils::VarSpeedCoil(1).MSCCapWaterFFlow(1); + Real64 MSRatedTotCap = state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedTotCap(1); + int MSCapFTemp = state.dataVariableSpeedCoils->VarSpeedCoil(1).MSCCapFTemp(1); + int MSCapAirFFlow = state.dataVariableSpeedCoils->VarSpeedCoil(1).MSCCapAirFFlow(1); + int MSCapWaterFFlow = state.dataVariableSpeedCoils->VarSpeedCoil(1).MSCCapWaterFFlow(1); Real64 QLoadTotal = 0.0; Real64 QLoadTotal1 = 0.0; Real64 QLoadTotal2 = 0.0; - Real64 SHR = VariableSpeedCoils::VarSpeedCoil(1).MSRatedSHR(1); + Real64 SHR = state.dataVariableSpeedCoils->VarSpeedCoil(1).MSRatedSHR(1); Real64 SSInletTemp = 24.0; Real64 InletAirPressure = 101320.0; VariableSpeedCoils::CalcTotCapSHR_VSWSHP(state, LSInletDBTemp, LSInletHumRat, LSInletEnth, LSInletWBTemp, AirMassFlowRatio, WaterMassFlowRatio, LSMassFlowRate, CBFSpeed, MSRatedTotCap, MSCapFTemp, MSCapAirFFlow, MSCapWaterFFlow, 0.0, 0, 0, 0, QLoadTotal1, QLoadTotal2, QLoadTotal, SHR, SSInletTemp, InletAirPressure, 0.0, 1, - VariableSpeedCoils::VarSpeedCoil(1).capModFacTotal); + state.dataVariableSpeedCoils->VarSpeedCoil(1).capModFacTotal); // same calculations as in CalcTotCapSHR_VSWSHP (except CapFTemp term is 1 so no need to add that calc here) Real64 hDelta = MSRatedTotCap / LSMassFlowRate; // Change in air enthalpy across the cooling coil [J/kg] diff --git a/tst/EnergyPlus/unit/VentilatedSlab.unit.cc b/tst/EnergyPlus/unit/VentilatedSlab.unit.cc index 92952bc7f21..5c7b020bb75 100644 --- a/tst/EnergyPlus/unit/VentilatedSlab.unit.cc +++ b/tst/EnergyPlus/unit/VentilatedSlab.unit.cc @@ -85,13 +85,13 @@ TEST_F(EnergyPlusFixture, VentilatedSlab_CalcVentilatedSlabCoilOutputTest) Real64 PowerMet = 0.0; Real64 LatOutputProvided = 0.0; - NumOfVentSlabs = 1; - VentSlab.allocate(NumOfVentSlabs); + state.dataVentilatedSlab->NumOfVentSlabs = 1; + state.dataVentilatedSlab->VentSlab.allocate(state.dataVentilatedSlab->NumOfVentSlabs); int Item = 1; int FanOutletNode = 1; int OutletNode = 2; - VentSlab(Item).FanOutletNode = FanOutletNode; - VentSlab(Item).RadInNode = OutletNode; + state.dataVentilatedSlab->VentSlab(Item).FanOutletNode = FanOutletNode; + state.dataVentilatedSlab->VentSlab(Item).RadInNode = OutletNode; Node.allocate(2); Node(OutletNode).MassFlowRate = 0.5; @@ -108,12 +108,12 @@ TEST_F(EnergyPlusFixture, VentilatedSlab_CalcVentilatedSlabCoilOutputTest) Node(FanOutletNode).HumRat = 0.003; Node(OutletNode).Temp = 20.0; Node(OutletNode).HumRat = 0.003; - CalcVentilatedSlabCoilOutput(Item, PowerMet, LatOutputProvided); + CalcVentilatedSlabCoilOutput(state, Item, PowerMet, LatOutputProvided); - EXPECT_TRUE(VentSlab(Item).HeatCoilPower > 0.0); - EXPECT_TRUE(VentSlab(Item).SensCoolCoilPower == 0.0); - EXPECT_TRUE(VentSlab(Item).TotCoolCoilPower == 0.0); - EXPECT_TRUE(VentSlab(Item).LateCoolCoilPower == 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).HeatCoilPower > 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower == 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilPower == 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilPower == 0.0); EXPECT_TRUE(LatOutputProvided == 0.0); EXPECT_TRUE(PowerMet > 0.0); @@ -122,12 +122,12 @@ TEST_F(EnergyPlusFixture, VentilatedSlab_CalcVentilatedSlabCoilOutputTest) Node(FanOutletNode).HumRat = 0.003; Node(OutletNode).Temp = 20.0; Node(OutletNode).HumRat = 0.003; - CalcVentilatedSlabCoilOutput(Item, PowerMet, LatOutputProvided); + CalcVentilatedSlabCoilOutput(state, Item, PowerMet, LatOutputProvided); - EXPECT_TRUE(VentSlab(Item).HeatCoilPower == 0.0); - EXPECT_TRUE(VentSlab(Item).SensCoolCoilPower > 0.0); - EXPECT_TRUE(VentSlab(Item).TotCoolCoilPower == VentSlab(Item).SensCoolCoilPower); - EXPECT_TRUE(VentSlab(Item).LateCoolCoilPower == 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).HeatCoilPower == 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower > 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilPower == state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilPower == 0.0); EXPECT_TRUE(LatOutputProvided == 0.0); EXPECT_TRUE(PowerMet < 0.0); @@ -136,12 +136,12 @@ TEST_F(EnergyPlusFixture, VentilatedSlab_CalcVentilatedSlabCoilOutputTest) Node(FanOutletNode).HumRat = 0.008; Node(OutletNode).Temp = 20.0; Node(OutletNode).HumRat = 0.003; - CalcVentilatedSlabCoilOutput(Item, PowerMet, LatOutputProvided); + CalcVentilatedSlabCoilOutput(state, Item, PowerMet, LatOutputProvided); - EXPECT_TRUE(VentSlab(Item).HeatCoilPower == 0.0); - EXPECT_TRUE(VentSlab(Item).SensCoolCoilPower > 0.0); - EXPECT_TRUE(VentSlab(Item).TotCoolCoilPower > VentSlab(Item).SensCoolCoilPower); - EXPECT_TRUE(VentSlab(Item).LateCoolCoilPower > 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).HeatCoilPower == 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower > 0.0); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilPower > state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower); + EXPECT_TRUE(state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilPower > 0.0); EXPECT_TRUE(LatOutputProvided < 0.0); EXPECT_TRUE(PowerMet < 0.0); @@ -2329,11 +2329,11 @@ TEST_F(EnergyPlusFixture, VentilatedSlab_InitVentilatedSlabTest) EXPECT_FALSE(ErrorsFound); GetVentilatedSlabInput(state); // read ventilated slab data - EXPECT_EQ(2, NumOfVentSlabs); - EXPECT_EQ("ZONE1VENTSLAB", VentSlab(1).Name); - EXPECT_EQ("ZONE4VENTSLAB", VentSlab(2).Name); + EXPECT_EQ(2, state.dataVentilatedSlab->NumOfVentSlabs); + EXPECT_EQ("ZONE1VENTSLAB", state.dataVentilatedSlab->VentSlab(1).Name); + EXPECT_EQ("ZONE4VENTSLAB", state.dataVentilatedSlab->VentSlab(2).Name); InitVentilatedSlab(state, Item, VentSlabZoneNum, FirstHVACIteration); - EXPECT_EQ(324.38499999999999, VentSlab(1).TotalSurfaceArea); - EXPECT_EQ(139.21499999999997, VentSlab(2).TotalSurfaceArea); + EXPECT_EQ(324.38499999999999, state.dataVentilatedSlab->VentSlab(1).TotalSurfaceArea); + EXPECT_EQ(139.21499999999997, state.dataVentilatedSlab->VentSlab(2).TotalSurfaceArea); }