-
Notifications
You must be signed in to change notification settings - Fork 466
Cpp check redundant assignment #11441
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
base: develop
Are you sure you want to change the base?
Changes from all commits
5d4a70c
0a492a1
661672f
9ec0795
f5abbd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -519,11 +519,7 @@ void SimDXCoilMultiMode(EnergyPlusData &state, | |
| PerfMode = (int)DehumidMode * 2 + 1; | ||
| CalcDoe2DXCoil(state, DXCoilNum, HVAC::CompressorOp::On, FirstHVACIteration, 1.0, fanOp, PerfMode); | ||
| S1SensCoolingEnergyRate = thisDXCoil.SensCoolingEnergyRate; | ||
| if (S1SensCoolingEnergyRate > 0.0) { | ||
| S1PLR = PartLoadRatio; | ||
| } else { | ||
| S1PLR = 0.0; | ||
| } | ||
|
|
||
| // Run stage 1+2 at full load | ||
| if (thisDXCoil.NumCapacityStages >= 2) { | ||
| PerfMode = (int)DehumidMode * 2 + 2; | ||
|
|
@@ -14072,7 +14068,7 @@ void CalcMultiSpeedDXCoilHeating(EnergyPlusData &state, | |
| thisDXCoil.CrankcaseHeaterPower = 0.0; | ||
|
|
||
| // Stage 1 | ||
| } else if (CycRatio > 0.0 || (CycRatio > 0.0 && SingleMode == 1)) { | ||
| } else if (CycRatio > 0.0 || (CycRatio > 0.0 && SingleMode == 1)) { // cppCheck Redundant Condition flag | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the intent was to include
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SingleMode (1 = Yes, 0 = No) does operate just like a cycling coil except that at speeds > 1 the cycling is between capacity at speed = x and off. There are other logic conditionals like this in code and I think testing would be required to know for sure but your suggestion of |
||
|
|
||
| // for cycling fan, reset mass flow to full on rate | ||
| if (fanOp == HVAC::FanOp::Cycling) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2766,8 +2766,8 @@ namespace ThermalComfort { | |
| for (i = 1; i <= 7; ++i) { | ||
| lineIn = statFile.readLine(); | ||
| } | ||
| lineIn = statFile.readLine(); | ||
| lineAvg = lineIn.data; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The last |
||
| auto lineAvgIn = statFile.readLine(); | ||
| lineAvg = lineAvgIn.data; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S1PLRgets set right after the stage-1 full-load calc, but that value is never used beforeS1PLRis recomputed in the “Determine run-time fractions” block, line 545 - 550 (develop). We can just drop the firstS1PLR = PartLoadRatio or 0.0assignment (no behavior change, since it was overwritten before use).