Skip to content
9 changes: 2 additions & 7 deletions src/EnergyPlus/DXCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,7 @@ void SimDXCoilMultiMode(EnergyPlusData &state,
PerfMode = (int)DehumidMode * 2 + 1;
CalcDoe2DXCoil(state, DXCoilNum, HVAC::CompressorOp::On, FirstHVACIteration, 1.0, fanOp, PerfMode);
Copy link
Collaborator Author

@dareumnam dareumnam Feb 27, 2026

Choose a reason for hiding this comment

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

S1PLR gets set right after the stage-1 full-load calc, but that value is never used before S1PLR is recomputed in the “Determine run-time fractions” block, line 545 - 550 (develop). We can just drop the first S1PLR = PartLoadRatio or 0.0 assignment (no behavior change, since it was overwritten before use).

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;
Expand Down Expand Up @@ -11803,7 +11799,6 @@ void CalcMultiSpeedDXCoil(EnergyPlusData &state,
// get current total capacity, SHR, EIR
if (SpeedRatio >= 1.0) {
TotCap = TotCapHS;
SHR = SHRHS;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cppcheck is flagging SHR here because it gets assigned in the SpeedRatio >= 1.0 path, then reassigned again later in the UserSHRCurveExists block before the earlier value is actually used. This looks more like a redundant intermediate assignment than a functional issue.
In if (thisDXCoil.UserSHRCurveExists) - else block (line 11817 in this branch), SHR is assigned on all paths, so the warning is about this SHR assignment here being overwritten before use.

EIR = EIRHS;
CBFNom = CBFHS;
AirMassFlowNom = thisDXCoil.InletAirMassFlowRateMax;
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7833,7 +7833,6 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum)
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxCoolAirVolFlow = sizingCoolingAirFlow.size(state, TempSize, errorsFound);

} else if (SAFMethod == FlowPerCoolingCapacity) {
SizingMethod = CoolingCapacitySizing; // either this isn't needed or needs to be assigned to EqSizing
TempSize = AutoSize;
PrintFlag = false;
state.dataSize->DataScalableSizingON = true;
Expand Down Expand Up @@ -7934,7 +7933,6 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum)
sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
state.dataSize->DataAutosizedHeatingCapacity = sizerHeatingCapacity.size(state, TempSize, errorsFound);
state.dataSize->DataFlowPerHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow;
SizingMethod = HeatingAirflowSizing; // either this isn't needed or needs to be assigned to EqSizing
PrintFlag = true;
TempSize = AutoSize;
errorsFound = false;
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15179,7 +15179,6 @@ void GatherComponentLoadsHVAC(EnergyPlusData &state)
spCompLoadDayTSSpace.infilInstantSeq = space.fracZoneVolume * znCompLoadDayTSZone.infilInstantSeq;
spCompLoadDayTSSpace.infilLatentSeq = space.fracZoneVolume * znCompLoadDayTSZone.infilLatentSeq;
spCompLoadDayTSSpace.zoneVentInstantSeq = space.fracZoneVolume * znCompLoadDayTSZone.zoneVentInstantSeq;
spCompLoadDayTSSpace.zoneVentInstantSeq = space.fracZoneVolume * znCompLoadDayTSZone.zoneVentInstantSeq;
spCompLoadDayTSSpace.interZoneMixInstantSeq = space.fracZoneVolume * znCompLoadDayTSZone.interZoneMixInstantSeq;
spCompLoadDayTSSpace.interZoneMixLatentSeq = space.fracZoneVolume * znCompLoadDayTSZone.interZoneMixLatentSeq;
}
Expand Down
9 changes: 0 additions & 9 deletions src/EnergyPlus/PurchasedAirManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ void GetPurchasedAir(EnergyPlusData &state)
}
}

