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

CppCheck FluidProperties through HVACUnitaryBypassVAV #10668

Merged
merged 3 commits into from
Aug 20, 2024
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
58 changes: 29 additions & 29 deletions src/EnergyPlus/FluidProperties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ namespace FluidProperties {
continue;
}

auto &supTempArray = FluidTemps(supTempArrayNum);
auto const &supTempArray = FluidTemps(supTempArrayNum);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/FluidProperties.cc:1038]:(style),[constVariable],Variable 'supTempArray' can be declared as reference to const

refrig->NumSupTempPoints = supTempArray.NumOfTemps;
refrig->SupTemps.allocate(refrig->NumSupTempPoints);
refrig->SupTemps = supTempArray.Temps;
Expand Down Expand Up @@ -1441,7 +1441,7 @@ namespace FluidProperties {

if (!glycolRaw->CpTempArrayName.empty()) {
int cpTempArrayNum = Util::FindItemInList(glycolRaw->CpTempArrayName, FluidTemps);
auto &cpTempArray = FluidTemps(cpTempArrayNum);
auto const &cpTempArray = FluidTemps(cpTempArrayNum);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/FluidProperties.cc:1444]:(style),[constVariable],Variable 'cpTempArray' can be declared as reference to const

glycolRaw->NumCpTempPoints = cpTempArray.NumOfTemps;
glycolRaw->CpTemps.allocate(glycolRaw->NumCpTempPoints);
glycolRaw->CpTemps = cpTempArray.Temps;
Expand All @@ -1452,7 +1452,7 @@ namespace FluidProperties {

if (!glycolRaw->RhoTempArrayName.empty()) {
int rhoTempArrayNum = Util::FindItemInList(glycolRaw->RhoTempArrayName, FluidTemps);
auto &rhoTempArray = FluidTemps(rhoTempArrayNum);
auto const &rhoTempArray = FluidTemps(rhoTempArrayNum);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/FluidProperties.cc:1455]:(style),[constVariable],Variable 'rhoTempArray' can be declared as reference to const

glycolRaw->NumRhoTempPoints = rhoTempArray.NumOfTemps;
glycolRaw->RhoTemps.allocate(glycolRaw->NumRhoTempPoints);
glycolRaw->RhoTemps = rhoTempArray.Temps;
Expand All @@ -1463,7 +1463,7 @@ namespace FluidProperties {

if (!glycolRaw->CondTempArrayName.empty()) {
int condTempArrayNum = Util::FindItemInList(glycolRaw->CondTempArrayName, FluidTemps);
auto &condTempArray = FluidTemps(condTempArrayNum);
auto const &condTempArray = FluidTemps(condTempArrayNum);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/FluidProperties.cc:1466]:(style),[constVariable],Variable 'condTempArray' can be declared as reference to const

glycolRaw->NumCondTempPoints = condTempArray.NumOfTemps;
glycolRaw->CondTemps.allocate(glycolRaw->NumCondTempPoints);
glycolRaw->CondTemps = condTempArray.Temps;
Expand All @@ -1474,7 +1474,7 @@ namespace FluidProperties {

if (!glycolRaw->ViscTempArrayName.empty()) {
int viscTempArrayNum = Util::FindItemInList(glycolRaw->ViscTempArrayName, FluidTemps);
auto &viscTempArray = FluidTemps(viscTempArrayNum);
auto const &viscTempArray = FluidTemps(viscTempArrayNum);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/FluidProperties.cc:1477]:(style),[constVariable],Variable 'viscTempArray' can be declared as reference to const

glycolRaw->NumViscTempPoints = viscTempArray.NumOfTemps;
glycolRaw->ViscTemps.allocate(glycolRaw->NumViscTempPoints);
glycolRaw->ViscTemps = viscTempArray.Temps;
Expand Down Expand Up @@ -1936,7 +1936,7 @@ namespace FluidProperties {
// Most properties requested (e.g., Specific Heat) must be > 0 but the tables may
// be set up for symmetry and not be limited to just valid values.

auto &df = state.dataFluidProps;
auto const &df = state.dataFluidProps;

for (auto *glycol : df->glycols) {
if (glycol->CpDataPresent) {
Expand Down Expand Up @@ -2039,7 +2039,7 @@ namespace FluidProperties {
// for the refrigerant properties.
// Most properties requested (e.g., Specific Heat) must be > 0 but the tables may
// be set up for symmetry and not be limited to just valid values.
auto &df = state.dataFluidProps;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought we were not supposed to reference a class? Maybe this is different. I can easily put these back.

Copy link
Collaborator

@amirroth amirroth Aug 20, 2024

Choose a reason for hiding this comment

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

A class/struct is about the only thing you should reference, what you shouldn't reference is scalars and arrays.

auto const &df = state.dataFluidProps;

for (auto *refrig : df->refrigs) {
for (int IndexNum = 1; IndexNum <= refrig->NumPsPoints; ++IndexNum) {
Expand Down Expand Up @@ -2181,7 +2181,7 @@ namespace FluidProperties {
Real64 Temperature; // Temperature to drive values
Real64 ReturnValue; // Values returned from glycol functions

auto &df = state.dataFluidProps;
auto const &df = state.dataFluidProps;

for (auto *glycol : df->glycols) {

Expand Down Expand Up @@ -2423,7 +2423,7 @@ namespace FluidProperties {
Real64 Temperature; // Temperature to drive values
Real64 ReturnValue; // Values returned from refrigerant functions

auto &df = state.dataFluidProps;
auto const &df = state.dataFluidProps;

for (auto *refrig : df->refrigs) {
// Lay out the basic values:
Expand Down Expand Up @@ -2759,8 +2759,6 @@ namespace FluidProperties {

int LoTempIndex = FindArrayIndex(Temperature, this->PsTemps, this->PsLowTempIndex, this->PsHighTempIndex);

auto &df = state.dataFluidProps;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why undo this?

Copy link
Member

Choose a reason for hiding this comment

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

If I'm seeing it right, it looks like this variable just got moved into a smaller scope, not undoing the reference usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The references are staying in place (I put them all back in) and only moving if there was a CppCheck reduce scope suggestion. I do want to see CI results though because the Mac results are troubling.

Copy link
Member

Choose a reason for hiding this comment

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

Just to be clear, Mac results are not reliable right now. There is something very odd going on that I'm trying to investigate. Gort and Tik-Tok are doing fine though.


// check for out of data bounds problems
if (LoTempIndex == 0) {
ReturnValue = this->PsValues(this->PsLowTempIndex);
Expand All @@ -2778,6 +2776,8 @@ namespace FluidProperties {

if (!state.dataGlobal->WarmupFlag && ErrorFlag) {
++this->errors[(int)RefrigError::SatTemp].count;
auto &df = state.dataFluidProps;

// send warning
if (this->errors[(int)RefrigError::SatTemp].count <= df->RefrigErrorLimitTest) {
ShowSevereMessage(
Expand Down Expand Up @@ -2851,8 +2851,6 @@ namespace FluidProperties {
// FUNCTION LOCAL VARIABLE DECLARATIONS:
bool ErrorFlag = false; // error flag for current call

auto &df = state.dataFluidProps;

// get the array indices
int LoPresIndex = FindArrayIndex(Pressure, this->PsValues, this->PsLowPresIndex, this->PsHighPresIndex);

Expand All @@ -2873,6 +2871,8 @@ namespace FluidProperties {

if (!state.dataGlobal->WarmupFlag && ErrorFlag) {
++this->errors[(int)RefrigError::SatPress].count;
auto &df = state.dataFluidProps;

// send warning
if (this->errors[(int)RefrigError::SatPress].count <= df->RefrigErrorLimitTest) {
ShowSevereMessage(state,
Expand Down Expand Up @@ -2995,8 +2995,6 @@ namespace FluidProperties {
// FUNCTION PARAMETER DEFINITIONS:
static constexpr std::string_view routineName = "RefrigProps::getSatDensity";

auto &df = state.dataFluidProps;

if ((Quality < 0.0) || (Quality > 1.0)) {
ShowSevereError(state, fmt::format("{}Refrigerant \"{}\", invalid quality, called from {}", routineName, this->Name, CalledFrom));
ShowContinueError(state, format("Saturated density quality must be between 0 and 1, entered value=[{:.4R}].", Quality));
Expand Down Expand Up @@ -3045,6 +3043,8 @@ namespace FluidProperties {

if (!state.dataGlobal->WarmupFlag && ErrorFlag) {
++this->errors[(int)RefrigError::SatTempDensity].count;
auto &df = state.dataFluidProps;

// send warning
if (this->errors[(int)RefrigError::SatTempDensity].count <= df->RefrigErrorLimitTest) {
ShowSevereMessage(
Expand Down Expand Up @@ -3403,8 +3403,6 @@ namespace FluidProperties {
// the enthalpy calculated from the pressure found
static constexpr std::string_view routineName = "RefrigProps::getSupHeatPressure";

auto &df = state.dataFluidProps;

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Real64 EnthalpyCheck; // recalculates enthalpy based on calculated pressure
Real64 EnthalpyHigh; // Enthalpy value at interpolated pressure and high temperature
Expand Down Expand Up @@ -3542,6 +3540,8 @@ namespace FluidProperties {
}

if (ErrCount > 0 && !state.dataGlobal->WarmupFlag) {
auto &df = state.dataFluidProps;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/FluidProperties.cc:3406]:(style),[variableScope],The scope of the variable 'df' can be reduced.


// send near saturation warning if flagged
this->errors[(int)RefrigError::SatSupPress].count += CurSatErrCount;
// send warning
Expand Down Expand Up @@ -4593,7 +4593,7 @@ namespace FluidProperties {

int GetGlycolRawNum(EnergyPlusData &state, std::string_view const glycolRawName) // carries in substance name
{
auto &df = state.dataFluidProps;
auto const &df = state.dataFluidProps;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/FluidProperties.cc:4596]:(style),[constVariable],Variable 'df' can be declared as reference to const


auto found = std::find_if(df->glycolsRaw.begin(), df->glycolsRaw.end(), [glycolRawName](GlycolRawProps const *glycolRaw) {
return glycolRaw->Name == glycolRawName;
Expand Down Expand Up @@ -4779,8 +4779,6 @@ namespace FluidProperties {
// Return value
Real64 ReturnValue;

auto &df = state.dataFluidProps;

// error counters and dummy string
bool ErrorFlag(false); // error flag for current call

Expand Down Expand Up @@ -4811,6 +4809,8 @@ namespace FluidProperties {
}

if (ErrorFlag && (CalledFrom != "ReportAndTestRefrigerants")) {
auto &df = state.dataFluidProps;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/FluidProperties.cc:4782]:(style),[variableScope],The scope of the variable 'df' can be reduced.


++df->TempRangeErrCountGetInterpolatedSatProp;
// send warning
if (df->TempRangeErrCountGetInterpolatedSatProp <= df->RefrigErrorLimitTest) {
Expand All @@ -4832,7 +4832,7 @@ namespace FluidProperties {

//*****************************************************************************

bool CheckFluidPropertyName(EnergyPlusData &state,
bool CheckFluidPropertyName(EnergyPlusData const &state,
std::string const &name) // Name from input(?) to be checked against valid FluidPropertyNames
{

Expand All @@ -4842,7 +4842,7 @@ namespace FluidProperties {

// PURPOSE OF THIS FUNCTION:
// This function checks on an input fluid property to make sure it is valid.
auto &df = state.dataFluidProps;
auto const &df = state.dataFluidProps;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/FluidProperties.cc:4845]:(style),[constVariable],Variable 'df' can be declared as reference to const


auto foundRefrig = std::find_if(df->refrigs.begin(), df->refrigs.end(), [name](RefrigProps const *refrig) { return refrig->Name == name; });
if (foundRefrig != df->refrigs.end()) return true;
Expand All @@ -4867,7 +4867,7 @@ namespace FluidProperties {
bool NeedOrphanMessage = true;
int NumUnusedRefrig = 0;

auto &df = state.dataFluidProps;
auto const &df = state.dataFluidProps;

for (auto const *refrig : df->refrigs) {
if (refrig->used) continue;
Expand Down Expand Up @@ -4913,18 +4913,18 @@ namespace FluidProperties {
void GetFluidDensityTemperatureLimits(EnergyPlusData &state, int const FluidIndex, Real64 &MinTempLimit, Real64 &MaxTempLimit)
{
if (FluidIndex > 0) {
auto &df = state.dataFluidProps;
MinTempLimit = df->glycols(FluidIndex)->RhoLowTempValue;
MaxTempLimit = df->glycols(FluidIndex)->RhoHighTempValue;
auto const &df = state.dataFluidProps->glycols(FluidIndex);
MinTempLimit = df->RhoLowTempValue;
MaxTempLimit = df->RhoHighTempValue;
}
}

void GetFluidSpecificHeatTemperatureLimits(EnergyPlusData &state, int const FluidIndex, Real64 &MinTempLimit, Real64 &MaxTempLimit)
{
if (FluidIndex > 0) {
auto &df = state.dataFluidProps;
MinTempLimit = df->glycols(FluidIndex)->CpLowTempValue;
MaxTempLimit = df->glycols(FluidIndex)->CpHighTempValue;
auto const &df = state.dataFluidProps->glycols(FluidIndex);
MinTempLimit = df->CpLowTempValue;
MaxTempLimit = df->CpHighTempValue;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/FluidProperties.hh
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ namespace FluidProperties {
int UpperBound // Valid values upper bound (set by calling program)
);

bool CheckFluidPropertyName(EnergyPlusData &state,
bool CheckFluidPropertyName(EnergyPlusData const &state,
std::string const &NameToCheck); // Name from input(?) to be checked against valid FluidPropertyNames

void ReportOrphanFluids(EnergyPlusData &state);
Expand Down
8 changes: 1 addition & 7 deletions src/EnergyPlus/Furnaces.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2768,8 +2768,6 @@ namespace Furnaces {
// Get fan data
FanName = Alphas(7);

errFlag = false;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/Furnaces.cc:2793]:(style),[redundantAssignment],Variable 'errFlag' is reassigned a value before the old one has been used.

thisFurnace.fanType = static_cast<HVAC::FanType>(getEnumValue(HVAC::fanTypeNamesUC, Alphas(6)));

if (thisFurnace.fanType == HVAC::FanType::OnOff || thisFurnace.fanType == HVAC::FanType::Constant) {
Expand Down Expand Up @@ -4739,11 +4737,7 @@ namespace Furnaces {

if (!state.dataGlobal->DoingSizing && state.dataFurnaces->MySecondOneTimeFlag(FurnaceNum)) {
// sizing all done. check fan air flow rates
errFlag = false;
thisFurnace.ActualFanVolFlowRate = state.dataFans->fans(thisFurnace.FanIndex)->maxAirFlowRate;
if (errFlag) {
ShowContinueError(state, format("...occurs in {} ={}", HVAC::unitarySysTypeNames[(int)thisFurnace.type], thisFurnace.Name));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/Furnaces.cc:4744]:(style),[knownConditionTrueFalse],Condition 'errFlag' is always false

if (thisFurnace.ActualFanVolFlowRate != DataSizing::AutoSize) {
if (thisFurnace.DesignFanVolFlowRate > thisFurnace.ActualFanVolFlowRate) {
ShowWarningError(state,
Expand Down Expand Up @@ -5001,11 +4995,11 @@ namespace Furnaces {
thisFurnace.CoolingSpeedRatio = thisFurnace.MaxCoolAirVolFlow / thisFurnace.ActualFanVolFlowRate;
thisFurnace.NoHeatCoolSpeedRatio = thisFurnace.MaxNoCoolHeatAirVolFlow / thisFurnace.ActualFanVolFlowRate;
}
std::string FanName; // used in warning messages
if (dynamic_cast<Fans::FanComponent *>(state.dataFans->fans(thisFurnace.FanIndex))->powerRatioAtSpeedRatioCurveNum > 0) {
if (thisFurnace.ActualFanVolFlowRate == thisFurnace.MaxHeatAirVolFlow &&
thisFurnace.ActualFanVolFlowRate == thisFurnace.MaxCoolAirVolFlow &&
thisFurnace.ActualFanVolFlowRate == thisFurnace.MaxNoCoolHeatAirVolFlow) {
std::string FanName = state.dataFans->fans(thisFurnace.FanIndex)->Name;
ShowWarningError(state, format("{} \"{}\"", HVAC::unitarySysTypeNames[(int)thisFurnace.type], thisFurnace.Name));
ShowContinueError(state,
format("...For fan type and name = {} \"{}\"", HVAC::fanTypeNames[(int)thisFurnace.fanType], FanName));
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HVACInterfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void UpdateHVACInterface(EnergyPlusData &state,
Real64 totDemandSideMaxAvail = 0.0;
for (int demIn = 1; demIn <= state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumSupplyNodes; ++demIn) {
int demInNode = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).ZoneEquipSupplyNodeNum(demIn);
auto &node = state.dataLoopNodes->Node(demInNode);
auto const &node = state.dataLoopNodes->Node(demInNode);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/HVACInterfaceManager.cc:126]:(style),[constVariable],Variable 'node' can be declared as reference to const

totDemandSideMassFlow += node.MassFlowRate;
totDemandSideMinAvail += node.MassFlowRateMinAvail;
totDemandSideMaxAvail += node.MassFlowRateMaxAvail;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HVACManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ void ResolveLockoutFlags(EnergyPlusData &state, bool &SimAir) // TRUE means air
}
}

void ResetHVACControl(EnergyPlusData &state)
void ResetHVACControl(EnergyPlusData const &state)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/HVACManager.cc:2054]:(style),[constParameter],Parameter 'state' can be declared as reference to const

{

// SUBROUTINE INFORMATION:
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HVACManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace HVACManager {

void ResolveLockoutFlags(EnergyPlusData &state, bool &SimAir); // TRUE means air loops must be (re)simulated

void ResetHVACControl(EnergyPlusData &state);
void ResetHVACControl(EnergyPlusData const &state);

void ResetNodeData(EnergyPlusData &state);

Expand Down
4 changes: 0 additions & 4 deletions src/EnergyPlus/HVACStandAloneERV.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,6 @@ void GetStandAloneERV(EnergyPlusData &state)
GlobalNames::IntraObjUniquenessCheck(
state, Alphas(4), CurrentModuleObject, cAlphaFields(4), state.dataHVACStandAloneERV->SupplyAirFanUniqueNames, ErrorsFound);

errFlag = false;

if ((standAloneERV.SupplyAirFanIndex = Fans::GetFanIndex(state, standAloneERV.SupplyAirFanName)) == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(4), standAloneERV.SupplyAirFanName);
ErrorsFound = true;
Expand All @@ -297,7 +295,6 @@ void GetStandAloneERV(EnergyPlusData &state)
standAloneERV.ExhaustAirFanName = Alphas(5);
GlobalNames::IntraObjUniquenessCheck(
state, Alphas(5), CurrentModuleObject, cAlphaFields(5), state.dataHVACStandAloneERV->ExhaustAirFanUniqueNames, ErrorsFound);
errFlag = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/HVACStandAloneERV.cc:300]:(style),[redundantAssignment],Variable 'errFlag' is reassigned a value before the old one has been used.


if ((standAloneERV.ExhaustAirFanIndex = Fans::GetFanIndex(state, standAloneERV.ExhaustAirFanName)) == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(5), standAloneERV.ExhaustAirFanName);
Expand Down Expand Up @@ -1695,7 +1692,6 @@ int getEqIndex(EnergyPlusData &state, std::string_view CompName)
for (int StandAloneERVNum = 1; StandAloneERVNum <= state.dataHVACStandAloneERV->NumStandAloneERVs; StandAloneERVNum++) {
if (Util::SameString(CompName, state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).Name)) {
return StandAloneERVNum;
break;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/HVACStandAloneERV.cc:1698]:(style),[duplicateBreak],Consecutive return, break, continue, goto or throw statements are unnecessary.

}
}
return 0;
Expand Down
5 changes: 2 additions & 3 deletions src/EnergyPlus/HVACUnitaryBypassVAV.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ namespace HVACUnitaryBypassVAV {
bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
bool DXErrorsFound(false); // Set to true if errors in get coil input
Array1D_int OANodeNums(4); // Node numbers of OA mixer (OA, EA, RA, MA)
std::string HXDXCoolCoilName; // Name of DX cooling coil used with Heat Exchanger Assisted Cooling Coil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/HVACUnitaryBypassVAV.cc:333]:(style),[unusedVariable],Unused variable: HXDXCoolCoilName

bool DXCoilErrFlag; // used in warning messages

Array1D_string Alphas(20, "");
Expand Down Expand Up @@ -754,7 +753,7 @@ namespace HVACUnitaryBypassVAV {
ShowContinueError(state, format("...occurs in {} \"{}\"", thisCBVAV.UnitType, thisCBVAV.Name));
ErrorsFound = true;
} else {
auto &newCoil = state.dataCoilCooingDX->coilCoolingDXs[thisCBVAV.DXCoolCoilIndexNum];
auto const &newCoil = state.dataCoilCooingDX->coilCoolingDXs[thisCBVAV.DXCoolCoilIndexNum];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/HVACUnitaryBypassVAV.cc:757]:(style),[constVariable],Variable 'newCoil' can be declared as reference to const

thisCBVAV.DXCoilInletNode = newCoil.evapInletNodeIndex;
thisCBVAV.DXCoilOutletNode = newCoil.evapOutletNodeIndex;
thisCBVAV.CondenserNodeNum = newCoil.condInletNodeIndex;
Expand Down Expand Up @@ -2444,7 +2443,7 @@ namespace HVACUnitaryBypassVAV {
}
// now find the speed ratio for the found speednum
auto f = [&state, CBVAVNum, SpeedNum, DesOutTemp](Real64 const SpeedRatio) {
auto &thisCBVAV = state.dataHVACUnitaryBypassVAV->CBVAV(CBVAVNum);
auto const &thisCBVAV = state.dataHVACUnitaryBypassVAV->CBVAV(CBVAVNum);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/HVACUnitaryBypassVAV.cc:2447]:(style),[constVariable],Variable 'thisCBVAV' can be declared as reference to const

// FUNCTION LOCAL VARIABLE DECLARATIONS:
Real64 OutletAirTemp; // outlet air temperature [C]
Real64 QZnReqCycling = 0.001;
Expand Down
Loading