Skip to content

Commit 9814fa5

Browse files
authored
Merge pull request #10963 from NREL/fixCrankcaseHeaterCurveNameErr
Add severe error when crankcase heater curve name is invalid
2 parents d2c044e + 321801b commit 9814fa5

3 files changed

Lines changed: 158 additions & 81 deletions

File tree

src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,25 @@ void CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec(EnergyPlus::Ener
124124
if (!input_data.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name.empty()) {
125125
this->crankcaseHeaterCapacityCurveIndex =
126126
Curve::GetCurveIndex(state, input_data.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name);
127-
// Verify Curve Object, only legal type is Quadratic and Cubic
128-
errorsFound |= Curve::CheckCurveDims(state,
129-
this->crankcaseHeaterCapacityCurveIndex, // Curve index
130-
{1}, // Valid dimensions
131-
routineName, // Routine name
132-
this->object_name, // Object Type
133-
this->name, // Object Name
134-
input_data.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name); // Field Name
127+
if (this->crankcaseHeaterCapacityCurveIndex == 0) { // can't find the curve
128+
ShowSevereError(state,
129+
format("{} = {}: {} not found = {}",
130+
this->object_name,
131+
this->name,
132+
"Crankcase Heater Capacity Function of Temperature Curve Name",
133+
input_data.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name));
134+
135+
errorsFound = true;
136+
} else {
137+
// Verify Curve Object, only legal type is Quadratic and Cubic
138+
errorsFound |= Curve::CheckCurveDims(state,
139+
this->crankcaseHeaterCapacityCurveIndex, // Curve index
140+
{1}, // Valid dimensions
141+
routineName, // Routine name
142+
this->object_name, // Object Type
143+
this->name, // Object Name
144+
input_data.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name); // Field Name
145+
}
135146
}
136147
if (errorsFound) {
137148
ShowFatalError(

src/EnergyPlus/DXCoils.cc

Lines changed: 84 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,13 +1238,18 @@ void GetDXCoils(EnergyPlusData &state)
12381238
// A12, \field Crankcase Heater Capacity Function of Outdoor Temperature Curve Name
12391239
if (!lAlphaBlanks(12)) {
12401240
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(12));
1241-
ErrorsFound |= Curve::CheckCurveDims(state,
1242-
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
1243-
{1}, // Valid dimensions
1244-
RoutineName, // Routine name
1245-
CurrentModuleObject, // Object Type
1246-
thisDXCoil.Name, // Object Name
1247-
cAlphaFields(12)); // Field Name
1241+
if (thisDXCoil.CrankcaseHeaterCapacityCurveIndex == 0) { // can't find the curve
1242+
ShowSevereError(state, format("{} = {}: {} not found = {}", CurrentModuleObject, thisDXCoil.Name, cAlphaFields(12), Alphas(12)));
1243+
ErrorsFound = true;
1244+
} else {
1245+
ErrorsFound |= Curve::CheckCurveDims(state,
1246+
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
1247+
{1}, // Valid dimensions
1248+
RoutineName, // Routine name
1249+
CurrentModuleObject, // Object Type
1250+
thisDXCoil.Name, // Object Name
1251+
cAlphaFields(12)); // Field Name
1252+
}
12481253
}
12491254

12501255
// Get Water System tank connections
@@ -1438,13 +1443,18 @@ void GetDXCoils(EnergyPlusData &state)
14381443
// A5; \field Crankcase Heater Capacity Function of Outdoor Temperature Curve Name
14391444
if (!lAlphaBlanks(5)) {
14401445
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(5));
1441-
ErrorsFound |= Curve::CheckCurveDims(state,
1442-
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
1443-
{1}, // Valid dimensions
1444-
RoutineName, // Routine name
1445-
CurrentModuleObject, // Object Type
1446-
thisDXCoil.Name, // Object Name
1447-
cAlphaFields(5)); // Field Name
1446+
if (thisDXCoil.CrankcaseHeaterCapacityCurveIndex == 0) { // can't find the curve
1447+
ShowSevereError(state, format("{} = {}: {} not found = {}", CurrentModuleObject, thisDXCoil.Name, cAlphaFields(5), Alphas(5)));
1448+
ErrorsFound = true;
1449+
} else {
1450+
ErrorsFound |= Curve::CheckCurveDims(state,
1451+
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
1452+
{1}, // Valid dimensions
1453+
RoutineName, // Routine name
1454+
CurrentModuleObject, // Object Type
1455+
thisDXCoil.Name, // Object Name
1456+
cAlphaFields(5)); // Field Name
1457+
}
14481458
}
14491459

14501460
// Set crankcase heater capacity
@@ -2188,13 +2198,18 @@ void GetDXCoils(EnergyPlusData &state)
21882198
// A11; \field Crankcase Heater Capacity Function of Outdoor Temperature Curve Name
21892199
if (!lAlphaBlanks(11)) {
21902200
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(11));
2191-
ErrorsFound |= Curve::CheckCurveDims(state,
2192-
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
2193-
{1}, // Valid dimensions
2194-
RoutineName, // Routine name
2195-
CurrentModuleObject, // Object Type
2196-
thisDXCoil.Name, // Object Name
2197-
cAlphaFields(11)); // Field Name
2201+
if (thisDXCoil.CrankcaseHeaterCapacityCurveIndex == 0) { // can't find the curve
2202+
ShowSevereError(state, format("{} = {}: {} not found = {}", CurrentModuleObject, thisDXCoil.Name, cAlphaFields(11), Alphas(11)));
2203+
ErrorsFound = true;
2204+
} else {
2205+
ErrorsFound |= Curve::CheckCurveDims(state,
2206+
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
2207+
{1}, // Valid dimensions
2208+
RoutineName, // Routine name
2209+
CurrentModuleObject, // Object Type
2210+
thisDXCoil.Name, // Object Name
2211+
cAlphaFields(11)); // Field Name
2212+
}
21982213
}
21992214

