From d200cbe223491cb435e024937df997c0332cd81c Mon Sep 17 00:00:00 2001 From: Lixing Gu Date: Thu, 13 Feb 2020 13:28:03 -0500 Subject: [PATCH 1/3] Upload a fix --- src/EnergyPlus/AirLoopHVACDOAS.cc | 174 +++++--------- tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc | 250 +++++++++++++++++++- 2 files changed, 309 insertions(+), 115 deletions(-) diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index bdb0900f97b..779723e13f3 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -479,12 +479,10 @@ namespace AirLoopHVACDOAS { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = HVACFan::fanObjs[thisDOAS.m_FanIndex]->inletNodeNum; if (OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) == 0) { InletNodeErrFlag = true; - errorsFound = true; } OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = HVACFan::fanObjs[thisDOAS.m_FanIndex]->outletNodeNum; if (OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) == 0) { OutletNodeErrFlag = true; - errorsFound = true; } thisDOAS.m_FanInletNodeNum = OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum); thisDOAS.m_FanOutletNodeNum = OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum); @@ -505,11 +503,9 @@ namespace AirLoopHVACDOAS { thisDOAS.FanBlowTroughFlag = true; } OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - Fans::GetFanInletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; + Fans::GetFanInletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - Fans::GetFanOutletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + Fans::GetFanOutletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); thisDOAS.m_FanInletNodeNum = OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum); thisDOAS.m_FanOutletNodeNum = OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum); if (!(CompNum == 1 || CompNum == OutsideAirSys(thisDOAS.m_OASystemNum).NumComponents)) { @@ -519,12 +515,10 @@ namespace AirLoopHVACDOAS { errorsFound = true; } } else if (SELECT_CASE_var == "COIL:COOLING:WATER") { - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - WaterCoils::GetCoilInletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - WaterCoils::GetCoilOutletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = WaterCoils::GetCoilInletNode( + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = WaterCoils::GetCoilOutletNode( + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); thisDOAS.CWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode("COIL:COOLING:WATER", CompName, errorsFound); if (errorsFound) { ShowContinueError("The control node number is not found in " + CurrentModuleObject + " = " + @@ -546,12 +540,10 @@ namespace AirLoopHVACDOAS { ShowFatalError("GetAirLoopDOASInput: Program terminated for previous conditions."); } } else if (SELECT_CASE_var == "COIL:HEATING:WATER") { - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - WaterCoils::GetCoilInletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - WaterCoils::GetCoilOutletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = WaterCoils::GetCoilInletNode( + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = WaterCoils::GetCoilOutletNode( + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); thisDOAS.HWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode("Coil:Heating:Water", CompName, errorsFound); if (errorsFound) { ShowContinueError("The control node number is not found in " + CurrentModuleObject + " = " + @@ -575,18 +567,14 @@ namespace AirLoopHVACDOAS { } else if (SELECT_CASE_var == "COIL:HEATING:STEAM") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - SteamCoils::GetCoilSteamInletNode(CompType, CompName, errorsFound); - if (errorsFound) InletNodeErrFlag = true; + SteamCoils::GetCoilSteamInletNode(CompType, CompName, InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - SteamCoils::GetCoilSteamOutletNode(CompType, CompName, errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + SteamCoils::GetCoilSteamOutletNode(CompType, CompName, OutletNodeErrFlag); } else if (SELECT_CASE_var == "COIL:COOLING:WATER:DETAILEDGEOMETRY") { - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - WaterCoils::GetCoilInletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - WaterCoils::GetCoilOutletNode(SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = WaterCoils::GetCoilInletNode( + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = WaterCoils::GetCoilOutletNode( + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); thisDOAS.CWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode("Coil:Cooling:Water:DetailedGeometry", CompName, errorsFound); if (errorsFound) { ShowContinueError("The control node number is not found in " + CurrentModuleObject + " = " + @@ -609,37 +597,29 @@ namespace AirLoopHVACDOAS { } } else if (SELECT_CASE_var == "COIL:HEATING:ELECTRIC") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = HeatingCoils::GetCoilInletNode( - SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = HeatingCoils::GetCoilOutletNode( - SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "COIL:HEATING:FUEL") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = HeatingCoils::GetCoilInletNode( - SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = HeatingCoils::GetCoilOutletNode( - SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - HVACHXAssistedCoolingCoil::GetCoilInletNode(CompType, CompName, errorsFound); - if (errorsFound) InletNodeErrFlag = true; + HVACHXAssistedCoolingCoil::GetCoilInletNode(CompType, CompName, InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - HVACHXAssistedCoolingCoil::GetCoilOutletNode(CompType, CompName, errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + HVACHXAssistedCoolingCoil::GetCoilOutletNode(CompType, CompName, OutletNodeErrFlag); } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:DX") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = HVACDXSystem::GetCoolingCoilInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); if (OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) == 0) { InletNodeErrFlag = true; - errorsFound = true; } OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = HVACDXSystem::GetCoolingCoilOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); if (OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) == 0) { OutletNodeErrFlag = true; - errorsFound = true; } OutsideAirSys(thisDOAS.m_OASystemNum).DXCoolingCoilFlag = true; } else if (SELECT_CASE_var == "COILSYSTEM:HEATING:DX") { @@ -647,13 +627,11 @@ namespace AirLoopHVACDOAS { HVACDXHeatPumpSystem::GetHeatingCoilInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); if (OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) == 0) { InletNodeErrFlag = true; - errorsFound = true; } OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = HVACDXHeatPumpSystem::GetHeatingCoilOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); if (OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) == 0) { OutletNodeErrFlag = true; - errorsFound = true; } } else if (SELECT_CASE_var == "AIRLOOPHVAC:UNITARYSYSTEM") { @@ -661,13 +639,11 @@ namespace AirLoopHVACDOAS { OutsideAirSys(thisDOAS.m_OASystemNum).compPointer[CompNum]->AirInNode; if (OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) == 0) { InletNodeErrFlag = true; - errorsFound = true; } OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = OutsideAirSys(thisDOAS.m_OASystemNum).compPointer[CompNum]->AirOutNode; if (OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) == 0) { OutletNodeErrFlag = true; - errorsFound = true; } } else if (SELECT_CASE_var == "COIL:USERDEFINED") { ShowSevereError("When " + CurrentModuleObject + " = " + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum) + @@ -688,102 +664,76 @@ namespace AirLoopHVACDOAS { } else if (SELECT_CASE_var == "HEATEXCHANGER:AIRTOAIR:SENSIBLEANDLATENT") { OutsideAirSys(thisDOAS.m_OASystemNum).HeatExchangerFlag = true; OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - HeatRecovery::GetSupplyInletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; + HeatRecovery::GetSupplyInletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - HeatRecovery::GetSupplyOutletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + HeatRecovery::GetSupplyOutletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "HEATEXCHANGER:DESICCANT:BALANCEDFLOW") { OutsideAirSys(thisDOAS.m_OASystemNum).HeatExchangerFlag = true; OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - HeatRecovery::GetSupplyInletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; + HeatRecovery::GetSupplyInletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - HeatRecovery::GetSupplyOutletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + HeatRecovery::GetSupplyOutletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); // Desiccant Dehumidifier } else if (SELECT_CASE_var == "DEHUMIDIFIER:DESICCANT:NOFANS") { - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - DesiccantDehumidifiers::GetProcAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = DesiccantDehumidifiers::GetProcAirOutletNodeNum( - OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = DesiccantDehumidifiers::GetProcAirInletNodeNum( + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = DesiccantDehumidifiers::GetProcAirOutletNodeNum( + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "DEHUMIDIFIER:DESICCANT:SYSTEM") { - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - DesiccantDehumidifiers::GetProcAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = DesiccantDehumidifiers::GetProcAirOutletNodeNum( - OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = DesiccantDehumidifiers::GetProcAirInletNodeNum( + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = DesiccantDehumidifiers::GetProcAirOutletNodeNum( + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); // Humidifiers: Humidifier:Steam:Electric and Humidifier:Steam:Gas } else if (SELECT_CASE_var == "HUMIDIFIER:STEAM:ELECTRIC") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - Humidifiers::GetAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - Humidifiers::GetAirOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + Humidifiers::GetAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = + Humidifiers::GetAirOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "HUMIDIFIER:STEAM:GAS") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - Humidifiers::GetAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - Humidifiers::GetAirOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + Humidifiers::GetAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = + Humidifiers::GetAirOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); // Unglazed Transpired Solar Collector } else if (SELECT_CASE_var == "SOLARCOLLECTOR:UNGLAZEDTRANSPIRED") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - TranspiredCollector::GetAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - TranspiredCollector::GetAirOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + TranspiredCollector::GetAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = + TranspiredCollector::GetAirOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); // PVT air heater } else if (SELECT_CASE_var == "SOLARCOLLECTOR:FLATPLATE:PHOTOVOLTAICTHERMAL") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = PhotovoltaicThermalCollectors::GetAirInletNodeNum( - OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = PhotovoltaicThermalCollectors::GetAirOutletNodeNum( - OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = PhotovoltaicThermalCollectors::GetAirOutletNodeNum( + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); // Evaporative Cooler Types } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:DIRECT:CELDEKPAD") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = + EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:CELDEKPAD") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = + EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:WETCOIL") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = + EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:RESEARCHSPECIAL") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = + EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:DIRECT:RESEARCHSPECIAL") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) InletNodeErrFlag = true; - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + EvaporativeCoolers::GetInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = + EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else { ShowSevereError(CurrentModuleObject + " = \"" + CompName + "\" invalid Outside Air Component=\"" + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentType(CompNum) + "\"."); @@ -791,9 +741,11 @@ namespace AirLoopHVACDOAS { } if (InletNodeErrFlag) { ShowSevereError("Inlet node number is not found in " + CurrentModuleObject + " = " + CompName); + errorsFound = true; } if (OutletNodeErrFlag) { ShowSevereError("Outlet node number is not found in " + CurrentModuleObject + " = " + CompName); + errorsFound = true; } } diff --git a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc index 4fcf2c0f09b..2aa6515398d 100644 --- a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc +++ b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc @@ -52,11 +52,12 @@ #include // EnergyPlus Headers -#include #include #include #include - +#include +#include +#include "Fixtures/EnergyPlusFixture.hh" #include #include #include @@ -74,7 +75,6 @@ #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" using namespace EnergyPlus; using namespace DataSurfaces; @@ -3977,7 +3977,7 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOASTest) // Mixer outlet EXPECT_NEAR(23.0, DataLoopNode::Node(68).Temp, 0.0001); EXPECT_NEAR(0.5, DataLoopNode::Node(68).MassFlowRate, 0.0001); - // Outlet of HX + // Outlet of HX EXPECT_NEAR(-8.0710884, DataLoopNode::Node(67).Temp, 0.0001); // Outlet of Central DOAS EXPECT_NEAR(4.5, DataLoopNode::Node(70).Temp, 0.0001); @@ -3988,6 +3988,248 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOASTest) EXPECT_NEAR(4.5, DataLoopNode::Node(4).Temp, 0.0001); EXPECT_NEAR(4.5, DataLoopNode::Node(5).Temp, 0.0001); EXPECT_NEAR(4.5, DataLoopNode::Node(6).Temp, 0.0001); +} + +TEST_F(EnergyPlusFixture, AirLoopHVACDOAS_TestOACompOutletNodeIndex) +{ + // 7686 + std::string const idf_objects = delimited_string({ + " Version,9.3;", + " AirLoopHVAC:DedicatedOutdoorAirSystem,", + " AirLoopHVAC DOAS, !- Name", + " AirLoopDOAS OA system, !- AirLoopHVAC:OutdoorAirSystem Name", + " ALWAYS_ON, !- Availability Schedule Name", + " AirLoopDOASMixer, !- AirLoopHVAC:Mixer Name", + " AirLoopDOASSplitter, !- AirLoopHVAC:Splitter Name", + " 4.5, !- Preheat Design Temperature {C}", + " 0.004, !- Preheat Design Humidity Ratio {kgWater/kgDryAir}", + " 17.5, !- Precool Design Temperature {C}", + " 0.012, !- Precool Design Humidity Ratio {kgWater/kgDryAir}", + " 5, !- Number of AirLoopHVAC", + " PSZ-AC:1, !- AirLoopHVAC 1 Name", + " PSZ-AC:2, !- AirLoopHVAC 2 Name", + " PSZ-AC:3, !- AirLoopHVAC 3 Name", + " PSZ-AC:4, !- AirLoopHVAC 4 Name", + " PSZ-AC:5; !- AirLoopHVAC 5 Name", + + " AirLoopHVAC:Mixer,", + " AirLoopDOASMixer, !- Name", + " AirLoopDOASMixerOutlet, !- Outlet Node Name", + " PSZ-AC:1_OARelief Node, !- Inlet 1 Node Name", + " PSZ-AC:2_OARelief Node, !- Inlet 2 Node Name", + " PSZ-AC:3_OARelief Node, !- Inlet 3 Node Name", + " PSZ-AC:4_OARelief Node, !- Inlet 4 Node Name", + " PSZ-AC:5_OARelief Node; !- Inlet 5 Node Name", + + " AirLoopHVAC:Splitter,", + " AirLoopDOASSplitter, !- Name", + " AirLoopDOASSplitterInlet,!- Inlet Node Name", + " PSZ-AC:1_OAInlet Node, !- Outlet 1 Node Name", + " PSZ-AC:2_OAInlet Node, !- Outlet 2 Node Name", + " PSZ-AC:3_OAInlet Node, !- Outlet 3 Node Name", + " PSZ-AC:4_OAInlet Node, !- Outlet 4 Node Name", + " PSZ-AC:5_OAInlet Node; !- Outlet 5 Node Name", + + " Schedule:Compact,", + " OA Cooling Supply Air Temp Sch, !- Name", + " Temperature, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00,17.5; !- Field 3", + + " Schedule:Compact,", + " OA Heating Supply Air Temp Sch, !- Name", + " Temperature, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00,4.5; !- Field 3", + + " SetpointManager:Scheduled,", + " OA Air Temp Manager 1, !- Name", + " Temperature, !- Control Variable", + " OA Cooling Supply Air Temp Sch, !- Schedule Name", + " AirLoopDOASSplitterInlet;!- Setpoint Node or NodeList Name", + + " SetpointManager:Scheduled,", + " OA Air Temp Manager 2, !- Name", + " Temperature, !- Control Variable", + " OA Heating Supply Air Temp Sch, !- Schedule Name", + " OA Heating Coil 1 Air Outlet Node; !- Setpoint Node or NodeList Name", + + " AirLoopHVAC:OutdoorAirSystem,", + " AirLoopDOAS OA system, !- Name", + " OA Sys 1 Controllers, !- Controller List Name", + " OA Sys 1 Equipment, !- Outdoor Air Equipment List Name", + " OA Sys 1 Avail List; !- Availability Manager List Name", + + " AvailabilityManagerAssignmentList,", + " OA Sys 1 Avail List, !- Name", + " AvailabilityManager:Scheduled, !- Availability Manager 1 Object Type", + " OA Sys 1 Avail; !- Availability Manager 1 Name", + + " AvailabilityManager:Scheduled,", + " OA Sys 1 Avail, !- Name", + " Always_ON; !- Schedule Name", + + " AirLoopHVAC:ControllerList,", + " OA Sys 1 Controllers, !- Name", + " Controller:WaterCoil, !- Controller 1 Object Type", + " OA CC Controller 1, !- Controller 1 Name", + " Controller:WaterCoil, !- Controller 2 Object Type", + " OA HC Controller 1; !- Controller 2 Name", + + " Schedule:Compact,", + " Min OA Sched, !- Name", + " Fraction, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: Weekdays, !- Field 2", + " Until: 6:00,0.0, !- Field 3", + " Until: 20:00,1.0, !- Field 5", + " Until: 24:00,0.02, !- Field 7", + " For: AllOtherDays, !- Field 9", + " Until: 24:00,0.02; !- Field 10", + + " AirLoopHVAC:OutdoorAirSystem:EquipmentList,", + " OA Sys 1 Equipment, !- Name", + " Fan:SystemModel, !- Component 1 Object Type", + " OA Supply Fan, !- Component 1 Name", + " Humidifier:Steam:Electric, !- Component 2 Object Type", + " DOAS OA Humidifier; !- Component 2 Name", + + " Humidifier:Steam:Electric,", + " DOAS OA Humidifier, !- Name", + " ALWAYS_ON, !- Availability Schedule Name", + " autosize, !- Rated Capacity {m3/s}", + " autosize, !- Rated Power {W}", + " 0, !- Rated Fan Power {W}", + " 0, !- Standby Power {W}", + " OA Supply Fan Outlet Node, !- Air Inlet Node Name", + " AirLoopDOASSplitterInlet, !- Air Outlet Node Name", + " ; !- Water Storage Tank Name", + + " SetpointManager:Scheduled,", + " Main Humidifier setpoint Mgr, !- Name", + " MinimumHumidityRatio, !- Control Variable", + " Humidifier Setpoint Schedule, !- Schedule Name", + " DOAS Humidifier Air Outlet; !- Setpoint Node or NodeList Name", + " Schedule:Compact,", + " Humidifier Setpoint Schedule, !- Name", + " HumidityRatio, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: Alldays, !- Field 2", + " Until: 24:00,0.001; !- Field 3", + + " ScheduleTypeLimits,", + " HumidityRatio, !- Name", + " 0.0001, !- Lower Limit Value", + " 0.0120, !- Upper Limit Value", + " CONTINUOUS; !- Numeric Type", + + " Fan:SystemModel,", + " OA Supply Fan, !- Name", + " ALWAYS_ON, !- Availability Schedule Name", + " Outside Air Inlet Node 1,!- Air Inlet Node Name", + " OA Supply Fan Outlet Node, !- Air Outlet Node Name", + " Autosize, !- Design Maximum Air Flow Rate {m3/s}", + " Discrete, !- Speed Control Method", + " 0.25, !- Electric Power Minimum Flow Rate Fraction", + " 600.0, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " Autosize, !- Design Electric Power Consumption {W}", + " TotalEfficiencyAndPressure, !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " , !- Electric Power Function of Flow Fraction Curve Name", + " , !- Night Ventilation Mode Pressure Rise {Pa}", + " , !- Night Ventilation Mode Flow Fraction", + " , !- Motor Loss Zone Name", + " , !- Motor Loss Radiative Fraction", + " General; !- End-Use Subcategory", + + + " OutdoorAir:NodeList,", + " OutsideAirInletNodes; !- Node or NodeList Name 1", + + " NodeList,", + " OutsideAirInletNodes, !- Name", + " Outside Air Inlet Node 1;!- Node 1 Name", + + " Schedule:Compact,", + " ALWAYS_ON, !- Name", + " On/Off, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00,1; !- Field 3", + " Schedule:Compact,", + " CoolingCoilAvailSched, !- Name", + " Fraction, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: WeekDays, !- Field 2", + " Until: 6:00,0.0, !- Field 3", + " Until: 20:00,1.0, !- Field 5", + " Until: 24:00,0.0, !- Field 7", + " For: SummerDesignDay WinterDesignDay, !- Field 9", + " Until: 24:00,1.0, !- Field 10", + " For: AllOtherDays, !- Field 12", + " Until: 24:00,0.0; !- Field 13", + + " OutdoorAir:Mixer,", + " PSZ-AC:1_OAMixing Box, !- Name", + " PSZ-AC:1_OA-PSZ-AC:1_CoolCNode, !- Mixed Air Node Name", + " PSZ-AC:1_OAInlet Node, !- Outdoor Air Stream Node Name", + " PSZ-AC:1_OARelief Node, !- Relief Air Stream Node Name", + " PSZ-AC:1 Supply Equipment Inlet Node; !- Return Air Stream Node Name", + + " OutdoorAir:Mixer,", + " PSZ-AC:2_OAMixing Box, !- Name", + " PSZ-AC:2_OA-PSZ-AC:2_CoolCNode, !- Mixed Air Node Name", + " PSZ-AC:2_OAInlet Node, !- Outdoor Air Stream Node Name", + " PSZ-AC:2_OARelief Node, !- Relief Air Stream Node Name", + " PSZ-AC:2 Supply Equipment Inlet Node; !- Return Air Stream Node Name", + + " OutdoorAir:Mixer,", + " PSZ-AC:3_OAMixing Box, !- Name", + " PSZ-AC:3_OA-PSZ-AC:3_CoolCNode, !- Mixed Air Node Name", + " PSZ-AC:3_OAInlet Node, !- Outdoor Air Stream Node Name", + " PSZ-AC:3_OARelief Node, !- Relief Air Stream Node Name", + " PSZ-AC:3 Supply Equipment Inlet Node; !- Return Air Stream Node Name", + + " OutdoorAir:Mixer,", + " PSZ-AC:4_OAMixing Box, !- Name", + " PSZ-AC:4_OA-PSZ-AC:4_CoolCNode, !- Mixed Air Node Name", + " PSZ-AC:4_OAInlet Node, !- Outdoor Air Stream Node Name", + " PSZ-AC:4_OARelief Node, !- Relief Air Stream Node Name", + " PSZ-AC:4 Supply Equipment Inlet Node; !- Return Air Stream Node Name", + + " OutdoorAir:Mixer,", + " PSZ-AC:5_OAMixing Box, !- Name", + " PSZ-AC:5_OA-PSZ-AC:5_CoolCNode, !- Mixed Air Node Name", + " PSZ-AC:5_OAInlet Node, !- Outdoor Air Stream Node Name", + " PSZ-AC:5_OARelief Node, !- Relief Air Stream Node Name", + " PSZ-AC:5 Supply Equipment Inlet Node; !- Return Air Stream Node Name", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + MixedAir::GetOutsideAirSysInputs(); + MixedAir::GetOASysInputFlag = false; + MixedAir::GetOAMixerInputs(); + + DataAirSystems::PrimaryAirSystem.allocate(5); + DataAirSystems::PrimaryAirSystem(1).Name = "PSZ-AC:1"; + DataAirSystems::PrimaryAirSystem(2).Name = "PSZ-AC:2"; + DataAirSystems::PrimaryAirSystem(3).Name = "PSZ-AC:3"; + DataAirSystems::PrimaryAirSystem(4).Name = "PSZ-AC:4"; + DataAirSystems::PrimaryAirSystem(5).Name = "PSZ-AC:5"; + + AirLoopHVACDOAS::AirLoopDOAS::getAirLoopDOASInput(); + + EXPECT_EQ(DataAirLoop::OutsideAirSys(1).ComponentType(2), "HUMIDIFIER:STEAM:ELECTRIC"); + EXPECT_EQ(DataAirLoop::OutsideAirSys(1).InletNodeNum(2), 2); + EXPECT_EQ(DataAirLoop::OutsideAirSys(1).OutletNodeNum(2), 23); } + } // namespace EnergyPlus From 37bdd772c50e194f05382ea27cf1500ca3e16274 Mon Sep 17 00:00:00 2001 From: Lixing Gu Date: Thu, 13 Feb 2020 15:11:33 -0500 Subject: [PATCH 2/3] Correct one more mistake --- src/EnergyPlus/AirLoopHVACDOAS.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index 779723e13f3..5d646c8b3eb 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -608,7 +608,7 @@ namespace AirLoopHVACDOAS { } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = HVACHXAssistedCoolingCoil::GetCoilInletNode(CompType, CompName, InletNodeErrFlag); - OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = + OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = HVACHXAssistedCoolingCoil::GetCoilOutletNode(CompType, CompName, OutletNodeErrFlag); } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:DX") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = From 240c39711b062463d687e7b72a86741c7789aa56 Mon Sep 17 00:00:00 2001 From: rraustad Date: Mon, 17 Feb 2020 10:54:02 -0500 Subject: [PATCH 3/3] Unify coil node calls --- src/EnergyPlus/AirLoopHVACDOAS.cc | 57 +++++++------------------- src/EnergyPlus/DataHVACSystems.hh | 4 +- src/EnergyPlus/HVACDXHeatPumpSystem.cc | 12 ++---- src/EnergyPlus/HVACDXHeatPumpSystem.hh | 4 +- src/EnergyPlus/HVACDXSystem.cc | 10 ++--- src/EnergyPlus/HVACDXSystem.hh | 4 +- src/EnergyPlus/UnitarySystem.cc | 6 ++- src/EnergyPlus/UnitarySystem.hh | 4 +- 8 files changed, 34 insertions(+), 67 deletions(-) diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index 88eb39b3aea..0cd94608fce 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -537,7 +537,7 @@ namespace AirLoopHVACDOAS { _, _, _); - if (errorsFound) { + if (errorsFound) { // is this really needed here, program fatals out later on when errorsFound = true ShowFatalError("GetAirLoopDOASInput: Program terminated for previous conditions."); } } else if (SELECT_CASE_var == "COIL:HEATING:WATER") { @@ -562,7 +562,7 @@ namespace AirLoopHVACDOAS { _, _, _); - if (errorsFound) { + if (errorsFound) { // is this really needed here, program fatals out later on when errorsFound = true ShowFatalError("GetAirLoopDOASInput: Program terminated for previous conditions."); } @@ -593,7 +593,7 @@ namespace AirLoopHVACDOAS { _, _, _); - if (errorsFound) { + if (errorsFound) { // is this really needed here, program fatals out later on when errorsFound = true ShowFatalError("GetAirLoopDOASInput: Program terminated for previous conditions."); } } else if (SELECT_CASE_var == "COIL:HEATING:ELECTRIC") { @@ -613,59 +613,36 @@ namespace AirLoopHVACDOAS { HVACHXAssistedCoolingCoil::GetCoilOutletNode(CompType, CompName, OutletNodeErrFlag); } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:DX") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - HVACDXSystem::GetCoolingCoilInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); - if (OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) == 0) { - InletNodeErrFlag = true; - } + HVACDXSystem::GetCoolingCoilInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - HVACDXSystem::GetCoolingCoilOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); - if (OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) == 0) { - OutletNodeErrFlag = true; - } + HVACDXSystem::GetCoolingCoilOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).DXCoolingCoilFlag = true; } else if (SELECT_CASE_var == "COILSYSTEM:HEATING:DX") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - HVACDXHeatPumpSystem::GetHeatingCoilInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); - if (OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) == 0) { - InletNodeErrFlag = true; - } + HVACDXHeatPumpSystem::GetHeatingCoilInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - HVACDXHeatPumpSystem::GetHeatingCoilOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); - if (OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) == 0) { - OutletNodeErrFlag = true; - } - + HVACDXHeatPumpSystem::GetHeatingCoilOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "AIRLOOPHVAC:UNITARYSYSTEM") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = OutsideAirSys(thisDOAS.m_OASystemNum) .compPointer[CompNum] - ->getAirInNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), 0); - if (OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) == 0) { - InletNodeErrFlag = true; - } + ->getAirInNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), 0, InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = OutsideAirSys(thisDOAS.m_OASystemNum) .compPointer[CompNum] - ->getAirOutNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), 0); - if (OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) == 0) { - OutletNodeErrFlag = true; - } + ->getAirOutNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), 0, OutletNodeErrFlag); } else if (SELECT_CASE_var == "COIL:USERDEFINED") { ShowSevereError("When " + CurrentModuleObject + " = " + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum) + " is used in AirLoopHVAC:DedicatedOutdoorAirSystem,"); - ShowContinueError(" the COIL:USERDEFINED can not be used as a component. Please change it"); + ShowContinueError(" the COIL:USERDEFINED can not be used as a component."); errorsFound = true; // Heat recovery } else if (SELECT_CASE_var == "HEATEXCHANGER:AIRTOAIR:FLATPLATE") { OutsideAirSys(thisDOAS.m_OASystemNum).HeatExchangerFlag = true; OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = - HeatRecovery::GetSupplyInletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); + HeatRecovery::GetSupplyInletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = - HeatRecovery::GetSupplyOutletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) { - ShowContinueError("Node number is not found in " + CurrentModuleObject + " = " + - OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); - } + HeatRecovery::GetSupplyOutletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "HEATEXCHANGER:AIRTOAIR:SENSIBLEANDLATENT") { OutsideAirSys(thisDOAS.m_OASystemNum).HeatExchangerFlag = true; OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = @@ -700,7 +677,6 @@ namespace AirLoopHVACDOAS { Humidifiers::GetAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = Humidifiers::GetAirOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); - // Unglazed Transpired Solar Collector } else if (SELECT_CASE_var == "SOLARCOLLECTOR:UNGLAZEDTRANSPIRED") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = @@ -741,14 +717,9 @@ namespace AirLoopHVACDOAS { EvaporativeCoolers::GetOutletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else if (SELECT_CASE_var == "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW") { OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = HVACVariableRefrigerantFlow::GetVRFTUInAirNodeFromName( - OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) { - InletNodeErrFlag = true; - errorsFound = false; - } + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag); OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = HVACVariableRefrigerantFlow::GetVRFTUOutAirNodeFromName( - OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound); - if (errorsFound) OutletNodeErrFlag = true; + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag); } else { ShowSevereError(CurrentModuleObject + " = \"" + CompName + "\" invalid Outside Air Component=\"" + OutsideAirSys(thisDOAS.m_OASystemNum).ComponentType(CompNum) + "\"."); diff --git a/src/EnergyPlus/DataHVACSystems.hh b/src/EnergyPlus/DataHVACSystems.hh index af321998d14..6103db332fd 100644 --- a/src/EnergyPlus/DataHVACSystems.hh +++ b/src/EnergyPlus/DataHVACSystems.hh @@ -79,8 +79,8 @@ namespace EnergyPlus { ) = 0; virtual void sizeSystem(bool const FirstHVACIteration, int const AirLoopNum) = 0; - virtual int getAirInNode(std::string const &UnitarySysName, int const ZoneOAUnitNum) = 0; - virtual int getAirOutNode(std::string const &UnitarySysName, int const ZoneOAUnitNum) = 0; + virtual int getAirInNode(std::string const &UnitarySysName, int const ZoneOAUnitNum, bool &errFlag) = 0; + virtual int getAirOutNode(std::string const &UnitarySysName, int const ZoneOAUnitNum, bool &errFlag) = 0; }; diff --git a/src/EnergyPlus/HVACDXHeatPumpSystem.cc b/src/EnergyPlus/HVACDXHeatPumpSystem.cc index 09aeba0ca42..d74f2601d40 100644 --- a/src/EnergyPlus/HVACDXHeatPumpSystem.cc +++ b/src/EnergyPlus/HVACDXHeatPumpSystem.cc @@ -1297,8 +1297,7 @@ namespace HVACDXHeatPumpSystem { return Residuum; } - int GetHeatingCoilInletNodeNum( - std::string const &DXHeatCoilSysName) + int GetHeatingCoilInletNodeNum(std::string const &DXHeatCoilSysName, bool &InletNodeErrFlag) { // SUBROUTINE INFORMATION: // AUTHOR Lixing Gu, FSEC @@ -1306,8 +1305,6 @@ namespace HVACDXHeatPumpSystem { // PURPOSE OF THIS SUBROUTINE: // Get inlet node number - // Using/Aliasing - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NodeNum; int DXHeatSysNum; @@ -1324,12 +1321,12 @@ namespace HVACDXHeatPumpSystem { NodeNum = DXHeatPumpSystem(DXHeatSysNum).DXHeatPumpCoilInletNodeNum; } } + if (NodeNum == 0) InletNodeErrFlag = true; return NodeNum; } - int GetHeatingCoilOutletNodeNum( - std::string const &DXHeatCoilSysName) + int GetHeatingCoilOutletNodeNum(std::string const &DXHeatCoilSysName, bool &OutletNodeErrFlag) { // SUBROUTINE INFORMATION: // AUTHOR Lixing Gu, FSEC @@ -1337,8 +1334,6 @@ namespace HVACDXHeatPumpSystem { // PURPOSE OF THIS SUBROUTINE: // Get Outlet node number - // Using/Aliasing - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NodeNum; int DXHeatSysNum; @@ -1355,6 +1350,7 @@ namespace HVACDXHeatPumpSystem { NodeNum = DXHeatPumpSystem(DXHeatSysNum).DXHeatPumpCoilOutletNodeNum; } } + if (NodeNum == 0) OutletNodeErrFlag = true; return NodeNum; } diff --git a/src/EnergyPlus/HVACDXHeatPumpSystem.hh b/src/EnergyPlus/HVACDXHeatPumpSystem.hh index 926a84724cb..f1643fbc7fb 100644 --- a/src/EnergyPlus/HVACDXHeatPumpSystem.hh +++ b/src/EnergyPlus/HVACDXHeatPumpSystem.hh @@ -190,9 +190,9 @@ namespace HVACDXHeatPumpSystem { Array1 const &Par // par(1) = DX coil number ); - int GetHeatingCoilInletNodeNum(std::string const &DXCoilSysName); + int GetHeatingCoilInletNodeNum(std::string const &DXCoilSysName, bool &InletNodeErrFlag); - int GetHeatingCoilOutletNodeNum(std::string const &DXCoilSysName); + int GetHeatingCoilOutletNodeNum(std::string const &DXCoilSysName, bool &OutletNodeErrFlag); } // namespace HVACDXHeatPumpSystem diff --git a/src/EnergyPlus/HVACDXSystem.cc b/src/EnergyPlus/HVACDXSystem.cc index 6e45f2b0365..08f3c84dd1b 100644 --- a/src/EnergyPlus/HVACDXSystem.cc +++ b/src/EnergyPlus/HVACDXSystem.cc @@ -3829,7 +3829,7 @@ namespace HVACDXSystem { return Residuum; } - int GetCoolingCoilInletNodeNum(std::string const &DXCoilSysName) + int GetCoolingCoilInletNodeNum(std::string const &DXCoilSysName, bool &InletNodeErrFlag) { // SUBROUTINE INFORMATION: // AUTHOR Lixing Gu, FSEC @@ -3837,8 +3837,6 @@ namespace HVACDXSystem { // PURPOSE OF THIS SUBROUTINE: // Get inlet node number - // Using/Aliasing - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NodeNum; int DXCoolSysNum; @@ -3855,11 +3853,12 @@ namespace HVACDXSystem { NodeNum = DXCoolingSystem(DXCoolSysNum).DXCoolingCoilInletNodeNum; } } + if (NodeNum == 0) InletNodeErrFlag = true; return NodeNum; } - int GetCoolingCoilOutletNodeNum(std::string const &DXCoilSysName) + int GetCoolingCoilOutletNodeNum(std::string const &DXCoilSysName, bool &OutletNodeErrFlag) { // SUBROUTINE INFORMATION: // AUTHOR Lixing Gu, FSEC @@ -3867,8 +3866,6 @@ namespace HVACDXSystem { // PURPOSE OF THIS SUBROUTINE: // Get Outlet node number - // Using/Aliasing - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NodeNum; int DXCoolSysNum; @@ -3885,6 +3882,7 @@ namespace HVACDXSystem { NodeNum = DXCoolingSystem(DXCoolSysNum).DXCoolingCoilOutletNodeNum; } } + if (NodeNum == 0) OutletNodeErrFlag = true; return NodeNum; } diff --git a/src/EnergyPlus/HVACDXSystem.hh b/src/EnergyPlus/HVACDXSystem.hh index 06f1690b20c..a695fdcb2b2 100644 --- a/src/EnergyPlus/HVACDXSystem.hh +++ b/src/EnergyPlus/HVACDXSystem.hh @@ -338,9 +338,9 @@ namespace HVACDXSystem { Array1 const &Par // par(1) = DX coil number ); - int GetCoolingCoilInletNodeNum(std::string const &DXCoilSysName); + int GetCoolingCoilInletNodeNum(std::string const &DXCoilSysName, bool &InletNodeErrFlag); - int GetCoolingCoilOutletNodeNum(std::string const &DXCoilSysName); + int GetCoolingCoilOutletNodeNum(std::string const &DXCoilSysName, bool &OutletNodeErrFlag); // End of Calculation subroutines for the DXCoolingSystem Module // ***************************************************************************** diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 912968c5148..ddc99a25e52 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -15064,7 +15064,7 @@ namespace UnitarySystems { } } - int UnitarySys::getAirInNode(std::string const &UnitarySysName, int const ZoneOAUnitNum) { + int UnitarySys::getAirInNode(std::string const &UnitarySysName, int const ZoneOAUnitNum, bool &errFlag) { if (UnitarySystems::getInputOnceFlag) { getUnitarySystemInput(UnitarySysName, false, ZoneOAUnitNum); UnitarySystems::getInputOnceFlag = false; @@ -15076,10 +15076,11 @@ namespace UnitarySystems { break; } } + if (airNode == 0) errFlag = true; return airNode; } - int UnitarySys::getAirOutNode(std::string const &UnitarySysName, int const ZoneOAUnitNum) { + int UnitarySys::getAirOutNode(std::string const &UnitarySysName, int const ZoneOAUnitNum, bool &errFlag) { if (UnitarySystems::getInputOnceFlag) { getUnitarySystemInput(UnitarySysName, false, ZoneOAUnitNum); UnitarySystems::getInputOnceFlag = false; @@ -15091,6 +15092,7 @@ namespace UnitarySystems { break; } } + if (airNode == 0) errFlag = true; return airNode; } diff --git a/src/EnergyPlus/UnitarySystem.hh b/src/EnergyPlus/UnitarySystem.hh index 8b286d2d448..5d0418033c8 100644 --- a/src/EnergyPlus/UnitarySystem.hh +++ b/src/EnergyPlus/UnitarySystem.hh @@ -763,8 +763,8 @@ namespace UnitarySystems { ) override; void sizeSystem(bool const FirstHVACIteration, int const AirLoopNum) override; - int getAirInNode(std::string const &UnitarySysName, int const ZoneOAUnitNum)override; - int getAirOutNode(std::string const &UnitarySysName, int const ZoneOAUnitNum)override; + int getAirInNode(std::string const &UnitarySysName, int const ZoneOAUnitNum, bool &errFlag) override; + int getAirOutNode(std::string const &UnitarySysName, int const ZoneOAUnitNum, bool &errFlag) override; }; extern std::vector unitarySys;