cAlphaFieldName = "System Inlet Air Node Name";
if (!systemInletAirNodeName.empty()) {
PurchAir.PlenumExhaustAirNodeNum = GetOnlySingleNode(state,
systemInletAirNodeName,
Expand All @@ -359,12 +358,10 @@ void GetPurchasedAir(EnergyPlusData &state)
PurchAir.MinCoolSuppAirTemp = s_ip->getRealFieldValue(fields, schemaProps, "minimum_cooling_supply_air_temperature");
PurchAir.MaxHeatSuppAirHumRat = s_ip->getRealFieldValue(fields, schemaProps, "maximum_heating_supply_air_humidity_ratio");
PurchAir.MinCoolSuppAirHumRat = s_ip->getRealFieldValue(fields, schemaProps, "minimum_cooling_supply_air_humidity_ratio");
cAlphaFieldName = "Heating Limit";
std::string fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "heating_limit");
PurchAir.HeatingLimit = static_cast<LimitType>(getEnumValue(limitTypeNamesUC, Util::makeUPPER(fieldValue)));
PurchAir.MaxHeatVolFlowRate = s_ip->getRealFieldValue(fields, schemaProps, "maximum_heating_air_flow_rate");
PurchAir.MaxHeatSensCap = s_ip->getRealFieldValue(fields, schemaProps, "maximum_sensible_heating_capacity");
cAlphaFieldName = "Cooling Limit";
fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "cooling_limit");
PurchAir.CoolingLimit = static_cast<LimitType>(getEnumValue(limitTypeNamesUC, Util::makeUPPER(fieldValue)));
PurchAir.MaxCoolVolFlowRate = s_ip->getRealFieldValue(fields, schemaProps, "maximum_cooling_air_flow_rate");
Expand All @@ -388,12 +385,10 @@ void GetPurchasedAir(EnergyPlusData &state)
ErrorsFound = true;
}
// get Dehumidification control type
cAlphaFieldName = "Dehumidification Control Type";
fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "dehumidification_control_type");
PurchAir.DehumidCtrlType = static_cast<HumControl>(getEnumValue(humControlNamesUC, Util::makeUPPER(fieldValue)));
PurchAir.CoolSHR = s_ip->getRealFieldValue(fields, schemaProps, "cooling_sensible_heat_ratio");
// get Humidification control type
cAlphaFieldName = "Humidification Control Type";
fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "humidification_control_type");
PurchAir.HumidCtrlType = static_cast<HumControl>(getEnumValue(humControlNamesUC, Util::makeUPPER(fieldValue)));
// get Design specification outdoor air object
Expand Down Expand Up @@ -467,11 +462,9 @@ void GetPurchasedAir(EnergyPlusData &state)
}
}
// get Outdoor air economizer type
cAlphaFieldName = "Outdoor Air Economizer Type";
fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "outdoor_air_economizer_type");
PurchAir.EconomizerType = static_cast<Econ>(getEnumValue(econNamesUC, Util::makeUPPER(fieldValue)));
// get Outdoor air heat recovery type and effectiveness
cAlphaFieldName = "Heat Recovery Type";
fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "heat_recovery_type");
PurchAir.HtRecType = static_cast<HeatRecovery>(getEnumValue(heatRecoveryNamesUC, Util::makeUPPER(fieldValue)));
} else { // No outdoorair
Expand Down Expand Up @@ -512,7 +505,6 @@ void GetPurchasedAir(EnergyPlusData &state)
ErrorsFound = true;
}
// get heating fuel type
cAlphaFieldName = "Heating Fuel Type";
fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "heating_fuel_type");
PurchAir.heatingFuelType = static_cast<Constant::eFuel>(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(fieldValue)));
// get optional cooling fuel efficiency schedule name
Expand All @@ -525,7 +517,6 @@ void GetPurchasedAir(EnergyPlusData &state)
ErrorsFound = true;
}
// get cooling fuel type
cAlphaFieldName = "Cooling Fuel Type";
fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "cooling_fuel_type");
PurchAir.coolingFuelType = static_cast<Constant::eFuel>(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(fieldValue)));
}
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/SteamBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,6 @@ namespace SteamBaseboardRadiator {
ZoneNum = state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ZonePtr;
QZnReq = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP;
SteamInletTemp = state.dataLoopNodes->Node(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamInletNode).Temp;
SteamOutletTemp = SteamInletTemp;
SteamMassFlowRate = state.dataLoopNodes->Node(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamInletNode).MassFlowRate;
SubcoolDeltaT = state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).DegOfSubcooling;

Expand Down
6 changes: 0 additions & 6 deletions src/EnergyPlus/SteamCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1241,9 +1241,6 @@ namespace SteamCoils {
// Setting to Maximum Coil Capacity
QCoilCap = QSteamCoilMaxHT;

// Temperature of air at outlet
TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnW(Win));

