diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index 318cabe5cca..a6761c15c55 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -105,7 +105,7 @@ namespace BaseboardElectric { Real64 QZnReq; // zone load not yet satisfied if (state.dataBaseboardElectric->getInputFlag) { - GetBaseboardInput(*state.dataBaseboardElectric); + GetBaseboardInput(state); state.dataBaseboardElectric->getInputFlag = false; } @@ -133,12 +133,12 @@ namespace BaseboardElectric { } } - InitBaseboard(state, *baseboard, BaseboardNum, ControlledZoneNum); + InitBaseboard(state, BaseboardNum, ControlledZoneNum); QZnReq = ZoneSysEnergyDemand(ActualZoneNum).RemainingOutputReqToHeatSP; // Simulate baseboard - SimElectricConvective(*baseboard, BaseboardNum, QZnReq); + SimElectricConvective(state, BaseboardNum, QZnReq); PowerMet = baseboard->Baseboard(BaseboardNum).Power; @@ -146,7 +146,7 @@ namespace BaseboardElectric { baseboard->Baseboard(BaseboardNum).ElecUseLoad = baseboard->Baseboard(BaseboardNum).ElecUseRate * DataHVACGlobals::TimeStepSys * SecInHour; } - void GetBaseboardInput(BaseboardElectricData &baseboard) + void GetBaseboardInput(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -193,15 +193,17 @@ namespace BaseboardElectric { int CtrlZone; // index to constrolled zone number int ZoneEquipTypeNum; // index to zone equipment in a zone equipment list + auto & baseboard = state.dataBaseboardElectric; + cCurrentModuleObject = cCMO_BBRadiator_Electric; NumConvElecBaseboards = inputProcessor->getNumObjectsFound(cCurrentModuleObject); // Calculate total number of baseboard units - baseboard.NumBaseboards = NumConvElecBaseboards; + baseboard->NumBaseboards = NumConvElecBaseboards; - baseboard.Baseboard.allocate(baseboard.NumBaseboards); - baseboard.BaseboardNumericFields.allocate(baseboard.NumBaseboards); + baseboard->Baseboard.allocate(baseboard->NumBaseboards); + baseboard->BaseboardNumericFields.allocate(baseboard->NumBaseboards); if (NumConvElecBaseboards > 0) { // Get the data for cooling schemes BaseboardNum = 0; @@ -219,9 +221,9 @@ namespace BaseboardElectric { cAlphaFieldNames, cNumericFieldNames); - baseboard.BaseboardNumericFields(ConvElecBBNum).FieldNames.allocate(NumNums); - baseboard.BaseboardNumericFields(ConvElecBBNum).FieldNames = ""; - baseboard.BaseboardNumericFields(ConvElecBBNum).FieldNames = cNumericFieldNames; + baseboard->BaseboardNumericFields(ConvElecBBNum).FieldNames.allocate(NumNums); + baseboard->BaseboardNumericFields(ConvElecBBNum).FieldNames = ""; + baseboard->BaseboardNumericFields(ConvElecBBNum).FieldNames = cNumericFieldNames; if (UtilityRoutines::IsNameEmpty(cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { continue; @@ -231,7 +233,7 @@ namespace BaseboardElectric { VerifyUniqueBaseboardName(cCurrentModuleObject, cAlphaArgs(1), ErrorsFound, cCurrentModuleObject + " Name"); ++BaseboardNum; - auto & thisBaseboard = baseboard.Baseboard(BaseboardNum); + auto & thisBaseboard = baseboard->Baseboard(BaseboardNum); thisBaseboard.EquipName = cAlphaArgs(1); // name of this baseboard thisBaseboard.EquipType = UtilityRoutines::MakeUPPERCase(cCurrentModuleObject); // the type of baseboard-rename change thisBaseboard.Schedule = cAlphaArgs(2); @@ -324,12 +326,12 @@ namespace BaseboardElectric { } } - for (BaseboardNum = 1; BaseboardNum <= baseboard.NumBaseboards; ++BaseboardNum) { + for (BaseboardNum = 1; BaseboardNum <= baseboard->NumBaseboards; ++BaseboardNum) { // Setup Report variables for the Electric Baseboards // CurrentModuleObject='ZoneHVAC:Baseboard:Convective:Electric' - auto &thisBaseboard = baseboard.Baseboard(BaseboardNum); + auto &thisBaseboard = baseboard->Baseboard(BaseboardNum); SetupOutputVariable("Baseboard Total Heating Energy", OutputProcessor::Unit::J, thisBaseboard.Energy, @@ -370,7 +372,7 @@ namespace BaseboardElectric { } } - void InitBaseboard(EnergyPlusData &state, BaseboardElectricData &baseboard, int const BaseboardNum, int const ControlledZoneNum) + void InitBaseboard(EnergyPlusData &state, int const BaseboardNum, int const ControlledZoneNum) { // SUBROUTINE INFORMATION: @@ -391,46 +393,48 @@ namespace BaseboardElectric { int ZoneNode; int Loop; static Array1D_bool MyEnvrnFlag; + + auto & baseboard = state.dataBaseboardElectric; // Do the one time initializations - if (baseboard.MyOneTimeFlag) { + if (baseboard->MyOneTimeFlag) { // initialize the environment and sizing flags - MyEnvrnFlag.allocate(baseboard.NumBaseboards); + MyEnvrnFlag.allocate(baseboard->NumBaseboards); MyEnvrnFlag = true; - baseboard.MyOneTimeFlag = false; + baseboard->MyOneTimeFlag = false; } // need to check all units to see if they are on ZoneHVAC:EquipmentList or issue warning - if (!baseboard.ZoneEquipmentListChecked && ZoneEquipInputsFilled) { - baseboard.ZoneEquipmentListChecked = true; - for (Loop = 1; Loop <= baseboard.NumBaseboards; ++Loop) { - if (CheckZoneEquipmentList(baseboard.Baseboard(Loop).EquipType, baseboard.Baseboard(Loop).EquipName)) continue; - ShowSevereError("InitBaseboard: Unit=[" + baseboard.Baseboard(Loop).EquipType + ',' + baseboard.Baseboard(Loop).EquipName + + if (!baseboard->ZoneEquipmentListChecked && ZoneEquipInputsFilled) { + baseboard->ZoneEquipmentListChecked = true; + for (Loop = 1; Loop <= baseboard->NumBaseboards; ++Loop) { + if (CheckZoneEquipmentList(baseboard->Baseboard(Loop).EquipType, baseboard->Baseboard(Loop).EquipName)) continue; + ShowSevereError("InitBaseboard: Unit=[" + baseboard->Baseboard(Loop).EquipType + ',' + baseboard->Baseboard(Loop).EquipName + "] is not on any ZoneHVAC:EquipmentList. It will not be simulated."); } } - if (!SysSizingCalc && baseboard.Baseboard(BaseboardNum).MySizeFlag) { + if (!SysSizingCalc && baseboard->Baseboard(BaseboardNum).MySizeFlag) { // for each coil, do the sizing once. - SizeElectricBaseboard(state,baseboard, BaseboardNum); + SizeElectricBaseboard(state, BaseboardNum); - baseboard.Baseboard(BaseboardNum).MySizeFlag = false; + baseboard->Baseboard(BaseboardNum).MySizeFlag = false; } // Set the reporting variables to zero at each timestep. - baseboard.Baseboard(BaseboardNum).Energy = 0.0; - baseboard.Baseboard(BaseboardNum).Power = 0.0; - baseboard.Baseboard(BaseboardNum).ElecUseLoad = 0.0; - baseboard.Baseboard(BaseboardNum).ElecUseRate = 0.0; + baseboard->Baseboard(BaseboardNum).Energy = 0.0; + baseboard->Baseboard(BaseboardNum).Power = 0.0; + baseboard->Baseboard(BaseboardNum).ElecUseLoad = 0.0; + baseboard->Baseboard(BaseboardNum).ElecUseRate = 0.0; // Do the every time step initializations ZoneNode = ZoneEquipConfig(ControlledZoneNum).ZoneNode; - baseboard.Baseboard(BaseboardNum).AirInletTemp = Node(ZoneNode).Temp; - baseboard.Baseboard(BaseboardNum).AirInletHumRat = Node(ZoneNode).HumRat; + baseboard->Baseboard(BaseboardNum).AirInletTemp = Node(ZoneNode).Temp; + baseboard->Baseboard(BaseboardNum).AirInletHumRat = Node(ZoneNode).HumRat; } - void SizeElectricBaseboard(EnergyPlusData &state, BaseboardElectricData &baseboard, int const BaseboardNum) + void SizeElectricBaseboard(EnergyPlusData &state, int const BaseboardNum) { // SUBROUTINE INFORMATION: @@ -459,6 +463,8 @@ namespace BaseboardElectric { // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("SizeElectricBaseboard"); + auto & baseboard = state.dataBaseboardElectric; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: std::string CompName; // component name @@ -476,48 +482,48 @@ namespace BaseboardElectric { if (CurZoneEqNum > 0) { - CompType = baseboard.Baseboard(BaseboardNum).EquipType; - CompName = baseboard.Baseboard(BaseboardNum).EquipName; + CompType = baseboard->Baseboard(BaseboardNum).EquipType; + CompName = baseboard->Baseboard(BaseboardNum).EquipName; DataFracOfAutosizedHeatingCapacity = 1.0; - DataZoneNumber = baseboard.Baseboard(BaseboardNum).ZonePtr; + DataZoneNumber = baseboard->Baseboard(BaseboardNum).ZonePtr; SizingMethod = HeatingCapacitySizing; FieldNum = 1; PrintFlag = true; - SizingString = baseboard.BaseboardNumericFields(BaseboardNum).FieldNames(FieldNum) + " [W]"; - CapSizingMethod = baseboard.Baseboard(BaseboardNum).HeatingCapMethod; + SizingString = baseboard->BaseboardNumericFields(BaseboardNum).FieldNames(FieldNum) + " [W]"; + CapSizingMethod = baseboard->Baseboard(BaseboardNum).HeatingCapMethod; ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || CapSizingMethod == FractionOfAutosizedHeatingCapacity) { if (CapSizingMethod == HeatingDesignCapacity) { - if (baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity == AutoSize) { + if (baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity == AutoSize) { CheckZoneSizing(CompType, CompName); ZoneEqSizing(CurZoneEqNum).HeatingCapacity = true; ZoneEqSizing(CurZoneEqNum).DesHeatingLoad = FinalZoneSizing(CurZoneEqNum).NonAirSysDesHeatLoad; } - TempSize = baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity; + TempSize = baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity; } else if (CapSizingMethod == CapacityPerFloorArea) { ZoneEqSizing(CurZoneEqNum).HeatingCapacity = true; - ZoneEqSizing(CurZoneEqNum).DesHeatingLoad = baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity * Zone(DataZoneNumber).FloorArea; + ZoneEqSizing(CurZoneEqNum).DesHeatingLoad = baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity * Zone(DataZoneNumber).FloorArea; TempSize = ZoneEqSizing(CurZoneEqNum).DesHeatingLoad; DataScalableCapSizingON = true; } else if (CapSizingMethod == FractionOfAutosizedHeatingCapacity) { CheckZoneSizing(CompType, CompName); ZoneEqSizing(CurZoneEqNum).HeatingCapacity = true; - DataFracOfAutosizedHeatingCapacity = baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity; + DataFracOfAutosizedHeatingCapacity = baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity; ZoneEqSizing(CurZoneEqNum).DesHeatingLoad = FinalZoneSizing(CurZoneEqNum).NonAirSysDesHeatLoad; TempSize = AutoSize; DataScalableCapSizingON = true; } else { - TempSize = baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity; + TempSize = baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity; } RequestSizing(state, CompType, CompName, SizingMethod, SizingString, TempSize, PrintFlag, RoutineName); - baseboard.Baseboard(BaseboardNum).NominalCapacity = TempSize; + baseboard->Baseboard(BaseboardNum).NominalCapacity = TempSize; DataScalableCapSizingON = false; } } } - void SimElectricConvective(BaseboardElectricData &baseboard, int const BaseboardNum, Real64 const LoadMet) + void SimElectricConvective(EnergyPlusData &state, int const BaseboardNum, Real64 const LoadMet) { // SUBROUTINE INFORMATION: // AUTHOR Richard Liesen @@ -547,19 +553,21 @@ namespace BaseboardElectric { Real64 AirOutletTemp; Real64 QBBCap; - AirInletTemp = baseboard.Baseboard(BaseboardNum).AirInletTemp; - CpAir = PsyCpAirFnW(baseboard.Baseboard(BaseboardNum).AirInletHumRat); + auto & baseboard = state.dataBaseboardElectric; + + AirInletTemp = baseboard->Baseboard(BaseboardNum).AirInletTemp; + CpAir = PsyCpAirFnW(baseboard->Baseboard(BaseboardNum).AirInletHumRat); AirMassFlowRate = SimpConvAirFlowSpeed; CapacitanceAir = CpAir * AirMassFlowRate; // currently only the efficiency is used to calculate the electric consumption. There could be some // thermal loss that could be accounted for with this efficiency input. - Effic = baseboard.Baseboard(BaseboardNum).BaseboardEfficiency; + Effic = baseboard->Baseboard(BaseboardNum).BaseboardEfficiency; - if (GetCurrentScheduleValue(baseboard.Baseboard(BaseboardNum).SchedPtr) > 0.0 && LoadMet >= SmallLoad) { + if (GetCurrentScheduleValue(baseboard->Baseboard(BaseboardNum).SchedPtr) > 0.0 && LoadMet >= SmallLoad) { // if the load exceeds the capacity than the capacity is set to the BB limit. - if (LoadMet > baseboard.Baseboard(BaseboardNum).NominalCapacity) { - QBBCap = baseboard.Baseboard(BaseboardNum).NominalCapacity; + if (LoadMet > baseboard->Baseboard(BaseboardNum).NominalCapacity) { + QBBCap = baseboard->Baseboard(BaseboardNum).NominalCapacity; } else { QBBCap = LoadMet; } @@ -568,17 +576,17 @@ namespace BaseboardElectric { AirOutletTemp = AirInletTemp + QBBCap / CapacitanceAir; // The Baseboard electric Load is calculated using the efficiency - baseboard.Baseboard(BaseboardNum).ElecUseRate = QBBCap / Effic; + baseboard->Baseboard(BaseboardNum).ElecUseRate = QBBCap / Effic; } else { // if there is an off condition the BB does nothing. AirOutletTemp = AirInletTemp; QBBCap = 0.0; - baseboard.Baseboard(BaseboardNum).ElecUseRate = 0.0; + baseboard->Baseboard(BaseboardNum).ElecUseRate = 0.0; } - baseboard.Baseboard(BaseboardNum).AirOutletTemp = AirOutletTemp; - baseboard.Baseboard(BaseboardNum).Power = QBBCap; + baseboard->Baseboard(BaseboardNum).AirOutletTemp = AirOutletTemp; + baseboard->Baseboard(BaseboardNum).Power = QBBCap; } } // namespace BaseboardElectric diff --git a/src/EnergyPlus/BaseboardElectric.hh b/src/EnergyPlus/BaseboardElectric.hh index 613398f6964..0e6a9f4116f 100644 --- a/src/EnergyPlus/BaseboardElectric.hh +++ b/src/EnergyPlus/BaseboardElectric.hh @@ -107,13 +107,13 @@ namespace BaseboardElectric { void SimElectricBaseboard(EnergyPlusData &state, std::string const &EquipName, int ActualZoneNum, int ControlledZoneNum, Real64 &PowerMet, int &CompIndex); - void GetBaseboardInput(BaseboardElectricData &baseboard); + void GetBaseboardInput(EnergyPlusData &state); - void InitBaseboard(EnergyPlusData &state, BaseboardElectricData &baseboard, int BaseboardNum, int ControlledZoneNum); + void InitBaseboard(EnergyPlusData &state, int BaseboardNum, int ControlledZoneNum); - void SizeElectricBaseboard(EnergyPlusData &state, BaseboardElectricData &baseboard, int BaseboardNum); + void SizeElectricBaseboard(EnergyPlusData &state, int BaseboardNum); - void SimElectricConvective(BaseboardElectricData &baseboard, int BaseboardNum, Real64 LoadMet); + void SimElectricConvective(EnergyPlusData &state, int BaseboardNum, Real64 LoadMet); } // namespace BaseboardElectric diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index 85d9bf1702c..3adaf4e81e3 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -145,7 +145,7 @@ namespace BaseboardRadiator { auto &baseboard = state.dataBaseboardRadiator; if (baseboard->getInputFlag) { - GetBaseboardInput(*baseboard); + GetBaseboardInput(state); baseboard->getInputFlag = false; } @@ -236,12 +236,12 @@ namespace BaseboardRadiator { PowerMet = baseboard->Baseboard(BaseboardNum).Power; } - UpdateBaseboard(*baseboard, BaseboardNum); + UpdateBaseboard(state, BaseboardNum); baseboard->Baseboard(BaseboardNum).Energy = baseboard->Baseboard(BaseboardNum).Power * DataHVACGlobals::TimeStepSys * SecInHour; } - void GetBaseboardInput(BaseboardRadiatorData &baseboard) + void GetBaseboardInput(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -283,15 +283,17 @@ namespace BaseboardRadiator { int IOStat; bool ErrorsFound(false); // If errors detected in input + auto & baseboard = state.dataBaseboardRadiator; + cCurrentModuleObject = cCMO_BBRadiator_Water; NumConvHWBaseboards = inputProcessor->getNumObjectsFound(cCurrentModuleObject); // Calculate total number of baseboard units - baseboard.NumBaseboards = NumConvHWBaseboards; + baseboard->NumBaseboards = NumConvHWBaseboards; - baseboard.Baseboard.allocate(baseboard.NumBaseboards); - baseboard.BaseboardParamsNumericFields.allocate(baseboard.NumBaseboards); + baseboard->Baseboard.allocate(baseboard->NumBaseboards); + baseboard->BaseboardParamsNumericFields.allocate(baseboard->NumBaseboards); if (NumConvHWBaseboards > 0) { // Get the data for cooling schemes BaseboardNum = 0; @@ -309,9 +311,9 @@ namespace BaseboardRadiator { cAlphaFieldNames, cNumericFieldNames); - baseboard.BaseboardParamsNumericFields(ConvHWBaseboardNum).FieldNames.allocate(NumNums); - baseboard.BaseboardParamsNumericFields(ConvHWBaseboardNum).FieldNames = ""; - baseboard.BaseboardParamsNumericFields(ConvHWBaseboardNum).FieldNames = cNumericFieldNames; + baseboard->BaseboardParamsNumericFields(ConvHWBaseboardNum).FieldNames.allocate(NumNums); + baseboard->BaseboardParamsNumericFields(ConvHWBaseboardNum).FieldNames = ""; + baseboard->BaseboardParamsNumericFields(ConvHWBaseboardNum).FieldNames = cNumericFieldNames; if (UtilityRoutines::IsNameEmpty(cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { continue; @@ -321,95 +323,95 @@ namespace BaseboardRadiator { VerifyUniqueBaseboardName(cCurrentModuleObject, cAlphaArgs(1), ErrorsFound, cCurrentModuleObject + " Name"); ++BaseboardNum; - baseboard.Baseboard(BaseboardNum).EquipID = cAlphaArgs(1); // name of this baseboard - baseboard.Baseboard(BaseboardNum).EquipType = TypeOf_Baseboard_Conv_Water; - baseboard.Baseboard(BaseboardNum).Schedule = cAlphaArgs(2); + baseboard->Baseboard(BaseboardNum).EquipID = cAlphaArgs(1); // name of this baseboard + baseboard->Baseboard(BaseboardNum).EquipType = TypeOf_Baseboard_Conv_Water; + baseboard->Baseboard(BaseboardNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { - baseboard.Baseboard(BaseboardNum).SchedPtr = ScheduleAlwaysOn; + baseboard->Baseboard(BaseboardNum).SchedPtr = ScheduleAlwaysOn; } else { - baseboard.Baseboard(BaseboardNum).SchedPtr = GetScheduleIndex(cAlphaArgs(2)); - if (baseboard.Baseboard(BaseboardNum).SchedPtr == 0) { + baseboard->Baseboard(BaseboardNum).SchedPtr = GetScheduleIndex(cAlphaArgs(2)); + if (baseboard->Baseboard(BaseboardNum).SchedPtr == 0) { ShowSevereError(RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames(2) + " entered =" + cAlphaArgs(2) + " for " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1)); ErrorsFound = true; } } // get inlet node number - baseboard.Baseboard(BaseboardNum).WaterInletNode = GetOnlySingleNode( + baseboard->Baseboard(BaseboardNum).WaterInletNode = GetOnlySingleNode( cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); // get outlet node number - baseboard.Baseboard(BaseboardNum).WaterOutletNode = GetOnlySingleNode( + baseboard->Baseboard(BaseboardNum).WaterOutletNode = GetOnlySingleNode( cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); TestCompSet(cCMO_BBRadiator_Water, cAlphaArgs(1), cAlphaArgs(3), cAlphaArgs(4), "Hot Water Nodes"); // Determine steam baseboard radiator system heating design capacity sizing method if (UtilityRoutines::SameString(cAlphaArgs(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { - baseboard.Baseboard(BaseboardNum).HeatingCapMethod = HeatingDesignCapacity; + baseboard->Baseboard(BaseboardNum).HeatingCapMethod = HeatingDesignCapacity; if (!lNumericFieldBlanks(iHeatDesignCapacityNumericNum)) { - baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatDesignCapacityNumericNum); - if (baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity < 0.0 && baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity != AutoSize) { - ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatDesignCapacityNumericNum); + if (baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity < 0.0 && baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity != AutoSize) { + ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); ShowContinueError("Illegal " + cNumericFieldNames(iHeatDesignCapacityNumericNum) + " = " + TrimSigDigits(rNumericArgs(iHeatDesignCapacityNumericNum), 7)); ErrorsFound = true; } } else { - ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard.Baseboard(BaseboardNum).EquipID); + ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); ShowContinueError("Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); ShowContinueError("Blank field not allowed for " + cNumericFieldNames(iHeatDesignCapacityNumericNum)); ErrorsFound = true; } } else if (UtilityRoutines::SameString(cAlphaArgs(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { - baseboard.Baseboard(BaseboardNum).HeatingCapMethod = CapacityPerFloorArea; + baseboard->Baseboard(BaseboardNum).HeatingCapMethod = CapacityPerFloorArea; if (!lNumericFieldBlanks(iHeatCapacityPerFloorAreaNumericNum)) { - baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatCapacityPerFloorAreaNumericNum); - if (baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity <= 0.0) { - ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatCapacityPerFloorAreaNumericNum); + if (baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity <= 0.0) { + ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); ShowContinueError("Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); ShowContinueError("Illegal " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum) + " = " + TrimSigDigits(rNumericArgs(iHeatCapacityPerFloorAreaNumericNum), 7)); ErrorsFound = true; - } else if (baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity == AutoSize) { - ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard.Baseboard(BaseboardNum).EquipID); + } else if (baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity == AutoSize) { + ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); ShowContinueError("Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); ShowContinueError("Illegal " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum) + " = Autosize"); ErrorsFound = true; } } else { - ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard.Baseboard(BaseboardNum).EquipID); + ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); ShowContinueError("Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); ShowContinueError("Blank field not allowed for " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum)); ErrorsFound = true; } } else if (UtilityRoutines::SameString(cAlphaArgs(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { - baseboard.Baseboard(BaseboardNum).HeatingCapMethod = FractionOfAutosizedHeatingCapacity; + baseboard->Baseboard(BaseboardNum).HeatingCapMethod = FractionOfAutosizedHeatingCapacity; if (!lNumericFieldBlanks(iHeatFracOfAutosizedCapacityNumericNum)) { - baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); - if (baseboard.Baseboard(BaseboardNum).ScaledHeatingCapacity < 0.0) { - ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); + if (baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity < 0.0) { + ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); ShowContinueError("Illegal " + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum) + " = " + TrimSigDigits(rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum), 7)); ErrorsFound = true; } } else { - ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard.Baseboard(BaseboardNum).EquipID); + ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); ShowContinueError("Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); ShowContinueError("Blank field not allowed for " + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum)); ErrorsFound = true; } } else { - ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard.Baseboard(BaseboardNum).EquipID); + ShowSevereError(cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); ShowContinueError("Illegal " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); ErrorsFound = true; } - baseboard.Baseboard(BaseboardNum).UA = rNumericArgs(4); - baseboard.Baseboard(BaseboardNum).WaterVolFlowRateMax = rNumericArgs(5); - baseboard.Baseboard(BaseboardNum).Offset = rNumericArgs(6); + baseboard->Baseboard(BaseboardNum).UA = rNumericArgs(4); + baseboard->Baseboard(BaseboardNum).WaterVolFlowRateMax = rNumericArgs(5); + baseboard->Baseboard(BaseboardNum).Offset = rNumericArgs(6); // Set default convergence tolerance - if (baseboard.Baseboard(BaseboardNum).Offset <= 0.0) { - baseboard.Baseboard(BaseboardNum).Offset = 0.001; + if (baseboard->Baseboard(BaseboardNum).Offset <= 0.0) { + baseboard->Baseboard(BaseboardNum).Offset = 0.001; } } @@ -418,16 +420,16 @@ namespace BaseboardRadiator { } } - for (BaseboardNum = 1; BaseboardNum <= baseboard.NumBaseboards; ++BaseboardNum) { + for (BaseboardNum = 1; BaseboardNum <= baseboard->NumBaseboards; ++BaseboardNum) { // Setup Report variables for the unit // CurrentModuleObject='ZoneHVAC:Baseboard:Convective:Water' SetupOutputVariable("Baseboard Total Heating Energy", OutputProcessor::Unit::J, - baseboard.Baseboard(BaseboardNum).Energy, + baseboard->Baseboard(BaseboardNum).Energy, "System", "Sum", - baseboard.Baseboard(BaseboardNum).EquipID, + baseboard->Baseboard(BaseboardNum).EquipID, _, "ENERGYTRANSFER", "BASEBOARD", @@ -436,10 +438,10 @@ namespace BaseboardRadiator { SetupOutputVariable("Baseboard Hot Water Energy", OutputProcessor::Unit::J, - baseboard.Baseboard(BaseboardNum).Energy, + baseboard->Baseboard(BaseboardNum).Energy, "System", "Sum", - baseboard.Baseboard(BaseboardNum).EquipID, + baseboard->Baseboard(BaseboardNum).EquipID, _, "PLANTLOOPHEATINGDEMAND", "BASEBOARD", @@ -448,52 +450,52 @@ namespace BaseboardRadiator { SetupOutputVariable("Baseboard Total Heating Rate", OutputProcessor::Unit::W, - baseboard.Baseboard(BaseboardNum).Power, + baseboard->Baseboard(BaseboardNum).Power, "System", "Average", - baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).EquipID); SetupOutputVariable("Baseboard Hot Water Mass Flow Rate", OutputProcessor::Unit::kg_s, - baseboard.Baseboard(BaseboardNum).WaterMassFlowRate, + baseboard->Baseboard(BaseboardNum).WaterMassFlowRate, "System", "Average", - baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).EquipID); SetupOutputVariable("Baseboard Air Mass Flow Rate", OutputProcessor::Unit::kg_s, - baseboard.Baseboard(BaseboardNum).AirMassFlowRate, + baseboard->Baseboard(BaseboardNum).AirMassFlowRate, "System", "Average", - baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).EquipID); SetupOutputVariable("Baseboard Air Inlet Temperature", OutputProcessor::Unit::C, - baseboard.Baseboard(BaseboardNum).AirInletTemp, + baseboard->Baseboard(BaseboardNum).AirInletTemp, "System", "Average", - baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).EquipID); SetupOutputVariable("Baseboard Air Outlet Temperature", OutputProcessor::Unit::C, - baseboard.Baseboard(BaseboardNum).AirOutletTemp, + baseboard->Baseboard(BaseboardNum).AirOutletTemp, "System", "Average", - baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).EquipID); SetupOutputVariable("Baseboard Water Inlet Temperature", OutputProcessor::Unit::C, - baseboard.Baseboard(BaseboardNum).WaterInletTemp, + baseboard->Baseboard(BaseboardNum).WaterInletTemp, "System", "Average", - baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).EquipID); SetupOutputVariable("Baseboard Water Outlet Temperature", OutputProcessor::Unit::C, - baseboard.Baseboard(BaseboardNum).WaterOutletTemp, + baseboard->Baseboard(BaseboardNum).WaterOutletTemp, "System", "Average", - baseboard.Baseboard(BaseboardNum).EquipID); + baseboard->Baseboard(BaseboardNum).EquipID); } } @@ -874,11 +876,11 @@ namespace BaseboardRadiator { baseboard->Baseboard(BaseboardNum).UA = UA0; Real64 LoadMet = 0.0; int BBIndex = BaseboardNum; - SimHWConvective(*baseboard, BBIndex, LoadMet); + SimHWConvective(state, BBIndex, LoadMet); if (LoadMet < DesCoilLoad) { // baseboard output should be below design load // now check output at max UA (where UA = design load) baseboard->Baseboard(BaseboardNum).UA = UA1; - SimHWConvective(*baseboard, BBIndex, LoadMet); + SimHWConvective(state, BBIndex, LoadMet); if (LoadMet > DesCoilLoad) { // if the load met is greater than design load, OK to iterate on UA // Invert the baseboard model: given the design inlet conditions and the design load, @@ -983,7 +985,7 @@ namespace BaseboardRadiator { } } - void SimHWConvective(BaseboardRadiatorData &baseboard, int &BaseboardNum, Real64 &LoadMet) + void SimHWConvective(EnergyPlusData &state, int &BaseboardNum, Real64 &LoadMet) { // SUBROUTINE INFORMATION: // AUTHOR Russ Taylor @@ -1035,35 +1037,37 @@ namespace BaseboardRadiator { Real64 CC; Real64 QZnReq; - ZoneNum = baseboard.Baseboard(BaseboardNum).ZonePtr; + auto &baseboard = state.dataBaseboardRadiator; + + ZoneNum = baseboard->Baseboard(BaseboardNum).ZonePtr; QZnReq = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; - if (baseboard.Baseboard(BaseboardNum).MySizeFlag) QZnReq = FinalZoneSizing(CurZoneEqNum).NonAirSysDesHeatLoad; // If in sizing, assign design condition + if (baseboard->Baseboard(BaseboardNum).MySizeFlag) QZnReq = FinalZoneSizing(CurZoneEqNum).NonAirSysDesHeatLoad; // If in sizing, assign design condition - WaterInletTemp = baseboard.Baseboard(BaseboardNum).WaterInletTemp; - AirInletTemp = baseboard.Baseboard(BaseboardNum).AirInletTemp; + WaterInletTemp = baseboard->Baseboard(BaseboardNum).WaterInletTemp; + AirInletTemp = baseboard->Baseboard(BaseboardNum).AirInletTemp; CpWater = GetSpecificHeatGlycol( - PlantLoop(baseboard.Baseboard(BaseboardNum).LoopNum).FluidName, WaterInletTemp, PlantLoop(baseboard.Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); - CpAir = PsyCpAirFnW(baseboard.Baseboard(BaseboardNum).AirInletHumRat); + PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, WaterInletTemp, PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); + CpAir = PsyCpAirFnW(baseboard->Baseboard(BaseboardNum).AirInletHumRat); - if (baseboard.Baseboard(BaseboardNum).DesAirMassFlowRate > 0.0) { // If UA is autosized, assign design condition - AirMassFlowRate = baseboard.Baseboard(BaseboardNum).DesAirMassFlowRate; + if (baseboard->Baseboard(BaseboardNum).DesAirMassFlowRate > 0.0) { // If UA is autosized, assign design condition + AirMassFlowRate = baseboard->Baseboard(BaseboardNum).DesAirMassFlowRate; } else { - AirMassFlowRate = baseboard.Baseboard(BaseboardNum).AirMassFlowRate; + AirMassFlowRate = baseboard->Baseboard(BaseboardNum).AirMassFlowRate; // pick a mass flow rate that depends on the max water mass flow rate. CR 8842 changed to factor of 2.0 - if (AirMassFlowRate <= 0.0) AirMassFlowRate = 2.0 * baseboard.Baseboard(BaseboardNum).WaterMassFlowRateMax; + if (AirMassFlowRate <= 0.0) AirMassFlowRate = 2.0 * baseboard->Baseboard(BaseboardNum).WaterMassFlowRateMax; } - WaterMassFlowRate = Node(baseboard.Baseboard(BaseboardNum).WaterInletNode).MassFlowRate; + WaterMassFlowRate = Node(baseboard->Baseboard(BaseboardNum).WaterInletNode).MassFlowRate; CapacitanceAir = CpAir * AirMassFlowRate; - if (QZnReq > SmallLoad && (!CurDeadBandOrSetback(ZoneNum) || baseboard.Baseboard(BaseboardNum).MySizeFlag) && - (GetCurrentScheduleValue(baseboard.Baseboard(BaseboardNum).SchedPtr) > 0 || baseboard.Baseboard(BaseboardNum).MySizeFlag) && (WaterMassFlowRate > 0.0)) { + if (QZnReq > SmallLoad && (!CurDeadBandOrSetback(ZoneNum) || baseboard->Baseboard(BaseboardNum).MySizeFlag) && + (GetCurrentScheduleValue(baseboard->Baseboard(BaseboardNum).SchedPtr) > 0 || baseboard->Baseboard(BaseboardNum).MySizeFlag) && (WaterMassFlowRate > 0.0)) { CapacitanceWater = CpWater * WaterMassFlowRate; CapacitanceMax = max(CapacitanceAir, CapacitanceWater); CapacitanceMin = min(CapacitanceAir, CapacitanceWater); CapacityRatio = CapacitanceMin / CapacitanceMax; - NTU = baseboard.Baseboard(BaseboardNum).UA / CapacitanceMin; + NTU = baseboard->Baseboard(BaseboardNum).UA / CapacitanceMin; // The effectiveness is given by the following formula: // Effectiveness = 1. - EXP((1./CapacityRatio)*(NTU)**0.22*(EXP(-CapacityRatio*(NTU)**0.78)-1.)) // To prevent possible underflows (numbers smaller than the computer can handle) we must break @@ -1083,7 +1087,7 @@ namespace BaseboardRadiator { AirOutletTemp = AirInletTemp + Effectiveness * CapacitanceMin * (WaterInletTemp - AirInletTemp) / CapacitanceAir; WaterOutletTemp = WaterInletTemp - CapacitanceAir * (AirOutletTemp - AirInletTemp) / CapacitanceWater; LoadMet = CapacitanceWater * (WaterInletTemp - WaterOutletTemp); - baseboard.Baseboard(BaseboardNum).WaterOutletEnthalpy = baseboard.Baseboard(BaseboardNum).WaterInletEnthalpy - LoadMet / WaterMassFlowRate; + baseboard->Baseboard(BaseboardNum).WaterOutletEnthalpy = baseboard->Baseboard(BaseboardNum).WaterInletEnthalpy - LoadMet / WaterMassFlowRate; } else { CapacitanceWater = 0.0; CapacitanceMax = CapacitanceAir; @@ -1093,26 +1097,26 @@ namespace BaseboardRadiator { AirOutletTemp = AirInletTemp; WaterOutletTemp = WaterInletTemp; LoadMet = 0.0; - baseboard.Baseboard(BaseboardNum).WaterOutletEnthalpy = baseboard.Baseboard(BaseboardNum).WaterInletEnthalpy; + baseboard->Baseboard(BaseboardNum).WaterOutletEnthalpy = baseboard->Baseboard(BaseboardNum).WaterInletEnthalpy; WaterMassFlowRate = 0.0; SetActuatedBranchFlowRate(WaterMassFlowRate, - baseboard.Baseboard(BaseboardNum).WaterInletNode, - baseboard.Baseboard(BaseboardNum).LoopNum, - baseboard.Baseboard(BaseboardNum).LoopSideNum, - baseboard.Baseboard(BaseboardNum).BranchNum, + baseboard->Baseboard(BaseboardNum).WaterInletNode, + baseboard->Baseboard(BaseboardNum).LoopNum, + baseboard->Baseboard(BaseboardNum).LoopSideNum, + baseboard->Baseboard(BaseboardNum).BranchNum, false); AirMassFlowRate = 0.0; } - baseboard.Baseboard(BaseboardNum).WaterOutletTemp = WaterOutletTemp; - baseboard.Baseboard(BaseboardNum).AirOutletTemp = AirOutletTemp; - baseboard.Baseboard(BaseboardNum).Power = LoadMet; - baseboard.Baseboard(BaseboardNum).WaterMassFlowRate = WaterMassFlowRate; - baseboard.Baseboard(BaseboardNum).AirMassFlowRate = AirMassFlowRate; + baseboard->Baseboard(BaseboardNum).WaterOutletTemp = WaterOutletTemp; + baseboard->Baseboard(BaseboardNum).AirOutletTemp = AirOutletTemp; + baseboard->Baseboard(BaseboardNum).Power = LoadMet; + baseboard->Baseboard(BaseboardNum).WaterMassFlowRate = WaterMassFlowRate; + baseboard->Baseboard(BaseboardNum).AirMassFlowRate = AirMassFlowRate; } - void UpdateBaseboard(BaseboardRadiatorData &baseboard, int &BaseboardNum) + void UpdateBaseboard(EnergyPlusData &state, int &BaseboardNum) { // SUBROUTINE INFORMATION: @@ -1129,14 +1133,16 @@ namespace BaseboardRadiator { int WaterInletNode; int WaterOutletNode; - WaterInletNode = baseboard.Baseboard(BaseboardNum).WaterInletNode; - WaterOutletNode = baseboard.Baseboard(BaseboardNum).WaterOutletNode; + auto & baseboard = state.dataBaseboardRadiator; + + WaterInletNode = baseboard->Baseboard(BaseboardNum).WaterInletNode; + WaterOutletNode = baseboard->Baseboard(BaseboardNum).WaterOutletNode; SafeCopyPlantNode(WaterInletNode, WaterOutletNode); // Set the outlet air nodes of the Baseboard // Set the outlet water nodes for the Coil - Node(WaterOutletNode).Temp = baseboard.Baseboard(BaseboardNum).WaterOutletTemp; - Node(WaterOutletNode).Enthalpy = baseboard.Baseboard(BaseboardNum).WaterOutletEnthalpy; + Node(WaterOutletNode).Temp = baseboard->Baseboard(BaseboardNum).WaterOutletTemp; + Node(WaterOutletNode).Enthalpy = baseboard->Baseboard(BaseboardNum).WaterOutletEnthalpy; } Real64 HWBaseboardUAResidual(EnergyPlusData &state, @@ -1168,7 +1174,7 @@ namespace BaseboardRadiator { BaseboardIndex = int(Par(2)); state.dataBaseboardRadiator->Baseboard(BaseboardIndex).UA = UA; - SimHWConvective(*state.dataBaseboardRadiator, BaseboardIndex, LoadMet); + SimHWConvective(state, BaseboardIndex, LoadMet); Residuum = (Par(1) - LoadMet) / Par(1); return Residuum; diff --git a/src/EnergyPlus/BaseboardRadiator.hh b/src/EnergyPlus/BaseboardRadiator.hh index a70b1a15dc7..0c6e8d067c0 100644 --- a/src/EnergyPlus/BaseboardRadiator.hh +++ b/src/EnergyPlus/BaseboardRadiator.hh @@ -136,15 +136,15 @@ namespace BaseboardRadiator { Real64 &PowerMet, int &CompIndex); - void GetBaseboardInput(BaseboardRadiatorData &baseboard); + void GetBaseboardInput(EnergyPlusData &state); void InitBaseboard(EnergyPlusData &state, int BaseboardNum, int ControlledZoneNumSub); void SizeBaseboard(EnergyPlusData &state, int BaseboardNum); - void SimHWConvective(BaseboardRadiatorData &baseboard, int &BaseboardNum, Real64 &LoadMet); + void SimHWConvective(EnergyPlusData &state, int &BaseboardNum, Real64 &LoadMet); - void UpdateBaseboard(BaseboardRadiatorData &baseboard, int &BaseboardNum); + void UpdateBaseboard(EnergyPlusData &state, int &BaseboardNum); Real64 HWBaseboardUAResidual(EnergyPlusData &state, Real64 UA, // UA of coil diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 3dab6964650..1d71081538b 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -539,7 +539,7 @@ void ControlCompOutput(EnergyPlusData &state, std::string const &CompName, case BBWaterConvOnlyNum: // 'ZONEHVAC:BASEBOARD:CONVECTIVE:WATER' // Simulate baseboard - SimHWConvective(*state.dataBaseboardRadiator, CompNum, LoadMet); + SimHWConvective(state, CompNum, LoadMet); // Calculate the control signal (the variable we are forcing to zero) ZoneController.SensedValue = (LoadMet - QZnReq) / Denom; break; diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index e4406e88395..1840fd01e2a 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -3292,19 +3292,27 @@ namespace WaterThermalTanks { } Tank.Nodes = DataIPShortCuts::rNumericArgs(32); + int specifiedNodes = 0; Tank.AdditionalCond = DataIPShortCuts::rNumericArgs(33); Tank.AdditionalLossCoeff.allocate(Tank.Nodes); Tank.AdditionalLossCoeff = 0.0; - for (int NodeNum = 1; NodeNum <= Tank.Nodes; ++NodeNum) { - if (NumNums > 32 + NodeNum) { - Tank.AdditionalLossCoeff(NodeNum) = DataIPShortCuts::rNumericArgs(33 + NodeNum); + for (int NodeNum = 1; NodeNum <= 12; ++NodeNum) { + int index = 33 + NodeNum; + if (NumNums >= index) { + if (NodeNum <= Tank.Nodes) { + ++specifiedNodes; + Tank.AdditionalLossCoeff(NodeNum) = DataIPShortCuts::rNumericArgs(index); + } else if (!DataIPShortCuts::lNumericFieldBlanks(index) && (DataIPShortCuts::rNumericArgs(index) != 0)) { + // If either blank, or zero (default), then do not warn + ++specifiedNodes; + } } else { break; } } - if (NumNums > 33 + Tank.Nodes) { + if (specifiedNodes > Tank.Nodes) { ShowWarningError(DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": More Additional Loss Coefficients were entered than the number of nodes; extra coefficients will not be used"); } diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index fe24a24fae0..f286d46cad7 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -3557,7 +3557,7 @@ namespace ZoneTempPredictorCorrector { // Calculate the various heat balance sums // NOTE: SumSysMCp and SumSysMCpT are not used in the predict step - CalcZoneSums(*state.dataZonePlenum, ZoneNum, SumIntGain, SumHA, SumHATsurf, SumHATref, SumMCp, SumMCpT, SumSysMCp, SumSysMCpT); + CalcZoneSums(*state.dataZonePlenum, ZoneNum, SumIntGain, SumHA, SumHATsurf, SumHATref, SumMCp, SumMCpT, SumSysMCp, SumSysMCpT, false); // Sum all convective internal gains except for people: SumIntGainExceptPeople if (HybridModel::FlagHybridModel_PC) { @@ -6070,7 +6070,8 @@ namespace ZoneTempPredictorCorrector { Real64 &SumMCp, // Zone sum of MassFlowRate*Cp Real64 &SumMCpT, // Zone sum of MassFlowRate*Cp*T Real64 &SumSysMCp, // Zone sum of air system MassFlowRate*Cp - Real64 &SumSysMCpT // Zone sum of air system MassFlowRate*Cp*T + Real64 &SumSysMCpT, // Zone sum of air system MassFlowRate*Cp*T + bool const CorrectorFlag ) { @@ -6166,84 +6167,85 @@ namespace ZoneTempPredictorCorrector { // Sum all system air flow: SumSysMCp, SumSysMCpT // Check to see if this is a controlled zone ControlledZoneAirFlag = Zone(ZoneNum).IsControlled; + if (CorrectorFlag) { + // Check to see if this is a plenum zone + ZoneRetPlenumAirFlag = Zone(ZoneNum).IsReturnPlenum; + ZoneSupPlenumAirFlag = Zone(ZoneNum).IsSupplyPlenum; + + // Plenum and controlled zones have a different set of inlet nodes which must be calculated. + if (ControlledZoneAirFlag) { + ZoneEquipConfigNum = Zone(ZoneNum).ZoneEqNum; + auto const &zec(ZoneEquipConfig(ZoneEquipConfigNum)); + for (int NodeNum = 1, NodeNum_end = zec.NumInletNodes; NodeNum <= NodeNum_end; ++NodeNum) { + // Get node conditions + // this next block is of interest to irratic system loads... maybe nodes are not accurate at time of call? + // how can we tell? predict step must be lagged ? correct step, systems have run. + auto const &node(Node(zec.InletNode(NodeNum))); + NodeTemp = node.Temp; + MassFlowRate = node.MassFlowRate; + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); - // Check to see if this is a plenum zone - ZoneRetPlenumAirFlag = Zone(ZoneNum).IsReturnPlenum; - ZoneSupPlenumAirFlag = Zone(ZoneNum).IsSupplyPlenum; - - // Plenum and controlled zones have a different set of inlet nodes which must be calculated. - if (ControlledZoneAirFlag) { - ZoneEquipConfigNum = Zone(ZoneNum).ZoneEqNum; - auto const &zec(ZoneEquipConfig(ZoneEquipConfigNum)); - for (int NodeNum = 1, NodeNum_end = zec.NumInletNodes; NodeNum <= NodeNum_end; ++NodeNum) { - // Get node conditions - // this next block is of interest to irratic system loads... maybe nodes are not accurate at time of call? - // how can we tell? predict step must be lagged ? correct step, systems have run. - auto const &node(Node(zec.InletNode(NodeNum))); - NodeTemp = node.Temp; - MassFlowRate = node.MassFlowRate; - CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); - - Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); - SumSysMCp += MassFlowRate_CpAir; - SumSysMCpT += MassFlowRate_CpAir * NodeTemp; - } // NodeNum - - } else if (ZoneRetPlenumAirFlag) { - ZoneRetPlenumNum = Zone(ZoneNum).PlenumCondNum; - auto const &zrpc(dataZonePlenum.ZoneRetPlenCond(ZoneRetPlenumNum)); - Real64 const air_hum_rat(ZoneAirHumRat(ZoneNum)); - for (int NodeNum = 1, NodeNum_end = zrpc.NumInletNodes; NodeNum <= NodeNum_end; ++NodeNum) { - // Get node conditions - auto const &node(Node(zrpc.InletNode(NodeNum))); - NodeTemp = node.Temp; - MassFlowRate = node.MassFlowRate; - CpAir = PsyCpAirFnW(air_hum_rat); - - Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); - SumSysMCp += MassFlowRate_CpAir; - SumSysMCpT += MassFlowRate_CpAir * NodeTemp; - } // NodeNum - // add in the leaks - for (int ADUListIndex = 1, ADUListIndex_end = dataZonePlenum.ZoneRetPlenCond(ZoneRetPlenumNum).NumADUs; ADUListIndex <= ADUListIndex_end; - ++ADUListIndex) { - ADUNum = dataZonePlenum.ZoneRetPlenCond(ZoneRetPlenumNum).ADUIndex(ADUListIndex); - if (AirDistUnit(ADUNum).UpStreamLeak) { - ADUInNode = AirDistUnit(ADUNum).InletNodeNum; - NodeTemp = Node(ADUInNode).Temp; - MassFlowRate = AirDistUnit(ADUNum).MassFlowRateUpStrLk; - CpAir = PsyCpAirFnW(air_hum_rat); Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; SumSysMCpT += MassFlowRate_CpAir * NodeTemp; - } - if (AirDistUnit(ADUNum).DownStreamLeak) { - ADUOutNode = AirDistUnit(ADUNum).OutletNodeNum; - NodeTemp = Node(ADUOutNode).Temp; - MassFlowRate = AirDistUnit(ADUNum).MassFlowRateDnStrLk; + } // NodeNum + + } else if (ZoneRetPlenumAirFlag) { + ZoneRetPlenumNum = Zone(ZoneNum).PlenumCondNum; + auto const &zrpc(dataZonePlenum.ZoneRetPlenCond(ZoneRetPlenumNum)); + Real64 const air_hum_rat(ZoneAirHumRat(ZoneNum)); + for (int NodeNum = 1, NodeNum_end = zrpc.NumInletNodes; NodeNum <= NodeNum_end; ++NodeNum) { + // Get node conditions + auto const &node(Node(zrpc.InletNode(NodeNum))); + NodeTemp = node.Temp; + MassFlowRate = node.MassFlowRate; CpAir = PsyCpAirFnW(air_hum_rat); + Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; SumSysMCpT += MassFlowRate_CpAir * NodeTemp; + } // NodeNum + // add in the leaks + for (int ADUListIndex = 1, ADUListIndex_end = dataZonePlenum.ZoneRetPlenCond(ZoneRetPlenumNum).NumADUs; + ADUListIndex <= ADUListIndex_end; + ++ADUListIndex) { + ADUNum = dataZonePlenum.ZoneRetPlenCond(ZoneRetPlenumNum).ADUIndex(ADUListIndex); + if (AirDistUnit(ADUNum).UpStreamLeak) { + ADUInNode = AirDistUnit(ADUNum).InletNodeNum; + NodeTemp = Node(ADUInNode).Temp; + MassFlowRate = AirDistUnit(ADUNum).MassFlowRateUpStrLk; + CpAir = PsyCpAirFnW(air_hum_rat); + Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); + SumSysMCp += MassFlowRate_CpAir; + SumSysMCpT += MassFlowRate_CpAir * NodeTemp; + } + if (AirDistUnit(ADUNum).DownStreamLeak) { + ADUOutNode = AirDistUnit(ADUNum).OutletNodeNum; + NodeTemp = Node(ADUOutNode).Temp; + MassFlowRate = AirDistUnit(ADUNum).MassFlowRateDnStrLk; + CpAir = PsyCpAirFnW(air_hum_rat); + Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); + SumSysMCp += MassFlowRate_CpAir; + SumSysMCpT += MassFlowRate_CpAir * NodeTemp; + } } - } - - } else if (ZoneSupPlenumAirFlag) { - ZoneSupPlenumNum = Zone(ZoneNum).PlenumCondNum; - // Get node conditions - NodeTemp = Node(dataZonePlenum.ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).Temp; - MassFlowRate = Node(dataZonePlenum.ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate; - CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); - SumSysMCp += MassFlowRate * CpAir; - SumSysMCpT += MassFlowRate * CpAir * NodeTemp; - } + } else if (ZoneSupPlenumAirFlag) { + ZoneSupPlenumNum = Zone(ZoneNum).PlenumCondNum; + // Get node conditions + NodeTemp = Node(dataZonePlenum.ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).Temp; + MassFlowRate = Node(dataZonePlenum.ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate; + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); - ZoneMult = Zone(ZoneNum).Multiplier * Zone(ZoneNum).ListMultiplier; + SumSysMCp += MassFlowRate * CpAir; + SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + } - SumSysMCp /= ZoneMult; - SumSysMCpT /= ZoneMult; + ZoneMult = Zone(ZoneNum).Multiplier * Zone(ZoneNum).ListMultiplier; + SumSysMCp /= ZoneMult; + SumSysMCpT /= ZoneMult; + } // Sum all surface convection: SumHA, SumHATsurf, SumHATref (and additional contributions to SumIntGain) for (SurfNum = Zone(ZoneNum).SurfaceFirst; SurfNum <= Zone(ZoneNum).SurfaceLast; ++SurfNum) { diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.hh b/src/EnergyPlus/ZoneTempPredictorCorrector.hh index 7622d79e13a..cfb0860d94d 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.hh +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.hh @@ -282,7 +282,8 @@ namespace ZoneTempPredictorCorrector { Real64 &SumMCp, // Zone sum of MassFlowRate*Cp Real64 &SumMCpT, // Zone sum of MassFlowRate*Cp*T Real64 &SumSysMCp, // Zone sum of air system MassFlowRate*Cp - Real64 &SumSysMCpT // Zone sum of air system MassFlowRate*Cp*T + Real64 &SumSysMCpT, // Zone sum of air system MassFlowRate*Cp*T + bool const CorrectorFlag = true // Corrector call flag ); void CalcZoneComponentLoadSums(ZonePlenumData &dataZonePlenum, int const ZoneNum, // Zone number diff --git a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc index 8f8b39a93e0..180597c8cc1 100644 --- a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc @@ -387,7 +387,7 @@ TEST_F(EnergyPlusFixture, BaseboardConvWater_SizingTest) DataZoneEquipment::GetZoneEquipmentData1(state); // get electric baseboard inputs - BaseboardRadiator::GetBaseboardInput(*state.dataBaseboardRadiator); + BaseboardRadiator::GetBaseboardInput(state); DataSizing::FinalZoneSizing.allocate(3); DataSizing::ZoneEqSizing.allocate(3); diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index 2d6b61e789a..a51c73aed54 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -457,7 +457,7 @@ TEST_F(ConvectionCoefficientsFixture, DynamicIntConvSurfaceClassification) DataZoneEquipment::GetZoneEquipmentData1(state); - BaseboardElectric::GetBaseboardInput(*state.dataBaseboardElectric); + BaseboardElectric::GetBaseboardInput(state); DataGlobals::ZoneSizingCalc = true; @@ -932,7 +932,7 @@ TEST_F(ConvectionCoefficientsFixture, CalcBeausoleilMorrisonMixedAssistedWall) DataZoneEquipment::GetZoneEquipmentData1(state); - BaseboardElectric::GetBaseboardInput(*state.dataBaseboardElectric); + BaseboardElectric::GetBaseboardInput(state); DataGlobals::ZoneSizingCalc = true; @@ -989,7 +989,7 @@ TEST_F(ConvectionCoefficientsFixture, CalcBeausoleilMorrisonMixedOpposingWall) DataZoneEquipment::GetZoneEquipmentData1(state); - BaseboardElectric::GetBaseboardInput(*state.dataBaseboardElectric); + BaseboardElectric::GetBaseboardInput(state); DataGlobals::ZoneSizingCalc = true; @@ -1046,7 +1046,7 @@ TEST_F(ConvectionCoefficientsFixture, CalcBeausoleilMorrisonMixedStableFloor) DataZoneEquipment::GetZoneEquipmentData1(state); - BaseboardElectric::GetBaseboardInput(*state.dataBaseboardElectric); + BaseboardElectric::GetBaseboardInput(state); DataGlobals::ZoneSizingCalc = true; @@ -1103,7 +1103,7 @@ TEST_F(ConvectionCoefficientsFixture, CalcBeausoleilMorrisonMixedUnstableFloor) DataZoneEquipment::GetZoneEquipmentData1(state); - BaseboardElectric::GetBaseboardInput(*state.dataBaseboardElectric); + BaseboardElectric::GetBaseboardInput(state); DataGlobals::ZoneSizingCalc = true; @@ -1160,7 +1160,7 @@ TEST_F(ConvectionCoefficientsFixture, CalcBeausoleilMorrisonMixedStableCeiling) DataZoneEquipment::GetZoneEquipmentData1(state); - BaseboardElectric::GetBaseboardInput(*state.dataBaseboardElectric); + BaseboardElectric::GetBaseboardInput(state); DataGlobals::ZoneSizingCalc = true; @@ -1217,7 +1217,7 @@ TEST_F(ConvectionCoefficientsFixture, CalcBeausoleilMorrisonMixedUnstableCeiling DataZoneEquipment::GetZoneEquipmentData1(state); - BaseboardElectric::GetBaseboardInput(*state.dataBaseboardElectric); + BaseboardElectric::GetBaseboardInput(state); DataGlobals::ZoneSizingCalc = true; diff --git a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc index 3d6ecfd70d0..c0a1bbb94b6 100644 --- a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc +++ b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc @@ -4993,3 +4993,306 @@ TEST_F(EnergyPlusFixture, HPWH_Pumped_Stratified_Simultaneous) EXPECT_TRUE(compare_err_stream("", true)); } + +TEST_F(EnergyPlusFixture, StratifiedTank_WarningNumberOfNodes_FalsePositiveBlanks) +{ + // Test for #8163 + + std::string const idf_objects = delimited_string({ + "Schedule:Constant, Hot Water Setpoint Temp Schedule, , 60.0;", + "Schedule:Constant, Ambient Temp Schedule, , 22.0;", + "Schedule:Constant, Hot Water Demand Schedule, , 0.0;", + "WaterHeater:Stratified,", + " Stratified Tank, !- Name", + " , !- End-Use Subcategory", + " 0.17, !- Tank Volume {m3}", + " 1.4, !- Tank Height {m}", + " VerticalCylinder, !- Tank Shape", + " , !- Tank Perimeter {m}", + " 100.0, !- Maximum Temperature Limit {C}", + " MasterSlave, !- Heater Priority Control", + " Hot Water Setpoint Temp Schedule, !- Heater 1 Setpoint Temperature Schedule Name", + " 2.0, !- Heater 1 Deadband Temperature Difference {deltaC}", + " 4500, !- Heater 1 Capacity {W}", + " 1.0, !- Heater 1 Height {m}", + " Hot Water Setpoint Temp Schedule, !- Heater 2 Setpoint Temperature Schedule Name", + " 5.0, !- Heater 2 Deadband Temperature Difference {deltaC}", + " 4500, !- Heater 2 Capacity {W}", + " 0.0, !- Heater 2 Height {m}", + " ELECTRICITY, !- Heater Fuel Type", + " 0.98, !- Heater Thermal Efficiency", + " , !- Off Cycle Parasitic Fuel Consumption Rate {W}", + " ELECTRICITY, !- Off Cycle Parasitic Fuel Type", + " , !- Off Cycle Parasitic Heat Fraction to Tank", + " , !- Off Cycle Parasitic Height {m}", + " , !- On Cycle Parasitic Fuel Consumption Rate {W}", + " ELECTRICITY, !- On Cycle Parasitic Fuel Type", + " , !- On Cycle Parasitic Heat Fraction to Tank", + " , !- On Cycle Parasitic Height {m}", + " SCHEDULE, !- Ambient Temperature Indicator", + " Ambient Temp Schedule, !- Ambient Temperature Schedule Name", + " , !- Ambient Temperature Zone Name", + " , !- Ambient Temperature Outdoor Air Node Name", + " 0.846, !- Uniform Skin Loss Coefficient per Unit Area to Ambient Temperature {W/m2-K}", + " , !- Skin Loss Fraction to Zone", + " , !- Off Cycle Flue Loss Coefficient to Ambient Temperature {W/K}", + " , !- Off Cycle Flue Loss Fraction to Zone", + " 0.000189, !- Peak Use Flow Rate {m3/s}", + " Hot Water Demand Schedule, !- Use Flow Rate Fraction Schedule Name", + " , !- Cold Water Supply Temperature Schedule Name", + " , !- Use Side Inlet Node Name", + " , !- Use Side Outlet Node Name", + " , !- Use Side Effectiveness", + " , !- Use Side Inlet Height {m}", + " , !- Use Side Outlet Height {m}", + " , !- Source Side Inlet Node Name", + " , !- Source Side Outlet Node Name", + " , !- Source Side Effectiveness", + " , !- Source Side Inlet Height {m}", + " , !- Source Side Outlet Height {m}", + " FIXED, !- Inlet Mode", + " , !- Use Side Design Flow Rate {m3/s}", + " , !- Source Side Design Flow Rate {m3/s}", + " , !- Indirect Water Heating Recovery Time {hr}", + " 6, !- Number of Nodes", + " , !- Additional Destratification Conductivity {W/m-K}", + " 1, !- Node 1 Additional Loss Coefficient {W/K}", + " , !- Node 2 Additional Loss Coefficient {W/K}", + " 3, !- Node 3 Additional Loss Coefficient {W/K}", + " 4, !- Node 4 Additional Loss Coefficient {W/K}", + " 5, !- Node 5 Additional Loss Coefficient {W/K}", + " 6, !- Node 6 Additional Loss Coefficient {W/K}", + " , !- Node 7 Additional Loss Coefficient {W/K}", + " , !- Node 8 Additional Loss Coefficient {W/K}", + " , !- Node 9 Additional Loss Coefficient {W/K}", + " ; !- Node 10 Additional Loss Coefficient {W/K}", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + bool ErrorsFound = false; + HeatBalanceManager::GetZoneData(ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); + + InternalHeatGains::GetInternalHeatGainsInput(state); + EXPECT_FALSE(WaterThermalTanks::GetWaterThermalTankInput(state)); + + EXPECT_EQ(1, state.dataWaterThermalTanks->numWaterHeaterStratified); + WaterThermalTanks::WaterThermalTankData &Tank = state.dataWaterThermalTanks->WaterThermalTank(1); + EXPECT_EQ(6, Tank.Nodes); + EXPECT_EQ(6u, Tank.AdditionalLossCoeff.size()); + for (int i = 1; i <= Tank.Nodes; ++i) { + if (i==2) { + EXPECT_EQ(0, Tank.AdditionalLossCoeff(i)); + } else { + EXPECT_EQ(i, Tank.AdditionalLossCoeff(i)); + } + } + + EXPECT_TRUE(compare_err_stream("")); +} + +TEST_F(EnergyPlusFixture, StratifiedTank_WarningNumberOfNodes_FalsePositiveZeroes) +{ + // Test for #8163 - Similar to what OpenStudio or IDFEditor would do when filling the entries after the Node X Additional Coefficients + + std::string const idf_objects = delimited_string({ + "Schedule:Constant, Hot Water Setpoint Temp Schedule, , 60.0;", + "Schedule:Constant, Ambient Temp Schedule, , 22.0;", + "Schedule:Constant, Hot Water Demand Schedule, , 0.0;", + "WaterHeater:Stratified,", + " Stratified Tank, !- Name", + " , !- End-Use Subcategory", + " 0.17, !- Tank Volume {m3}", + " 1.4, !- Tank Height {m}", + " VerticalCylinder, !- Tank Shape", + " , !- Tank Perimeter {m}", + " 100.0, !- Maximum Temperature Limit {C}", + " MasterSlave, !- Heater Priority Control", + " Hot Water Setpoint Temp Schedule, !- Heater 1 Setpoint Temperature Schedule Name", + " 2.0, !- Heater 1 Deadband Temperature Difference {deltaC}", + " 4500, !- Heater 1 Capacity {W}", + " 1.0, !- Heater 1 Height {m}", + " Hot Water Setpoint Temp Schedule, !- Heater 2 Setpoint Temperature Schedule Name", + " 5.0, !- Heater 2 Deadband Temperature Difference {deltaC}", + " 4500, !- Heater 2 Capacity {W}", + " 0.0, !- Heater 2 Height {m}", + " ELECTRICITY, !- Heater Fuel Type", + " 0.98, !- Heater Thermal Efficiency", + " , !- Off Cycle Parasitic Fuel Consumption Rate {W}", + " ELECTRICITY, !- Off Cycle Parasitic Fuel Type", + " , !- Off Cycle Parasitic Heat Fraction to Tank", + " , !- Off Cycle Parasitic Height {m}", + " , !- On Cycle Parasitic Fuel Consumption Rate {W}", + " ELECTRICITY, !- On Cycle Parasitic Fuel Type", + " , !- On Cycle Parasitic Heat Fraction to Tank", + " , !- On Cycle Parasitic Height {m}", + " SCHEDULE, !- Ambient Temperature Indicator", + " Ambient Temp Schedule, !- Ambient Temperature Schedule Name", + " , !- Ambient Temperature Zone Name", + " , !- Ambient Temperature Outdoor Air Node Name", + " 0.846, !- Uniform Skin Loss Coefficient per Unit Area to Ambient Temperature {W/m2-K}", + " , !- Skin Loss Fraction to Zone", + " , !- Off Cycle Flue Loss Coefficient to Ambient Temperature {W/K}", + " , !- Off Cycle Flue Loss Fraction to Zone", + " 0.000189, !- Peak Use Flow Rate {m3/s}", + " Hot Water Demand Schedule, !- Use Flow Rate Fraction Schedule Name", + " , !- Cold Water Supply Temperature Schedule Name", + " , !- Use Side Inlet Node Name", + " , !- Use Side Outlet Node Name", + " , !- Use Side Effectiveness", + " , !- Use Side Inlet Height {m}", + " , !- Use Side Outlet Height {m}", + " , !- Source Side Inlet Node Name", + " , !- Source Side Outlet Node Name", + " , !- Source Side Effectiveness", + " , !- Source Side Inlet Height {m}", + " , !- Source Side Outlet Height {m}", + " FIXED, !- Inlet Mode", + " , !- Use Side Design Flow Rate {m3/s}", + " , !- Source Side Design Flow Rate {m3/s}", + " , !- Indirect Water Heating Recovery Time {hr}", + " 6, !- Number of Nodes", + " , !- Additional Destratification Conductivity {W/m-K}", + " 1, !- Node 1 Additional Loss Coefficient {W/K}", + " , !- Node 2 Additional Loss Coefficient {W/K}", + " 3, !- Node 3 Additional Loss Coefficient {W/K}", + " 4, !- Node 4 Additional Loss Coefficient {W/K}", + " 5, !- Node 5 Additional Loss Coefficient {W/K}", + " 6, !- Node 6 Additional Loss Coefficient {W/K}", + " 0, !- Node 7 Additional Loss Coefficient {W/K}", + " 0, !- Node 8 Additional Loss Coefficient {W/K}", + " 0, !- Node 9 Additional Loss Coefficient {W/K}", + " 0, !- Node 10 Additional Loss Coefficient {W/K}", + " 0, !- Node 11 Additional Loss Coefficient {W/K}", + " 0, !- Node 12 Additional Loss Coefficient {W/K}", + " IndirectHeatPrimarySetpoint; !- Source Side Flow Control Mode" + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + bool ErrorsFound = false; + HeatBalanceManager::GetZoneData(ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); + + InternalHeatGains::GetInternalHeatGainsInput(state); + EXPECT_FALSE(WaterThermalTanks::GetWaterThermalTankInput(state)); + + EXPECT_EQ(1, state.dataWaterThermalTanks->numWaterHeaterStratified); + WaterThermalTanks::WaterThermalTankData &Tank = state.dataWaterThermalTanks->WaterThermalTank(1); + EXPECT_EQ(6, Tank.Nodes); + EXPECT_EQ(6u, Tank.AdditionalLossCoeff.size()); + for (int i = 1; i <= Tank.Nodes; ++i) { + if (i==2) { + EXPECT_EQ(0, Tank.AdditionalLossCoeff(i)); + } else { + EXPECT_EQ(i, Tank.AdditionalLossCoeff(i)); + } + } + + EXPECT_TRUE(compare_err_stream("")); +} + +TEST_F(EnergyPlusFixture, StratifiedTank_WarningNumberOfNodes_ExpectedWarning) +{ + + // Test for #8163 + + std::string const idf_objects = delimited_string({ + "Schedule:Constant, Hot Water Setpoint Temp Schedule, , 60.0;", + "Schedule:Constant, Ambient Temp Schedule, , 22.0;", + "Schedule:Constant, Hot Water Demand Schedule, , 0.0;", + "WaterHeater:Stratified,", + " Stratified Tank, !- Name", + " , !- End-Use Subcategory", + " 0.17, !- Tank Volume {m3}", + " 1.4, !- Tank Height {m}", + " VerticalCylinder, !- Tank Shape", + " , !- Tank Perimeter {m}", + " 100.0, !- Maximum Temperature Limit {C}", + " MasterSlave, !- Heater Priority Control", + " Hot Water Setpoint Temp Schedule, !- Heater 1 Setpoint Temperature Schedule Name", + " 2.0, !- Heater 1 Deadband Temperature Difference {deltaC}", + " 4500, !- Heater 1 Capacity {W}", + " 1.0, !- Heater 1 Height {m}", + " Hot Water Setpoint Temp Schedule, !- Heater 2 Setpoint Temperature Schedule Name", + " 5.0, !- Heater 2 Deadband Temperature Difference {deltaC}", + " 4500, !- Heater 2 Capacity {W}", + " 0.0, !- Heater 2 Height {m}", + " ELECTRICITY, !- Heater Fuel Type", + " 0.98, !- Heater Thermal Efficiency", + " , !- Off Cycle Parasitic Fuel Consumption Rate {W}", + " ELECTRICITY, !- Off Cycle Parasitic Fuel Type", + " , !- Off Cycle Parasitic Heat Fraction to Tank", + " , !- Off Cycle Parasitic Height {m}", + " , !- On Cycle Parasitic Fuel Consumption Rate {W}", + " ELECTRICITY, !- On Cycle Parasitic Fuel Type", + " , !- On Cycle Parasitic Heat Fraction to Tank", + " , !- On Cycle Parasitic Height {m}", + " SCHEDULE, !- Ambient Temperature Indicator", + " Ambient Temp Schedule, !- Ambient Temperature Schedule Name", + " , !- Ambient Temperature Zone Name", + " , !- Ambient Temperature Outdoor Air Node Name", + " 0.846, !- Uniform Skin Loss Coefficient per Unit Area to Ambient Temperature {W/m2-K}", + " , !- Skin Loss Fraction to Zone", + " , !- Off Cycle Flue Loss Coefficient to Ambient Temperature {W/K}", + " , !- Off Cycle Flue Loss Fraction to Zone", + " 0.000189, !- Peak Use Flow Rate {m3/s}", + " Hot Water Demand Schedule, !- Use Flow Rate Fraction Schedule Name", + " , !- Cold Water Supply Temperature Schedule Name", + " , !- Use Side Inlet Node Name", + " , !- Use Side Outlet Node Name", + " , !- Use Side Effectiveness", + " , !- Use Side Inlet Height {m}", + " , !- Use Side Outlet Height {m}", + " , !- Source Side Inlet Node Name", + " , !- Source Side Outlet Node Name", + " , !- Source Side Effectiveness", + " , !- Source Side Inlet Height {m}", + " , !- Source Side Outlet Height {m}", + " FIXED, !- Inlet Mode", + " , !- Use Side Design Flow Rate {m3/s}", + " , !- Source Side Design Flow Rate {m3/s}", + " , !- Indirect Water Heating Recovery Time {hr}", + " 6, !- Number of Nodes", + " , !- Additional Destratification Conductivity {W/m-K}", + " 1, !- Node 1 Additional Loss Coefficient {W/K}", + " , !- Node 2 Additional Loss Coefficient {W/K}", + " 3, !- Node 3 Additional Loss Coefficient {W/K}", + " 4, !- Node 4 Additional Loss Coefficient {W/K}", + " 5, !- Node 5 Additional Loss Coefficient {W/K}", + " 6, !- Node 6 Additional Loss Coefficient {W/K}", + " 7, !- Node 7 Additional Loss Coefficient {W/K}", + " , !- Node 8 Additional Loss Coefficient {W/K}", + " , !- Node 9 Additional Loss Coefficient {W/K}", + " ; !- Node 10 Additional Loss Coefficient {W/K}", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + bool ErrorsFound = false; + HeatBalanceManager::GetZoneData(ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); + + InternalHeatGains::GetInternalHeatGainsInput(state); + EXPECT_FALSE(WaterThermalTanks::GetWaterThermalTankInput(state)); + + EXPECT_EQ(1, state.dataWaterThermalTanks->numWaterHeaterStratified); + WaterThermalTanks::WaterThermalTankData &Tank = state.dataWaterThermalTanks->WaterThermalTank(1); + EXPECT_EQ(6, Tank.Nodes); + EXPECT_EQ(6u, Tank.AdditionalLossCoeff.size()); + for (int i = 1; i <= Tank.Nodes; ++i) { + if (i==2) { + EXPECT_EQ(0, Tank.AdditionalLossCoeff(i)); + } else { + EXPECT_EQ(i, Tank.AdditionalLossCoeff(i)); + } + } + + + std::string const error_string = delimited_string({ + " ** Warning ** WaterHeater:Stratified = STRATIFIED TANK: More Additional Loss Coefficients were entered than the number of nodes; extra coefficients will not be used", + }); + + EXPECT_TRUE(compare_err_stream(error_string)); +} diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index 040eb75244a..22af2ccbad6 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -52,7 +52,6 @@ #include "Fixtures/EnergyPlusFixture.hh" - // EnergyPlus Headers #include #include @@ -1056,6 +1055,16 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_CalcZoneSums_SurfConvection EXPECT_EQ(10.0, SumHA); EXPECT_EQ(300.0, SumHATsurf); EXPECT_EQ(50.0, SumHATref); + + Node(1).MassFlowRate = 0.1; + Node(2).MassFlowRate = 0.2; + CalcZoneSums(*state.dataZonePlenum, ZoneNum, SumIntGain, SumHA, SumHATsurf, SumHATref, SumMCp, SumMCpT, SumSysMCp, SumSysMCpT); + EXPECT_NEAR(302.00968500, SumSysMCp, 0.0001); + EXPECT_NEAR(6040.1937, SumSysMCpT,0.0001); + + CalcZoneSums(*state.dataZonePlenum, ZoneNum, SumIntGain, SumHA, SumHATsurf, SumHATref, SumMCp, SumMCpT, SumSysMCp, SumSysMCpT, false); + EXPECT_EQ(0.0, SumSysMCp); + EXPECT_EQ(0.0, SumSysMCpT); } TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_EMSOverrideSetpointTest) @@ -1487,12 +1496,11 @@ TEST_F(EnergyPlusFixture, ReportMoistLoadsZoneMultiplier_Test) OutReqToDehumSP = 3000.0; ZoneMultiplier = 1.0; ZoneMultiplierList = 1.0; - ReportMoistLoadsZoneMultiplier(TotOutReq,OutReqToHumSP,OutReqToDehumSP, - SingleZoneTotRate,SingleZoneHumRate,SingleZoneDehRate, - ZoneMultiplier,ZoneMultiplierList); - EXPECT_NEAR(TotOutReq,SingleZoneTotRate,AcceptableTolerance); - EXPECT_NEAR(OutReqToHumSP,SingleZoneHumRate,AcceptableTolerance); - EXPECT_NEAR(OutReqToDehumSP,SingleZoneDehRate,AcceptableTolerance); + ReportMoistLoadsZoneMultiplier( + TotOutReq, OutReqToHumSP, OutReqToDehumSP, SingleZoneTotRate, SingleZoneHumRate, SingleZoneDehRate, ZoneMultiplier, ZoneMultiplierList); + EXPECT_NEAR(TotOutReq, SingleZoneTotRate, AcceptableTolerance); + EXPECT_NEAR(OutReqToHumSP, SingleZoneHumRate, AcceptableTolerance); + EXPECT_NEAR(OutReqToDehumSP, SingleZoneDehRate, AcceptableTolerance); // Test 2a: Zone Multiplier (non-list) is greater than 1, list Zone Multiplier is still one TotOutReq = 1000.0; @@ -1500,21 +1508,20 @@ TEST_F(EnergyPlusFixture, ReportMoistLoadsZoneMultiplier_Test) OutReqToDehumSP = 3000.0; ZoneMultiplier = 7.0; ZoneMultiplierList = 1.0; - ReportMoistLoadsZoneMultiplier(TotOutReq,OutReqToHumSP,OutReqToDehumSP, - SingleZoneTotRate,SingleZoneHumRate,SingleZoneDehRate, - ZoneMultiplier,ZoneMultiplierList); + ReportMoistLoadsZoneMultiplier( + TotOutReq, OutReqToHumSP, OutReqToDehumSP, SingleZoneTotRate, SingleZoneHumRate, SingleZoneDehRate, ZoneMultiplier, ZoneMultiplierList); ExpectedResult = 1000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneTotRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneTotRate, AcceptableTolerance); ExpectedResult = 2000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneHumRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneHumRate, AcceptableTolerance); ExpectedResult = 3000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneDehRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneDehRate, AcceptableTolerance); ExpectedResult = 7000.0; - EXPECT_NEAR(TotOutReq,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(TotOutReq, ExpectedResult, AcceptableTolerance); ExpectedResult = 14000.0; - EXPECT_NEAR(OutReqToHumSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToHumSP, ExpectedResult, AcceptableTolerance); ExpectedResult = 21000.0; - EXPECT_NEAR(OutReqToDehumSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToDehumSP, ExpectedResult, AcceptableTolerance); // Test 2b: list Zone Multiplier is greater than 1, non-list Zone Multiplier is one TotOutReq = 1000.0; @@ -1522,21 +1529,20 @@ TEST_F(EnergyPlusFixture, ReportMoistLoadsZoneMultiplier_Test) OutReqToDehumSP = 3000.0; ZoneMultiplier = 1.0; ZoneMultiplierList = 7.0; - ReportMoistLoadsZoneMultiplier(TotOutReq,OutReqToHumSP,OutReqToDehumSP, - SingleZoneTotRate,SingleZoneHumRate,SingleZoneDehRate, - ZoneMultiplier,ZoneMultiplierList); + ReportMoistLoadsZoneMultiplier( + TotOutReq, OutReqToHumSP, OutReqToDehumSP, SingleZoneTotRate, SingleZoneHumRate, SingleZoneDehRate, ZoneMultiplier, ZoneMultiplierList); ExpectedResult = 1000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneTotRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneTotRate, AcceptableTolerance); ExpectedResult = 2000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneHumRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneHumRate, AcceptableTolerance); ExpectedResult = 3000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneDehRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneDehRate, AcceptableTolerance); ExpectedResult = 7000.0; - EXPECT_NEAR(TotOutReq,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(TotOutReq, ExpectedResult, AcceptableTolerance); ExpectedResult = 14000.0; - EXPECT_NEAR(OutReqToHumSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToHumSP, ExpectedResult, AcceptableTolerance); ExpectedResult = 21000.0; - EXPECT_NEAR(OutReqToDehumSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToDehumSP, ExpectedResult, AcceptableTolerance); // Test 3: both zone multipliers are greater than 1.0 TotOutReq = 300.0; @@ -1544,21 +1550,20 @@ TEST_F(EnergyPlusFixture, ReportMoistLoadsZoneMultiplier_Test) OutReqToDehumSP = 100.0; ZoneMultiplier = 2.0; ZoneMultiplierList = 3.0; - ReportMoistLoadsZoneMultiplier(TotOutReq,OutReqToHumSP,OutReqToDehumSP, - SingleZoneTotRate,SingleZoneHumRate,SingleZoneDehRate, - ZoneMultiplier,ZoneMultiplierList); + ReportMoistLoadsZoneMultiplier( + TotOutReq, OutReqToHumSP, OutReqToDehumSP, SingleZoneTotRate, SingleZoneHumRate, SingleZoneDehRate, ZoneMultiplier, ZoneMultiplierList); ExpectedResult = 300.0; - EXPECT_NEAR(ExpectedResult,SingleZoneTotRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneTotRate, AcceptableTolerance); ExpectedResult = 150.0; - EXPECT_NEAR(ExpectedResult,SingleZoneHumRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneHumRate, AcceptableTolerance); ExpectedResult = 100.0; - EXPECT_NEAR(ExpectedResult,SingleZoneDehRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneDehRate, AcceptableTolerance); ExpectedResult = 1800.0; - EXPECT_NEAR(TotOutReq,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(TotOutReq, ExpectedResult, AcceptableTolerance); ExpectedResult = 900.0; - EXPECT_NEAR(OutReqToHumSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToHumSP, ExpectedResult, AcceptableTolerance); ExpectedResult = 600.0; - EXPECT_NEAR(OutReqToDehumSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToDehumSP, ExpectedResult, AcceptableTolerance); } TEST_F(EnergyPlusFixture, ReportSensibleLoadsZoneMultiplier_Test) @@ -1586,12 +1591,20 @@ TEST_F(EnergyPlusFixture, ReportSensibleLoadsZoneMultiplier_Test) CorrectionFactor = 1.0; ZoneMultiplier = 1.0; ZoneMultiplierList = 1.0; - ReportSensibleLoadsZoneMultiplier(TotOutReq,OutReqToHeatSP,OutReqToCoolSP, - SingleZoneTotRate,SingleZoneHeatRate,SingleZoneCoolRate, - HeatToSP,CoolToSP,CorrectionFactor,ZoneMultiplier,ZoneMultiplierList); - EXPECT_NEAR(TotOutReq,SingleZoneTotRate,AcceptableTolerance); - EXPECT_NEAR(OutReqToHeatSP,SingleZoneHeatRate,AcceptableTolerance); - EXPECT_NEAR(OutReqToCoolSP,SingleZoneCoolRate,AcceptableTolerance); + ReportSensibleLoadsZoneMultiplier(TotOutReq, + OutReqToHeatSP, + OutReqToCoolSP, + SingleZoneTotRate, + SingleZoneHeatRate, + SingleZoneCoolRate, + HeatToSP, + CoolToSP, + CorrectionFactor, + ZoneMultiplier, + ZoneMultiplierList); + EXPECT_NEAR(TotOutReq, SingleZoneTotRate, AcceptableTolerance); + EXPECT_NEAR(OutReqToHeatSP, SingleZoneHeatRate, AcceptableTolerance); + EXPECT_NEAR(OutReqToCoolSP, SingleZoneCoolRate, AcceptableTolerance); // Test 2a: Zone Multiplier (non-list) is greater than 1, list Zone Multiplier and Load Correction are still one TotOutReq = 1000.0; @@ -1602,21 +1615,29 @@ TEST_F(EnergyPlusFixture, ReportSensibleLoadsZoneMultiplier_Test) CorrectionFactor = 1.0; ZoneMultiplier = 4.0; ZoneMultiplierList = 1.0; - ReportSensibleLoadsZoneMultiplier(TotOutReq,OutReqToHeatSP,OutReqToCoolSP, - SingleZoneTotRate,SingleZoneHeatRate,SingleZoneCoolRate, - HeatToSP,CoolToSP,CorrectionFactor,ZoneMultiplier,ZoneMultiplierList); + ReportSensibleLoadsZoneMultiplier(TotOutReq, + OutReqToHeatSP, + OutReqToCoolSP, + SingleZoneTotRate, + SingleZoneHeatRate, + SingleZoneCoolRate, + HeatToSP, + CoolToSP, + CorrectionFactor, + ZoneMultiplier, + ZoneMultiplierList); ExpectedResult = 1000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneTotRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneTotRate, AcceptableTolerance); ExpectedResult = 2000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneHeatRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneHeatRate, AcceptableTolerance); ExpectedResult = 3000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneCoolRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneCoolRate, AcceptableTolerance); ExpectedResult = 4000.0; - EXPECT_NEAR(TotOutReq,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(TotOutReq, ExpectedResult, AcceptableTolerance); ExpectedResult = 8000.0; - EXPECT_NEAR(OutReqToHeatSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToHeatSP, ExpectedResult, AcceptableTolerance); ExpectedResult = 12000.0; - EXPECT_NEAR(OutReqToCoolSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToCoolSP, ExpectedResult, AcceptableTolerance); // Test 2b: list Zone Multiplier is greater than 1, non-list Zone Multiplier and Load Correction are still one TotOutReq = 1000.0; @@ -1627,21 +1648,29 @@ TEST_F(EnergyPlusFixture, ReportSensibleLoadsZoneMultiplier_Test) CorrectionFactor = 1.0; ZoneMultiplier = 1.0; ZoneMultiplierList = 5.0; - ReportSensibleLoadsZoneMultiplier(TotOutReq,OutReqToHeatSP,OutReqToCoolSP, - SingleZoneTotRate,SingleZoneHeatRate,SingleZoneCoolRate, - HeatToSP,CoolToSP,CorrectionFactor,ZoneMultiplier,ZoneMultiplierList); + ReportSensibleLoadsZoneMultiplier(TotOutReq, + OutReqToHeatSP, + OutReqToCoolSP, + SingleZoneTotRate, + SingleZoneHeatRate, + SingleZoneCoolRate, + HeatToSP, + CoolToSP, + CorrectionFactor, + ZoneMultiplier, + ZoneMultiplierList); ExpectedResult = 1000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneTotRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneTotRate, AcceptableTolerance); ExpectedResult = 2000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneHeatRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneHeatRate, AcceptableTolerance); ExpectedResult = 3000.0; - EXPECT_NEAR(ExpectedResult,SingleZoneCoolRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneCoolRate, AcceptableTolerance); ExpectedResult = 5000.0; - EXPECT_NEAR(TotOutReq,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(TotOutReq, ExpectedResult, AcceptableTolerance); ExpectedResult = 10000.0; - EXPECT_NEAR(OutReqToHeatSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToHeatSP, ExpectedResult, AcceptableTolerance); ExpectedResult = 15000.0; - EXPECT_NEAR(OutReqToCoolSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToCoolSP, ExpectedResult, AcceptableTolerance); // Test 2c: list Zone Multiplier and Zone Multiplier are unity, Load Correction is not equal to 1.0 TotOutReq = 1000.0; @@ -1652,21 +1681,29 @@ TEST_F(EnergyPlusFixture, ReportSensibleLoadsZoneMultiplier_Test) CorrectionFactor = 1.1; ZoneMultiplier = 1.0; ZoneMultiplierList = 1.0; - ReportSensibleLoadsZoneMultiplier(TotOutReq,OutReqToHeatSP,OutReqToCoolSP, - SingleZoneTotRate,SingleZoneHeatRate,SingleZoneCoolRate, - HeatToSP,CoolToSP,CorrectionFactor,ZoneMultiplier,ZoneMultiplierList); + ReportSensibleLoadsZoneMultiplier(TotOutReq, + OutReqToHeatSP, + OutReqToCoolSP, + SingleZoneTotRate, + SingleZoneHeatRate, + SingleZoneCoolRate, + HeatToSP, + CoolToSP, + CorrectionFactor, + ZoneMultiplier, + ZoneMultiplierList); ExpectedResult = 1100.0; - EXPECT_NEAR(ExpectedResult,SingleZoneTotRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneTotRate, AcceptableTolerance); ExpectedResult = 2200.0; - EXPECT_NEAR(ExpectedResult,SingleZoneHeatRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneHeatRate, AcceptableTolerance); ExpectedResult = 3300.0; - EXPECT_NEAR(ExpectedResult,SingleZoneCoolRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneCoolRate, AcceptableTolerance); ExpectedResult = 1100.0; - EXPECT_NEAR(TotOutReq,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(TotOutReq, ExpectedResult, AcceptableTolerance); ExpectedResult = 2200.0; - EXPECT_NEAR(OutReqToHeatSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToHeatSP, ExpectedResult, AcceptableTolerance); ExpectedResult = 3300.0; - EXPECT_NEAR(OutReqToCoolSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToCoolSP, ExpectedResult, AcceptableTolerance); // Test 3: none of the multipliers are unity TotOutReq = 1000.0; @@ -1677,19 +1714,27 @@ TEST_F(EnergyPlusFixture, ReportSensibleLoadsZoneMultiplier_Test) CorrectionFactor = 1.2; ZoneMultiplier = 2.0; ZoneMultiplierList = 1.5; - ReportSensibleLoadsZoneMultiplier(TotOutReq,OutReqToHeatSP,OutReqToCoolSP, - SingleZoneTotRate,SingleZoneHeatRate,SingleZoneCoolRate, - HeatToSP,CoolToSP,CorrectionFactor,ZoneMultiplier,ZoneMultiplierList); + ReportSensibleLoadsZoneMultiplier(TotOutReq, + OutReqToHeatSP, + OutReqToCoolSP, + SingleZoneTotRate, + SingleZoneHeatRate, + SingleZoneCoolRate, + HeatToSP, + CoolToSP, + CorrectionFactor, + ZoneMultiplier, + ZoneMultiplierList); ExpectedResult = 1200.0; - EXPECT_NEAR(ExpectedResult,SingleZoneTotRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneTotRate, AcceptableTolerance); ExpectedResult = 2400.0; - EXPECT_NEAR(ExpectedResult,SingleZoneHeatRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneHeatRate, AcceptableTolerance); ExpectedResult = 3600.0; - EXPECT_NEAR(ExpectedResult,SingleZoneCoolRate,AcceptableTolerance); + EXPECT_NEAR(ExpectedResult, SingleZoneCoolRate, AcceptableTolerance); ExpectedResult = 3600.0; - EXPECT_NEAR(TotOutReq,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(TotOutReq, ExpectedResult, AcceptableTolerance); ExpectedResult = 7200.0; - EXPECT_NEAR(OutReqToHeatSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToHeatSP, ExpectedResult, AcceptableTolerance); ExpectedResult = 10800.0; - EXPECT_NEAR(OutReqToCoolSP,ExpectedResult,AcceptableTolerance); + EXPECT_NEAR(OutReqToCoolSP, ExpectedResult, AcceptableTolerance); }