@@ -639,6 +639,23 @@ TEST_F(EnergyPlusFixture, VariableSpeedCoils_RHControl)
639639 EXPECT_NEAR (state->dataLoopNodes ->Node (ControlNode).HumRat , state->dataLoopNodes ->Node (ControlNode).HumRatMax , 0.0000001 );
640640 // latent load needed to increase compressor speed to speed 4
641641 EXPECT_EQ (4 , thisSys->m_CoolingSpeedNum );
642+
643+ // test for divide by zero error in controlCoolingSystemToSP
644+ thisSys->m_DesiredOutletTemp = 23.888888888888900 ;
645+ thisSys->m_DesiredOutletHumRat = 0.0092857142857142895 ;
646+ state->dataLoopNodes ->Node (InletNode).MassFlowRate = 1.3840962084222401 ;
647+ state->dataLoopNodes ->Node (InletNode).Temp = 16.566173051926114 ;
648+ state->dataLoopNodes ->Node (InletNode).HumRat = 0.0092873376541228961 ;
649+ state->dataLoopNodes ->Node (InletNode).HumRatMax = -999 ;
650+
651+ has_err_output (true );
652+ EXPECT_NO_THROW (thisSys->controlCoolingSystemToSP (*state, airLoopNum, FirstHVACIteration, HXUnitOn, CompressorOn));
653+ EXPECT_EQ (thisSys->m_CoolingPartLoadFrac , 0 );
654+ std::string const expected_error =
655+ " ** Warning ** CoilSystem:Cooling:DX - sensible part-load ratio calculation failed: part-load ratio limits exceeded, for unit = DX "
656+ " COOLING COIL SYSTEM\n ** ~~~ ** Estimated part-load ratio = 0.000\n ** ~~~ ** The estimated part-load ratio will be used and "
657+ " the simulation continues. Occurrence info:\n ** ~~~ ** Environment=, at Simulation time= 00:-15 - 00:00\n " ;
658+ compare_err_stream (expected_error, true );
642659}
643660
644661TEST_F (EnergyPlusFixture, VariableSpeedCoils_LatentDegradation_Test)
@@ -1149,6 +1166,23 @@ TEST_F(EnergyPlusFixture, NewDXCoilModel_RHControl)
11491166 EXPECT_LT (outHumRat3, outHumRat1); // lower outlet humrat with multimode's alternate operating mode
11501167 EXPECT_NEAR (outHumRat1, 0.01166 , 0.0001 ); // sensible control yields higher outlet humrat
11511168 EXPECT_NEAR (outHumRat3, 0.01119 , 0.0001 ); // multimode control yields lower outlet humrat
1169+
1170+ // test for divide by zero error in controlCoolingSystemToSP
1171+ thisSys->m_DesiredOutletTemp = 23.888888888888900 ;
1172+ thisSys->m_DesiredOutletHumRat = 0.0092857142857142895 ;
1173+ state->dataLoopNodes ->Node (InletNode).MassFlowRate = 1.3840962084222401 ;
1174+ state->dataLoopNodes ->Node (InletNode).Temp = 16.566173051926114 ;
1175+ state->dataLoopNodes ->Node (InletNode).HumRat = 0.0092873376541228961 ;
1176+ state->dataLoopNodes ->Node (InletNode).HumRatMax = -999 ;
1177+
1178+ has_err_output (true );
1179+ EXPECT_NO_THROW (thisSys->controlCoolingSystemToSP (*state, airLoopNum, FirstHVACIteration, HXUnitOn, CompOn));
1180+ EXPECT_EQ (thisSys->m_CoolingPartLoadFrac , 0 );
1181+ std::string const expected_error =
1182+ " ** Warning ** CoilSystem:Cooling:DX - sensible part-load ratio calculation failed: part-load ratio limits exceeded, for unit = DX "
1183+ " COOLING COIL SYSTEM\n ** ~~~ ** Estimated part-load ratio = 0.000\n ** ~~~ ** The estimated part-load ratio will be used and "
1184+ " the simulation continues. Occurrence info:\n ** ~~~ ** Environment=, at Simulation time= 00:-15 - 00:00\n " ;
1185+ compare_err_stream (expected_error, true );
11521186}
11531187
11541188} // namespace EnergyPlus
0 commit comments