-
Notifications
You must be signed in to change notification settings - Fork 475
Fix cppcheck errors: final follow-up
#11584
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
2b6e7b0
1b6e669
a5a0485
9a2af19
f86defa
bb24caf
f062ca0
bb49211
5f4fe7b
b06afe3
492a893
72c2979
122a56c
7b4b020
a7cdb4e
162db20
59229e4
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 |
|---|---|---|
|
|
@@ -5041,12 +5041,12 @@ namespace AirflowNetwork { | |
| if (simulation_control.DuctLoss) { | ||
| // Assign node num based on Distribution node | ||
| for (int i = 1; i <= AirflowNetworkNumOfLinks; ++i) { | ||
| for (int k = 1; k <= DisSysNumOfNodes; ++k) { | ||
| if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[0], DisSysNodeData(k).Name)) { | ||
| AirflowNetworkLinkageData(i).NodeNums[0] = k; | ||
| for (int l = 1; l <= DisSysNumOfNodes; ++l) { | ||
| if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[0], DisSysNodeData(l).Name)) { | ||
|
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. This local |
||
| AirflowNetworkLinkageData(i).NodeNums[0] = l; | ||
| } | ||
| if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[1], DisSysNodeData(k).Name)) { | ||
| AirflowNetworkLinkageData(i).NodeNums[1] = k; | ||
| if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[1], DisSysNodeData(l).Name)) { | ||
| AirflowNetworkLinkageData(i).NodeNums[1] = l; | ||
| } | ||
| } | ||
| if (AirflowNetworkLinkageData(i).NodeNums[0] == 0) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -248,8 +248,8 @@ namespace BaseboardRadiator { | |
| static constexpr std::string_view availabilityScheduleFieldName = "Availability Schedule Name"; | ||
| static constexpr std::string_view heatingDesignCapacityMethodFieldName = "Heating Design Capacity Method"; | ||
|
|
||
| int ConvHWBaseboardNum = 0; | ||
| if (baseboardObjects != inputProcessor->epJSON.end()) { | ||
| int ConvHWBaseboardNum = 0; | ||
|
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.
|
||
| for (auto const &baseboardInstance : baseboardObjects.value().items()) { | ||
| auto const &baseboardFields = baseboardInstance.value(); | ||
| auto const baseboardName = Util::makeUPPER(baseboardInstance.key()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,8 +171,8 @@ namespace BoilerSteam { | |
| auto const &boilerSchemaProps = inputProcessor->getObjectSchemaProps(state, state.dataIPShortCut->cCurrentModuleObject); | ||
| auto const boilerObjects = inputProcessor->epJSON.find(state.dataIPShortCut->cCurrentModuleObject); | ||
|
|
||
| int BoilerNum = 1; | ||
| if (boilerObjects != inputProcessor->epJSON.end()) { | ||
| int BoilerNum = 1; | ||
|
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. Same issue as the |
||
| for (auto const &boilerInstance : boilerObjects.value().items()) { | ||
| auto const &boilerFields = boilerInstance.value(); | ||
| auto const boilerName = Util::makeUPPER(boilerInstance.key()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -212,8 +212,8 @@ namespace ElectricBaseboardRadiator { | |
| static constexpr std::string_view radiantSurfaceFractionFieldName = "Fraction of Radiant Energy to Surface"; | ||
| auto const &surfaceFractionSchemaProps = elecBaseboardSchemaProps.at("surface_fractions").at("items").at("properties"); | ||
|
|
||
| int BaseboardNum = 0; | ||
| if (elecBaseboardObjects != inputProcessor->epJSON.end()) { | ||
| int BaseboardNum = 0; | ||
|
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. Same as above. |
||
| for (auto const &elecBaseboardInstance : elecBaseboardObjects.value().items()) { | ||
| auto const &elecBaseboardFields = elecBaseboardInstance.value(); | ||
| auto const elecBaseboardName = Util::makeUPPER(elecBaseboardInstance.key()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -706,7 +706,6 @@ namespace Furnaces { | |
| if (errorFound) { | ||
| ShowSevereError(state, EnergyPlus::format("The index of \"{}\" is not found", thisFurnace.SuppHeatCoilName)); | ||
| ShowContinueError(state, EnergyPlus::format("...occurs for {}", thisFurnace.Name)); | ||
| errorFound = false; | ||
|
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 |
||
| } | ||
| state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = | ||
| max(refAFNLoopHeatingCoilMaxRTF, heatingCoilRTF, suppHeatingCoilRTF); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7326,7 +7326,7 @@ void SetCompFlowRate(EnergyPlusData &state, int const VRFTUNum, int const VRFCon | |
| int IndexToTUInTUList; // - index to TU in specific list for this VRF system | ||
| int TUListIndex; // index to TU list for this VRF system | ||
|
|
||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| IndexToTUInTUList = vrfTU.IndexToTUInTUList; | ||
| TUListIndex = vrfTU.TUListIndex; | ||
|
|
||
|
|
@@ -8272,18 +8272,18 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) | |
| auto &vrfTUList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum); | ||
| for (int NumTU = 1; NumTU <= vrfTUList.NumTUInList; ++NumTU) { | ||
| int TUIndex = vrfTUList.ZoneTUPtr(NumTU); | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
| if (vrfTU.CoolCoilIndex > 0) { | ||
| DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, vrfTU.CoolCoilIndex, vrfTU.coolCoilType, errFlag); | ||
| auto &vrfTUobj = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
|
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 (vrfTUobj.CoolCoilIndex > 0) { | ||
| DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, vrfTUobj.CoolCoilIndex, vrfTUobj.coolCoilType, errFlag); | ||
| TUCoolingCapacity += DXCoilCap; | ||
| if (DXCoilCap == AutoSize) { | ||
| FoundAll = false; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| if (vrfTU.HeatCoilIndex > 0) { | ||
| DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, vrfTU.HeatCoilIndex, vrfTU.heatCoilType, errFlag); | ||
| if (vrfTUobj.HeatCoilIndex > 0) { | ||
| DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, vrfTUobj.HeatCoilIndex, vrfTUobj.heatCoilType, errFlag); | ||
| TUHeatingCapacity += DXCoilCap; | ||
| if (DXCoilCap == AutoSize) { | ||
| FoundAll = false; | ||
|
|
@@ -10455,7 +10455,7 @@ int GetVRFTUOutAirNode(EnergyPlusData &state, int const VRFTUNum) | |
| } | ||
|
|
||
| if (VRFTUNum > 0 && VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU) { | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| return vrfTU.VRFTUOAMixerOANodeNum; | ||
| } | ||
| return 0; | ||
|
|
@@ -10479,7 +10479,7 @@ int GetVRFTUZoneInletAirNode(EnergyPlusData &state, int const VRFTUNum) | |
| } | ||
|
|
||
| if (VRFTUNum > 0 && VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU) { | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| return vrfTU.VRFTUOutletNodeNum; | ||
| } | ||
| return 0; | ||
|
|
@@ -10547,7 +10547,7 @@ int GetVRFTUMixedAirNode(EnergyPlusData &state, int const VRFTUNum) | |
| } | ||
|
|
||
| if (VRFTUNum > 0 && VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU) { | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| return vrfTU.VRFTUOAMixerOANodeNum; | ||
| } | ||
| return 0; | ||
|
|
@@ -10571,7 +10571,7 @@ int GetVRFTUReturnAirNode(EnergyPlusData &state, int const VRFTUNum) | |
| } | ||
|
|
||
| if (VRFTUNum > 0 && VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU) { | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| return vrfTU.VRFTUOAMixerRetNodeNum; | ||
| } | ||
| return 0; | ||
|
|
@@ -14936,7 +14936,7 @@ void VRFCondenserEquipment::VRFOU_PipeLossC( | |
| NumIUActivated = 0; | ||
| for (int NumTU = 1; NumTU <= NumTUInList; ++NumTU) { | ||
| int TUIndex = vrfTUList.ZoneTUPtr(NumTU); | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
| int CoilIndex = vrfTU.CoolCoilIndex; | ||
|
|
||
| if (state.dataDXCoils->DXCoil(CoilIndex).TotalCoolingEnergyRate > 0.0) { | ||
|
|
@@ -15096,7 +15096,7 @@ void VRFCondenserEquipment::VRFOU_PipeLossH( | |
| NumIUActivated = 0; | ||
| for (int NumTU = 1; NumTU <= NumTUInList; ++NumTU) { | ||
| int TUIndex = vrfTUList.ZoneTUPtr(NumTU); | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
| int CoilIndex = vrfTU.HeatCoilIndex; | ||
|
|
||
| if (state.dataDXCoils->DXCoil(CoilIndex).TotalHeatingEnergyRate > 0.0) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5310,10 +5310,8 @@ void UpdateThermalHistories(EnergyPlusData &state) | |
| SurfOutsideTempCurr * construct.CTFTUserOut[0] + state.dataHeatBalSurf->SurfTempIn(SurfNum) * construct.CTFTUserIn[0] + | ||
| state.dataHeatBalSurf->SurfQsrcHist(SurfNum, 1) * construct.CTFTUserSource[0] + | ||
| state.dataHeatBalFanSys->CTFTuserConstPart(SurfNum); | ||
| } | ||
|
|
||
| // Set current outside flux: | ||
| if (construct.SourceSinkPresent) { | ||
| // Set current outside flux: | ||
|
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 second and third |
||
| state.dataHeatBalSurf->SurfOutsideFluxHist(1)(SurfNum) = | ||
| SurfOutsideTempCurr * construct.CTFOutside[0] - state.dataHeatBalSurf->SurfTempIn(SurfNum) * construct.CTFCross[0] + | ||
| state.dataHeatBalSurf->SurfQsrcHist(SurfNum, 1) * construct.CTFSourceOut[0] + | ||
|
|
@@ -9936,7 +9934,7 @@ void InitSurfacePropertyViewFactors(EnergyPlusData &state) | |
| } | ||
| if (Surface.IsSurfPropertyGndSurfacesDefined) { | ||
| GndSurfsNum = Surface.SurfPropertyGndSurfIndex; | ||
| auto &GrndSurfsProperty = state.dataSurface->GroundSurfsProperty(GndSurfsNum); | ||
| auto const &GrndSurfsProperty = state.dataSurface->GroundSurfsProperty(GndSurfsNum); | ||
| GroundSurfsViewFactor = GrndSurfsProperty.SurfsViewFactorSum; | ||
| IsGroundViewFactorSet = GrndSurfsProperty.IsGroundViewFactorSet; | ||
| SrdSurfsViewFactor += GroundSurfsViewFactor; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15204,7 +15204,6 @@ void SecondaryLoopData::CalculateSecondary(EnergyPlusData &state, int const Seco | |
| Real64 constexpr ErrorTol(0.001); // Iterative solution tolerance | ||
|
|
||
| bool AtPartLoad; // Whether or not need to iterate on pump power | ||
| bool DeRate; // If true, need to derate aircoils because don't carry over unmet energy | ||
| Real64 CpBrine; // Specific heat (W/kg) | ||
| Real64 DensityBrine; // Density (kg/m3) | ||
| Real64 DiffTemp; // (C) | ||
|
|
@@ -15424,10 +15423,7 @@ void SecondaryLoopData::CalculateSecondary(EnergyPlusData &state, int const Seco | |
| } //>my large number | ||
|
|
||
| } else { // air coils on secondary loop, no "unmet" energy accounting, just reduce amount of cooling provided to zone by coils | ||
| DeRate = false; | ||
| if (TotalLoad > this->MaxLoad) { | ||
| DeRate = true; | ||
| } | ||
| bool DeRate = (TotalLoad > this->MaxLoad); // If true, need to derate aircoils because don't carry over unmet energy | ||
|
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.
|
||
| FinalRateCoils( | ||
| state, DeRate, SourceType::SecondarySystem, SecondaryNum, TotalLoad, this->MaxLoad); // assign case credits for coils on this loop | ||
| // Bug TotalCoolingLoad not set but used below | ||
|
|
||
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.
In the
non-OpenMPpath,number_of_threads = 1is assigned inside the if block but never read afterward. Removed the dead assignment.