Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Unused Var6 from PerformanceCurveObject #8798

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/EnergyPlus/CurveManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ namespace CurveManager {
// Return value
Real64 CurveValue(0.0);

// need to be careful on where and how resetting curve outputs to some "iactive value" is done
// need to be careful on where and how resetting curve outputs to some "inactive value" is done
// EMS can intercept curves and modify output
if (state.dataGlobal->BeginEnvrnFlag && state.dataCurveManager->CurveValueMyBeginTimeStepFlag) {
ResetPerformanceCurveOutput(state);
Expand All @@ -195,15 +195,17 @@ namespace CurveManager {
ShowFatalError(state, "CurveValue: Invalid curve passed.");
}

{
auto const SELECT_CASE_var(state.dataCurveManager->PerfCurve(CurveIndex).InterpolationType);
if (SELECT_CASE_var == InterpTypeEnum::EvaluateCurveToLimits) {
CurveValue = PerformanceCurveObject(state, CurveIndex, Var1, Var2, Var3, Var4, Var5, Var6);
} else if (SELECT_CASE_var == InterpTypeEnum::BtwxtMethod) {
CurveValue = BtwxtTableInterpolation(state, CurveIndex, Var1, Var2, Var3, Var4, Var5, Var6);
} else {
ShowFatalError(state, "CurveValue: Invalid Interpolation Type");
}
switch (state.dataCurveManager->PerfCurve(CurveIndex).InterpolationType) {
case InterpTypeEnum::EvaluateCurveToLimits: {
CurveValue = PerformanceCurveObject(state, CurveIndex, Var1, Var2, Var3, Var4, Var5);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Var6 was removed.

break;
}
case InterpTypeEnum::BtwxtMethod: {
CurveValue = BtwxtTableInterpolation(state, CurveIndex, Var1, Var2, Var3, Var4, Var5, Var6);
break;
}
default:
ShowFatalError(state, "CurveValue: Invalid Interpolation Type");
}
Comment on lines +198 to 209
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed this from an IF/ELSE to a switch block since we already have enums.


if (state.dataCurveManager->PerfCurve(CurveIndex).EMSOverrideOn)
Expand Down Expand Up @@ -1341,7 +1343,7 @@ namespace CurveManager {
}
}

// Loop over Fan Pressure Rise curves and load data - udated 15Sep2010 for unit types
// Loop over Fan Pressure Rise curves and load data
CurrentModuleObject = "Curve:FanPressureRise";
for (CurveIndex = 1; CurveIndex <= NumFanPressRise; ++CurveIndex) {
state.dataInputProcessing->inputProcessor->getObjectItem(state,
Expand Down Expand Up @@ -2549,13 +2551,12 @@ namespace CurveManager {
}

Real64 PerformanceCurveObject(EnergyPlusData &state,
int const CurveIndex, // index of curve in curve array
Real64 const Var1, // 1st independent variable
Optional<Real64 const> Var2, // 2nd independent variable
Optional<Real64 const> Var3, // 3rd independent variable
Optional<Real64 const> Var4, // 4th independent variable
Optional<Real64 const> Var5, // 5th independent variable
[[maybe_unused]] Optional<Real64 const> Var6 // 6th independent variable
int const CurveIndex, // index of curve in curve array
Real64 const Var1, // 1st independent variable
Optional<Real64 const> Var2, // 2nd independent variable
Optional<Real64 const> Var3, // 3rd independent variable
Optional<Real64 const> Var4, // 4th independent variable
Optional<Real64 const> Var5 // 5th independent variable
)
{

Expand Down Expand Up @@ -2591,7 +2592,6 @@ namespace CurveManager {
Real64 const V3(Var3.present() ? max(min(Var3, Curve.Var3Max), Curve.Var3Min) : 0.0); // 3rd independent variable after limits imposed
Real64 const V4(Var4.present() ? max(min(Var4, Curve.Var4Max), Curve.Var4Min) : 0.0); // 4th independent variable after limits imposed
Real64 const V5(Var5.present() ? max(min(Var5, Curve.Var5Max), Curve.Var5Min) : 0.0); // 5th independent variable after limits imposed
// Real64 const V6(Var6.present() ? max(min(Var6, Curve.Var6Max), Curve.Var6Min) : 0.0); // 6th independent variable after limits imposed

{
auto const SELECT_CASE_var(Curve.CurveType);
Expand Down
3 changes: 1 addition & 2 deletions src/EnergyPlus/CurveManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ namespace CurveManager {
Optional<Real64 const> Var2 = _, // 2nd independent variable
Optional<Real64 const> Var3 = _, // 3rd independent variable
Optional<Real64 const> Var4 = _, // 4th independent variable
Optional<Real64 const> Var5 = _, // 5th independent variable
Optional<Real64 const> Var6 = _ // 6th independent variable
Optional<Real64 const> Var5 = _ // 5th independent variable
);

Real64 BtwxtTableInterpolation(EnergyPlusData &state,
Expand Down