-
Notifications
You must be signed in to change notification settings - Fork 397
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
CppCheck HVAC VRF #10672
CppCheck HVAC VRF #10672
Conversation
if (OAUCoilOutTemp > 0.0) tmpFlag = true; | ||
if (ZoneEquipment) tmpFlag = true; | ||
} | ||
|
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:179]:(style),[unreadVariable],Variable 'tmpFlag' is assigned a value that is never used.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:180]:(style),[unreadVariable],Variable 'tmpFlag' is assigned a value that is never used.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:181]:(style),[unreadVariable],Variable 'tmpFlag' is assigned a value that is never used.
int NumTU; // loop counter | ||
int TUIndex; // Index to terminal unit | ||
int CoolCoilIndex; // index to cooling coil in terminal unit | ||
int HeatCoilIndex; // index to heating coil in terminal unit |
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:367]:(style),[variableScope],The scope of the variable 'TUIndex' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:368]:(style),[variableScope],The scope of the variable 'CoolCoilIndex' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:369]:(style),[variableScope],The scope of the variable 'HeatCoilIndex' can be reduced.
Real64 HRCAPFTConst; // stead-state capacity fraction | ||
Real64 HRInitialCapFrac; // Fractional cooling degradation at the start of heat recovery from cooling mode | ||
Real64 HRCapTC; // Time constant used to recover from initial degradation in cooling heat recovery | ||
int HREIRFT; // Index to cool EIR as a function of temperature curve for heat recovery |
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:386]:(style),[variableScope],The scope of the variable 'Stage' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:402]:(style),[variableScope],The scope of the variable 'HRCAPFT' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:406]:(style),[variableScope],The scope of the variable 'HREIRFT' can be reduced.
@@ -3271,8 +3258,6 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) | |||
for (int VRFTUNum = 1; VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU; ++VRFTUNum) { | |||
|
|||
// initialize local node number variables | |||
int FanInletNodeNum = 0; | |||
int FanOutletNodeNum = 0; |
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:3274]:(style),[variableScope],The scope of the variable 'FanInletNodeNum' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:3275]:(style),[variableScope],The scope of the variable 'FanOutletNodeNum' can be reduced.
Real64 TUCoolingCapacity; // total terminal unit cooling capacity | ||
Real64 TUHeatingCapacity; // total terminal unit heating capacity | ||
int VRFCond; // index to VRF condenser | ||
int TUListNum; // index to terminal unit list | ||
int TUIndex; // index to terminal unit | ||
int NumTU; // DO Loop index counter |
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:7513]:(style),[variableScope],The scope of the variable 'FoundAll' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:7514]:(style),[variableScope],The scope of the variable 'errFlag' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:7518]:(style),[variableScope],The scope of the variable 'TUListNum' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:7519]:(style),[variableScope],The scope of the variable 'TUIndex' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:7520]:(style),[variableScope],The scope of the variable 'NumTU' can be reduced.
P_discharge = this->refrig->getSatPressure(state, T_discharge, RoutineName); | ||
|
||
MinRefriPe = this->refrig->getSatPressure(state, -15, RoutineName); | ||
MinOutdoorUnitPe = max(P_discharge - this->CompMaxDeltaP, MinRefriPe); | ||
MinOutdoorUnitTe = this->refrig->getSatTemperature(state, max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), RoutineName); |
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:14040]:(style),[redundantAssignment],Variable 'MinOutdoorUnitTe' is reassigned a value before the old one has been used.
@@ -14865,8 +14813,6 @@ void VRFCondenserEquipment::VRFOU_PipeLossC( | |||
using General::SolveRoot; | |||
|
|||
int TUListNum; // index to TU List | |||
int TUIndex; // Index to terminal unit | |||
int CoilIndex; // index to coil in terminal unit |
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:14868]:(style),[variableScope],The scope of the variable 'TUIndex' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:14869]:(style),[variableScope],The scope of the variable 'CoilIndex' can be reduced.
@@ -14994,8 +14940,6 @@ void VRFCondenserEquipment::VRFOU_PipeLossH( | |||
using General::SolveRoot; | |||
|
|||
int TUListNum; // index to TU List | |||
int TUIndex; // Index to terminal unit | |||
int CoilIndex; // index to coil in terminal unit |
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:14997]:(style),[variableScope],The scope of the variable 'TUIndex' can be reduced.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:14998]:(style),[variableScope],The scope of the variable 'CoilIndex' can be reduced.
@@ -15120,7 +15064,6 @@ void VRFTerminalUnitEquipment::CalcVRFSuppHeatingCoil(EnergyPlusData &state, | |||
Real64 constexpr Acc(1.e-3); // Accuracy of solver result | |||
|
|||
// local variable declaration: | |||
int SolFla; // Flag of solver, num iterations if >0, else error index |
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:15123]:(style),[variableScope],The scope of the variable 'SolFla' can be reduced.
@@ -14655,7 +14604,6 @@ void VRFCondenserEquipment::VRFHR_OU_HR_Mode(EnergyPlusData &state, | |||
Real64 Ncomp_new; | |||
Real64 Q_c_tot_temp; | |||
Real64 Q_c_OU_temp; | |||
Real64 Tsuction_new; |
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.
[src/EnergyPlus/HVACVariableRefrigerantFlow.cc:14658]:(style),[shadowVariable],Local variable 'Tsuction_new' shadows outer variable
Completely happy here, no reason to wait on anything, merging this. Thanks for the continued cppcheck work @rraustad |
Pull request overview
NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.