@@ -1083,6 +1083,88 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_EMSOverrideSetpointTest)
10831083 EXPECT_EQ (25.0 , state->dataHeatBalFanSys ->zoneTstatSetpts (1 ).setptHi );
10841084}
10851085
1086+ TEST_F (EnergyPlusFixture, ZoneTempPredictorCorrector_WrongControlTypeSchedule)
1087+ {
1088+ // Test for #11026
1089+
1090+ std::string const idf_objects = delimited_string ({
1091+ " Zone," ,
1092+ " Zone1, !- Name" ,
1093+ " 0, !- Direction of Relative North {deg}" ,
1094+ " 0, !- X Origin {m}" ,
1095+ " 0, !- Y Origin {m}" ,
1096+ " 0, !- Z Origin {m}" ,
1097+ " , !- Type" ,
1098+ " 1, !- Multiplier" ,
1099+ " , !- Ceiling Height {m}" ,
1100+ " , !- Volume {m3}" ,
1101+ " , !- Floor Area {m2}" ,
1102+ " , !- Zone Inside Convection Algorithm" ,
1103+ " , !- Zone Outside Convection Algorithm" ,
1104+ " Yes; !- Part of Total Floor Area" ,
1105+
1106+ " ZoneControl:Thermostat," ,
1107+ " Zone1 Thermostat, !- Name" ,
1108+ " Zone1, !- Zone or ZoneList Name" ,
1109+ " Single HEATING Control Type Sched, !- Control Type Schedule Name" ,
1110+ " ThermostatSetpoint:SingleCooling, !- Control 1 Object Type" ,
1111+ " Thermostat Setpoint Single Cooling; !- Control 1 Name" ,
1112+
1113+ " Schedule:Constant," ,
1114+ " Single HEATING Control Type Sched, !- Name" ,
1115+ " Control Type, !- Schedule Type Limits Name" ,
1116+ " 1; !- Hourly Value" , // <-------- 1 = Single Heating, which is WRONG
1117+
1118+ " ThermostatSetpoint:SingleCooling," ,
1119+ " Thermostat Setpoint Single Cooling, !- Name" ,
1120+ " Always 26C; !- Setpoint Temperature Schedule Name" ,
1121+
1122+ " Schedule:Constant," ,
1123+ " Always 26C, !- Name" ,
1124+ " Temperature, !- Schedule Type Limits Name" ,
1125+ " 26; !- Hourly Value" ,
1126+
1127+ " ScheduleTypeLimits," ,
1128+ " Control Type, !- Name" ,
1129+ " 0, !- Lower Limit Value {BasedOnField A3}" ,
1130+ " 4, !- Upper Limit Value {BasedOnField A3}" ,
1131+ " Discrete; !- Numeric Type" ,
1132+
1133+ " ScheduleTypeLimits," ,
1134+ " Temperature, !- Name" ,
1135+ " , !- Lower Limit Value {BasedOnField A3}" ,
1136+ " , !- Upper Limit Value {BasedOnField A3}" ,
1137+ " Continuous, !- Numeric Type" ,
1138+ " Temperature; !- Unit Type" ,
1139+ });
1140+
1141+ ASSERT_TRUE (process_idf (idf_objects));
1142+
1143+ state->dataGlobal ->TimeStepsInHour = 1 ; // must initialize this to get schedules initialized
1144+ state->dataGlobal ->MinutesInTimeStep = 60 ; // must initialize this to get schedules initialized
1145+ state->init_state (*state);
1146+
1147+ bool ErrorsFound (false ); // If errors detected in input
1148+
1149+ GetZoneData (*state, ErrorsFound);
1150+ ASSERT_FALSE (ErrorsFound);
1151+
1152+ EXPECT_THROW (GetZoneAirSetPoints (*state), EnergyPlus::FatalError);
1153+ std::string const error_string = delimited_string ({
1154+ " ** Severe ** Control Type Schedule=SINGLE HEATING CONTROL TYPE SCHED" ,
1155+ " ** ~~~ ** ..specifies 1 (ThermostatSetpoint:SingleHeating) as the control type. Not valid for this zone." ,
1156+ " ** ~~~ ** ..reference ZoneControl:Thermostat=ZONE1 THERMOSTAT" ,
1157+ " ** ~~~ ** ..reference ZONE=ZONE1" ,
1158+ " ** Severe ** GetStagedDualSetpoint: Errors with invalid names in ZoneControl:Thermostat:StagedDualSetpoint objects." ,
1159+ " ** ~~~ ** ...These will not be read in. Other errors may occur." ,
1160+ " ** Fatal ** Errors getting Zone Control input data. Preceding condition(s) cause termination." ,
1161+ " ...Summary of Errors that led to program termination:" ,
1162+ " ..... Reference severe error count=2" ,
1163+ " ..... Last severe error=GetStagedDualSetpoint: Errors with invalid names in ZoneControl:Thermostat:StagedDualSetpoint objects." ,
1164+ });
1165+ EXPECT_TRUE (compare_err_stream (error_string, true ));
1166+ }
1167+
10861168TEST_F (EnergyPlusFixture, temperatureAndCountInSch_test)
10871169{
10881170 // J.Glazer - August 2017
@@ -1216,6 +1298,7 @@ TEST_F(EnergyPlusFixture, SetPointWithCutoutDeltaT_test)
12161298 auto *coolSetptSched = Sched::AddScheduleConstant (*state, " COOL SETPT-1" );
12171299
12181300 state->dataZoneCtrls ->TempControlledZone (1 ).setpts [(int )HVAC::SetptType::SingleHeat].heatSetptSched = heatSetptSched;
1301+ state->dataZoneCtrls ->TempControlledZone (1 ).setpts [(int )HVAC::SetptType::SingleHeat].isUsed = true ;
12191302 state->dataZoneTempPredictorCorrector ->tempSetptScheds [(int )HVAC::SetptType::SingleHeat].allocate (1 );
12201303 state->dataZoneTempPredictorCorrector ->tempSetptScheds [(int )HVAC::SetptType::SingleHeat](1 ).heatSched = heatSetptSched;
12211304 heatSetptSched->currentVal = 22.0 ;
@@ -1349,6 +1432,7 @@ TEST_F(EnergyPlusFixture, TempAtPrevTimeStepWithCutoutDeltaT_test)
13491432 state->dataHeatBalFanSys ->TempControlType .allocate (1 );
13501433 state->dataHeatBalFanSys ->TempControlTypeRpt .allocate (1 );
13511434 state->dataZoneCtrls ->TempControlledZone (1 ).setpts [(int )HVAC::SetptType::SingleHeat].heatSetptSched = heatSetptSched;
1435+ state->dataZoneCtrls ->TempControlledZone (1 ).setpts [(int )HVAC::SetptType::SingleHeat].isUsed = true ;
13521436 state->dataZoneTempPredictorCorrector ->tempSetptScheds [(int )HVAC::SetptType::SingleHeat].allocate (1 );
13531437 state->dataZoneTempPredictorCorrector ->tempSetptScheds [(int )HVAC::SetptType::SingleHeat](1 ).heatSched = heatSetptSched;
13541438 heatSetptSched->currentVal = 22.0 ;
0 commit comments