-
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 7 commits
5d4a70c
0a492a1
661672f
9ec0795
f5abbd3
c0a8e48
18488b9
5477058
e8ab095
344c911
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 |
|---|---|---|
|
|
@@ -521,11 +521,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; | ||
|
|
@@ -11803,7 +11799,6 @@ void CalcMultiSpeedDXCoil(EnergyPlusData &state, | |
| // get current total capacity, SHR, EIR | ||
| if (SpeedRatio >= 1.0) { | ||
| TotCap = TotCapHS; | ||
| SHR = SHRHS; | ||
|
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. Cppcheck is flagging |
||
| EIR = EIRHS; | ||
| CBFNom = CBFHS; | ||
| AirMassFlowNom = thisDXCoil.InletAirMassFlowRateMax; | ||
|
|
@@ -14258,7 +14253,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 | ||
|
|
||
| // 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 |
|---|---|---|
|
|
@@ -2778,8 +2778,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; | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -911,7 +911,7 @@ namespace VariableSpeedCoils { | |
|
|
||
| // Get Water System tank connections | ||
| // A8, \field Name of Water Storage Tank for Supply | ||
| cFieldName = "Supply Water Storage Tank Name"; // cAlphaFields(8) | ||
| // cFieldName = "Supply Water Storage Tank Name"; // cAlphaFields(8) | ||
|
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. I avoided re-declaring
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. Agreed. This is fine to leave like this for reference. |
||
| varSpeedCoil.EvapWaterSupplyName = s_ip->getAlphaFieldValue(fields, schemaProps, "supply_water_storage_tank_name"); | ||
| if (varSpeedCoil.EvapWaterSupplyName.empty()) { | ||
| varSpeedCoil.EvapWaterSupplyMode = WaterSupplyFromMains; | ||
|
|
@@ -927,7 +927,7 @@ namespace VariableSpeedCoils { | |
| } | ||
|
|
||
| // A9; \field Name of Water Storage Tank for Condensate Collection | ||
| cFieldName = "Condensate Collection Water Storage Tank Name"; // cAlphaFields(9) | ||
| // cFieldName = "Condensate Collection Water Storage Tank Name"; // cAlphaFields(9) | ||
| varSpeedCoil.CondensateCollectName = s_ip->getAlphaFieldValue(fields, schemaProps, "condensate_collection_water_storage_tank_name"); | ||
| if (varSpeedCoil.CondensateCollectName.empty()) { | ||
| varSpeedCoil.CondensateCollectMode = CondensateDiscarded; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8707,8 +8707,8 @@ namespace Weather { | |
| for (int i = 1; i <= 7; ++i) { | ||
| lineIn = statFile.readLine(); | ||
| } | ||
| lineIn = statFile.readLine(); | ||
| lineAvg = lineIn.data; | ||
| 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).