Skip to content

Commit

Permalink
add curve validation
Browse files Browse the repository at this point in the history
  • Loading branch information
yujiex committed Apr 28, 2023
1 parent b9e2903 commit a334a7d
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ void CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec(EnergyPlus::Ener
if (!input_data.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name.empty()) {
this->crankcaseHeaterCapacityCurveIndex =
Curve::GetCurveIndex(state, input_data.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name);
// Verify Curve Object, only legal type is Quadratic and Cubic
errorsFound |= Curve::CheckCurveDims(state,
this->crankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
routineName, // Routine name
this->object_name, // Object Type
this->name, // Object Name
input_data.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name); // Field Name
}
if (errorsFound) {
ShowFatalError(
Expand Down
49 changes: 49 additions & 0 deletions src/EnergyPlus/DXCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,13 @@ void GetDXCoils(EnergyPlusData &state)
// A19; \field Crankcase Heater Capacity Function of Outdoor Temperature Curve Name
if (!lAlphaBlanks(19)) {
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(19));
ErrorsFound |= Curve::CheckCurveDims(state,
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
thisDXCoil.Name, // Object Name
cAlphaFields(19)); // Field Name
}

} // end of the Doe2 DX coil loop
Expand Down Expand Up @@ -1916,6 +1923,13 @@ void GetDXCoils(EnergyPlusData &state)
// A16; \field Crankcase Heater Capacity Function of Outdoor Temperature Curve Name
if (!lAlphaBlanks(16)) {
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(16));
ErrorsFound |= Curve::CheckCurveDims(state,
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
thisDXCoil.Name, // Object Name
cAlphaFields(16)); // Field Name
}

} // end of the Multimode DX coil loop
Expand Down Expand Up @@ -2371,6 +2385,13 @@ void GetDXCoils(EnergyPlusData &state)
// A17; \field Crankcase Heater Capacity Function of Outdoor Temperature Curve Name
if (!lAlphaBlanks(17)) {
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(17));
ErrorsFound |= Curve::CheckCurveDims(state,
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
thisDXCoil.Name, // Object Name
cAlphaFields(17)); // Field Name
}

} // end of the DX heating coil loop
Expand Down Expand Up @@ -3430,6 +3451,13 @@ void GetDXCoils(EnergyPlusData &state)

if (!lAlphaBlanks(17)) {
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(17));
ErrorsFound |= Curve::CheckCurveDims(state,
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
thisDXCoil.Name, // Object Name
cAlphaFields(17)); // Field Name
}

// assume compressor resides at the inlet to the DX Coil
Expand Down Expand Up @@ -3816,6 +3844,13 @@ void GetDXCoils(EnergyPlusData &state)
// Coil:WaterHeating:AirToWaterHeatPump:Wrapped
if (!lAlphaBlanks(11)) {
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(11));
ErrorsFound |= Curve::CheckCurveDims(state,
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
thisDXCoil.Name, // Object Name
cAlphaFields(11)); // Field Name
}

// assume compressor resides at the inlet to the DX Coil
Expand Down Expand Up @@ -4372,6 +4407,13 @@ void GetDXCoils(EnergyPlusData &state)
}
if (!lAlphaBlanks(38)) {
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(38));
ErrorsFound |= Curve::CheckCurveDims(state,
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
thisDXCoil.Name, // Object Name
cAlphaFields(38)); // Field Name
}
}

Expand Down Expand Up @@ -4871,6 +4913,13 @@ void GetDXCoils(EnergyPlusData &state)
}
if (!lAlphaBlanks(43)) {
thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(43));
ErrorsFound |= Curve::CheckCurveDims(state,
thisDXCoil.CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
thisDXCoil.Name, // Object Name
cAlphaFields(43)); // Field Name
}
}

Expand Down
24 changes: 24 additions & 0 deletions src/EnergyPlus/VariableSpeedCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,14 @@ namespace VariableSpeedCoils {
// A50; \field Crankcase Heater Capacity Function of Outdoor Temperature Curve Name
if (!lAlphaBlanks(50)) {
state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, AlphArray(50));
ErrorsFound |=
Curve::CheckCurveDims(state,
state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name
cAlphaFields(50)); // Field Name
}

// CurrentModuleObject = "Coil:Cooling:DX:VariableSpeed"
Expand Down Expand Up @@ -2410,6 +2418,14 @@ namespace VariableSpeedCoils {

if (!lAlphaBlanks(48)) {
state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, AlphArray(48));
ErrorsFound |=
Curve::CheckCurveDims(state,
state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name
cAlphaFields(48)); // Field Name
}

// CurrentModuleObject = "Coil:Heating:DX:Variablespeed "
Expand Down Expand Up @@ -3036,6 +3052,14 @@ namespace VariableSpeedCoils {

if (!lAlphaBlanks(71)) {
state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, AlphArray(71));
ErrorsFound |=
Curve::CheckCurveDims(state,
state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacityCurveIndex, // Curve index
{1}, // Valid dimensions
RoutineName, // Routine name
CurrentModuleObject, // Object Type
state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, // Object Name
cAlphaFields(71)); // Field Name
}

// CurrentModuleObject = "Coil:Waterheating:Airtowaterheatpump:Variablespeed"
Expand Down

2 comments on commit a334a7d

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crankcaseHeater (yujiex) - Win64-Windows-10-VisualStudio-16: OK (2634 of 2634 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crankcaseHeater (yujiex) - x86_64-MacOS-10.17-clang-13.0.0: OK (3408 of 3408 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.