diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index fb0f600ff44..979bbdbda63 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -5066,12 +5066,12 @@ namespace AirflowNetwork { if (simulation_control.DuctLoss) { // Assign node num based on Distribution node for (int i = 1; i <= AirflowNetworkNumOfLinks; ++i) { - for (int j = 1; j <= DisSysNumOfNodes; ++j) { - if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[0], DisSysNodeData(j).Name)) { - AirflowNetworkLinkageData(i).NodeNums[0] = j; + for (int k = 1; k <= DisSysNumOfNodes; ++k) { + if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[0], DisSysNodeData(k).Name)) { + AirflowNetworkLinkageData(i).NodeNums[0] = k; } - if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[1], DisSysNodeData(j).Name)) { - AirflowNetworkLinkageData(i).NodeNums[1] = j; + if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[1], DisSysNodeData(k).Name)) { + AirflowNetworkLinkageData(i).NodeNums[1] = k; } } if (AirflowNetworkLinkageData(i).NodeNums[0] == 0) { @@ -11479,7 +11479,7 @@ namespace AirflowNetwork { // Check number of fans specified in an AirLoop #6748 int BranchNum; - int NumOfFans; + int NumOfFans = 0; std::string FanNames; for (BranchNum = 1; BranchNum <= m_state.dataAirSystemsData->PrimaryAirSystems(1).NumBranches; ++BranchNum) { NumOfFans = 0; diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index f5159e45c27..cba9d5ec3a0 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -512,7 +512,7 @@ Real64 SurfaceData::get_average_height(EnergyPlusData &state) const for (Vertices::size_type i = 0; i < n; ++i) { Vertex2D const &v(v2d[i]); - Vertex2D *v2; + Vertex2D const *v2; if (i == n - 1) { v2 = &v2d[0]; } else { diff --git a/src/EnergyPlus/DuctLoss.cc b/src/EnergyPlus/DuctLoss.cc index bb25bb812db..0429aa80fe8 100644 --- a/src/EnergyPlus/DuctLoss.cc +++ b/src/EnergyPlus/DuctLoss.cc @@ -133,9 +133,11 @@ namespace DuctLoss { state.dataDuctLoss->ductloss(DuctLossNum).CalcDuctLoss(state, DuctLossNum); } } - } - // Return branch leak - if (AirPathWay == AirPath::Return) { + + SupplyPathUpdate(state, PathNum); + ReportDuctLoss(state); + + } else if (AirPathWay == AirPath::Return) { // Return branch leak for (int DuctLossNum = 1; DuctLossNum <= state.dataDuctLoss->NumOfDuctLosses; DuctLossNum++) { if (state.dataDuctLoss->ductloss(DuctLossNum).LossSubType == DuctLossSubType::RetLeakBranch) { state.dataDuctLoss->ductloss(DuctLossNum).CalcDuctLoss(state, DuctLossNum); @@ -165,14 +167,9 @@ namespace DuctLoss { state.dataDuctLoss->ductloss(DuctLossNum).CalcDuctLoss(state, DuctLossNum); } } - } - if (AirPathWay == AirPath::Return) { + ReturnPathUpdate(state, PathNum); } - if (AirPathWay == AirPath::Supply) { - SupplyPathUpdate(state, PathNum); - ReportDuctLoss(state); - } } } diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index 924faac7a91..cc6dbf5cb59 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -799,8 +799,13 @@ void InstantiateInitializeFMUImport(EnergyPlusData &state) for (int j = 1; j <= fmu.NumInstances; ++j) { auto &fmuInst = fmu.Instance(j); std::string const folderStr = FileSystem::toString(fmuInst.WorkingFolder); - fmuInst.fmicomponent = fmiEPlusInstantiateSlave( - (char *)folderStr.c_str(), &fmuInst.LenWorkingFolder, &fmu.TimeOut, &fmu.Visible, &fmu.Interactive, &fmu.LoggingOn, &fmuInst.Index); + fmuInst.fmicomponent = fmiEPlusInstantiateSlave(const_cast(folderStr.c_str()), + &fmuInst.LenWorkingFolder, + &fmu.TimeOut, + &fmu.Visible, + &fmu.Interactive, + &fmu.LoggingOn, + &fmuInst.Index); // TODO: This is doing a null pointer check; OK? if (fmuInst.fmicomponent == nullptr) { ShowSevereError(state, "ExternalInterface/CalcExternalInterfaceFMUImport: Error when trying to instantiate"); @@ -1109,7 +1114,7 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) std::vector workingFolderArr(getCharArrayFromString(workingFolderStr)); // make the library call - fmuInst.Index = model_ID_GUID((char *)fmuInst.Name.c_str(), + fmuInst.Index = model_ID_GUID(const_cast(fmuInst.Name.c_str()), &workingFolderArr[0], &fmuInst.LenWorkingFolder, &fmuInst.NumInputVariablesInFMU, diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 398dbefe9d0..c7f30ba1c50 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -9540,15 +9540,15 @@ namespace Furnaces { int constexpr SolveMaxIter(50); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 mdot; // heating coil steam or hot water mass flow rate - Real64 MinWaterFlow; // coil minimum hot water mass flow rate, kg/s - Real64 MaxHotWaterFlow; // coil maximum hot water mass flow rate, kg/s - Real64 HotWaterMdot; // actual hot water mass flow rate - HVAC::CoilType CoilType = HVAC::CoilType::Invalid; // heating coil type number - int HeatingCoilIndex(0); // heating coil index - int CoilControlNode(0); // control node for hot water and steam heating coils - int CoilOutletNode(0); // air outlet node of the heating coils - PlantLocation plantLoc{}; // plant loop location + Real64 mdot; // heating coil steam or hot water mass flow rate + Real64 MinWaterFlow; // coil minimum hot water mass flow rate, kg/s + Real64 MaxHotWaterFlow; // coil maximum hot water mass flow rate, kg/s + Real64 HotWaterMdot; // actual hot water mass flow rate + HVAC::CoilType CoilType; // heating coil type number + int HeatingCoilIndex(0); // heating coil index + int CoilControlNode(0); // control node for hot water and steam heating coils + int CoilOutletNode(0); // air outlet node of the heating coils + PlantLocation plantLoc{}; // plant loop location Real64 QActual = 0.0; // actual heating load std::string &HeatingCoilName = state.dataFurnaces->HeatingCoilName; // name of heating coil diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 737d62cef48..26838cb6732 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -9881,8 +9881,6 @@ void SetAverageAirFlow(EnergyPlusData &state, // could there be a reason for air loops to use inlet node flow? Possibly when VAV TUs used? if (!vrfTu.isInOASys) { state.dataLoopNodes->Node(InletNode).MassFlowRate = AverageUnitMassFlow; - } - if (!vrfTu.isInOASys) { state.dataLoopNodes->Node(InletNode).MassFlowRateMaxAvail = AverageUnitMassFlow; } if (OutsideAirNode > 0) { diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index c4abb44b1ef..c5d56e9893a 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -2830,8 +2830,6 @@ namespace HeatingCoils { heatingCoil.ParasiticFuelConsumption = heatingCoil.ParasiticFuelRate * TimeStepSysSec; - std::string coilObjClassName = std::string{HVAC::coilTypeNames[(int)heatingCoil.coilType]}; - if (heatingCoil.reportCoilFinalSizes) { if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { ReportCoilSelection::setCoilFinalSizes( diff --git a/src/EnergyPlus/HybridEvapCoolingModel.cc b/src/EnergyPlus/HybridEvapCoolingModel.cc index 2bc794b0f23..dd07fc62726 100644 --- a/src/EnergyPlus/HybridEvapCoolingModel.cc +++ b/src/EnergyPlus/HybridEvapCoolingModel.cc @@ -1945,7 +1945,7 @@ namespace HybridEvapCoolingModel { QLatentZoneOutMass = OutletMassFlowRateDry * (InletHumRat - OutletHumRat); // Watts QLatentZoneOut = QLatentZoneOutMass * LambdaSa; QTotZoneOut = OutletMassFlowRateDry * (InletEnthalpy - OutletEnthalpy); // Watts - Real64 QLatentCheck = QTotZoneOut - QSensZoneOut; // Watts + // Real64 QLatentCheck = QTotZoneOut - QSensZoneOut; // Watts // System Sensible Cooling{ W } = m'SA {kg/s} * 0.5*(cpRA + OSAF*(cpOSA-cpRA) + cpSA) {kJ/kg-C} * (T_RA + OSAF*(T_OSA - T_RA) - T_SA) // System Latent Cooling{ W } = m'SAdryair {kg/s} * L {kJ/kgWater} * (HR_RA + OSAF *(HR_OSA - HR_RA) - HR_SA) {kgWater/kgDryAir} @@ -1958,7 +1958,7 @@ namespace HybridEvapCoolingModel { QLatentSystemOut = LambdaSa * OutletMassFlowRateDry * SystemTimeStepW; // Watts QTotSystemOut = OutletMassFlowRateDry * (MixedAirEnthalpy - OutletEnthalpy); // Watts - QLatentCheck = QTotSystemOut - QSensSystemOut; // Watts + // QLatentCheck = QTotSystemOut - QSensSystemOut; // Watts // reset outputs ResetOutputs(); diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 9681ffdfdce..8add0979ac3 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -473,9 +473,8 @@ void initPython(EnergyPlusData &state, fs::path const &pathToPythonPackages) // GilGrabber is an RAII helper that will ensure we release the GIL (including if we end up throwing) struct GilGrabber { - GilGrabber() + GilGrabber() : gil(PyGILState_Ensure()) { - gil = PyGILState_Ensure(); } ~GilGrabber() { diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index 25c666bba3e..97bdfc970c6 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -173,12 +173,13 @@ void SetupPollutionCalculations(EnergyPlusData &state) // and the like are happening as expected. OutputProcessor::ReportFreq freq = OutputProcessor::ReportFreq::Simulation; - if (!state.dataIPShortCut->lAlphaFieldBlanks(1) && - (freq = static_cast( - getEnumValue(OutputProcessor::reportFreqNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1))))) == - OutputProcessor::ReportFreq::Invalid) { - ShowSevereError(state, EnergyPlus::format("Invalid reporting frequency {}", state.dataIPShortCut->cAlphaArgs(1))); - continue; + if (!state.dataIPShortCut->lAlphaFieldBlanks(1)) { + freq = static_cast( + getEnumValue(OutputProcessor::reportFreqNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); + if (freq == OutputProcessor::ReportFreq::Invalid) { + ShowSevereError(state, EnergyPlus::format("Invalid reporting frequency {}", state.dataIPShortCut->cAlphaArgs(1))); + continue; + } } InitPollutionMeterReporting(state, freq); diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 2338c81b2aa..7930f4a597c 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -306,42 +306,36 @@ namespace Psychrometrics { DISABLE_WARNING_PUSH DISABLE_WARNING_STRICT_ALIASING - // cppcheck-suppress invalidPointerCast std::uint64_t Tdb_tag = *reinterpret_cast(&Tdb) >> Grid_Shift; - // cppcheck-suppress invalidPointerCast std::uint64_t W_tag = *reinterpret_cast(&W) >> Grid_Shift; - // cppcheck-suppress invalidPointerCast std::uint64_t Pb_tag = *reinterpret_cast(&Pb) >> Grid_Shift; DISABLE_WARNING_POP std::uint64_t hash = (Tdb_tag ^ (W_tag ^ Pb_tag)) & std::uint64_t(twbcache_size - 1); - auto &cached_Twb = state.dataPsychCache->cached_Twb; + auto &twb_Cache = state.dataPsychCache->cached_Twb; - if (cached_Twb[hash].iTdb != Tdb_tag || cached_Twb[hash].iW != W_tag || cached_Twb[hash].iPb != Pb_tag) { - cached_Twb[hash].iTdb = Tdb_tag; - cached_Twb[hash].iW = W_tag; - cached_Twb[hash].iPb = Pb_tag; + if (twb_Cache[hash].iTdb != Tdb_tag || twb_Cache[hash].iW != W_tag || twb_Cache[hash].iPb != Pb_tag) { + twb_Cache[hash].iTdb = Tdb_tag; + twb_Cache[hash].iW = W_tag; + twb_Cache[hash].iPb = Pb_tag; DISABLE_WARNING_PUSH DISABLE_WARNING_STRICT_ALIASING Tdb_tag <<= Grid_Shift; - // cppcheck-suppress invalidPointerCast Real64 Tdb_tag_r = *reinterpret_cast(&Tdb_tag); W_tag <<= Grid_Shift; - // cppcheck-suppress invalidPointerCast Real64 W_tag_r = *reinterpret_cast(&W_tag); Pb_tag <<= Grid_Shift; - // cppcheck-suppress invalidPointerCast Real64 Pb_tag_r = *reinterpret_cast(&Pb_tag); DISABLE_WARNING_POP - cached_Twb[hash].Twb = PsyTwbFnTdbWPb_raw(state, Tdb_tag_r, W_tag_r, Pb_tag_r, CalledFrom); + twb_Cache[hash].Twb = PsyTwbFnTdbWPb_raw(state, Tdb_tag_r, W_tag_r, Pb_tag_r, CalledFrom); } - return cached_Twb[hash].Twb; + return twb_Cache[hash].Twb; } Real64 PsyTwbFnTdbWPb_raw(EnergyPlusData &state, @@ -1311,8 +1305,8 @@ namespace Psychrometrics { // na // FUNCTION LOCAL VARIABLE DECLARATIONS: - Real64 tSat; // Water temperature guess - int iter(0); // Iteration counter + Real64 tSat; // Water temperature guess + [[maybe_unused]] int iter(0); // Iteration counter #ifdef EP_psych_stats ++state.dataPsychCache->NumTimesCalled[static_cast(PsychrometricFunction::TsatFnPb)]; diff --git a/src/EnergyPlus/PythonEngine.cc b/src/EnergyPlus/PythonEngine.cc index 9d2f50d4423..f727c493bf2 100644 --- a/src/EnergyPlus/PythonEngine.cc +++ b/src/EnergyPlus/PythonEngine.cc @@ -395,10 +395,10 @@ sys.argv.append("energyplus") for (auto &p : std::filesystem::directory_iterator(pathToPythonPackages)) { if (p.is_directory()) { std::string dirName = p.path().filename().string(); - if (dirName.find("tcl", 0) == 0 && dirName.find('.', 0) > 0) { + if (dirName.starts_with("tcl") && dirName.find('.', 0) > 0) { tclConfigDir = dirName; } - if (dirName.find("tk", 0) == 0 && dirName.find('.', 0) > 0) { + if (dirName.starts_with("tk") && dirName.find('.', 0) > 0) { tkConfigDir = dirName; } if (!tclConfigDir.empty() && !tkConfigDir.empty()) { diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index ae624e5333d..44a4c51ef9d 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -3318,7 +3318,6 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state) lbracket = index(cAlphaArgs(1), '['); if (lbracket == std::string::npos) { - UnitsA = ""; // if (lAlphaFieldBlanks(6)) then // CALL ShowWarningError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//' no units // indicated.') CALL ShowContinueError(state, '...no units indicated for this variable. [] is assumed.') @@ -3494,7 +3493,6 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state) lbracket = index(cAlphaArgs(1), '['); if (lbracket == std::string::npos) { - UnitsA = ""; // if (lAlphaFieldBlanks(9)) then // CALL ShowWarningError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//' no units // indicated.') CALL ShowContinueError(state, '...no units indicated for this variable. [] is assumed.') diff --git a/src/EnergyPlus/ScheduleManager.cc b/src/EnergyPlus/ScheduleManager.cc index 6eaed762d21..c26ff8bf351 100644 --- a/src/EnergyPlus/ScheduleManager.cc +++ b/src/EnergyPlus/ScheduleManager.cc @@ -2436,7 +2436,7 @@ namespace Sched { int DayNum = 1; while (DayNum <= 366) { auto *weekSched = schedDetailed->weekScheds[DayNum]; - while (schedDetailed->weekScheds[DayNum] == weekSched && DayNum <= 366) { + while (DayNum <= 366 && schedDetailed->weekScheds[DayNum] == weekSched) { if (DayNum == 366) { General::InvOrdinalDay(DayNum, PMon, PDay, 1); print(state.files.eio, ThruFmt, Months[PMon - 1], PDay, weekSched->Name); diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 63b7d1a70e0..e88ce1e354d 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -2696,7 +2696,7 @@ void GetZoneSizingInput(EnergyPlusData &state) bool errFlag; Array1D_string ZoneNames; int NumZones; - int NumZoneLists; + int NumZoneLists = 0; struct GlobalMiscObject { diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 1e477bb22b6..e4cecce67d8 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -185,7 +185,7 @@ void InitSolarCalculations(EnergyPlusData &state) if (state.files.outputControl.shd) { state.dataSolarShading->shd_stream = std::make_unique(state.dataStrGlobals->outputShdFilePath, std::ios_base::out | std::ios_base::trunc); - if (!state.dataSolarShading->shd_stream) { + if (!static_cast(state.dataSolarShading->shd_stream.get())->is_open()) { ShowFatalError(state, EnergyPlus::format("InitSolarCalculations: Could not open file \"{}\" for output (write).", state.dataStrGlobals->outputShdFilePath)); diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 05d519425ed..85f54de8010 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -10019,7 +10019,6 @@ namespace SurfaceGeometry { ErrorsFound = true; } } else if (IShadedConst > 0 && IShadingDevice > 0) { - IShadingDevice = 0; ShowWarningError(state, EnergyPlus::format("{}=\"{}\" Both {} and {} are specified.", s_ipsc->cCurrentModuleObject, diff --git a/src/EnergyPlus/TARCOGOutput.cc b/src/EnergyPlus/TARCOGOutput.cc index b4fa8a1af1e..ec69f49cace 100644 --- a/src/EnergyPlus/TARCOGOutput.cc +++ b/src/EnergyPlus/TARCOGOutput.cc @@ -550,8 +550,6 @@ void WriteModifiedArguments(InputOutputFile &InArgumentsFile, for (i = 1; i <= nlayer + 1; ++i) { // loop through gaps: if ((i > 1) && (i <= nlayer)) { print(InArgumentsFile, Format_1111, i - 1); - } - if ((i > 1) && (i <= nlayer)) { print(InArgumentsFile, Format_1112, gap(i - 1)); } if (i == 1) { diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 039717a4adf..9f382b216e6 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -15674,7 +15674,7 @@ namespace UnitarySystems { std::string CompName; // Name of Unitary System object Real64 SensLoad = 0.0; Real64 LatLoad = 0.0; - HVAC::CoilType coilType = HVAC::CoilType::Invalid; + HVAC::CoilType coilType; int CompIndex = 0; Real64 dummy = 0.0; diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index 36d2af061ec..c0ebc6a8d12 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -474,7 +474,7 @@ namespace Util { template ::value>::type> // Container needs operator[i] and value_type inline int - FindItemInList(std::string_view const String, Container const &ListOfItems, std::string Container::value_type::*name_p, int const NumItems) + FindItemInList(std::string_view const String, Container const &ListOfItems, std::string Container::value_type::*const name_p, int const NumItems) { for (typename Container::size_type i = 0, e = NumItems; i < e; ++i) { if (String == ListOfItems[i].*name_p) { diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index c265ed2988b..dd596100a45 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -4629,9 +4629,7 @@ void ReportWaterCoil(EnergyPlusData &state, int const CoilNum) auto &waterCoil = state.dataWaterCoils->WaterCoil(CoilNum); if (waterCoil.reportCoilFinalSizes) { if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { - std::string coilObjClassName; if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { - coilObjClassName = "Coil:Heating:Water"; ReportCoilSelection::setCoilFinalSizes(state, waterCoil.coilReportNum, waterCoil.DesWaterHeatingCoilRate, @@ -4640,7 +4638,6 @@ void ReportWaterCoil(EnergyPlusData &state, int const CoilNum) waterCoil.MaxWaterVolFlowRate); waterCoil.reportCoilFinalSizes = false; } else if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { - coilObjClassName = "Coil:Cooling:Water:DetailedGeometry"; ReportCoilSelection::setCoilFinalSizes(state, waterCoil.coilReportNum, waterCoil.DesWaterCoolingCoilRate, @@ -4649,7 +4646,6 @@ void ReportWaterCoil(EnergyPlusData &state, int const CoilNum) waterCoil.MaxWaterVolFlowRate); waterCoil.reportCoilFinalSizes = false; } else if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { - coilObjClassName = "Coil:Cooling:Water"; ReportCoilSelection::setCoilFinalSizes(state, waterCoil.coilReportNum, waterCoil.DesWaterCoolingCoilRate, diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 301b32c75db..fb548fd8088 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -681,7 +681,6 @@ bool getDesuperHtrInput(EnergyPlusData &state) bool ErrorsFound = false; static constexpr std::string_view routineName = "getDesuperHtrInput"; // Make local copies of IPShortCut because other getinputs might overwrite the ones in state <-- need to fix this idiom - std::string cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; Array1D cAlphaArgs = state.dataIPShortCut->cAlphaArgs; Array1D rNumericArgs = state.dataIPShortCut->rNumericArgs; Array1D lNumericFieldBlanks = state.dataIPShortCut->lNumericFieldBlanks; @@ -689,7 +688,7 @@ bool getDesuperHtrInput(EnergyPlusData &state) Array1D cAlphaFieldNames = state.dataIPShortCut->cAlphaFieldNames; Array1D cNumericFieldNames = state.dataIPShortCut->cNumericFieldNames; - cCurrentModuleObject = cCoilDesuperheater; + std::string cCurrentModuleObject = cCoilDesuperheater; for (int DesuperheaterNum = 1; DesuperheaterNum <= state.dataWaterThermalTanks->numWaterHeaterDesuperheater; ++DesuperheaterNum) { int NumAlphas; int NumNums; diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index 594c0616b54..a4ed5d13b64 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -1345,17 +1345,10 @@ namespace WaterToAirHeatPumpSimple { HardSizeNoDesRun = true; if (simpleWAHP.RatedAirVolFlowRate > 0.0) { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Air Flow Rate [m3/s]", - simpleWAHP.RatedAirVolFlowRate); + state, CompType, simpleWAHP.Name, "User-Specified Rated Air Flow Rate [m3/s]", simpleWAHP.RatedAirVolFlowRate); } } else { - CheckSysSizing( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name); + CheckSysSizing(state, CompType, simpleWAHP.Name); if (state.dataSize->FinalSysSizing(state.dataSize->CurSysNum).DesMainVolFlow >= HVAC::SmallAirVolFlow) { RatedAirVolFlowRateDes = state.dataSize->FinalSysSizing(state.dataSize->CurSysNum).DesMainVolFlow; CoolingAirVolFlowRateDes = state.dataSize->CalcSysSizing(state.dataSize->CurSysNum).DesCoolVolFlow; @@ -1369,17 +1362,10 @@ namespace WaterToAirHeatPumpSimple { HardSizeNoDesRun = true; if (simpleWAHP.RatedAirVolFlowRate > 0.0) { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Air Flow Rate [m3/s]", - simpleWAHP.RatedAirVolFlowRate); + state, CompType, simpleWAHP.Name, "User-Specified Rated Air Flow Rate [m3/s]", simpleWAHP.RatedAirVolFlowRate); } } else { - CheckZoneSizing( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name); + CheckZoneSizing(state, CompType, simpleWAHP.Name); RatedAirVolFlowRateDes = max(state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).DesCoolVolFlow, state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).DesHeatVolFlow); CoolingAirVolFlowRateDes = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).DesCoolVolFlow; @@ -1392,32 +1378,22 @@ namespace WaterToAirHeatPumpSimple { if (!HardSizeNoDesRun) { if (IsAutoSize) { simpleWAHP.RatedAirVolFlowRate = RatedAirVolFlowRateDes; - BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "Design Size Rated Air Flow Rate [m3/s]", - RatedAirVolFlowRateDes); + BaseSizer::reportSizerOutput(state, CompType, simpleWAHP.Name, "Design Size Rated Air Flow Rate [m3/s]", RatedAirVolFlowRateDes); } else { if (simpleWAHP.RatedAirVolFlowRate > 0.0 && RatedAirVolFlowRateDes > 0.0) { RatedAirVolFlowRateUser = simpleWAHP.RatedAirVolFlowRate; if ((std::abs(RatedAirVolFlowRateDes - RatedAirVolFlowRateUser) / RatedAirVolFlowRateUser) > state.dataSize->AutoVsHardSizingThreshold) { - BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "Design Size Rated Air Flow Rate [m3/s]", - RatedAirVolFlowRateDes, - "User-Specified Rated Air Flow Rate [m3/s]", - RatedAirVolFlowRateUser); + BaseSizer::reportSizerOutput(state, + CompType, + simpleWAHP.Name, + "Design Size Rated Air Flow Rate [m3/s]", + RatedAirVolFlowRateDes, + "User-Specified Rated Air Flow Rate [m3/s]", + RatedAirVolFlowRateUser); } else { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Air Flow Rate [m3/s]", - RatedAirVolFlowRateUser); + state, CompType, simpleWAHP.Name, "User-Specified Rated Air Flow Rate [m3/s]", RatedAirVolFlowRateUser); } if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(RatedAirVolFlowRateDes - RatedAirVolFlowRateUser) / RatedAirVolFlowRateUser) > @@ -1459,17 +1435,10 @@ namespace WaterToAirHeatPumpSimple { HardSizeNoDesRun = true; if (simpleWAHP.RatedCapCoolTotal > 0.0) { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Total Cooling Capacity [W]", - simpleWAHP.RatedCapCoolTotal); + state, CompType, simpleWAHP.Name, "User-Specified Rated Total Cooling Capacity [W]", simpleWAHP.RatedCapCoolTotal); } } else { - CheckSysSizing( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name); + CheckSysSizing(state, CompType, simpleWAHP.Name); if (CoolingAirVolFlowRateDes > 0.0) { VolFlowRate = CoolingAirVolFlowRateDes; } else { @@ -1543,13 +1512,7 @@ namespace WaterToAirHeatPumpSimple { // calculate temperatue ratio at design day peak conditions ratioTWB = (MixWetBulb + Constant::Kelvin) / Tref; PltSizNum = PlantUtilities::MyPlantSizingIndex( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - simpleWAHP.WaterInletNodeNum, - simpleWAHP.WaterOutletNodeNum, - ErrorsFound, - false); + state, CompType, simpleWAHP.Name, simpleWAHP.WaterInletNodeNum, simpleWAHP.WaterOutletNodeNum, ErrorsFound, false); if (PltSizNum > 0) { DesignEntWaterTemp = state.dataSize->PlantSizData(PltSizNum).ExitTemp; ratioTS = (DesignEntWaterTemp + Constant::Kelvin) / Tref; @@ -1590,19 +1553,12 @@ namespace WaterToAirHeatPumpSimple { HardSizeNoDesRun = true; if (simpleWAHP.RatedCapCoolTotal > 0.0) { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Total Cooling Capacity [W]", - simpleWAHP.RatedCapCoolTotal); + state, CompType, simpleWAHP.Name, "User-Specified Rated Total Cooling Capacity [W]", simpleWAHP.RatedCapCoolTotal); } } else { auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum); - CheckZoneSizing( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name); + CheckZoneSizing(state, CompType, simpleWAHP.Name); if (CoolingAirVolFlowRateDes > 0.0) { VolFlowRate = CoolingAirVolFlowRateDes; } else { @@ -1669,13 +1625,7 @@ namespace WaterToAirHeatPumpSimple { // calculate temperatue ratio at design day peak conditions ratioTWB = (MixWetBulb + Constant::Kelvin) / Tref; PltSizNum = PlantUtilities::MyPlantSizingIndex( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - simpleWAHP.WaterInletNodeNum, - simpleWAHP.WaterOutletNodeNum, - ErrorsFound, - false); + state, CompType, simpleWAHP.Name, simpleWAHP.WaterInletNodeNum, simpleWAHP.WaterOutletNodeNum, ErrorsFound, false); if (PltSizNum > 0) { DesignEntWaterTemp = state.dataSize->PlantSizData(PltSizNum).ExitTemp; ratioTS = (DesignEntWaterTemp + Constant::Kelvin) / Tref; @@ -1727,17 +1677,10 @@ namespace WaterToAirHeatPumpSimple { HardSizeNoDesRun = true; if (simpleWAHP.RatedCapCoolSens > 0.0) { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Sensible Cooling Capacity [W]", - simpleWAHP.RatedCapCoolSens); + state, CompType, simpleWAHP.Name, "User-Specified Rated Sensible Cooling Capacity [W]", simpleWAHP.RatedCapCoolSens); } } else { - CheckSysSizing( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name); + CheckSysSizing(state, CompType, simpleWAHP.Name); if (CoolingAirVolFlowRateDes > 0.0) { VolFlowRate = CoolingAirVolFlowRateDes; } else { @@ -1799,13 +1742,7 @@ namespace WaterToAirHeatPumpSimple { ratioTDB = (MixTemp + Constant::Kelvin) / Tref; ratioTWB = (MixWetBulb + Constant::Kelvin) / Tref; PltSizNum = PlantUtilities::MyPlantSizingIndex( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - simpleWAHP.WaterInletNodeNum, - simpleWAHP.WaterOutletNodeNum, - ErrorsFound, - false); + state, CompType, simpleWAHP.Name, simpleWAHP.WaterInletNodeNum, simpleWAHP.WaterOutletNodeNum, ErrorsFound, false); if (PltSizNum > 0) { DesignEntWaterTemp = state.dataSize->PlantSizData(PltSizNum).ExitTemp; ratioTS = (DesignEntWaterTemp + Constant::Kelvin) / Tref; @@ -1839,17 +1776,10 @@ namespace WaterToAirHeatPumpSimple { HardSizeNoDesRun = true; if (simpleWAHP.RatedCapCoolSens > 0.0) { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Sensible Cooling Capacity [W]", - simpleWAHP.RatedCapCoolSens); + state, CompType, simpleWAHP.Name, "User-Specified Rated Sensible Cooling Capacity [W]", simpleWAHP.RatedCapCoolSens); } } else { - CheckZoneSizing( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name); + CheckZoneSizing(state, CompType, simpleWAHP.Name); auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum); if (CoolingAirVolFlowRateDes > 0.0) { VolFlowRate = CoolingAirVolFlowRateDes; @@ -1907,13 +1837,7 @@ namespace WaterToAirHeatPumpSimple { ratioTDB = (MixTemp + Constant::Kelvin) / Tref; ratioTWB = (MixWetBulb + Constant::Kelvin) / Tref; PltSizNum = PlantUtilities::MyPlantSizingIndex( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - simpleWAHP.WaterInletNodeNum, - simpleWAHP.WaterOutletNodeNum, - ErrorsFound, - false); + state, CompType, simpleWAHP.Name, simpleWAHP.WaterInletNodeNum, simpleWAHP.WaterOutletNodeNum, ErrorsFound, false); if (PltSizNum > 0) { DesignEntWaterTemp = state.dataSize->PlantSizData(PltSizNum).ExitTemp; ratioTS = (DesignEntWaterTemp + Constant::Kelvin) / Tref; @@ -2023,11 +1947,7 @@ namespace WaterToAirHeatPumpSimple { simpleWAHP.RatedPowerCool = simpleWAHP.RatedPowerCoolAtRatedCdts / RatedCoolPowerTempModFac; if (simpleWAHP.RatedCapCoolTotal != DataSizing::AutoSize) { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "Design Size Rated Total Cooling Capacity [W]", - simpleWAHP.RatedCapCoolTotal); + state, CompType, simpleWAHP.Name, "Design Size Rated Total Cooling Capacity [W]", simpleWAHP.RatedCapCoolTotal); } OutputReportPredefined::PreDefTableEntry( state, state.dataOutRptPredefined->pdchWAHPRatedAirDBT, simpleWAHP.Name, RatedMixDryBulb); @@ -2135,11 +2055,7 @@ namespace WaterToAirHeatPumpSimple { simpleWAHP.RatedCapCoolSensDesAtRatedCdts = RatedCapCoolSensDes * RatedSensCapTempModFac; if (simpleWAHP.RatedCapCoolTotal != DataSizing::AutoSize) { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "Design Size Rated Sensible Cooling Capacity [W]", - RatedCapCoolSensDes); + state, CompType, simpleWAHP.Name, "Design Size Rated Sensible Cooling Capacity [W]", RatedCapCoolSensDes); } } else { if (simpleWAHP.RatedCapCoolSens > 0.0 && RatedCapCoolSensDes > 0.0) { @@ -2303,10 +2219,7 @@ namespace WaterToAirHeatPumpSimple { } if (IsAutoSize) { if (state.dataSize->CurSysNum > 0) { - CheckSysSizing( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name); + CheckSysSizing(state, CompType, simpleWAHP.Name); if (HeatingAirVolFlowRateDes > 0.0) { VolFlowRate = HeatingAirVolFlowRateDes; } else { @@ -2373,13 +2286,7 @@ namespace WaterToAirHeatPumpSimple { // calculate temperatue ratio at design day peak conditions HeatratioTDB = (HeatMixTemp + Constant::Kelvin) / Tref; PltSizNum = PlantUtilities::MyPlantSizingIndex( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - simpleWAHP.WaterInletNodeNum, - simpleWAHP.WaterOutletNodeNum, - ErrorsFound, - false); + state, CompType, simpleWAHP.Name, simpleWAHP.WaterInletNodeNum, simpleWAHP.WaterOutletNodeNum, ErrorsFound, false); if (PltSizNum > 0) { DesignEntWaterTemp = state.dataSize->PlantSizData(PltSizNum).ExitTemp; HeatratioTS = (DesignEntWaterTemp + Constant::Kelvin) / Tref; @@ -2423,10 +2330,7 @@ namespace WaterToAirHeatPumpSimple { } } else if (state.dataSize->CurZoneEqNum > 0) { auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum); - CheckZoneSizing( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name); + CheckZoneSizing(state, CompType, simpleWAHP.Name); if (HeatingAirVolFlowRateDes > 0.0) { VolFlowRate = HeatingAirVolFlowRateDes; } else { @@ -2477,13 +2381,7 @@ namespace WaterToAirHeatPumpSimple { // calculate temperatue ratio at design day peak conditions HeatratioTDB = (HeatMixTemp + Constant::Kelvin) / Tref; PltSizNum = PlantUtilities::MyPlantSizingIndex( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - simpleWAHP.WaterInletNodeNum, - simpleWAHP.WaterOutletNodeNum, - ErrorsFound, - false); + state, CompType, simpleWAHP.Name, simpleWAHP.WaterInletNodeNum, simpleWAHP.WaterOutletNodeNum, ErrorsFound, false); if (PltSizNum > 0) { DesignEntWaterTemp = state.dataSize->PlantSizData(PltSizNum).ExitTemp; HeatratioTS = (DesignEntWaterTemp + Constant::Kelvin) / Tref; @@ -2639,12 +2537,7 @@ namespace WaterToAirHeatPumpSimple { state, state.dataOutRptPredefined->pdchWAHPRatedAirDBT, simpleWAHP.Name, RatedHeatMixDryBulb); OutputReportPredefined::PreDefTableEntry( state, state.dataOutRptPredefined->pdchWAHPRatedWtrT, simpleWAHP.Name, simpleWAHP.RatedEntWaterTemp); - BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "Design Size Rated Heating Capacity [W]", - simpleWAHP.RatedCapHeat); + BaseSizer::reportSizerOutput(state, CompType, simpleWAHP.Name, "Design Size Rated Heating Capacity [W]", simpleWAHP.RatedCapHeat); OutputReportPredefined::PreDefTableEntry( state, state.dataOutRptPredefined->pdchHeatCoilNomCap, simpleWAHP.Name, simpleWAHP.RatedCapHeat); if (simpleWAHP.RatedCapHeat != 0.0) { @@ -2657,21 +2550,15 @@ namespace WaterToAirHeatPumpSimple { if (simpleWAHP.RatedCapHeat > 0.0 && RatedCapHeatDes > 0.0 && !HardSizeNoDesRun) { RatedCapHeatUser = simpleWAHP.RatedCapHeat; if ((std::abs(RatedCapHeatDes - RatedCapHeatUser) / RatedCapHeatUser) > state.dataSize->AutoVsHardSizingThreshold) { - BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "Design Size Rated Heating Capacity [W]", - RatedCapHeatDes, - "User-Specified Rated Heating Capacity [W]", - RatedCapHeatUser); + BaseSizer::reportSizerOutput(state, + CompType, + simpleWAHP.Name, + "Design Size Rated Heating Capacity [W]", + RatedCapHeatDes, + "User-Specified Rated Heating Capacity [W]", + RatedCapHeatUser); } else { - BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Heating Capacity [W]", - RatedCapHeatUser); + BaseSizer::reportSizerOutput(state, CompType, simpleWAHP.Name, "User-Specified Rated Heating Capacity [W]", RatedCapHeatUser); } if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(RatedCapHeatDes - RatedCapHeatUser) / RatedCapHeatUser) > state.dataSize->AutoVsHardSizingThreshold) { @@ -2690,12 +2577,7 @@ namespace WaterToAirHeatPumpSimple { } else { if (simpleWAHP.RatedCapHeat > 0.0) { RatedCapHeatUser = simpleWAHP.RatedCapHeat; - BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Heating Capacity [W]", - RatedCapHeatUser); + BaseSizer::reportSizerOutput(state, CompType, simpleWAHP.Name, "User-Specified Rated Heating Capacity [W]", RatedCapHeatUser); } } @@ -2811,13 +2693,7 @@ namespace WaterToAirHeatPumpSimple { // first check to see if coil is connected to a plant loop, no warning on this CALL if (IsAutoSize) { PltSizNum = PlantUtilities::MyPlantSizingIndex( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - simpleWAHP.WaterInletNodeNum, - simpleWAHP.WaterOutletNodeNum, - ErrorsFound, - false); + state, CompType, simpleWAHP.Name, simpleWAHP.WaterInletNodeNum, simpleWAHP.WaterOutletNodeNum, ErrorsFound, false); if (PltSizNum > 0) { rho = simpleWAHP.plantLoc.loop->glycol->getDensity(state, state.dataSize->PlantSizData(PltSizNum).ExitTemp, RoutineNameAlt); @@ -2874,12 +2750,7 @@ namespace WaterToAirHeatPumpSimple { if (SystemCapacity != DataSizing::AutoSize) { simpleWAHP.RatedWaterVolFlowRate = RatedWaterVolFlowRateDes; - BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "Design Size Rated Water Flow Rate [m3/s]", - RatedWaterVolFlowRateDes); + BaseSizer::reportSizerOutput(state, CompType, simpleWAHP.Name, "Design Size Rated Water Flow Rate [m3/s]", RatedWaterVolFlowRateDes); if (simpleWAHP.WAHPType == WatertoAirHP::Heating && simpleWAHP.CompanionCoolingCoilNum > 0) { auto &companionCoolingCoil(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(simpleWAHP.CompanionCoolingCoilNum)); companionCoolingCoil.RatedWaterVolFlowRate = RatedWaterVolFlowRateDes; @@ -2905,21 +2776,16 @@ namespace WaterToAirHeatPumpSimple { RatedWaterVolFlowRateUser = simpleWAHP.RatedWaterVolFlowRate; if ((std::abs(RatedWaterVolFlowRateDes - RatedWaterVolFlowRateUser) / RatedWaterVolFlowRateUser) > state.dataSize->AutoVsHardSizingThreshold) { - BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "Design Size Rated Water Flow Rate [m3/s]", - RatedWaterVolFlowRateDes, - "User-Specified Rated Water Flow Rate [m3/s]", - RatedWaterVolFlowRateUser); + BaseSizer::reportSizerOutput(state, + CompType, + simpleWAHP.Name, + "Design Size Rated Water Flow Rate [m3/s]", + RatedWaterVolFlowRateDes, + "User-Specified Rated Water Flow Rate [m3/s]", + RatedWaterVolFlowRateUser); } else { BaseSizer::reportSizerOutput( - state, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]), - simpleWAHP.Name, - "User-Specified Rated Water Flow Rate [m3/s]", - RatedWaterVolFlowRateUser); + state, CompType, simpleWAHP.Name, "User-Specified Rated Water Flow Rate [m3/s]", RatedWaterVolFlowRateUser); } if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(RatedWaterVolFlowRateDes - RatedWaterVolFlowRateUser) / RatedWaterVolFlowRateUser) > diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index 962f09d1308..0637eca341c 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -2636,7 +2636,7 @@ namespace WindowComplexManager { // Deflection // Tarcog requires deflection as input parameters. Deflection is NOT used in EnergyPlus simulations - TARCOGParams::DeflectionCalculation CalcDeflection = TARCOGParams::DeflectionCalculation::NONE; // Deflection calculation flag: + TARCOGParams::DeflectionCalculation CalcDeflection; // Deflection calculation flag: // 0 - no deflection calculations // 1 - perform deflection calculation (input is Pressure/Temp) // 2 - perform deflection calculation (input is measured deflection) @@ -2649,7 +2649,7 @@ namespace WindowComplexManager { // 1 - ISO 15099, // 2 - EN673 / ISO 10292 Declared, // 3 - EN673 / ISO 10292 Design. - TARCOGParams::TARCOGThermalModel ThermalMod = TARCOGParams::TARCOGThermalModel::ISO15099; // Thermal model: + TARCOGParams::TARCOGThermalModel ThermalMod; // Thermal model: // 0 - ISO15099 // 1 - Scaled Cavity Width (SCW) // 2 - Convective Scalar Model (CSM) @@ -3415,9 +3415,7 @@ namespace WindowComplexManager { // Save hcv for use in divider calc with interior or exterior shade (see CalcWinFrameAndDividerTemps) if (ShadeFlag == WinShadingType::IntShade) { state.dataSurface->SurfWinConvCoeffWithShade(SurfNum) = 0.0; - } - if (ShadeFlag == WinShadingType::IntShade) { auto const &surfShade = state.dataSurface->surfShades(SurfNum); SurfInsideTemp = theta(2 * ngllayer + 2) - Constant::Kelvin; diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 24f5c61a191..2d92bc292f1 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -4260,7 +4260,7 @@ namespace Window { // as output: decomposed matrix // if odd - int imax; // Temporary variable + int imax = 0; // Temporary variable // as output: decomposed matrix assert(n <= 10); // vv sizing @@ -4609,7 +4609,6 @@ namespace Window { for (int i = 1; i < NMix; ++i) { auto const &wmgas = wm->gaps[iGap].gases[i]; fvis[i] = wmgas.vis.c0 + wmgas.vis.c1 * tmean + wmgas.vis.c2 * tmean_2; - fdens[i] = pres * wmgas.wght / (gaslaw * tmean); molmix += frct[i] * wmgas.wght; // eq. 56 mukpdwn[i] = 1.0; // initialize denominator of eq. 60 } diff --git a/src/EnergyPlus/WindowManagerExteriorOptical.hh b/src/EnergyPlus/WindowManagerExteriorOptical.hh index 073ae44d6a4..3a110788b38 100644 --- a/src/EnergyPlus/WindowManagerExteriorOptical.hh +++ b/src/EnergyPlus/WindowManagerExteriorOptical.hh @@ -204,7 +204,7 @@ namespace Window { class CWCEVenetianBlindCellFactory : public IWCECellDescriptionFactory { public: - CWCEVenetianBlindCellFactory(const Material::MaterialBase *t_Material); + explicit CWCEVenetianBlindCellFactory(const Material::MaterialBase *t_Material); std::shared_ptr getCellDescription(EnergyPlusData &state) override; }; @@ -215,7 +215,7 @@ namespace Window { class CWCEScreenCellFactory : public IWCECellDescriptionFactory { public: - CWCEScreenCellFactory(const Material::MaterialBase *t_Material); + explicit CWCEScreenCellFactory(const Material::MaterialBase *t_Material); std::shared_ptr getCellDescription(EnergyPlusData &state) override; }; @@ -226,7 +226,7 @@ namespace Window { class CWCEDiffuseShadeCellFactory : public IWCECellDescriptionFactory { public: - CWCEDiffuseShadeCellFactory(const Material::MaterialBase *t_Material); + explicit CWCEDiffuseShadeCellFactory(const Material::MaterialBase *t_Material); std::shared_ptr getCellDescription(EnergyPlusData &state) override; }; diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index ee4078f8143..d8f88549133 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -6991,8 +6991,6 @@ void ZoneSpaceHeatBalanceData::calcPredictedSystemLoad(EnergyPlusData &state, Re ZoneSetPoint = zoneTstatSetpt.setpt; if (RAFNFrac > 0.0) { LoadToHeatingSetPoint = LoadToHeatingSetPoint / RAFNFrac; - } - if (RAFNFrac > 0.0) { LoadToCoolingSetPoint = LoadToCoolingSetPoint / RAFNFrac; } @@ -7083,8 +7081,6 @@ void ZoneSpaceHeatBalanceData::calcPredictedSystemLoad(EnergyPlusData &state, Re if (RAFNFrac > 0.0) { LoadToHeatingSetPoint = LoadToHeatingSetPoint / RAFNFrac; - } - if (RAFNFrac > 0.0) { LoadToCoolingSetPoint = LoadToCoolingSetPoint / RAFNFrac; } diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc index f53b9835211..60473769b2b 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc @@ -7937,7 +7937,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) // check mass flow rates EXPECT_NEAR(PrimaryAirMassFlowRate, 0.2, 0.000001); - // Tolerance here wwas 0.000001, why? Why is tolerance of less + // Tolerance here was 0.000001, why? Why is tolerance of less // than 1/10th or even 1/100th of a percent needed on anything? EXPECT_NEAR(SecondaryAirMassFlowRate, 0.350865, 0.001); EXPECT_NEAR(state->dataLoopNodes->Node(thisFanCoil.AirInNode).MassFlowRate, thisFan->inletAirMassFlowRate, 0.000001);