Skip to content
Draft
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
8 changes: 2 additions & 6 deletions src/EnergyPlus/DXCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,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;
}

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).

// Run stage 1+2 at full load
if (thisDXCoil.NumCapacityStages >= 2) {
PerfMode = (int)DehumidMode * 2 + 2;
Expand Down Expand Up @@ -14072,7 +14068,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
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If the intent was to include SingleMode in the logic, this might need to be CycRatio > 0.0 || SingleMode == 1 or CycRatio > 0.0 && SingleMode == 1; otherwise it can be simplified to CycRatio > 0.0.

Copy link
Collaborator

Choose a reason for hiding this comment

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

SingleMode (1 = Yes, 0 = No) does operate just like a cycling coil except that at speeds > 1 the cycling is between capacity at speed = x and off. There are other logic conditionals like this in code and I think testing would be required to know for sure but your suggestion of CycRatio > 0.0 may be correct since line 14070 says "Stage 1" and at stage 1 it wouldn't matter what SingleMode was.

    if (SpeedNum > 1 && SingleMode == 0) {
    } else if (CycRatio > 0.0) {


// 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 @@ -7774,7 +7774,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 @@ -7875,7 +7874,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 @@ -15161,7 +15161,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 @@ -344,7 +344,6 @@ void GetPurchasedAir(EnergyPlusData &state)
}
}

cAlphaFieldName = "System Inlet Air Node Name";
if (!systemInletAirNodeName.empty()) {
PurchAir.PlenumExhaustAirNodeNum = GetOnlySingleNode(state,
systemInletAirNodeName,
Expand All @@ -360,12 +359,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 @@ -389,12 +386,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 @@ -465,11 +460,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 @@ -510,7 +503,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 @@ -523,7 +515,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 @@ -1283,7 +1283,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 @@ -1238,9 +1238,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 @@ -1271,9 +1268,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 @@ -848,7 +848,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 @@ -2766,8 +2766,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
Loading
Loading