22002215
if (Util::SameString(Alphas(12), "ReverseCycle")) {
@@ -3179,13 +3194,18 @@ void GetDXCoils(EnergyPlusData &state)
31793194

31803195
if (!lAlphaBlanks(9)) {
31813196
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(9));
3182-
ErrorsFound |= Curve::CheckCurveDims(state,
3183-
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
3184-
{1}, // Valid dimensions
3185-
RoutineName, // Routine name
3186-
CurrentModuleObject, // Object Type
3187-
thisDXCoil.Name, // Object Name
3188-
cAlphaFields(9)); // Field Name
3197+
if (thisDXCoil.CrankcaseHeaterCapacityCurveIndex == 0) { // can't find the curve
3198+
ShowSevereError(state, format("{} = {}: {} not found = {}", CurrentModuleObject, thisDXCoil.Name, cAlphaFields(9), Alphas(9)));
3199+
ErrorsFound = true;
3200+
} else {
3201+
ErrorsFound |= Curve::CheckCurveDims(state,
3202+
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
3203+
{1}, // Valid dimensions
3204+
RoutineName, // Routine name
3205+
CurrentModuleObject, // Object Type
3206+
thisDXCoil.Name, // Object Name
3207+
cAlphaFields(9)); // Field Name
3208+
}
31893209
}
31903210

31913211
thisDXCoil.InletAirTemperatureType = static_cast<HVAC::OATType>(getEnumValue(HVAC::oatTypeNamesUC, Alphas(10)));
@@ -3618,13 +3638,18 @@ void GetDXCoils(EnergyPlusData &state)
36183638
// Coil:WaterHeating:AirToWaterHeatPump:Wrapped
36193639
if (!lAlphaBlanks(5)) {
36203640
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(5));
3621-
ErrorsFound |= Curve::CheckCurveDims(state,
3622-
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
3623-
{1}, // Valid dimensions
3624-
RoutineName, // Routine name
3625-
CurrentModuleObject, // Object Type
3626-
thisDXCoil.Name, // Object Name
3627-
cAlphaFields(5)); // Field Name
3641+
if (thisDXCoil.CrankcaseHeaterCapacityCurveIndex == 0) { // can't find the curve
3642+
ShowSevereError(state, format("{} = {}: {} not found = {}", CurrentModuleObject, thisDXCoil.Name, cAlphaFields(5), Alphas(5)));
3643+
ErrorsFound = true;
3644+
} else {
3645+
ErrorsFound |= Curve::CheckCurveDims(state,
3646+
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
3647+
{1}, // Valid dimensions
3648+
RoutineName, // Routine name
3649+
CurrentModuleObject, // Object Type
3650+
thisDXCoil.Name, // Object Name
3651+
cAlphaFields(5)); // Field Name
3652+
}
36283653
}
36293654

36303655
if (Util::SameString(Alphas(6), "DryBulbTemperature")) {
@@ -4036,13 +4061,18 @@ void GetDXCoils(EnergyPlusData &state)
40364061

40374062
if (!lAlphaBlanks(11)) {
40384063
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(11));
4039-
ErrorsFound |= Curve::CheckCurveDims(state,
4040-
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
4041-
{1}, // Valid dimensions
4042-
RoutineName, // Routine name
4043-
CurrentModuleObject, // Object Type
4044-
thisDXCoil.Name, // Object Name
4045-
cAlphaFields(11)); // Field Name
4064+
if (thisDXCoil.CrankcaseHeaterCapacityCurveIndex == 0) { // can't find the curve
4065+
ShowSevereError(state, format("{} = {}: {} not found = {}", CurrentModuleObject, thisDXCoil.Name, cAlphaFields(11), Alphas(11)));
4066+
ErrorsFound = true;
4067+
} else {
4068+
ErrorsFound |= Curve::CheckCurveDims(state,
4069+
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
4070+
{1}, // Valid dimensions
4071+
RoutineName, // Routine name
4072+
CurrentModuleObject, // Object Type
4073+
thisDXCoil.Name, // Object Name
4074+
cAlphaFields(11)); // Field Name
4075+
}
40464076
}
40474077

40484078
if (!lAlphaBlanks(12)) {
@@ -4475,13 +4505,18 @@ void GetDXCoils(EnergyPlusData &state)
44754505

44764506
if (!lAlphaBlanks(5)) {
44774507
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(5));
4478-
ErrorsFound |= Curve::CheckCurveDims(state,
4479-
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
4480-
{1}, // Valid dimensions
4481-
RoutineName, // Routine name
4482-
CurrentModuleObject, // Object Type
4483-
thisDXCoil.Name, // Object Name
4484-
cAlphaFields(5)); // Field Name
4508+
if (thisDXCoil.CrankcaseHeaterCapacityCurveIndex == 0) { // can't find the curve
4509+
ShowSevereError(state, format("{} = {}: {} not found = {}", CurrentModuleObject, thisDXCoil.Name, cAlphaFields(5), Alphas(5)));
4510+
ErrorsFound = true;
4511+
} else {
4512+
ErrorsFound |= Curve::CheckCurveDims(state,
4513+
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
4514+
{1}, // Valid dimensions
4515+
RoutineName, // Routine name
4516+
CurrentModuleObject, // Object Type
4517+
thisDXCoil.Name, // Object Name
4518+
cAlphaFields(5)); // Field Name
4519+
}
44854520
}
44864521

44874522
// Only required for reverse cycle heat pumps

0 commit comments

Comments
 (0)