// In practice Sensible & Superheated heat transfer is negligible compared to latent part.
// This is required for outlet water temperature, otherwise it will be saturation temperature.
// Steam Trap drains off all the Water formed.
Expand Down Expand Up @@ -1274,9 +1271,6 @@ namespace SteamCoils {
state.dataSteamCoils->SteamCoil(CoilNum).InletSteamMassFlowRate = SteamMassFlowRate;

} else {
// Temp air out is temperature Setpoint
TempAirOut = TempSetPoint;

// In practice Sensible & Superheated heat transfer is negligible compared to latent part.
// This is required for outlet water temperature, otherwise it will be saturation temperature.
// Steam Trap drains off all the Water formed.
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/ThermalChimney.cc
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ namespace ThermalChimney {
if (std::abs(TempTCMassAirFlowRate(IterationLoop) - TempTCMassAirFlowRate(IterationLoop - 1)) < ThermChimTolerance) {
ThermChimTolerance = std::abs(TempTCMassAirFlowRate(IterationLoop) - TempTCMassAirFlowRate(IterationLoop - 1));
TCMassAirFlowRate = TempTCMassAirFlowRate(IterationLoop);
TCVolumeAirFlowRate = TempTCVolumeAirFlowRate(IterationLoop);
// TCVolumeAirFlowRate = TempTCVolumeAirFlowRate(IterationLoop);
}

} // IF (IterationLoop == 1) THEN
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/ThermalComfort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2778,8 +2778,8 @@ namespace ThermalComfort {
for (i = 1; i <= 7; ++i) {
lineIn = statFile.readLine();
}
lineIn = statFile.readLine();
lineAvg = lineIn.data;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The last lineIn = readLine() inside the 7-line skip loop is immediately overwritten by the next readLine() before it’s ever used. Easiest fix is to discard the skipped lines without assigning to lineIn, then read the actual avg line once into lineAvg.

auto lineAvgIn = statFile.readLine();
lineAvg = lineAvgIn.data;
break;
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/EnergyPlus/ThermalISO15099Calc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -740,12 +740,12 @@ void Calc_ISO15099(EnergyPlusData &state,
if (IsShadingLayer(LayerType(1))) {
--nlayer_NOSD;
FirstSpecularLayer = 2;
NeedUnshadedRun = true;
// NeedUnshadedRun = true;
}

if (IsShadingLayer(LayerType(nlayer))) {
--nlayer_NOSD;
NeedUnshadedRun = true;
// NeedUnshadedRun = true;
}

// no unshaded run for now
Expand Down Expand Up @@ -1703,7 +1703,6 @@ void therm1d(EnergyPlusData &state,
// it is important not to update gaps around shading layers since that is already calculated by
// shading routines
for (i = 1; i <= nlayer + 1; ++i) {
updateGapTemperature = true;
if ((i == 1) || (i == nlayer + 1)) {
// update gap array with interior and exterior temperature
updateGapTemperature = true;
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/VariableSpeedCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I avoided re-declaring cFieldName in inner scopes (like in the previous commit) since that caused a mac build issue. Instead, I commented out the two cFieldName assignments that were never used before being overwritten.

Copy link
Collaborator

Choose a reason for hiding this comment

The 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;
Expand All @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions src/EnergyPlus/WeatherManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8704,11 +8704,10 @@ namespace Weather {
while (statFile.good()) {
auto lineIn = statFile.readLine();
if (has(lineIn.data, "Monthly Statistics for Dry Bulb temperatures")) {
for (int i = 1; i <= 7; ++i) {
lineIn = statFile.readLine();
for (int i = 0; i < 7; ++i) {
statFile.readLine();
}
lineIn = statFile.readLine();
lineAvg = lineIn.data;
lineAvg = statFile.readLine().data;
break;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/EnergyPlus/WindowComplexManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2636,7 +2636,7 @@ namespace WindowComplexManager {

// Deflection
// Tarcog requires deflection as input parameters. Deflection is NOT used in EnergyPlus simulations
TARCOGParams::DeflectionCalculation CalcDeflection; // Deflection calculation flag:
TARCOGParams::DeflectionCalculation CalcDeflection = TARCOGParams::DeflectionCalculation::NONE; // Deflection calculation flag:
// 0 - no deflection calculations
// 1 - perform deflection calculation (input is Pressure/Temp)
// 2 - perform deflection calculation (input is measured deflection)
Expand Down Expand Up @@ -2755,7 +2755,6 @@ namespace WindowComplexManager {
auto &s_mat = state.dataMaterial;
// fill local vars

CalcDeflection = TARCOGParams::DeflectionCalculation::NONE;
CalcSHGC = 0;

if (CalcCondition == DataBSDFWindow::Condition::Invalid) {
Expand Down