diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index 02eb18bca70..0ef6461c08a 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -441,7 +441,7 @@ namespace AirLoopHVACDOAS { if (!(CompNum == 1 || CompNum == state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).NumComponents)) { ShowSevereError(state, "The fan placement is either first as blow through or last as draw through in" + CurrentModuleObject + " = " + state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); - ShowContinueError(state, "The current position is number " + General::RoundSigDigits(CompNum)); + ShowContinueError(state, format("The current position is number {}", CompNum)); errorsFound = true; } } else if (SELECT_CASE_var == "FAN:COMPONENTMODEL") { @@ -460,7 +460,7 @@ namespace AirLoopHVACDOAS { if (!(CompNum == 1 || CompNum == state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).NumComponents)) { ShowSevereError(state, "The fan placement is either first as blow through or last as draw through in" + CurrentModuleObject + " = " + state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum)); - ShowContinueError(state, "The current position is number " + General::RoundSigDigits(CompNum)); + ShowContinueError(state, format("The current position is number {}", CompNum)); errorsFound = true; } } else if (SELECT_CASE_var == "COIL:COOLING:WATER") { @@ -742,8 +742,8 @@ namespace AirLoopHVACDOAS { thisDOAS.NumOfAirLoops = fields.at("number_of_airloophvac"); // if (thisDOAS.NumOfAirLoops < 1) { cFieldName = "Number of AirLoopHVAC"; - ShowSevereError(state, cCurrentModuleObject + ", \"" + thisDOAS.Name + "\" " + cFieldName + " = " + - General::TrimSigDigits(thisDOAS.NumOfAirLoops)); + ShowSevereError(state, + fmt::format("{}, \"{}\" {} = {}", cCurrentModuleObject, thisDOAS.Name, cFieldName, thisDOAS.NumOfAirLoops)); ShowContinueError(state, " The minimum value should be 1."); errorsFound = true; } @@ -1021,8 +1021,8 @@ namespace AirLoopHVACDOAS { if (loop.ConveCount == 0) { ++loop.ConveCount; ShowWarningError(state, "Convergence limit is above 1.0e-6 for unit=" + loop.Name); - ShowContinueErrorTimeStamp(state, "The max difference of node temperatures between AirLoopDOAS outlet and OA mixer inlet =" + - General::RoundSigDigits(maxDiff, 6)); + ShowContinueErrorTimeStamp( + state, format("The max difference of node temperatures between AirLoopDOAS outlet and OA mixer inlet ={:.6R}", maxDiff)); } else { ++loop.ConveCount; ShowRecurringWarningErrorAtEnd(state, loop.Name + diff --git a/src/EnergyPlus/AirflowNetwork/src/Properties.cpp b/src/EnergyPlus/AirflowNetwork/src/Properties.cpp index e880ce854ea..7acc211702c 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Properties.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Properties.cpp @@ -73,18 +73,18 @@ namespace AirflowNetwork { if (lowerLimitErrIdx == 0) { ShowWarningMessage(state, "Air temperature below lower limit of -20C for conductivity calculation"); } - ShowRecurringWarningErrorAtEnd(state, "Air temperature below lower limit of -20C for conductivity calculation. " - "Air temperature of " + General::RoundSigDigits(LowerLimit, 1) + - " used for conductivity calculation.", + ShowRecurringWarningErrorAtEnd(state, format("Air temperature below lower limit of -20C for conductivity calculation. Air temperature of {:.1R} " + "used for conductivity calculation.", + LowerLimit), lowerLimitErrIdx); T = LowerLimit; } else if (T > UpperLimit) { if (upperLimitErrIdx == 0) { ShowWarningMessage(state, "Air temperature above upper limit of 70C for conductivity calculation"); } - ShowRecurringWarningErrorAtEnd(state, "Air temperature below lower limit of 70C for conductivity calculation. " - "Air temperature of " + General::RoundSigDigits(UpperLimit, 1) + - " used for conductivity calculation.", + ShowRecurringWarningErrorAtEnd(state, format("Air temperature above upper limit of 70C for conductivity calculation. Air temperature of {:.1R} " + "used for conductivity calculation.", + UpperLimit), upperLimitErrIdx); T = UpperLimit; } diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index 20aa733c346..79cba0e991f 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -179,7 +179,7 @@ namespace AirflowNetworkBalanceManager { using Fans::GetFanOutletNode; using Fans::GetFanType; using Fans::GetFanVolFlow; - using General::RoundSigDigits; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -377,8 +377,12 @@ namespace AirflowNetworkBalanceManager { if (fields.find("reference_barometric_pressure") != fields.end()) { // not required field, has default value pressure = fields.at("reference_barometric_pressure"); if (std::abs((pressure - StdBaroPress) / StdBaroPress) > 0.1) { // 10% off - ShowWarningError(state, RoutineName + ": " + CurrentModuleObject + ": Pressure = " + RoundSigDigits(pressure, 0) + - " differs by more than 10% from Standard Barometric Pressure = " + RoundSigDigits(StdBaroPress, 0) + '.'); + ShowWarningError(state, + format("{}: {}: Pressure = {:.0R} differs by more than 10% from Standard Barometric Pressure = {:.0R}.", + RoutineName, + CurrentModuleObject, + pressure, + StdBaroPress)); ShowContinueError(state, "...occurs in " + CurrentModuleObject + " = " + thisObjectName); } if (pressure <= 31000.0) { @@ -874,7 +878,7 @@ namespace AirflowNetworkBalanceManager { ShowWarningError(state, RoutineName + ": " + CurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "..This object specifies that only 3 opening factors will be used. So, the value of Opening Factor #2 is set to 1.0."); - ShowContinueError(state, "..Input value was " + RoundSigDigits(MultizoneCompDetOpeningData(i).OpenFac2, 2)); + ShowContinueError(state, format("..Input value was {:.2R}", MultizoneCompDetOpeningData(i).OpenFac2)); MultizoneCompDetOpeningData(i).OpenFac2 = 1.0; } } else if (N >= 3) { @@ -889,7 +893,7 @@ namespace AirflowNetworkBalanceManager { ShowWarningError(state, RoutineName + ": " + CurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "..This object specifies that 4 opening factors will be used. So, the value of Opening Factor #4 " "is set to 1.0."); - ShowContinueError(state, "..Input value was " + RoundSigDigits(MultizoneCompDetOpeningData(i).OpenFac4, 2)); + ShowContinueError(state, format("..Input value was {:.2R}", MultizoneCompDetOpeningData(i).OpenFac4)); MultizoneCompDetOpeningData(i).OpenFac4 = 1.0; } MultizoneCompDetOpeningData(i).DischCoeff4 = cds[3]; // Discharge coefficient for opening factor #4 @@ -901,7 +905,7 @@ namespace AirflowNetworkBalanceManager { ShowWarningError(state, RoutineName + ": " + CurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "..This object specifies that only 3 opening factors will be used. So, the value of Opening Factor #3 " "is set to 1.0."); - ShowContinueError(state, "..Input value was " + RoundSigDigits(MultizoneCompDetOpeningData(i).OpenFac3, 2)); + ShowContinueError(state, format("..Input value was {:.2R}", MultizoneCompDetOpeningData(i).OpenFac3)); MultizoneCompDetOpeningData(i).OpenFac3 = 1.0; } } @@ -1245,8 +1249,11 @@ namespace AirflowNetworkBalanceManager { CurrentModuleObject = "AirflowNetwork:Distribution:Component:Fan"; state.dataAirflowNetworkBalanceManager->DisSysNumOfCVFs = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); if (state.dataAirflowNetworkBalanceManager->DisSysNumOfCVFs > 0 && state.dataAirflowNetworkBalanceManager->DisSysNumOfCVFs != inputProcessor->getNumObjectsFound(state, "AirLoopHVAC")) { - ShowSevereError(state, "The number of entered AirflowNetwork:Distribution:Component:Fan objects is " + RoundSigDigits(state.dataAirflowNetworkBalanceManager->DisSysNumOfCVFs)); - ShowSevereError(state, "The number of entered AirLoopHVAC objects is " + RoundSigDigits(inputProcessor->getNumObjectsFound(state, "AirLoopHVAC"))); + ShowSevereError(state, + format("The number of entered AirflowNetwork:Distribution:Component:Fan objects is {}", + state.dataAirflowNetworkBalanceManager->DisSysNumOfCVFs)); + ShowSevereError(state, + format("The number of entered AirLoopHVAC objects is {}", inputProcessor->getNumObjectsFound(state, "AirLoopHVAC"))); ShowContinueError(state, "Both numbers should be equal. Please check your inputs."); success = false; } @@ -1666,16 +1673,18 @@ namespace AirflowNetworkBalanceManager { state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinOpeningTime = Numbers(1); if (state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinOpeningTime < 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(1) + " < 0.0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinOpeningTime, 1) + - ", Value will be reset to 0.0"); + ShowContinueError(state, + format("..Input value = {:.1R}, Value will be reset to 0.0", + state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinOpeningTime)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).Name); state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinOpeningTime = 0.0; } state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinClosingTime = Numbers(2); if (state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinClosingTime < 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(2) + " < 0.0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinClosingTime, 1) + - ", Value will be reset to 0.0"); + ShowContinueError(state, + format("..Input value = {:.1R}, Value will be reset to 0.0", + state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinClosingTime)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).Name); state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MinClosingTime = 0.0; } @@ -1723,8 +1732,9 @@ namespace AirflowNetworkBalanceManager { state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).ComfortBouPoint = Numbers(3); if (state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).ComfortBouPoint < 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(3) + " < 0.0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).ComfortBouPoint, 1) + - ", Value will be reset to 10.0 as default"); + ShowContinueError(state, + format("..Input value = {:.1R}, Value will be reset to 10.0 as default", + state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).ComfortBouPoint)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).Name); state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).ComfortBouPoint = 10.0; } @@ -1735,8 +1745,10 @@ namespace AirflowNetworkBalanceManager { CurveValue(state, state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).ComfortHighTempCurveNum, Numbers(3))) > 0.1) { ShowSevereError(state, RoutineName + CurrentModuleObject + " object: The difference of both curve values at boundary point > 0.1"); ShowContinueError(state, "Both curve names are = " + cAlphaFields(2) + " and " + cAlphaFields(3)); - ShowContinueError(state, "The input value of " + cNumericFields(3) + " = " + - RoundSigDigits(state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).ComfortBouPoint, 1)); + ShowContinueError(state, + format("The input value of {} = {:.1R}", + cNumericFields(3), + state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).ComfortBouPoint)); ErrorsFound = true; } } @@ -1744,8 +1756,9 @@ namespace AirflowNetworkBalanceManager { state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MaxPPD = Numbers(4); if (state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MaxPPD < 0.0 || state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MaxPPD > 100.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(4) + " beyond 0.0 and 100.0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MaxPPD, 1) + - ", Value will be reset to 10.0 as default"); + ShowContinueError(state, + format("..Input value = {:.1R}, Value will be reset to 10.0 as default", + state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MaxPPD)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).Name); state.dataAirflowNetworkBalanceManager->OccupantVentilationControl(i).MaxPPD = 10.0; } @@ -2149,7 +2162,7 @@ namespace AirflowNetworkBalanceManager { } if (MultizoneZoneData(i).OpenFactor > 1.0 || MultizoneZoneData(i).OpenFactor < 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(1) + " is out of range [0.0,1.0]"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneZoneData(i).OpenFactor, 2) + ", Value will be set to 1.0"); + ShowContinueError(state, format("..Input value = {:.2R}, Value will be set to 1.0", MultizoneZoneData(i).OpenFactor)); MultizoneZoneData(i).OpenFactor = 1.0; } @@ -2158,20 +2171,22 @@ namespace AirflowNetworkBalanceManager { if (SELECT_CASE_var == "TEMPERATURE") { // checks on Temperature control if (MultizoneZoneData(i).LowValueTemp < 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(2) + " < 0.0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneZoneData(i).LowValueTemp, 1) + ", Value will be set to 0.0"); + ShowContinueError(state, format("..Input value = {:.1R}, Value will be set to 0.0", MultizoneZoneData(i).LowValueTemp)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + MultizoneZoneData(i).ZoneName); MultizoneZoneData(i).LowValueTemp = 0.0; } if (MultizoneZoneData(i).LowValueTemp >= 100.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(2) + " >= 100.0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneZoneData(i).LowValueTemp, 1) + ", Value will be reset to 0.0"); + ShowContinueError(state, format("..Input value = {:.1R}, Value will be reset to 0.0", MultizoneZoneData(i).LowValueTemp)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + MultizoneZoneData(i).ZoneName); MultizoneZoneData(i).LowValueTemp = 0.0; } if (MultizoneZoneData(i).UpValueTemp <= MultizoneZoneData(i).LowValueTemp) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(3) + " <= " + cNumericFields(2)); - ShowContinueError(state, "..Input value for " + cNumericFields(3) + " = " + RoundSigDigits(MultizoneZoneData(i).UpValueTemp, 1) + - ", Value will be reset to 100.0"); + ShowContinueError(state, + format("..Input value for {} = {:.1R}, Value will be reset to 100.0", + cNumericFields(3), + MultizoneZoneData(i).UpValueTemp)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + MultizoneZoneData(i).ZoneName); MultizoneZoneData(i).UpValueTemp = 100.0; } @@ -2179,21 +2194,22 @@ namespace AirflowNetworkBalanceManager { } else if (SELECT_CASE_var == "ENTHALPY") { // checks for Enthalpy control if (MultizoneZoneData(i).LowValueEnth < 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(4) + " < 0.0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneZoneData(i).LowValueEnth, 1) + ", Value will be reset to 0.0"); + ShowContinueError(state, format("..Input value = {:.1R}, Value will be reset to 0.0", MultizoneZoneData(i).LowValueEnth)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + MultizoneZoneData(i).ZoneName); MultizoneZoneData(i).LowValueEnth = 0.0; } if (MultizoneZoneData(i).LowValueEnth >= 300000.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(4) + " >= 300000.0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneZoneData(i).LowValueEnth, 1) + - ", Value will be reset to 0.0."); + ShowContinueError(state, format("..Input value = {:.1R}, Value will be reset to 0.0.", MultizoneZoneData(i).LowValueEnth)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + MultizoneZoneData(i).ZoneName); MultizoneZoneData(i).LowValueEnth = 0.0; } if (MultizoneZoneData(i).UpValueEnth <= MultizoneZoneData(i).LowValueEnth) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, " + cNumericFields(5) + " <= " + cNumericFields(4)); - ShowContinueError(state, "..Input value for " + cNumericFields(5) + "= " + RoundSigDigits(MultizoneZoneData(i).UpValueEnth, 1) + - ", Value will be reset to 300000.0"); + ShowContinueError(state, + format("..Input value for {}= {:.1R}, Value will be reset to 300000.0", + cNumericFields(5), + MultizoneZoneData(i).UpValueEnth)); ShowContinueError(state, "..for " + cAlphaFields(1) + " = \"" + MultizoneZoneData(i).ZoneName); MultizoneZoneData(i).UpValueEnth = 300000.0; } @@ -2258,7 +2274,7 @@ namespace AirflowNetworkBalanceManager { if (UtilityRoutines::SameString(AirflowNetworkSimu.HeightOption, "ExternalNode") && lNumericBlanks(1)) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object =" + Alphas(1) + ". The input of " + cNumericFields(1) + " is required, but a blank is found."); - ShowContinueError(state, "The default value is assigned as " + RoundSigDigits(Numbers(1), 1)); + ShowContinueError(state, format("The default value is assigned as {:.1R}", Numbers(1))); } MultizoneExternalNodeData(i).ExtNum = AirflowNetworkNumOfZones + i; // External node number MultizoneExternalNodeData(i).curve = CurveManager::GetCurveIndex(state, Alphas(2)); // Wind pressure curve @@ -2389,7 +2405,7 @@ namespace AirflowNetworkBalanceManager { if (MultizoneSurfaceData(i).Factor > 1.0 || MultizoneSurfaceData(i).Factor <= 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object=" + MultizoneSurfaceData(i).SurfName + ", " + cNumericFields(1) + " is out of range (0.0,1.0]"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneSurfaceData(i).Factor, 2) + ", Value will be set to 1.0"); + ShowContinueError(state, format("..Input value = {:.2R}, Value will be set to 1.0", MultizoneSurfaceData(i).Factor)); MultizoneSurfaceData(i).Factor = 1.0; } // Get input of ventilation control and associated data @@ -2807,8 +2823,10 @@ namespace AirflowNetworkBalanceManager { "surfaces defined in " + CurrentModuleObject + " objects "); ShowContinueError(state, "has to be equal to the number of AirflowNetwork:MultiZone:ExternalNode objects."); - ShowContinueError(state, "The entered number of external nodes is " + RoundSigDigits(state.dataAirflowNetworkBalanceManager->AirflowNetworkNumOfExtNode) + - ". The entered number of external surfaces is " + RoundSigDigits(state.dataAirflowNetworkBalanceManager->AirflowNetworkNumOfExtSurfaces) + '.'); + ShowContinueError(state, + format("The entered number of external nodes is {}. The entered number of external surfaces is {}.", + state.dataAirflowNetworkBalanceManager->AirflowNetworkNumOfExtNode, + state.dataAirflowNetworkBalanceManager->AirflowNetworkNumOfExtSurfaces)); ErrorsFound = true; } } @@ -2898,22 +2916,22 @@ namespace AirflowNetworkBalanceManager { } if (MultizoneSurfaceData(i).LowValueTemp < 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, Low Temperature difference value < 0.0d0"); - ShowContinueError(state, "..Input value=" + RoundSigDigits(MultizoneSurfaceData(i).LowValueTemp, 1) + - ", Value will be reset to 0.0."); + ShowContinueError(state, + format("..Input value={:.1R}, Value will be reset to 0.0.", MultizoneSurfaceData(i).LowValueTemp)); ShowContinueError(state, "..for Surface = \"" + MultizoneSurfaceData(i).SurfName + "\""); MultizoneSurfaceData(i).LowValueTemp = 0.0; } if (MultizoneSurfaceData(i).LowValueTemp >= 100.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, Low Temperature difference value >= 100.0d0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneSurfaceData(i).LowValueTemp, 1) + - ", Value will be reset to 0.0"); + ShowContinueError(state, + format("..Input value = {:.1R}, Value will be reset to 0.0", MultizoneSurfaceData(i).LowValueTemp)); ShowContinueError(state, "..for Surface = \"" + MultizoneSurfaceData(i).SurfName + "\""); MultizoneZoneData(i).LowValueTemp = 0.0; } if (MultizoneSurfaceData(i).UpValueTemp <= MultizoneSurfaceData(i).LowValueTemp) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, Upper Temperature <= Lower Temperature difference value."); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneSurfaceData(i).UpValueTemp, 1) + - ", Value will be reset to 100.0"); + ShowContinueError(state, + format("..Input value = {:.1R}, Value will be reset to 100.0", MultizoneSurfaceData(i).UpValueTemp)); ShowContinueError(state, "..for Surface = \"" + MultizoneSurfaceData(i).SurfName + "\""); MultizoneSurfaceData(i).UpValueTemp = 100.0; } @@ -2934,22 +2952,22 @@ namespace AirflowNetworkBalanceManager { } if (MultizoneSurfaceData(i).LowValueEnth < 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, Low Enthalpy difference value < 0.0d0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneSurfaceData(i).LowValueEnth, 1) + - ", Value will be reset to 0.0"); + ShowContinueError(state, + format("..Input value = {:.1R}, Value will be reset to 0.0", MultizoneSurfaceData(i).LowValueEnth)); ShowContinueError(state, "..for Surface = \"" + MultizoneSurfaceData(i).SurfName + "\""); MultizoneSurfaceData(i).LowValueEnth = 0.0; } if (MultizoneSurfaceData(i).LowValueEnth >= 300000.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, Low Enthalpy difference value >= 300000.0"); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneSurfaceData(i).LowValueEnth, 1) + - ", Value will be reset to 0.0"); + ShowContinueError(state, + format("..Input value = {:.1R}, Value will be reset to 0.0", MultizoneSurfaceData(i).LowValueEnth)); ShowContinueError(state, "..for Surface = \"" + MultizoneSurfaceData(i).SurfName + "\""); MultizoneZoneData(i).LowValueEnth = 0.0; } if (MultizoneSurfaceData(i).UpValueEnth <= MultizoneSurfaceData(i).LowValueEnth) { ShowWarningError(state, RoutineName + CurrentModuleObject + " object, Upper Enthalpy <= Lower Enthalpy difference value."); - ShowContinueError(state, "..Input value = " + RoundSigDigits(MultizoneSurfaceData(i).UpValueEnth, 1) + - ", Value will be set to 300000.0"); + ShowContinueError(state, + format("..Input value = {:.1R}, Value will be set to 300000.0", MultizoneSurfaceData(i).UpValueEnth)); ShowContinueError(state, "..for Surface = \"" + MultizoneSurfaceData(i).SurfName + "\""); MultizoneSurfaceData(i).UpValueEnth = 300000.0; } @@ -3021,8 +3039,11 @@ namespace AirflowNetworkBalanceManager { ShowWarningError(state, RoutineName + "SurfaceAverageCalculation is entered for field = Wind Pressure Coefficient Type."); ShowContinueError(state, "The AirflowNetwork model provides wind pressure coefficients for 4 vertical exterior orientations and 1 horizontal roof."); - ShowContinueError(state, " There are only " + RoundSigDigits(n) + - " exterior surface orientations defined in this input file using AirflowNetwork:MultiZone:Surface objects."); + ShowContinueError( + state, + format( + " There are only {} exterior surface orientations defined in this input file using AirflowNetwork:MultiZone:Surface objects.", + n)); ShowContinueError(state, "Reconsider if this is your modeling intent. Simulation continues."); } } @@ -4676,7 +4697,7 @@ namespace AirflowNetworkBalanceManager { "The inputs of component name field as a heat exchanger in AIRFLOWNETWORK:DISTRIBUTION:LINKAGE is not correct"); ShowContinueError(state, "The entered name of heat exchanger is " + DisSysCompHXData(i).name + " in AirflowNetwork:Distribution:Component:HeatExchanger objects"); - ShowContinueError(state, "The correct appearance number is 2. The entered appearance number is " + RoundSigDigits(count)); + ShowContinueError(state, format("The correct appearance number is 2. The entered appearance number is {}", count)); ErrorsFound = true; } if ((!DisSysCompHXData(i).CoilParentExists) && count != 1) { @@ -4684,7 +4705,7 @@ namespace AirflowNetworkBalanceManager { "The inputs of component name field as a heat exchanger in AIRFLOWNETWORK:DISTRIBUTION:LINKAGE is not correct"); ShowContinueError(state, "The entered name of heat exchanger is " + DisSysCompHXData(i).name + " in AirflowNetwork:Distribution:Component:HeatExchanger objects"); - ShowContinueError(state, "The correct appearance number is 1. The entered appearance number is " + RoundSigDigits(count)); + ShowContinueError(state, format("The correct appearance number is 1. The entered appearance number is {}", count)); ErrorsFound = true; } } @@ -5839,7 +5860,7 @@ namespace AirflowNetworkBalanceManager { if (MultizoneSurfaceData(i).ExtLargeOpeningErrCount < 2) { ShowWarningError(state, "AirflowNetwork: The window or door is open during HVAC system operation " + MultizoneSurfaceData(i).SurfName); - ShowContinueError(state, "The window or door opening factor is " + RoundSigDigits(MultizoneSurfaceData(i).OpenFactor, 2)); + ShowContinueError(state, format("The window or door opening factor is {:.2R}", MultizoneSurfaceData(i).OpenFactor)); ShowContinueErrorTimeStamp(state, ""); } else { ShowRecurringWarningErrorAtEnd(state, "AirFlowNetwork: " + MultizoneSurfaceData(i).SurfName + @@ -5929,8 +5950,8 @@ namespace AirflowNetworkBalanceManager { ++ErrCountLowPre; ShowWarningError(state, "The calculated pressure with minimum exhaust fan rate is lower than the pressure setpoint. The pressure " "control is unable to perform."); - ShowContinueErrorTimeStamp(state, "Calculated pressure = " + RoundSigDigits(ZonePressure1, 2) + - "[Pa], Pressure setpoint =" + RoundSigDigits(PressureSet, 2)); + ShowContinueErrorTimeStamp(state, + format("Calculated pressure = {:.2R}[Pa], Pressure setpoint ={:.2R}", ZonePressure1, PressureSet)); } else { ++ErrCountLowPre; ShowRecurringWarningErrorAtEnd(state, AirflowNetworkNodeData(PressureControllerData(1).AFNNodeNum).Name + @@ -5951,8 +5972,8 @@ namespace AirflowNetworkBalanceManager { ++ErrCountHighPre; ShowWarningError(state, "The calculated pressure with maximum exhaust fan rate is higher than the pressure setpoint. The " "pressure control is unable to perform."); - ShowContinueErrorTimeStamp(state, "Calculated pressure = " + RoundSigDigits(ZonePressure2, 2) + - "[Pa], Pressure setpoint = " + RoundSigDigits(PressureSet, 2)); + ShowContinueErrorTimeStamp( + state, format("Calculated pressure = {:.2R}[Pa], Pressure setpoint = {:.2R}", ZonePressure2, PressureSet)); } else { ++ErrCountHighPre; ShowRecurringWarningErrorAtEnd(state, @@ -5973,7 +5994,7 @@ namespace AirflowNetworkBalanceManager { if (ErrCountVar == 0) { ++ErrCountVar; ShowWarningError(state, "Iteration limit exceeded pressure setpoint using an exhaust fan. Simulation continues."); - ShowContinueErrorTimeStamp(state, "Exhaust fan flow rate = " + RoundSigDigits(ExhaustFanMassFlowRate, 4)); + ShowContinueErrorTimeStamp(state, format("Exhaust fan flow rate = {:.4R}", ExhaustFanMassFlowRate)); } else { ++ErrCountVar; ShowRecurringWarningErrorAtEnd(state, PressureControllerData(1).Name + @@ -6008,8 +6029,8 @@ namespace AirflowNetworkBalanceManager { ++ErrCountLowPre; ShowWarningError(state, "The calculated pressure with minimum relief air rate is lower than the pressure setpoint. The pressure " "control is unable to perform."); - ShowContinueErrorTimeStamp(state, "Calculated pressure = " + RoundSigDigits(ZonePressure1, 2) + - "[Pa], Pressure setpoint =" + RoundSigDigits(PressureSet, 2)); + ShowContinueErrorTimeStamp(state, + format("Calculated pressure = {:.2R}[Pa], Pressure setpoint ={:.2R}", ZonePressure1, PressureSet)); } else { ++ErrCountLowPre; ShowRecurringWarningErrorAtEnd(state, AirflowNetworkNodeData(PressureControllerData(1).AFNNodeNum).Name + @@ -6031,8 +6052,8 @@ namespace AirflowNetworkBalanceManager { ++ErrCountHighPre; ShowWarningError(state, "The calculated pressure with maximum relief air rate is higher than the pressure setpoint. The " "pressure control is unable to perform."); - ShowContinueErrorTimeStamp(state, "Calculated pressure = " + RoundSigDigits(ZonePressure2, 2) + - "[Pa], Pressure setpoint = " + RoundSigDigits(PressureSet, 2)); + ShowContinueErrorTimeStamp( + state, format("Calculated pressure = {:.2R}[Pa], Pressure setpoint = {:.2R}", ZonePressure2, PressureSet)); } else { ++ErrCountHighPre; ShowRecurringWarningErrorAtEnd(state, @@ -6052,7 +6073,7 @@ namespace AirflowNetworkBalanceManager { if (ErrCountVar == 0) { ++ErrCountVar; ShowWarningError(state, "Iteration limit exceeded pressure setpoint using relief air. Simulation continues."); - ShowContinueErrorTimeStamp(state, "Relief air flow rate = " + RoundSigDigits(ReliefMassFlowRate, 4)); + ShowContinueErrorTimeStamp(state, format("Relief air flow rate = {:.4R}", ReliefMassFlowRate)); } else { ++ErrCountVar; ShowRecurringWarningErrorAtEnd(state, PressureControllerData(1).Name + @@ -6366,7 +6387,7 @@ namespace AirflowNetworkBalanceManager { } // End of wind direction loop // Add new table vals[12] = vals[0]; // Enforce periodicity - curveIndex[FacadeNum - 1] = AirflowNetworkBalanceManager::makeTable(state, "!WPCTABLE" + std::to_string(FacadeNum), dirs30GridIndex, vals); + curveIndex[FacadeNum - 1] = AirflowNetworkBalanceManager::makeTable(state, format("!WPCTABLE{}", FacadeNum), dirs30GridIndex, vals); } // End of facade number loop } else { //-calculate the advanced single sided wind pressure coefficients @@ -6444,14 +6465,17 @@ namespace AirflowNetworkBalanceManager { for (FacadeNum = 1; FacadeNum <= 4; ++FacadeNum) { valsByFacade[FacadeNum - 1].push_back(valsByFacade[FacadeNum - 1][0]); // Enforce periodicity - curveIndex[FacadeNum - 1] = AirflowNetworkBalanceManager::makeTable(state, "!SSWPCTABLEFACADE" + std::to_string(FacadeNum), dirs10GridIndex, valsByFacade[FacadeNum - 1]); + curveIndex[FacadeNum - 1] = AirflowNetworkBalanceManager::makeTable( + state, format("!SSWPCTABLEFACADE{}", FacadeNum), dirs10GridIndex, valsByFacade[FacadeNum - 1]); } FacadeNum = 5; valsByFacade[FacadeNum - 1].push_back(valsByFacade[FacadeNum - 1][0]); // Enforce periodicity - curveIndex[FacadeNum - 1] = AirflowNetworkBalanceManager::makeTable(state, "!SSWPCTABLEFACADE" + std::to_string(FacadeNum), dirs30GridIndex, valsByFacade[FacadeNum - 1]); + curveIndex[FacadeNum - 1] = AirflowNetworkBalanceManager::makeTable( + state, format("!SSWPCTABLEFACADE{}", FacadeNum), dirs30GridIndex, valsByFacade[FacadeNum - 1]); for (unsigned facadeNum = 6; facadeNum <= valsByFacade.size(); ++facadeNum) { valsByFacade[facadeNum - 1].push_back(valsByFacade[facadeNum - 1][0]); // Enforce periodicity - curveIndex[facadeNum - 1] = AirflowNetworkBalanceManager::makeTable(state, "!SSWPCTABLE" + std::to_string(facadeNum), dirs10GridIndex, valsByFacade[facadeNum - 1]); + curveIndex[facadeNum - 1] = + AirflowNetworkBalanceManager::makeTable(state, format("!SSWPCTABLE{}", facadeNum), dirs10GridIndex, valsByFacade[facadeNum - 1]); } } // Connect the external nodes to the new curves @@ -8907,10 +8931,11 @@ namespace AirflowNetworkBalanceManager { "is above 10% with fan operation mode = ContFanCycCoil."); ShowContinueError(state, "The added zone loads using the AirflowNetwork model may not be accurate because the zone loads are " "calculated based on the mass flow rate during HVAC operation."); - ShowContinueError(state, - "The mass flow rate during HVAC operation = " + RoundSigDigits(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOnMassFlowrate, 2) + - " The mass flow rate during no HVAC operation = " + - RoundSigDigits(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOffMassFlowrate, 2)); + ShowContinueError( + state, + format("The mass flow rate during HVAC operation = {:.2R} The mass flow rate during no HVAC operation = {:.2R}", + state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOnMassFlowrate, + state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOffMassFlowrate)); state.dataAirflowNetworkBalanceManager->UpdateAirflowNetworkMyOneTimeFlag = false; } } @@ -8941,8 +8966,10 @@ namespace AirflowNetworkBalanceManager { ShowWarningError(state, "The mass flow rate difference is found between System Node = '" + NodeID(AirflowNetworkNodeData(Node3).EPlusNodeNum) + "' and AFN Link = '" + AirflowNetworkLinkageData(i).Name + "'."); - ShowContinueError(state, "The system node max mass flow rate = " + RoundSigDigits(NodeMass, 3) + - " kg/s. The AFN node mass flow rate = " + RoundSigDigits(AFNMass, 3) + " kg.s."); + ShowContinueError(state, + format("The system node max mass flow rate = {:.3R} kg/s. The AFN node mass flow rate = {:.3R} kg.s.", + NodeMass, + AFNMass)); WriteFlag = true; } } @@ -10341,8 +10368,10 @@ namespace AirflowNetworkBalanceManager { if (state.dataAirflowNetworkBalanceManager->NumOfExhaustFans != AirflowNetworkNumOfExhFan) { ShowSevereError(state, RoutineName + "The number of " + CurrentModuleObject + " is not equal to the number of Fan:ZoneExhaust fans defined in ZoneHVAC:EquipmentConnections"); - ShowContinueError(state, "The number of " + CurrentModuleObject + " is " + RoundSigDigits(AirflowNetworkNumOfExhFan)); - ShowContinueError(state, "The number of Zone exhaust fans defined in ZoneHVAC:EquipmentConnections is " + RoundSigDigits(state.dataAirflowNetworkBalanceManager->NumOfExhaustFans)); + ShowContinueError(state, format("The number of {} is {}", CurrentModuleObject, AirflowNetworkNumOfExhFan)); + ShowContinueError(state, + format("The number of Zone exhaust fans defined in ZoneHVAC:EquipmentConnections is {}", + state.dataAirflowNetworkBalanceManager->NumOfExhaustFans)); ErrorsFound = true; } @@ -10660,11 +10689,12 @@ namespace AirflowNetworkBalanceManager { ShowContinueError(state, "The wind pressure coefficient model for this zone will be set to \"STANDARD\" and simulation continues."); MultizoneZoneData(AFNZnNum).SingleSidedCpType = "STANDARD"; } else if (NumofExtSurfInZone(AFNZnNum) > 2) { - ShowWarningError(state, "AirflowNetwork:Multizone:Zone = " + MultizoneZoneData(AFNZnNum).ZoneName + - " has single side wind pressure coefficient type \"ADVANCED\", but has " + - RoundSigDigits(NumofExtSurfInZone(AFNZnNum)) + - " exterior AirflowNetwork:MultiZone:Component:DetailedOpening and/or " - "AirflowNetwork:MultiZone:Component:SimpleOpening objects."); + ShowWarningError( + state, + format("AirflowNetwork:Multizone:Zone = {} has single side wind pressure coefficient type \"ADVANCED\", but has {} exterior " + "AirflowNetwork:MultiZone:Component:DetailedOpening and/or AirflowNetwork:MultiZone:Component:SimpleOpening objects.", + MultizoneZoneData(AFNZnNum).ZoneName, + NumofExtSurfInZone(AFNZnNum))); ShowContinueError(state, "Zones must have exactly two openings in order for the \"ADVANCED\" single side wind pressure coefficient " "model to be used."); ShowContinueError(state, "The wind pressure coefficient model for this zone will be set to \"STANDARD\" and simulation continues."); diff --git a/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc b/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc index 478423c881d..a49727f53a4 100644 --- a/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc +++ b/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc @@ -168,11 +168,10 @@ Real64 ASHRAEMinSATCoolingSizer::size(EnergyPlusData &state, Real64 _originalVal this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; this->addErrorMessage(msg); ShowSevereError(state, msg); - msg = "SizingString = " + this->sizingString + - ", DataCapacityUsedForSizing = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 1); + msg = format("SizingString = {}, DataCapacityUsedForSizing = {:.1T}", this->sizingString, this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "SizingString = " + this->sizingString + ", DataFlowUsedForSizing = " + General::TrimSigDigits(this->dataFlowUsedForSizing, 1); + msg = format("SizingString = {}, DataFlowUsedForSizing = {:.1T}", this->sizingString, this->dataFlowUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); } @@ -192,15 +191,13 @@ Real64 ASHRAEMinSATCoolingSizer::size(EnergyPlusData &state, Real64 _originalVal this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; this->addErrorMessage(msg); ShowSevereError(state, msg); - msg = "SizingString = " + this->sizingString + - ", DataCapacityUsedForSizing = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 1); + msg = format("SizingString = {}, DataCapacityUsedForSizing = {:.1T}", this->sizingString, this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "SizingString = " + this->sizingString + ", DataFlowUsedForSizing = " + General::TrimSigDigits(this->dataFlowUsedForSizing, 1); + msg = format("SizingString = {}, DataFlowUsedForSizing = {:.1T}", this->sizingString, this->dataFlowUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "SizingString = " + this->sizingString + - ", DataZoneUsedForSizing = " + General::TrimSigDigits(Real64(this->dataZoneUsedForSizing), 0); + msg = format("SizingString = {}, DataZoneUsedForSizing = {:.0T}", this->sizingString, Real64(this->dataZoneUsedForSizing)); ShowContinueError(state, msg); } } @@ -230,11 +227,10 @@ Real64 ASHRAEMaxSATHeatingSizer::size(EnergyPlusData &state, Real64 _originalVal this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; this->addErrorMessage(msg); ShowSevereError(state, msg); - msg = "SizingString = " + this->sizingString + - ", DataCapacityUsedForSizing = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 1); + msg = format("SizingString = {}, DataCapacityUsedForSizing = {:.1T}", this->sizingString, this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "SizingString = " + this->sizingString + ", DataFlowUsedForSizing = " + General::TrimSigDigits(this->dataFlowUsedForSizing, 1); + msg = format("SizingString = {}, DataFlowUsedForSizing = {:.1T}", this->sizingString, this->dataFlowUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); } @@ -254,15 +250,13 @@ Real64 ASHRAEMaxSATHeatingSizer::size(EnergyPlusData &state, Real64 _originalVal this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; this->addErrorMessage(msg); ShowSevereError(state, msg); - msg = "SizingString = " + this->sizingString + - ", DataCapacityUsedForSizing = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 1); + msg = format("SizingString = {}, DataCapacityUsedForSizing = {:.1T}", this->sizingString, this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "SizingString = " + this->sizingString + ", DataFlowUsedForSizing = " + General::TrimSigDigits(this->dataFlowUsedForSizing, 1); + msg = format("SizingString = {}, DataFlowUsedForSizing = {:.1T}", this->sizingString, this->dataFlowUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "SizingString = " + this->sizingString + - ", DataZoneUsedForSizing = " + General::TrimSigDigits(Real64(this->dataZoneUsedForSizing), 0); + msg = format("SizingString = {}, DataZoneUsedForSizing = {:.0T}", this->sizingString, Real64(this->dataZoneUsedForSizing)); ShowContinueError(state, msg); } } diff --git a/src/EnergyPlus/Autosizing/Base.cc b/src/EnergyPlus/Autosizing/Base.cc index 3a1963d184b..7c0296fef90 100644 --- a/src/EnergyPlus/Autosizing/Base.cc +++ b/src/EnergyPlus/Autosizing/Base.cc @@ -401,11 +401,10 @@ void BaseSizer::selectSizerOutput(EnergyPlusData &state, bool &errorsFound) std::string msg = this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName; this->addErrorMessage(msg); ShowMessage(state, msg); - msg = - "User-Specified " + this->sizingStringScalable + this->sizingString + " = " + General::RoundSigDigits(this->originalValue, 5); + msg = format("User-Specified {}{} = {:.5R}", this->sizingStringScalable, this->sizingString, this->originalValue); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "differs from Design Size " + this->sizingString + " = " + General::RoundSigDigits(this->autoSizedValue, 5); + msg = format("differs from Design Size {} = {:.5R}", this->sizingString, this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); msg = "This may, or may not, indicate mismatched component sizes."; @@ -421,7 +420,7 @@ void BaseSizer::selectSizerOutput(EnergyPlusData &state, bool &errorsFound) std::string msg = this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; this->addErrorMessage(msg); ShowSevereError(state, msg); - msg = "SizingString = " + this->sizingString + ", SizingResult = " + General::TrimSigDigits(this->originalValue, 1); + msg = format("SizingString = {}, SizingResult = {:.1T}", this->sizingString, this->originalValue); this->addErrorMessage(msg); ShowContinueError(state, msg); this->errorType = AutoSizingResultType::ErrorType1; @@ -527,11 +526,10 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro std::string msg = this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName; this->addErrorMessage(msg); ShowMessage(state, msg); - msg = - "User-Specified " + this->sizingStringScalable + this->sizingString + " = " + General::RoundSigDigits(this->originalValue, 5); + msg = format("User-Specified {}{} = {:.5R}", this->sizingStringScalable, this->sizingString, this->originalValue); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "differs from Design Size " + this->sizingString + " = " + General::RoundSigDigits(this->autoSizedValue, 5); + msg = format("differs from Design Size {} = {:.5R}", this->sizingString, this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); msg = "This may, or may not, indicate mismatched component sizes."; @@ -547,7 +545,7 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro std::string msg = this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; this->addErrorMessage(msg); ShowSevereError(state, msg); - msg = "SizingString = " + this->sizingString + ", SizingResult = " + General::TrimSigDigits(this->originalValue, 1); + msg = format("SizingString = {}, SizingResult = {:.1T}", this->sizingString, this->originalValue); this->addErrorMessage(msg); ShowContinueError(state, msg); this->errorType = AutoSizingResultType::ErrorType1; diff --git a/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc b/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc index 0344152c560..d59c6125315 100644 --- a/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc @@ -91,9 +91,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else { if (DataSizing::ZoneCoolingOnlyFan) { @@ -102,11 +103,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -114,11 +114,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; @@ -126,11 +125,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; @@ -138,11 +136,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow, @@ -152,24 +149,20 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -180,24 +173,20 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -209,9 +198,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -219,9 +209,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; @@ -229,9 +220,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; @@ -239,9 +231,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -253,11 +246,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -265,11 +257,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -282,11 +273,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -294,11 +284,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -309,9 +298,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -319,9 +309,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; @@ -329,9 +320,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; @@ -339,9 +331,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -353,11 +346,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -365,11 +357,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -382,11 +373,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -394,11 +384,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -409,9 +398,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -419,9 +409,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; @@ -429,9 +420,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -439,9 +431,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity, @@ -451,22 +444,20 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -477,22 +468,20 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -503,9 +492,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -513,9 +503,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; @@ -523,9 +514,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -533,9 +525,10 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity, @@ -545,22 +538,20 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -571,22 +562,20 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -658,7 +647,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b std::string msg = this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; ShowSevereError(state, msg); this->addErrorMessage(msg); - msg = "SizingString = " + this->sizingString + ", SizingResult = " + General::TrimSigDigits(this->autoSizedValue, 1); + msg = format("SizingString = {}, SizingResult = {:.1T}", this->sizingString, this->autoSizedValue); ShowContinueError(state, msg); this->addErrorMessage(msg); errorsFound = true; diff --git a/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc b/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc index a1f6cea1ac4..1446744d397 100644 --- a/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc @@ -220,31 +220,27 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->dataDesAccountForFanHeat = true; // reset for next water coil if (state.dataGlobal->DisplayExtraWarnings && this->autoSizedValue <= 0.0) { ShowWarningMessage(state, this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName); - ShowContinueError(state, "...Rated Total Cooling Capacity = " + General::TrimSigDigits(this->autoSizedValue, 2) + " [W]"); + ShowContinueError(state, format("...Rated Total Cooling Capacity = {:.2T} [W]", this->autoSizedValue)); if (this->zoneEqSizing(this->curZoneEqNum).CoolingCapacity) { - ShowContinueError(state, "...Capacity passed by parent object to size child component = " + - General::TrimSigDigits(this->autoSizedValue, 2) + " [W]"); + ShowContinueError(state, + format("...Capacity passed by parent object to size child component = {:.2T} [W]", this->autoSizedValue)); } else { if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER") || UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER:DETAILEDGEOMETRY") || UtilityRoutines::SameString(this->compType, "ZONEHVAC:IDEALLOADSAIRSYSTEM")) { if (this->termUnitIU || this->zoneEqFanCoil) { - ShowContinueError(state, "...Capacity passed by parent object to size child component = " + - General::TrimSigDigits(this->autoSizedValue, 2) + " [W]"); + ShowContinueError( + state, format("...Capacity passed by parent object to size child component = {:.2T} [W]", this->autoSizedValue)); } else { - ShowContinueError(state, "...Air flow rate used for sizing = " + General::TrimSigDigits(DesVolFlow, 5) + " [m3/s]"); - ShowContinueError(state, "...Coil inlet air temperature used for sizing = " + General::TrimSigDigits(CoilInTemp, 2) + - " [C]"); - ShowContinueError(state, "...Coil outlet air temperature used for sizing = " + General::TrimSigDigits(CoilOutTemp, 2) + - " [C]"); + ShowContinueError(state, format("...Air flow rate used for sizing = {:.5T} [m3/s]", DesVolFlow)); + ShowContinueError(state, format("...Coil inlet air temperature used for sizing = {:.2T} [C]", CoilInTemp)); + ShowContinueError(state, format("...Coil outlet air temperature used for sizing = {:.2T} [C]", CoilOutTemp)); } } else { if (CoilOutTemp > -999.0) { - ShowContinueError(state, "...Air flow rate used for sizing = " + General::TrimSigDigits(DesVolFlow, 5) + " [m3/s]"); - ShowContinueError(state, "...Coil inlet air temperature used for sizing = " + General::TrimSigDigits(CoilInTemp, 2) + - " [C]"); - ShowContinueError(state, "...Coil outlet air temperature used for sizing = " + General::TrimSigDigits(CoilOutTemp, 2) + - " [C]"); + ShowContinueError(state, format("...Air flow rate used for sizing = {:.5T} [m3/s]", DesVolFlow)); + ShowContinueError(state, format("...Coil inlet air temperature used for sizing = {:.2T} [C]", CoilInTemp)); + ShowContinueError(state, format("...Coil outlet air temperature used for sizing = {:.2T} [C]", CoilOutTemp)); } else { ShowContinueError(state, "...Capacity used to size child component set to 0 [W]"); } @@ -445,18 +441,18 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->dataDesAccountForFanHeat = true; // reset for next water coil if (state.dataGlobal->DisplayExtraWarnings && this->autoSizedValue <= 0.0) { ShowWarningMessage(state, this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName); - ShowContinueError(state, "...Rated Total Cooling Capacity = " + General::TrimSigDigits(this->autoSizedValue, 2) + " [W]"); + ShowContinueError(state, format("...Rated Total Cooling Capacity = {:.2T} [W]", this->autoSizedValue)); if (this->oaSysFlag || this->airLoopSysFlag || this->finalSysSizing(this->curSysNum).CoolingCapMethod == DataSizing::CapacityPerFloorArea || (this->finalSysSizing(this->curSysNum).CoolingCapMethod == DataSizing::CoolingDesignCapacity && this->finalSysSizing(this->curSysNum).CoolingTotalCapacity)) { - ShowContinueError(state, "...Capacity passed by parent object to size child component = " + - General::TrimSigDigits(this->autoSizedValue, 2) + " [W]"); + ShowContinueError(state, + format("...Capacity passed by parent object to size child component = {:.2T} [W]", this->autoSizedValue)); } else { - ShowContinueError(state, "...Air flow rate used for sizing = " + General::TrimSigDigits(DesVolFlow, 5) + " [m3/s]"); - ShowContinueError(state, "...Outdoor air fraction used for sizing = " + General::TrimSigDigits(OutAirFrac, 2)); - ShowContinueError(state, "...Coil inlet air temperature used for sizing = " + General::TrimSigDigits(CoilInTemp, 2) + " [C]"); - ShowContinueError(state, "...Coil outlet air temperature used for sizing = " + General::TrimSigDigits(CoilOutTemp, 2) + " [C]"); + ShowContinueError(state, format("...Air flow rate used for sizing = {:.5T} [m3/s]", DesVolFlow)); + ShowContinueError(state, format("...Outdoor air fraction used for sizing = {:.2T}", OutAirFrac)); + ShowContinueError(state, format("...Coil inlet air temperature used for sizing = {:.2T} [C]", CoilInTemp)); + ShowContinueError(state, format("...Coil outlet air temperature used for sizing = {:.2T} [C]", CoilOutTemp)); } } } @@ -468,7 +464,7 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, std::string msg = this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; ShowSevereError(state, msg); this->addErrorMessage(msg); - msg = "SizingString = " + this->sizingString + ", SizingResult = " + General::TrimSigDigits(this->autoSizedValue, 1); + msg = format("SizingString = {}, SizingResult = {:.1T}", this->sizingString, this->autoSizedValue); ShowContinueError(state, msg); this->addErrorMessage(msg); errorsFound = true; @@ -493,11 +489,12 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, ShowWarningError(state, this->callingRoutine + ' ' + this->compType + ' ' + this->compName); ShowContinueError(state, "..." + this->sizingString + " will be limited by the minimum rated volume flow per rated total capacity ratio."); - ShowContinueError(state, "...DX coil volume flow rate (m3/s ) = " + General::TrimSigDigits(DesVolFlow, 6)); - ShowContinueError(state, "...Requested capacity (W ) = " + General::TrimSigDigits(this->autoSizedValue, 3)); - ShowContinueError(state, "...Requested flow/capacity ratio (m3/s/W ) = " + General::TrimSigDigits(RatedVolFlowPerRatedTotCap, 3)); - ShowContinueError(state, "...Minimum flow/capacity ratio (m3/s/W ) = " + - General::TrimSigDigits(DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT), 3)); + ShowContinueError(state, format("...DX coil volume flow rate (m3/s ) = {:.6T}", DesVolFlow)); + ShowContinueError(state, format("...Requested capacity (W ) = {:.3T}", this->autoSizedValue)); + ShowContinueError(state, format("...Requested flow/capacity ratio (m3/s/W ) = {:.3T}", RatedVolFlowPerRatedTotCap)); + ShowContinueError(state, + format("...Minimum flow/capacity ratio (m3/s/W ) = {:.3T}", + DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT))); } DXFlowPerCapMinRatio = (DesVolFlow / DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT)) / @@ -505,18 +502,19 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = DesVolFlow / DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT); if (!this->dataEMSOverride && state.dataGlobal->DisplayExtraWarnings && this->printWarningFlag) { - ShowContinueError(state, "...Adjusted capacity ( W ) = " + General::TrimSigDigits(this->autoSizedValue, 3)); + ShowContinueError(state, format("...Adjusted capacity ( W ) = {:.3T}", this->autoSizedValue)); } } else if (RatedVolFlowPerRatedTotCap > DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT)) { if (!this->dataEMSOverride && state.dataGlobal->DisplayExtraWarnings && this->printWarningFlag) { ShowWarningError(state, this->callingRoutine + ' ' + this->compType + ' ' + this->compName); ShowContinueError(state, "..." + this->sizingString + " will be limited by the maximum rated volume flow per rated total capacity ratio."); - ShowContinueError(state, "...DX coil volume flow rate ( m3/s ) = " + General::TrimSigDigits(DesVolFlow, 6)); - ShowContinueError(state, "...Requested capacity ( W ) = " + General::TrimSigDigits(this->autoSizedValue, 3)); - ShowContinueError(state, "...Requested flow/capacity ratio ( m3/s/W ) = " + General::TrimSigDigits(RatedVolFlowPerRatedTotCap, 3)); - ShowContinueError(state, "...Maximum flow/capacity ratio ( m3/s/W ) = " + - General::TrimSigDigits(DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT), 3)); + ShowContinueError(state, format("...DX coil volume flow rate ( m3/s ) = {:.6T}", DesVolFlow)); + ShowContinueError(state, format("...Requested capacity ( W ) = {:.3T}", this->autoSizedValue)); + ShowContinueError(state, format("...Requested flow/capacity ratio ( m3/s/W ) = {:.3T}", RatedVolFlowPerRatedTotCap)); + ShowContinueError(state, + format("...Maximum flow/capacity ratio ( m3/s/W ) = {:.3T}", + DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT))); } DXFlowPerCapMaxRatio = DesVolFlow / DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT) / @@ -524,7 +522,7 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = DesVolFlow / DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT); if (!this->dataEMSOverride && state.dataGlobal->DisplayExtraWarnings && this->printWarningFlag) { - ShowContinueError(state, "...Adjusted capacity ( W ) = " + General::TrimSigDigits(this->autoSizedValue, 3)); + ShowContinueError(state, format("...Adjusted capacity ( W ) = {:.3T}", this->autoSizedValue)); } } } diff --git a/src/EnergyPlus/Autosizing/CoolingSHRSizing.cc b/src/EnergyPlus/Autosizing/CoolingSHRSizing.cc index 878f527ff88..2312a7a1711 100644 --- a/src/EnergyPlus/Autosizing/CoolingSHRSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingSHRSizing.cc @@ -149,9 +149,9 @@ void CoolingSHRSizer::updateSizingString() } } else if (this->coilType_Num == DataHVACGlobals::CoilDX_MultiSpeedCooling) { if (this->isEpJSON) { - this->sizingString = "speed_" + General::TrimSigDigits(DataSizing::DataDXSpeedNum) + "_rated_sensible_heat_ratio"; + this->sizingString = fmt::format("speed_{}_rated_sensible_heat_ratio", DataSizing::DataDXSpeedNum); } else { - this->sizingString = "Speed " + General::TrimSigDigits(DataSizing::DataDXSpeedNum) + " Rated Sensible Heat Ratio"; + this->sizingString = fmt::format("Speed {} Rated Sensible Heat Ratio", DataSizing::DataDXSpeedNum); } } else if (this->coilType_Num == DataHVACGlobals::CoilVRF_FluidTCtrl_Cooling) { if (this->isEpJSON) { diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc index c50520ef089..bbc25577b6e 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc @@ -102,10 +102,10 @@ Real64 CoolingWaterDesAirOutletHumRatSizer::size(EnergyPlusData &state, Real64 _ this->callingRoutine + ":" + " Coil=\"" + this->compName + "\", Cooling Coil has leaving humidity ratio > entering humidity ratio."; this->addErrorMessage(msg); ShowWarningError(state, msg); - msg = " Wair,in = " + General::RoundSigDigits(this->dataDesInletAirHumRat, 6) + " [kgWater/kgDryAir]"; + msg = format(" Wair,in = {:.6R} [kgWater/kgDryAir]", this->dataDesInletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Wair,out = " + General::RoundSigDigits(this->autoSizedValue, 6) + " [kgWater/kgDryAir]"; + msg = format(" Wair,out = {:.6R} [kgWater/kgDryAir]", this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); if (this->dataDesInletAirHumRat > 0.016) { @@ -116,7 +116,7 @@ Real64 CoolingWaterDesAirOutletHumRatSizer::size(EnergyPlusData &state, Real64 _ msg = "....coil leaving humidity ratio will be reset to:"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Wair,out = " + General::RoundSigDigits(this->autoSizedValue, 6) + " [kgWater/kgDryAir]"; + msg = format(" Wair,out = {:.6R} [kgWater/kgDryAir]", this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); } @@ -133,24 +133,24 @@ Real64 CoolingWaterDesAirOutletHumRatSizer::size(EnergyPlusData &state, Real64 _ "temperature > design air entering humidity ratio."; this->addErrorMessage(msg); ShowWarningError(state, msg); - msg = " Wair,in = " + General::RoundSigDigits(this->dataDesInletAirHumRat, 6) + " [kgWater/kgDryAir]"; + msg = format(" Wair,in = {:.6R} [kgWater/kgDryAir]", this->dataDesInletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Wair,out = " + General::RoundSigDigits(this->autoSizedValue, 6) + " [kgWater/kgDryAir]"; + msg = format(" Wair,out = {:.6R} [kgWater/kgDryAir]", this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Inlet chilled water temperature = " + General::RoundSigDigits(this->dataDesInletWaterTemp, 3) + " [C]"; + msg = format(" Inlet chilled water temperature = {:.3R} [C]", this->dataDesInletWaterTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Minimum humidity ratio at saturation for inlet chilled water temperature = " + - General::RoundSigDigits(desHumRatAtWaterInTemp, 6) + " [kgWater/kgDryAir]"; + msg = format(" Minimum humidity ratio at saturation for inlet chilled water temperature = {:.6R} [kgWater/kgDryAir]", + desHumRatAtWaterInTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); this->autoSizedValue = this->dataDesInletAirHumRat; msg = "....coil leaving humidity ratio will be reset to:"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Wair,out = " + General::RoundSigDigits(this->autoSizedValue, 6) + " [kgWater/kgDryAir]"; + msg = format(" Wair,out = {:.6R} [kgWater/kgDryAir]", this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); } diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc index 59eb08fe4a4..668bb34dd16 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc @@ -102,17 +102,17 @@ Real64 CoolingWaterDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _or "\", Cooling Coil has leaving air temperature < entering water temperature."; this->addErrorMessage(msg); ShowWarningError(state, msg); - msg = " Tair,out = " + General::RoundSigDigits(this->autoSizedValue, 3); + msg = format(" Tair,out = {:.3R}", this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Twater,in = " + General::RoundSigDigits(this->dataDesInletWaterTemp, 3); + msg = format(" Twater,in = {:.3R}", this->dataDesInletWaterTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); this->autoSizedValue = this->dataDesInletWaterTemp + 0.5; msg = "....coil leaving air temperature will be reset to:"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Tair,out = " + General::RoundSigDigits(this->autoSizedValue, 3); + msg = format(" Tair,out = {:.3R}", this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); } @@ -159,14 +159,14 @@ Real64 CoolingWaterDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _or "\", Cooling Coil has leaving air temperature < entering water temperature."; this->addErrorMessage(msg); ShowWarningError(state, msg); - msg = " Tair,out = " + General::RoundSigDigits(this->autoSizedValue, 3); + msg = format(" Tair,out = {:.3R}", this->autoSizedValue); ShowContinueError(state, msg); - msg = " Twater,in = " + General::RoundSigDigits(this->dataDesInletWaterTemp, 3); + msg = format(" Twater,in = {:.3R}", this->dataDesInletWaterTemp); ShowContinueError(state, msg); this->autoSizedValue = this->dataDesInletWaterTemp + 0.5; msg = "....coil leaving air temperature will be reset to:"; ShowContinueError(state, msg); - msg = " Tair,out = " + General::RoundSigDigits(this->autoSizedValue, 3); + msg = format(" Tair,out = {:.3R}", this->autoSizedValue); ShowContinueError(state, msg); } } diff --git a/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc b/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc index f1376837df3..cde76257832 100644 --- a/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc @@ -246,7 +246,7 @@ Real64 HeatingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b std::string msg = this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; ShowSevereError(state, msg); this->addErrorMessage(msg); - msg = "SizingString = " + this->sizingString + ", SizingResult = " + General::TrimSigDigits(this->autoSizedValue, 1); + msg = format("SizingString = {}, SizingResult = {:.1T}", this->sizingString, this->autoSizedValue); ShowContinueError(state, msg); this->addErrorMessage(msg); errorsFound = true; diff --git a/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc b/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc index 08446720ed7..931d99b8419 100644 --- a/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc @@ -193,16 +193,16 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, } if (state.dataGlobal->DisplayExtraWarnings && this->autoSizedValue <= 0.0) { ShowWarningMessage(state, this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName); - ShowContinueError(state, "...Rated Total Heating Capacity = " + General::TrimSigDigits(this->autoSizedValue, 2) + " [W]"); + ShowContinueError(state, format("...Rated Total Heating Capacity = {:.2T} [W]", this->autoSizedValue)); if (this->zoneEqSizing(this->curZoneEqNum).HeatingCapacity || (this->dataCoolCoilCap > 0.0 && this->dataFlowUsedForSizing > 0.0)) { - ShowContinueError(state, "...Capacity passed by parent object to size child component = " + - General::TrimSigDigits(NominalCapacityDes, 2) + " [W]"); + ShowContinueError(state, + format("...Capacity passed by parent object to size child component = {:.2T} [W]", NominalCapacityDes)); } else { if (CoilOutTemp > -999.0) { - ShowContinueError(state, "...Air flow rate used for sizing = " + General::TrimSigDigits(DesVolFlow, 5) + " [m3/s]"); - ShowContinueError(state, "...Coil inlet air temperature used for sizing = " + General::TrimSigDigits(CoilInTemp, 2) + " [C]"); - ShowContinueError(state, "...Coil outlet air temperature used for sizing = " + General::TrimSigDigits(CoilOutTemp, 2) + " [C]"); + ShowContinueError(state, format("...Air flow rate used for sizing = {:.5T} [m3/s]", DesVolFlow)); + ShowContinueError(state, format("...Coil inlet air temperature used for sizing = {:.2T} [C]", CoilInTemp)); + ShowContinueError(state, format("...Coil outlet air temperature used for sizing = {:.2T} [C]", CoilOutTemp)); } else { ShowContinueError(state, "...Capacity used to size child component set to 0 [W]"); } @@ -366,15 +366,14 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = NominalCapacityDes * this->dataHeatSizeRatio * this->dataFracOfAutosizedHeatingCapacity; if (state.dataGlobal->DisplayExtraWarnings && this->autoSizedValue <= 0.0) { ShowWarningMessage(state, this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName); - ShowContinueError(state, "...Rated Total Heating Capacity = " + General::TrimSigDigits(this->autoSizedValue, 2) + " [W]"); + ShowContinueError(state, format("...Rated Total Heating Capacity = {:.2T} [W]", this->autoSizedValue)); if (CoilOutTemp > -999.0) { - ShowContinueError(state, "...Air flow rate used for sizing = " + General::TrimSigDigits(DesVolFlow, 5) + " [m3/s]"); - ShowContinueError(state, "...Outdoor air fraction used for sizing = " + General::TrimSigDigits(OutAirFrac, 2)); - ShowContinueError(state, "...Coil inlet air temperature used for sizing = " + General::TrimSigDigits(CoilInTemp, 2) + " [C]"); - ShowContinueError(state, "...Coil outlet air temperature used for sizing = " + General::TrimSigDigits(CoilOutTemp, 2) + " [C]"); + ShowContinueError(state, format("...Air flow rate used for sizing = {:.5T} [m3/s]", DesVolFlow)); + ShowContinueError(state, format("...Outdoor air fraction used for sizing = {:.2T}", OutAirFrac)); + ShowContinueError(state, format("...Coil inlet air temperature used for sizing = {:.2T} [C]", CoilInTemp)); + ShowContinueError(state, format("...Coil outlet air temperature used for sizing = {:.2T} [C]", CoilOutTemp)); } else { - ShowContinueError(state, "...Capacity passed by parent object to size child component = " + General::TrimSigDigits(DesCoilLoad, 2) + - " [W]"); + ShowContinueError(state, format("...Capacity passed by parent object to size child component = {:.2T} [W]", DesCoilLoad)); } } } @@ -386,7 +385,7 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, std::string msg = this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; ShowSevereError(state, msg); this->addErrorMessage(msg); - msg = "SizingString = " + this->sizingString + ", SizingResult = " + General::TrimSigDigits(this->autoSizedValue, 1); + msg = format("SizingString = {}, SizingResult = {:.1T}", this->sizingString, this->autoSizedValue); ShowContinueError(state, msg); this->addErrorMessage(msg); errorsFound = true; @@ -411,11 +410,12 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, ShowWarningError(state, this->callingRoutine + ' ' + this->compType + ' ' + this->compName); ShowContinueError(state, "..." + this->sizingString + " will be limited by the minimum rated volume flow per rated total capacity ratio."); - ShowContinueError(state, "...DX coil volume flow rate (m3/s ) = " + General::TrimSigDigits(DesVolFlow, 6)); - ShowContinueError(state, "...Requested capacity (W ) = " + General::TrimSigDigits(this->autoSizedValue, 3)); - ShowContinueError(state, "...Requested flow/capacity ratio (m3/s/W ) = " + General::TrimSigDigits(RatedVolFlowPerRatedTotCap, 3)); - ShowContinueError(state, "...Minimum flow/capacity ratio (m3/s/W ) = " + - General::TrimSigDigits(DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT), 3)); + ShowContinueError(state, format("...DX coil volume flow rate (m3/s ) = {:.6T}", DesVolFlow)); + ShowContinueError(state, format("...Requested capacity (W ) = {:.3T}", this->autoSizedValue)); + ShowContinueError(state, format("...Requested flow/capacity ratio (m3/s/W ) = {:.3T}", RatedVolFlowPerRatedTotCap)); + ShowContinueError(state, + format("...Minimum flow/capacity ratio (m3/s/W ) = {:.3T}", + DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT))); } DXFlowPerCapMinRatio = (DesVolFlow / DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT)) / @@ -423,18 +423,19 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = DesVolFlow / DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT); if (!this->dataEMSOverride && state.dataGlobal->DisplayExtraWarnings && this->printWarningFlag) { - ShowContinueError(state, "...Adjusted capacity ( W ) = " + General::TrimSigDigits(this->autoSizedValue, 3)); + ShowContinueError(state, format("...Adjusted capacity ( W ) = {:.3T}", this->autoSizedValue)); } } else if (RatedVolFlowPerRatedTotCap > DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT)) { if (!this->dataEMSOverride && state.dataGlobal->DisplayExtraWarnings && this->printWarningFlag) { ShowWarningError(state, this->callingRoutine + ' ' + this->compType + ' ' + this->compName); ShowContinueError(state, "..." + this->sizingString + " will be limited by the maximum rated volume flow per rated total capacity ratio."); - ShowContinueError(state, "...DX coil volume flow rate ( m3/s ) = " + General::TrimSigDigits(DesVolFlow, 6)); - ShowContinueError(state, "...Requested capacity ( W ) = " + General::TrimSigDigits(this->autoSizedValue, 3)); - ShowContinueError(state, "...Requested flow/capacity ratio ( m3/s/W ) = " + General::TrimSigDigits(RatedVolFlowPerRatedTotCap, 3)); - ShowContinueError(state, "...Maximum flow/capacity ratio ( m3/s/W ) = " + - General::TrimSigDigits(DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT), 3)); + ShowContinueError(state, format("...DX coil volume flow rate ( m3/s ) = {:.6T}", DesVolFlow)); + ShowContinueError(state, format("...Requested capacity ( W ) = {:.3T}", this->autoSizedValue)); + ShowContinueError(state, format("...Requested flow/capacity ratio ( m3/s/W ) = {:.3T}", RatedVolFlowPerRatedTotCap)); + ShowContinueError(state, + format("...Maximum flow/capacity ratio ( m3/s/W ) = {:.3T}", + DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT))); } DXFlowPerCapMaxRatio = DesVolFlow / DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT) / @@ -442,7 +443,7 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = DesVolFlow / DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT); if (!this->dataEMSOverride && state.dataGlobal->DisplayExtraWarnings && this->printWarningFlag) { - ShowContinueError(state, "...Adjusted capacity ( W ) = " + General::TrimSigDigits(this->autoSizedValue, 3)); + ShowContinueError(state, format("...Adjusted capacity ( W ) = {:.3T}", this->autoSizedValue)); } } } diff --git a/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc b/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc index cf360be9a01..de3b172a46e 100644 --- a/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc @@ -87,22 +87,20 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).AirVolFlow) { DDNameFanPeak = "Unknown"; @@ -114,11 +112,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -126,11 +123,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; @@ -138,11 +134,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; @@ -150,11 +145,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow, @@ -164,24 +158,20 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -192,24 +182,20 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -221,9 +207,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -231,9 +218,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; @@ -241,9 +229,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; @@ -251,9 +240,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -265,11 +255,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -277,11 +266,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -294,11 +282,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -306,11 +293,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -321,9 +307,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -331,9 +318,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; @@ -341,9 +329,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; @@ -351,9 +340,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -365,11 +355,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -377,11 +366,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -394,11 +382,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -406,11 +393,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -421,9 +407,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -431,9 +418,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; @@ -441,9 +429,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -451,9 +440,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity, @@ -463,22 +453,20 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -489,22 +477,20 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -515,9 +501,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -525,9 +512,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; @@ -535,9 +523,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -545,9 +534,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity, @@ -557,22 +547,20 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -583,22 +571,20 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -609,9 +595,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; @@ -619,9 +606,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -631,22 +619,20 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -660,11 +646,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -672,11 +657,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else { this->autoSizedValue = max(this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow, @@ -686,24 +670,20 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -762,16 +742,13 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD > 0 && DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Title; - dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth) + - " " + + dateTimeFanPeak = format( + "{}/{} {}", + state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month, + state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth, coilSelectionReportObj->getTimeText(state, DataSizing::SysSizPeakDDNum(this->curSysNum) - .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD)); + .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD))); } } else if (this->autoSizedValue == this->unitarySysEqSizing(this->curSysNum).HeatingAirVolFlow) { @@ -779,11 +756,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalSysSizing(this->curSysNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } } else if (this->unitarySysEqSizing(this->curSysNum).CoolingAirFlow) { @@ -791,16 +767,13 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD > 0 && DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Title; - dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth) + - " " + + dateTimeFanPeak = format( + "{}/{} {}", + state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month, + state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth, coilSelectionReportObj->getTimeText(state, DataSizing::SysSizPeakDDNum(this->curSysNum) - .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD)); + .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD))); } } else if (this->unitarySysEqSizing(this->curSysNum).HeatingAirFlow) { this->autoSizedValue = this->unitarySysEqSizing(this->curSysNum).HeatingAirVolFlow; @@ -808,9 +781,10 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalSysSizing(this->curSysNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else { @@ -820,26 +794,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalSysSizing(this->curSysNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { if (DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD > 0 && DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Title; - dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth) + - " " + + dateTimeFanPeak = format( + "{}/{} {}", + state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month, + state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth, coilSelectionReportObj->getTimeText(state, DataSizing::SysSizPeakDDNum(this->curSysNum) - .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD)); + .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD))); } } } @@ -850,24 +820,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalSysSizing(this->curSysNum).HeatDDNum <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Title; dateTimeFanPeak = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).DayOfMonth) + - " " + coilSelectionReportObj->getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk); + format("{}/{} {}", + state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).Month, + state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum).DayOfMonth, + coilSelectionReportObj->getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { if (DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD > 0 && DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD <= DataEnvironment::TotDesDays) { DDNameFanPeak = state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Title; - dateTimeFanPeak = - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month) + - "/" + - General::TrimSigDigits( - state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth) + - " " + + dateTimeFanPeak = format( + "{}/{} {}", + state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month, + state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth, coilSelectionReportObj->getTimeText(state, DataSizing::SysSizPeakDDNum(this->curSysNum) - .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD)); + .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD))); } } } @@ -882,7 +850,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo std::string msg = this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete."; ShowSevereError(state, msg); this->addErrorMessage(msg); - msg = "SizingString = " + this->sizingString + ", SizingResult = " + General::TrimSigDigits(this->autoSizedValue, 1); + msg = format("SizingString = {}, SizingResult = {:.1T}", this->sizingString, this->autoSizedValue); ShowContinueError(state, msg); this->addErrorMessage(msg); errorsFound = true; diff --git a/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc b/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc index a0ef667abd8..7bef24bd79d 100644 --- a/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc @@ -122,27 +122,27 @@ Real64 WaterHeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalVa std::string msg = this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName; this->addErrorMessage(msg); ShowWarningMessage(state, msg); - msg = "...Rated Total Heating Capacity = " + General::TrimSigDigits(this->autoSizedValue, 2) + " [W]"; + msg = format("...Rated Total Heating Capacity = {:.2T} [W]", this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "...Air flow rate used for sizing = " + General::TrimSigDigits(DesMassFlow / DataEnvironment::StdRhoAir, 5) + " [m3/s]"; + msg = format("...Air flow rate used for sizing = {:.5T} [m3/s]", DesMassFlow / DataEnvironment::StdRhoAir); this->addErrorMessage(msg); ShowContinueError(state, msg); if (this->termUnitSingDuct || this->termUnitPIU || this->termUnitIU || this->zoneEqFanCoil || this->zoneEqUnitHeater) { - msg = "...Air flow rate used for sizing = " + General::TrimSigDigits(DesMassFlow / DataEnvironment::StdRhoAir, 5) + " [m3/s]"; + msg = format("...Air flow rate used for sizing = {:.5T} [m3/s]", DesMassFlow / DataEnvironment::StdRhoAir); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "...Plant loop temperature difference = " + General::TrimSigDigits(this->dataWaterCoilSizHeatDeltaT, 2) + " [C]"; + msg = format("...Plant loop temperature difference = {:.2T} [C]", this->dataWaterCoilSizHeatDeltaT); this->addErrorMessage(msg); ShowContinueError(state, msg); } else { - msg = "...Coil inlet air temperature used for sizing = " + General::TrimSigDigits(CoilInTemp, 2) + " [C]"; + msg = format("...Coil inlet air temperature used for sizing = {:.2T} [C]", CoilInTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "...Coil outlet air temperature used for sizing = " + General::TrimSigDigits(CoilOutTemp, 2) + " [C]"; + msg = format("...Coil outlet air temperature used for sizing = {:.2T} [C]", CoilOutTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = "...Coil outlet air humidity ratio used for sizing = " + General::TrimSigDigits(CoilOutHumRat, 2) + " [kgWater/kgDryAir]"; + msg = format("...Coil outlet air humidity ratio used for sizing = {:.2T} [kgWater/kgDryAir]", CoilOutHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); } diff --git a/src/EnergyPlus/Autosizing/WaterHeatingCoilUASizing.cc b/src/EnergyPlus/Autosizing/WaterHeatingCoilUASizing.cc index d784312bd77..7d3525833a6 100644 --- a/src/EnergyPlus/Autosizing/WaterHeatingCoilUASizing.cc +++ b/src/EnergyPlus/Autosizing/WaterHeatingCoilUASizing.cc @@ -88,57 +88,55 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu msg = " Iteration limit exceeded in calculating coil UA"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Lower UA estimate = " + General::TrimSigDigits(UA0, 6) + " W/m2-K (0.1% of Design Coil Load)"; + msg = format(" Lower UA estimate = {:.6T} W/m2-K (0.1% of Design Coil Load)", UA0); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Upper UA estimate = " + General::TrimSigDigits(UA1, 6) + " W/m2-K (100% of Design Coil Load)"; + msg = format(" Upper UA estimate = {:.6T} W/m2-K (100% of Design Coil Load)", UA1); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Final UA estimate when iterations exceeded limit = " + General::TrimSigDigits(this->autoSizedValue, 6) + " W/m2-K"; + msg = format(" Final UA estimate when iterations exceeded limit = {:.6T} W/m2-K", this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); msg = " Zone \"" + this->finalZoneSizing(this->curZoneEqNum).ZoneName + "\" coil sizing conditions (may be different than Sizing inputs):"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air temperature = " + General::TrimSigDigits(this->dataDesInletAirTemp, 3) + " C"; + msg = format(" Coil inlet air temperature = {:.3T} C", this->dataDesInletAirTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air humidity ratio = " + General::TrimSigDigits(this->dataDesInletAirHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil inlet air humidity ratio = {:.3T} kgWater/kgDryAir", this->dataDesInletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air mass flow rate = " + General::TrimSigDigits(this->dataFlowUsedForSizing, 6) + " kg/s"; + msg = format(" Coil inlet air mass flow rate = {:.6T} kg/s", this->dataFlowUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); // TotWaterHeatingCoilRate is set in CALL to CalcSimpleHeatingCoil - msg = " Design Coil Capacity = " + General::TrimSigDigits(this->dataDesignCoilCapacity, 3) + " W"; + msg = format(" Design Coil Capacity = {:.3T} W", this->dataDesignCoilCapacity); this->addErrorMessage(msg); ShowContinueError(state, msg); if (this->dataNomCapInpMeth) { - msg = " Design Coil Load = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 3) + " W"; + msg = format(" Design Coil Load = {:.3T} W", this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil outlet air temperature = " + General::TrimSigDigits(this->dataDesOutletAirTemp, 3) + " C"; + msg = format(" Coil outlet air temperature = {:.3T} C", this->dataDesOutletAirTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil outlet air humidity ratio = " + General::TrimSigDigits(this->dataDesOutletAirHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil outlet air humidity ratio = {:.3T} kgWater/kgDryAir", this->dataDesOutletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); } else if (this->termUnitSingDuct || this->termUnitPIU || this->termUnitIU || this->zoneEqFanCoil) { - msg = " Design Coil Load = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 3) + " W"; + msg = format(" Design Coil Load = {:.3T} W", this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); } else { - msg = " Design Coil Load = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 3) + " W"; + msg = format(" Design Coil Load = {:.3T} W", this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = - " Coil outlet air temperature = " + General::TrimSigDigits(this->finalZoneSizing(this->curZoneEqNum).HeatDesTemp, 3) + - " C"; + msg = format(" Coil outlet air temperature = {:.3T} C", this->finalZoneSizing(this->curZoneEqNum).HeatDesTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil outlet air humidity ratio = " + - General::TrimSigDigits(this->finalZoneSizing(this->curZoneEqNum).HeatDesHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil outlet air humidity ratio = {:.3T} kgWater/kgDryAir", + this->finalZoneSizing(this->curZoneEqNum).HeatDesHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); } @@ -152,53 +150,51 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu msg = " Bad starting values for UA"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Lower UA estimate = " + General::TrimSigDigits(UA0, 6) + " W/m2-K (0.1% of Design Coil Load)"; + msg = format(" Lower UA estimate = {:.6T} W/m2-K (0.1% of Design Coil Load)", UA0); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Upper UA estimate = " + General::TrimSigDigits(UA1, 6) + " W/m2-K (100% of Design Coil Load)"; + msg = format(" Upper UA estimate = {:.6T} W/m2-K (100% of Design Coil Load)", UA1); this->addErrorMessage(msg); ShowContinueError(state, msg); msg = " Zone \"" + this->finalZoneSizing(this->curZoneEqNum).ZoneName + "\" coil sizing conditions (may be different than Sizing inputs):"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air temperature = " + General::TrimSigDigits(this->dataDesInletAirTemp, 3) + " C"; + msg = format(" Coil inlet air temperature = {:.3T} C", this->dataDesInletAirTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air humidity ratio = " + General::TrimSigDigits(this->dataDesInletAirHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil inlet air humidity ratio = {:.3T} kgWater/kgDryAir", this->dataDesInletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air mass flow rate = " + General::TrimSigDigits(this->dataFlowUsedForSizing, 6) + " kg/s"; + msg = format(" Coil inlet air mass flow rate = {:.6T} kg/s", this->dataFlowUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Design Coil Capacity = " + General::TrimSigDigits(this->dataDesignCoilCapacity, 3) + " W"; + msg = format(" Design Coil Capacity = {:.3T} W", this->dataDesignCoilCapacity); this->addErrorMessage(msg); ShowContinueError(state, msg); if (this->dataNomCapInpMeth) { - msg = " Design Coil Load = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 3) + " W"; + msg = format(" Design Coil Load = {:.3T} W", this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil outlet air temperature = " + General::TrimSigDigits(this->dataDesOutletAirTemp, 3) + " C"; + msg = format(" Coil outlet air temperature = {:.3T} C", this->dataDesOutletAirTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil outlet air humidity ratio = " + General::TrimSigDigits(this->dataDesOutletAirHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil outlet air humidity ratio = {:.3T} kgWater/kgDryAir", this->dataDesOutletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); } else if (this->termUnitSingDuct || this->termUnitPIU || this->termUnitIU || this->zoneEqFanCoil) { - msg = " Design Coil Load = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 3) + " W"; + msg = format(" Design Coil Load = {:.3T} W", this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); } else { - msg = " Design Coil Load = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 3) + " W"; + msg = format(" Design Coil Load = {:.3T} W", this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = - " Coil outlet air temperature = " + General::TrimSigDigits(this->finalZoneSizing(this->curZoneEqNum).HeatDesTemp, 3) + - " C"; + msg = format(" Coil outlet air temperature = {:.3T} C", this->finalZoneSizing(this->curZoneEqNum).HeatDesTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil outlet air humidity ratio = " + - General::TrimSigDigits(this->finalZoneSizing(this->curZoneEqNum).HeatDesHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil outlet air humidity ratio = {:.3T} kgWater/kgDryAir", + this->finalZoneSizing(this->curZoneEqNum).HeatDesHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); } @@ -213,11 +209,10 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu msg = " Plant Sizing object = " + this->plantSizData(this->dataPltSizHeatNum).PlantLoopName; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Plant design loop exit temperature = " + - General::TrimSigDigits(this->plantSizData(this->dataPltSizHeatNum).ExitTemp, 3) + " C"; + msg = format(" Plant design loop exit temperature = {:.3T} C", this->plantSizData(this->dataPltSizHeatNum).ExitTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Plant design loop delta T = " + General::TrimSigDigits(this->dataWaterCoilSizHeatDeltaT, 3) + " C"; + msg = format(" Plant design loop delta T = {:.3T} C", this->dataWaterCoilSizHeatDeltaT); this->addErrorMessage(msg); ShowContinueError(state, msg); } @@ -267,39 +262,39 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu msg = " Iteration limit exceeded in calculating coil UA"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Lower UA estimate = " + General::TrimSigDigits(UA0, 6) + " W/m2-K (1% of Design Coil Load)"; + msg = format(" Lower UA estimate = {:.6T} W/m2-K (1% of Design Coil Load)", UA0); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Upper UA estimate = " + General::TrimSigDigits(UA1, 6) + " W/m2-K (100% of Design Coil Load)"; + msg = format(" Upper UA estimate = {:.6T} W/m2-K (100% of Design Coil Load)", UA1); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Final UA estimate when iterations exceeded limit = " + General::TrimSigDigits(this->autoSizedValue, 6) + " W/m2-K"; + msg = format(" Final UA estimate when iterations exceeded limit = {:.6T} W/m2-K", this->autoSizedValue); this->addErrorMessage(msg); ShowContinueError(state, msg); msg = " AirloopHVAC \"" + this->finalSysSizing(this->curSysNum).AirPriLoopName + "\" coil sizing conditions (may be different than Sizing inputs):"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air temperature = " + General::TrimSigDigits(this->dataDesInletAirTemp, 3) + " C"; + msg = format(" Coil inlet air temperature = {:.3T} C", this->dataDesInletAirTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air humidity ratio = " + General::TrimSigDigits(this->dataDesInletAirHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil inlet air humidity ratio = {:.3T} kgWater/kgDryAir", this->dataDesInletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air mass flow rate = " + General::TrimSigDigits(this->dataFlowUsedForSizing, 6) + " kg/s"; + msg = format(" Coil inlet air mass flow rate = {:.6T} kg/s", this->dataFlowUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Design Coil Capacity = " + General::TrimSigDigits(this->dataDesignCoilCapacity, 3) + " W"; + msg = format(" Design Coil Capacity = {:.3T} W", this->dataDesignCoilCapacity); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Design Coil Load = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 3) + " W"; + msg = format(" Design Coil Load = {:.3T} W", this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); if (this->dataNomCapInpMeth) { - msg = " Coil outlet air temperature = " + General::TrimSigDigits(this->dataDesOutletAirTemp, 3) + " C"; + msg = format(" Coil outlet air temperature = {:.3T} C", this->dataDesOutletAirTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil outlet air humidity ratio = " + General::TrimSigDigits(this->dataDesOutletAirHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil outlet air humidity ratio = {:.3T} kgWater/kgDryAir", this->dataDesOutletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); } @@ -313,36 +308,36 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu msg = " Bad starting values for UA"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Lower UA estimate = " + General::TrimSigDigits(UA0, 6) + " W/m2-K (1% of Design Coil Load)"; + msg = format(" Lower UA estimate = {:.6T} W/m2-K (1% of Design Coil Load)", UA0); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Upper UA estimate = " + General::TrimSigDigits(UA1, 6) + " W/m2-K (100% of Design Coil Load)"; + msg = format(" Upper UA estimate = {:.6T} W/m2-K (100% of Design Coil Load)", UA1); this->addErrorMessage(msg); ShowContinueError(state, msg); msg = " AirloopHVAC \"" + this->finalSysSizing(this->curSysNum).AirPriLoopName + "\" coil sizing conditions (may be different than Sizing inputs):"; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air temperature = " + General::TrimSigDigits(this->dataDesInletAirTemp, 3) + " C"; + msg = format(" Coil inlet air temperature = {:.3T} C", this->dataDesInletAirTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air humidity ratio = " + General::TrimSigDigits(this->dataDesInletAirHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil inlet air humidity ratio = {:.3T} kgWater/kgDryAir", this->dataDesInletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil inlet air mass flow rate = " + General::TrimSigDigits(this->dataFlowUsedForSizing, 6) + " kg/s"; + msg = format(" Coil inlet air mass flow rate = {:.6T} kg/s", this->dataFlowUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Design Coil Capacity = " + General::TrimSigDigits(this->dataDesignCoilCapacity, 3) + " W"; + msg = format(" Design Coil Capacity = {:.3T} W", this->dataDesignCoilCapacity); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Design Coil Load = " + General::TrimSigDigits(this->dataCapacityUsedForSizing, 3) + " W"; + msg = format(" Design Coil Load = {:.3T} W", this->dataCapacityUsedForSizing); this->addErrorMessage(msg); ShowContinueError(state, msg); if (this->dataNomCapInpMeth) { - msg = " Coil outlet air temperature = " + General::TrimSigDigits(this->dataDesOutletAirTemp, 3) + " C"; + msg = format(" Coil outlet air temperature = {:.3T} C", this->dataDesOutletAirTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Coil outlet air humidity ratio = " + General::TrimSigDigits(this->dataDesOutletAirHumRat, 3) + " kgWater/kgDryAir"; + msg = format(" Coil outlet air humidity ratio = {:.3T} kgWater/kgDryAir", this->dataDesOutletAirHumRat); this->addErrorMessage(msg); ShowContinueError(state, msg); } @@ -356,11 +351,10 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu msg = " Plant Sizing object = " + this->plantSizData(this->dataPltSizHeatNum).PlantLoopName; this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Plant design loop exit temperature = " + - General::TrimSigDigits(this->plantSizData(this->dataPltSizHeatNum).ExitTemp, 3) + " C"; + msg = format(" Plant design loop exit temperature = {:.3T} C", this->plantSizData(this->dataPltSizHeatNum).ExitTemp); this->addErrorMessage(msg); ShowContinueError(state, msg); - msg = " Plant design loop delta T = " + General::TrimSigDigits(this->dataWaterCoilSizHeatDeltaT, 3) + " C"; + msg = format(" Plant design loop delta T = {:.3T} C", this->dataWaterCoilSizHeatDeltaT); this->addErrorMessage(msg); ShowContinueError(state, msg); } diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index e3ae4aeda0c..feed934131d 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -98,7 +98,6 @@ namespace BaseboardElectric { // This subroutine simulates the Electric Baseboard units. using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::TrimSigDigits; int BaseboardNum; // index of unit in baseboard array Real64 QZnReq; // zone load not yet satisfied @@ -120,13 +119,19 @@ namespace BaseboardElectric { } else { BaseboardNum = CompIndex; if (BaseboardNum > baseboard->NumBaseboards || BaseboardNum < 1) { - ShowFatalError(state, "SimElectricBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + - ", Number of Units=" + TrimSigDigits(baseboard->NumBaseboards) + ", Entered Unit name=" + EquipName); + ShowFatalError(state, + format("SimElectricBaseboard: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + BaseboardNum, + baseboard->NumBaseboards, + EquipName)); } if (baseboard->Baseboard(BaseboardNum).CheckEquipName) { if (EquipName != baseboard->Baseboard(BaseboardNum).EquipName) { - ShowFatalError(state, "SimElectricBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + ", Unit name=" + EquipName + - ", stored Unit Name for that index=" + baseboard->Baseboard(BaseboardNum).EquipName); + ShowFatalError(state, + format("SimElectricBaseboard: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + BaseboardNum, + EquipName, + baseboard->Baseboard(BaseboardNum).EquipName)); } baseboard->Baseboard(BaseboardNum).CheckEquipName = false; } @@ -169,7 +174,6 @@ namespace BaseboardElectric { using DataSizing::HeatingDesignCapacity; using DataZoneEquipment::BBElectricConvective_Num; using DataZoneEquipment::ZoneEquipList; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetBaseboardInput: "); // include trailing blank space @@ -256,8 +260,10 @@ namespace BaseboardElectric { thisBaseboard.ScaledHeatingCapacity = rNumericArgs(iHeatDesignCapacityNumericNum); if (thisBaseboard.ScaledHeatingCapacity < 0.0 && thisBaseboard.ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + thisBaseboard.EquipName); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatDesignCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatDesignCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatDesignCapacityNumericNum), + rNumericArgs(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } } else { @@ -273,8 +279,10 @@ namespace BaseboardElectric { if (thisBaseboard.ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + thisBaseboard.EquipName); ShowContinueError(state, "Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum), + rNumericArgs(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } else if (thisBaseboard.ScaledHeatingCapacity == AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + thisBaseboard.EquipName); @@ -294,8 +302,10 @@ namespace BaseboardElectric { thisBaseboard.ScaledHeatingCapacity = rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); if (thisBaseboard.ScaledHeatingCapacity < 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + thisBaseboard.EquipName); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum), + rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -446,7 +456,6 @@ namespace BaseboardElectric { using namespace DataSizing; using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("SizeElectricBaseboard"); diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index 00c07d5e3e0..7fdf76e2069 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -130,7 +130,7 @@ namespace BaseboardRadiator { // Using/Aliasing using DataLoopNode::Node; using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::TrimSigDigits; + using PlantUtilities::SetActuatedBranchFlowRate; int BaseboardNum; // index of unit in baseboard array @@ -156,13 +156,19 @@ namespace BaseboardRadiator { } else { BaseboardNum = CompIndex; if (BaseboardNum > baseboard->NumBaseboards || BaseboardNum < 1) { - ShowFatalError(state, "SimBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + - ", Number of Units=" + TrimSigDigits(baseboard->NumBaseboards) + ", Entered Unit name=" + EquipName); + ShowFatalError(state, + format("SimBaseboard: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + BaseboardNum, + baseboard->NumBaseboards, + EquipName)); } if (baseboard->Baseboard(BaseboardNum).CheckEquipName) { if (EquipName != baseboard->Baseboard(BaseboardNum).EquipID) { - ShowFatalError(state, "SimBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + ", Unit name=" + EquipName + - ", stored Unit Name for that index=" + baseboard->Baseboard(BaseboardNum).EquipID); + ShowFatalError(state, + format("SimBaseboard: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + BaseboardNum, + EquipName, + baseboard->Baseboard(BaseboardNum).EquipID)); } baseboard->Baseboard(BaseboardNum).CheckEquipName = false; } @@ -260,7 +266,6 @@ namespace BaseboardRadiator { using GlobalNames::VerifyUniqueBaseboardName; using namespace DataIPShortCuts; using namespace DataSizing; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetBaseboardInput: "); // include trailing blank space @@ -350,8 +355,10 @@ namespace BaseboardRadiator { baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatDesignCapacityNumericNum); if (baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity < 0.0 && baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatDesignCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatDesignCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatDesignCapacityNumericNum), + rNumericArgs(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } } else { @@ -367,8 +374,10 @@ namespace BaseboardRadiator { if (baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); ShowContinueError(state, "Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum), + rNumericArgs(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } else if (baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity == AutoSize) { ShowSevereError(state, cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); @@ -388,8 +397,10 @@ namespace BaseboardRadiator { baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); if (baseboard->Baseboard(BaseboardNum).ScaledHeatingCapacity < 0.0) { ShowSevereError(state, cCMO_BBRadiator_Water + " = " + baseboard->Baseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum), + rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -640,7 +651,7 @@ namespace BaseboardRadiator { using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; using DataLoopNode::Node; - using General::RoundSigDigits; + using General::SolveRoot; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -784,10 +795,10 @@ namespace BaseboardRadiator { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeBaseboard: Potential issue with equipment sizing for ZoneHVAC:Baseboard:Convective:Water=\"" + baseboard->Baseboard(BaseboardNum).EquipID + "\"."); - ShowContinueError(state, "User-Specified Maximum Water Flow Rate of " + RoundSigDigits(WaterVolFlowRateMaxUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Water Flow Rate of " + - RoundSigDigits(WaterVolFlowRateMaxDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Water Flow Rate of {:.5R} [m3/s]", WaterVolFlowRateMaxUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Water Flow Rate of {:.5R} [m3/s]", WaterVolFlowRateMaxDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -925,9 +936,10 @@ namespace BaseboardRadiator { baseboard->Baseboard(BaseboardNum).EquipID + "\""); ShowContinueError(state, "Design UA set equal to design coil load for " + cCMO_BBRadiator_Water + "=\"" + baseboard->Baseboard(BaseboardNum).EquipID + "\""); - ShowContinueError(state, "Design coil load used during sizing = " + RoundSigDigits(DesCoilLoad, 5) + " W."); - ShowContinueError(state, "Inlet water temperature used during sizing = " + - RoundSigDigits(baseboard->Baseboard(BaseboardNum).WaterInletTemp, 5) + " C."); + ShowContinueError(state, format("Design coil load used during sizing = {:.5R} W.", DesCoilLoad)); + ShowContinueError(state, + format("Inlet water temperature used during sizing = {:.5R} C.", + baseboard->Baseboard(BaseboardNum).WaterInletTemp)); } } } else { // baseboard design load is less than output at UA = 0.001 * design load so set UA to minimum value @@ -937,9 +949,10 @@ namespace BaseboardRadiator { baseboard->Baseboard(BaseboardNum).EquipID + "\""); ShowContinueError(state, "Design UA set equal to 0.001 * design coil load for " + cCMO_BBRadiator_Water + "=\"" + baseboard->Baseboard(BaseboardNum).EquipID + "\""); - ShowContinueError(state, "Design coil load used during sizing = " + RoundSigDigits(DesCoilLoad, 5) + " W."); - ShowContinueError(state, "Inlet water temperature used during sizing = " + - RoundSigDigits(baseboard->Baseboard(BaseboardNum).WaterInletTemp, 5) + " C."); + ShowContinueError(state, format("Design coil load used during sizing = {:.5R} W.", DesCoilLoad)); + ShowContinueError(state, + format("Inlet water temperature used during sizing = {:.5R} C.", + baseboard->Baseboard(BaseboardNum).WaterInletTemp)); } } @@ -965,8 +978,8 @@ namespace BaseboardRadiator { if ((std::abs(UADes - UAUser) / UAUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeBaseboard: Potential issue with equipment sizing for ZoneHVAC:Baseboard:Convective:Water=\"" + baseboard->Baseboard(BaseboardNum).EquipID + "\"."); - ShowContinueError(state, "User-Specified U-Factor Times Area Value of " + RoundSigDigits(UAUser, 2) + " [W/K]"); - ShowContinueError(state, "differs from Design Size U-Factor Times Area Value of " + RoundSigDigits(UADes, 2) + " [W/K]"); + ShowContinueError(state, format("User-Specified U-Factor Times Area Value of {:.2R} [W/K]", UAUser)); + ShowContinueError(state, format("differs from Design Size U-Factor Times Area Value of {:.2R} [W/K]", UADes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc index 683cf9a0c28..7f94dee3872 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -238,15 +238,13 @@ namespace BoilerSteam { if (DataIPShortCuts::rNumericArgs(5) < 0.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(5) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(5), 3)); + ShowContinueError(state, format("Invalid {}={:.3R}", DataIPShortCuts::cNumericFieldNames(5), DataIPShortCuts::rNumericArgs(5))); ErrorsFound = true; } if (DataIPShortCuts::rNumericArgs(3) == 0.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(3) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(3), 3)); + ShowContinueError(state, format("Invalid {}={:.3R}", DataIPShortCuts::cNumericFieldNames(3), DataIPShortCuts::rNumericArgs(3))); ErrorsFound = true; } thisBoiler.BoilerInletNodeNum = NodeInputManager::GetOnlySingleNode(state, @@ -518,9 +516,8 @@ namespace BoilerSteam { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizePump: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -610,8 +607,8 @@ namespace BoilerSteam { if (this->PressErrIndex == 0) { ShowSevereError(state, "Boiler:Steam=\"" + this->Name + "\", Saturation Pressure is greater than Maximum Operating Pressure,"); ShowContinueError(state, "Lower Input Temperature"); - ShowContinueError(state, "Steam temperature=[" + General::RoundSigDigits(this->BoilerOutletTemp, 2) + "] C"); - ShowContinueError(state, "Refrigerant Saturation Pressure =[" + General::RoundSigDigits(this->BoilerPressCheck, 0) + "] Pa"); + ShowContinueError(state, format("Steam temperature=[{:.2R}] C", this->BoilerOutletTemp)); + ShowContinueError(state, format("Refrigerant Saturation Pressure =[{:.0R}] Pa", this->BoilerPressCheck)); } ShowRecurringSevereErrorAtEnd(state, "Boiler:Steam=\"" + this->Name + "\", Saturation Pressure is greater than Maximum Operating Pressure..continues", diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index 3b7c0b009f3..0a66f4e0116 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -224,8 +224,7 @@ namespace EnergyPlus::Boilers { thisBoiler.NomCap = DataIPShortCuts::rNumericArgs(1); if (DataIPShortCuts::rNumericArgs(1) == 0.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowContinueError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, "..." + DataIPShortCuts::cNumericFieldNames(1) + " must be greater than 0.0"); ErrorsFound = true; } @@ -236,8 +235,7 @@ namespace EnergyPlus::Boilers { thisBoiler.NomEffic = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 3)); + ShowContinueError(state, format("Invalid {}={:.3R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ShowSevereError(state, "..." + DataIPShortCuts::cNumericFieldNames(2) + " must be greater than 0.0"); ErrorsFound = true; } @@ -597,9 +595,8 @@ namespace EnergyPlus::Boilers { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeBoilerHotWater: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -649,10 +646,9 @@ namespace EnergyPlus::Boilers { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpBoilerVolFlowRate - VolFlowRateUser) / VolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeBoilerHotWater: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Water Flow Rate of " + General::RoundSigDigits(VolFlowRateUser, 2) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Water Flow Rate of " + - General::RoundSigDigits(tmpBoilerVolFlowRate, 2) + " [m3/s]"); + ShowContinueError(state, format("User-Specified Design Water Flow Rate of {:.2R} [m3/s]", VolFlowRateUser)); + ShowContinueError( + state, format("differs from Design Size Design Water Flow Rate of {:.2R} [m3/s]", tmpBoilerVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -852,18 +848,19 @@ namespace EnergyPlus::Boilers { ++this->EffCurveOutputError; ShowWarningError(state, "Boiler:HotWater \"" + this->Name + "\""); ShowContinueError(state, "...Normalized Boiler Efficiency Curve output is less than or equal to 0."); - ShowContinueError(state, "...Curve input x value (PLR) = " + General::TrimSigDigits(this->BoilerPLR, 5)); + ShowContinueError(state, format("...Curve input x value (PLR) = {:.5T}", this->BoilerPLR)); if (state.dataCurveManager->PerfCurve(this->EfficiencyCurvePtr).NumDims == 2) { if (this->CurveTempMode == TempMode::ENTERINGBOILERTEMP) { - ShowContinueError(state, "...Curve input y value (Tinlet) = " + - General::TrimSigDigits(DataLoopNode::Node(BoilerInletNode).Temp, 2)); + ShowContinueError(state, format("...Curve input y value (Tinlet) = {:.2T}", DataLoopNode::Node(BoilerInletNode).Temp)); } else if (this->CurveTempMode == TempMode::LEAVINGBOILERTEMP) { - ShowContinueError(state, "...Curve input y value (Toutlet) = " + General::TrimSigDigits(this->BoilerOutletTemp, 2)); + ShowContinueError(state, format("...Curve input y value (Toutlet) = {:.2T}", this->BoilerOutletTemp)); } } - ShowContinueError(state, "...Curve output (normalized eff) = " + General::TrimSigDigits(EffCurveOutput, 5)); - ShowContinueError(state, "...Calculated Boiler efficiency = " + General::TrimSigDigits(BoilerEff, 5) + - " (Boiler efficiency = Nominal Thermal Efficiency * Normalized Boiler Efficiency Curve output)"); + ShowContinueError(state, format("...Curve output (normalized eff) = {:.5T}", EffCurveOutput)); + ShowContinueError(state, + format("...Calculated Boiler efficiency = {:.5T} (Boiler efficiency = Nominal Thermal Efficiency * Normalized " + "Boiler Efficiency Curve output)", + BoilerEff)); ShowContinueErrorTimeStamp(state, "...Curve output reset to 0.01 and simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, "Boiler:HotWater \"" + this->Name + @@ -884,18 +881,19 @@ namespace EnergyPlus::Boilers { ShowWarningError(state, "Boiler:HotWater \"" + this->Name + "\""); ShowContinueError(state, "...Calculated Boiler Efficiency is greater than 1.1."); ShowContinueError(state, "...Boiler Efficiency calculations shown below."); - ShowContinueError(state, "...Curve input x value (PLR) = " + General::TrimSigDigits(this->BoilerPLR, 5)); + ShowContinueError(state, format("...Curve input x value (PLR) = {:.5T}", this->BoilerPLR)); if (state.dataCurveManager->PerfCurve(this->EfficiencyCurvePtr).NumDims == 2) { if (this->CurveTempMode == TempMode::ENTERINGBOILERTEMP) { - ShowContinueError(state, "...Curve input y value (Tinlet) = " + - General::TrimSigDigits(DataLoopNode::Node(BoilerInletNode).Temp, 2)); + ShowContinueError(state, format("...Curve input y value (Tinlet) = {:.2T}", DataLoopNode::Node(BoilerInletNode).Temp)); } else if (this->CurveTempMode == TempMode::LEAVINGBOILERTEMP) { - ShowContinueError(state, "...Curve input y value (Toutlet) = " + General::TrimSigDigits(this->BoilerOutletTemp, 2)); + ShowContinueError(state, format("...Curve input y value (Toutlet) = {:.2T}", this->BoilerOutletTemp)); } } - ShowContinueError(state, "...Curve output (normalized eff) = " + General::TrimSigDigits(EffCurveOutput, 5)); - ShowContinueError(state, "...Calculated Boiler efficiency = " + General::TrimSigDigits(BoilerEff, 5) + - " (Boiler efficiency = Nominal Thermal Efficiency * Normalized Boiler Efficiency Curve output)"); + ShowContinueError(state, format("...Curve output (normalized eff) = {:.5T}", EffCurveOutput)); + ShowContinueError(state, + format("...Calculated Boiler efficiency = {:.5T} (Boiler efficiency = Nominal Thermal Efficiency * Normalized " + "Boiler Efficiency Curve output)", + BoilerEff)); ShowContinueErrorTimeStamp(state, "...Curve output reset to 1.1 and simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, "Boiler:HotWater \"" + this->Name + diff --git a/src/EnergyPlus/BranchInputManager.cc b/src/EnergyPlus/BranchInputManager.cc index f4fbaaa66ac..f0c4df7774d 100644 --- a/src/EnergyPlus/BranchInputManager.cc +++ b/src/EnergyPlus/BranchInputManager.cc @@ -142,7 +142,6 @@ namespace BranchInputManager { // returns number and names to the outside calling routine. // Using/Aliasing - using General::TrimSigDigits; int Found; // Points to correct Branch List/Branch bool ErrFound; // True when error has occurred (cannot find Branch List) @@ -176,7 +175,7 @@ namespace BranchInputManager { if (isize(BranchNames) < NumBranchNames) { ShowSevereError(state, "GetBranchList: Branch Names array not big enough to hold Branch Names"); ShowContinueError(state, "Input BranchListName=" + BranchListName + ", in Loop=" + LoopName); - ShowContinueError(state, "BranchName Array size=" + TrimSigDigits(size(BranchNames)) + ", but input size=" + TrimSigDigits(NumBranchNames)); + ShowContinueError(state, fmt::format("BranchName Array size={}, but input size={}", size(BranchNames), (NumBranchNames))); ErrFound = true; } else { BranchNames = ""; @@ -250,7 +249,6 @@ namespace BranchInputManager { // Branch Name and returns it in "list structure" to the calling routine. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Count; // Loop Counter @@ -270,7 +268,7 @@ namespace BranchInputManager { if (MinCompsAllowed < NumComps) { ShowSevereError(state, "GetBranchData: Component List arrays not big enough to hold Number of Components"); ShowContinueError(state, "Input BranchName=" + BranchName + ", in Loop=" + LoopName); - ShowContinueError(state, "Max Component Array size=" + TrimSigDigits(MinCompsAllowed) + ", but input size=" + TrimSigDigits(NumComps)); + ShowContinueError(state, fmt::format("Max Component Array size={}, but input size={}", MinCompsAllowed, NumComps)); ShowFatalError(state, "Program terminates due to preceding conditions."); } @@ -385,7 +383,6 @@ namespace BranchInputManager { // routine can either use this flow or use then branch flow for sizing. // Using/Aliasing - using General::TrimSigDigits; // FUNCTION LOCAL VARIABLE DECLARATIONS: int CompNum; @@ -403,7 +400,7 @@ namespace BranchInputManager { FanName = std::string(); if (NumBranches == 0) { - ShowSevereError(state, "GetBranchFanTypeName: Branch index not found = " + TrimSigDigits(BranchNum)); + ShowSevereError(state, fmt::format("GetBranchFanTypeName: Branch index not found = {}", BranchNum)); ErrFound = true; } else { if (BranchNum > 0 && BranchNum <= NumBranches) { @@ -419,7 +416,7 @@ namespace BranchInputManager { } if (FanType.empty()) ErrFound = true; } else { - ShowSevereError(state, "GetBranchFanTypeName: Branch index not found = " + TrimSigDigits(BranchNum)); + ShowSevereError(state, fmt::format("GetBranchFanTypeName: Branch index not found = {}", BranchNum)); ErrFound = true; } } @@ -612,7 +609,6 @@ namespace BranchInputManager { // if this connector list name is a mixer or not. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Count; // Loop Counter @@ -694,8 +690,7 @@ namespace BranchInputManager { if (NumInletNodes > isize(InletNodeNames) || NumInletNodes > isize(InletNodeNums)) { ShowSevereError(state, "GetLoopMixer: Connector:Mixer=" + MixerName + " contains too many inlets for size of Inlet Array."); - ShowContinueError(state, "Max array size=" + TrimSigDigits(size(InletNodeNames)) + - ", Mixer statement inlets=" + TrimSigDigits(NumInletNodes)); + ShowContinueError(state, fmt::format("Max array size={}, Mixer statement inlets={}", size(InletNodeNames), NumInletNodes)); ShowFatalError(state, "Program terminates due to preceding condition."); } InletNodeNums = 0; @@ -755,7 +750,6 @@ namespace BranchInputManager { // if this connector list name is a splitter or not. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Count; // Loop Counter @@ -841,8 +835,7 @@ namespace BranchInputManager { if (NumOutletNodes > isize(OutletNodeNames) || NumOutletNodes > isize(OutletNodeNums)) { ShowSevereError(state, "GetLoopSplitter: Connector:Splitter=" + SplitterName + " contains too many outlets for size of Outlet Array."); - ShowContinueError(state, "Max array size=" + TrimSigDigits(size(OutletNodeNames)) + - ", Splitter statement outlets=" + TrimSigDigits(NumOutletNodes)); + ShowContinueError(state, fmt::format("Max array size={}, Splitter statement outlets={}", size(OutletNodeNames), NumOutletNodes)); ShowFatalError(state, "Program terminates due to preceding condition."); } OutletNodeNums = 0; @@ -1087,7 +1080,6 @@ namespace BranchInputManager { { // Using using CurveManager::GetPressureCurveTypeAndIndex; - using General::RoundSigDigits; // Locals PressureCurveType pressureCurveType; @@ -1127,8 +1119,7 @@ namespace BranchInputManager { } if (Comp > NumInComps) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", invalid data."); - ShowContinueError(state, "...Number of Arguments indicate [" + RoundSigDigits(NumInComps) + "], but count of fields indicates [" + - RoundSigDigits(Comp) + ']'); + ShowContinueError(state, fmt::format("...Number of Arguments indicate [{}], but count of fields indicates [{}]", NumInComps, Comp)); ShowContinueError(state, "...examine " + CurrentModuleObject + " carefully."); continue; } @@ -1259,7 +1250,6 @@ namespace BranchInputManager { // \object-list Branches // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetBranchListInput: "); @@ -1357,7 +1347,7 @@ namespace BranchInputManager { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataBranchInputManager->BranchList(BCount).Name + "\", invalid data."); ShowContinueError(state, "..invalid: duplicate branch name specified in the list."); ShowContinueError(state, "..Branch Name=" + TestName); - ShowContinueError(state, "..Branch Name #" + TrimSigDigits(Loop) + " is duplicate."); + ShowContinueError(state, fmt::format("..Branch Name #{} is duplicate.", Loop)); ErrFound = true; } } @@ -1668,7 +1658,6 @@ namespace BranchInputManager { // \object-list Branches // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; // Used to retrieve names from IDF @@ -1749,9 +1738,12 @@ namespace BranchInputManager { for (Loop = 1; Loop <= state.dataBranchInputManager->Splitters(Count).NumOutletBranches; ++Loop) { Found = UtilityRoutines::FindItemInList(state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop), state.dataBranchInputManager->Branch); if (Found == 0) { - ShowSevereError(state, "GetSplitterInput: Invalid Branch=" + state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop) + - ", referenced as Outlet Branch # " + TrimSigDigits(Loop) + " to " + CurrentModuleObject + '=' + - state.dataBranchInputManager->Splitters(Count).Name); + ShowSevereError(state, + fmt::format("GetSplitterInput: Invalid Branch={}, referenced as Outlet Branch # {} to {}={}", + state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop), + Loop, + CurrentModuleObject, + state.dataBranchInputManager->Splitters(Count).Name)); ErrorsFound = true; } } @@ -1764,15 +1756,17 @@ namespace BranchInputManager { if (TestName != state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop)) continue; ShowSevereError(state, CurrentModuleObject + '=' + state.dataBranchInputManager->Splitters(Count).Name + " specifies an outlet node name the same as the inlet node."); ShowContinueError(state, "..Inlet Node=" + TestName); - ShowContinueError(state, "..Outlet Node #" + TrimSigDigits(Loop) + " is duplicate."); + ShowContinueError(state, fmt::format("..Outlet Node #{} is duplicate.", Loop)); ErrorsFound = true; } for (Loop = 1; Loop <= state.dataBranchInputManager->Splitters(Count).NumOutletBranches; ++Loop) { for (Loop1 = Loop + 1; Loop1 <= state.dataBranchInputManager->Splitters(Count).NumOutletBranches; ++Loop1) { if (state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop) != state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop1)) continue; ShowSevereError(state, CurrentModuleObject + '=' + state.dataBranchInputManager->Splitters(Count).Name + " specifies duplicate outlet nodes in its outlet node list."); - ShowContinueError(state, "..Outlet Node #" + TrimSigDigits(Loop) + " Name=" + state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop)); - ShowContinueError(state, "..Outlet Node #" + TrimSigDigits(Loop) + " is duplicate."); + ShowContinueError( + state, + fmt::format("..Outlet Node #{} Name={}", Loop, state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop))); + ShowContinueError(state, fmt::format("..Outlet Node #{} is duplicate.", Loop)); ErrorsFound = true; } } @@ -1895,7 +1889,6 @@ namespace BranchInputManager { // \object-list Branches // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; // Used to retrieve names from IDF @@ -1978,8 +1971,12 @@ namespace BranchInputManager { for (Loop = 1; Loop <= state.dataBranchInputManager->Mixers(Count).NumInletBranches; ++Loop) { Found = UtilityRoutines::FindItemInList(state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop), state.dataBranchInputManager->Branch); if (Found == 0) { - ShowSevereError(state, "GetMixerInput: Invalid Branch=" + state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop) + ", referenced as Inlet Branch # " + - TrimSigDigits(Loop) + " in " + CurrentModuleObject + '=' + state.dataBranchInputManager->Mixers(Count).Name); + ShowSevereError(state, + format("GetMixerInput: Invalid Branch={}, referenced as Inlet Branch # {} in {}={}", + state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop), + Loop, + CurrentModuleObject, + state.dataBranchInputManager->Mixers(Count).Name)); ErrorsFound = true; } } @@ -1992,15 +1989,16 @@ namespace BranchInputManager { if (TestName != state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop)) continue; ShowSevereError(state, CurrentModuleObject + '=' + state.dataBranchInputManager->Mixers(Count).Name + " specifies an inlet node name the same as the outlet node."); ShowContinueError(state, "..Outlet Node=" + TestName); - ShowContinueError(state, "..Inlet Node #" + TrimSigDigits(Loop) + " is duplicate."); + ShowContinueError(state, format("..Inlet Node #{} is duplicate.", Loop)); ErrorsFound = true; } for (Loop = 1; Loop <= state.dataBranchInputManager->Mixers(Count).NumInletBranches; ++Loop) { for (Loop1 = Loop + 1; Loop1 <= state.dataBranchInputManager->Mixers(Count).NumInletBranches; ++Loop1) { if (state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop) != state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop1)) continue; ShowSevereError(state, CurrentModuleObject + '=' + state.dataBranchInputManager->Mixers(Count).Name + " specifies duplicate inlet nodes in its inlet node list."); - ShowContinueError(state, "..Inlet Node #" + TrimSigDigits(Loop) + " Name=" + state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop)); - ShowContinueError(state, "..Inlet Node #" + TrimSigDigits(Loop) + " is duplicate."); + ShowContinueError( + state, fmt::format("..Inlet Node #{} Name={}", Loop, state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop))); + ShowContinueError(state, fmt::format("..Inlet Node #{} is duplicate.", Loop)); ErrorsFound = true; } } @@ -2354,7 +2352,6 @@ namespace BranchInputManager { // Using/Aliasing using DataErrorTracking::TotalSevereErrors; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumDanglingCount; // when mustprint not true, count and report @@ -2402,7 +2399,7 @@ namespace BranchInputManager { ShowContinueError(state, "Look for mistyped branch or component names/types."); } if (!mustprint && NumDanglingCount > 0) { - ShowSevereMessage(state, "AuditBranches: There are " + RoundSigDigits(NumDanglingCount) + " branch(es) that do not appear on any BranchList."); + ShowSevereMessage(state, fmt::format("AuditBranches: There are {} branch(es) that do not appear on any BranchList.", NumDanglingCount)); TotalSevereErrors += NumDanglingCount; ShowContinueError(state, "Use Output:Diagnostics,DisplayExtraWarnings; for detail of each branch not on a branch list."); } @@ -2422,7 +2419,6 @@ namespace BranchInputManager { // Also, input and output nodes. // Using/Aliasing - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Loop; diff --git a/src/EnergyPlus/BranchNodeConnections.cc b/src/EnergyPlus/BranchNodeConnections.cc index ee773aac6c2..86a35c04588 100644 --- a/src/EnergyPlus/BranchNodeConnections.cc +++ b/src/EnergyPlus/BranchNodeConnections.cc @@ -56,7 +56,6 @@ #include #include #include -#include #include namespace EnergyPlus::BranchNodeConnections { @@ -299,7 +298,6 @@ namespace EnergyPlus::BranchNodeConnections { // Needs description, as appropriate. // Using/Aliasing - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Loop1; @@ -616,7 +614,7 @@ namespace EnergyPlus::BranchNodeConnections { state.dataBranchNodeConnections->NodeConnections(Loop1).ObjectName); ShowContinueError(state, "Object has multiple connections on both inlet and outlet fluid streams."); for (Loop2 = 1; Loop2 <= MaxFluidStream; ++Loop2) { - if (FluidStreamCounts(Loop2)) ShowContinueError(state, "...occurs in Fluid Stream [" + RoundSigDigits(Loop2) + "]."); + if (FluidStreamCounts(Loop2)) ShowContinueError(state, format("...occurs in Fluid Stream [{}].", Loop2)); } ++ErrorCounter; ErrorsFound = true; diff --git a/src/EnergyPlus/CMakeLists.txt b/src/EnergyPlus/CMakeLists.txt index 03e8c745897..75a16febec5 100644 --- a/src/EnergyPlus/CMakeLists.txt +++ b/src/EnergyPlus/CMakeLists.txt @@ -762,7 +762,7 @@ endif() add_library( energyplusparser STATIC ${INPUTPARSING_SRC} ) add_dependencies( energyplusparser GenerateEmbeddedEpJSONSchema ) -target_link_libraries( energyplusparser re2 ) +target_link_libraries( energyplusparser re2 fmt::fmt) if(UNIX AND NOT APPLE) target_link_libraries( energyplusparser dl ) endif() diff --git a/src/EnergyPlus/CTElectricGenerator.cc b/src/EnergyPlus/CTElectricGenerator.cc index b911f54ba1c..8d7a5f6cd33 100644 --- a/src/EnergyPlus/CTElectricGenerator.cc +++ b/src/EnergyPlus/CTElectricGenerator.cc @@ -187,7 +187,7 @@ namespace CTElectricGenerator { state.dataCTElectricGenerator->CTGenerator(genNum).RatedPowerOutput = NumArray(1); if (NumArray(1) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + General::RoundSigDigits(NumArray(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), NumArray(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ErrorsFound = true; } diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index d696e714f9b..1cafee3757f 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -127,7 +127,6 @@ namespace CoolingPanelSimple { using DataLoopNode::Node; using DataPlant::TypeOf_CoolingPanel_Simple; using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CoolingPanelNum; // Index of unit in baseboard array @@ -150,13 +149,19 @@ namespace CoolingPanelSimple { } else { CoolingPanelNum = CompIndex; if (CoolingPanelNum > state.dataChilledCeilingPanelSimple->NumCoolingPanels || CoolingPanelNum < 1) { - ShowFatalError(state, "SimCoolingPanelSimple: Invalid CompIndex passed=" + TrimSigDigits(CoolingPanelNum) + - ", Number of Units=" + TrimSigDigits(state.dataChilledCeilingPanelSimple->NumCoolingPanels) + ", Entered Unit name=" + EquipName); + ShowFatalError(state, + format("SimCoolingPanelSimple: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + CoolingPanelNum, + state.dataChilledCeilingPanelSimple->NumCoolingPanels, + EquipName)); } if (state.dataChilledCeilingPanelSimple->CheckEquipName(CoolingPanelNum)) { if (EquipName != state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID) { - ShowFatalError(state, "SimCoolingPanelSimple: Invalid CompIndex passed=" + TrimSigDigits(CoolingPanelNum) + ", Unit name=" + EquipName + - ", stored Unit Name for that index=" + state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID); + ShowFatalError(state, + format("SimCoolingPanelSimple: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + CoolingPanelNum, + EquipName, + state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID)); } state.dataChilledCeilingPanelSimple->CheckEquipName(CoolingPanelNum) = false; } @@ -187,7 +192,9 @@ namespace CoolingPanelSimple { ThisCP.CalcCoolingPanel(state, CoolingPanelNum); } else { ShowSevereError(state, "SimCoolingPanelSimple: Errors in CoolingPanel=" + state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID); - ShowContinueError(state, "Invalid or unimplemented equipment type=" + TrimSigDigits(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipType)); + ShowContinueError(state, + format("Invalid or unimplemented equipment type={}", + state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipType)); ShowFatalError(state, "Preceding condition causes termination."); } } @@ -224,8 +231,7 @@ namespace CoolingPanelSimple { using DataLoopNode::ObjectIsNotParent; using DataPlant::TypeOf_CoolingPanel_Simple; using DataSurfaces::Surface; - using General::RoundSigDigits; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; using ScheduleManager::GetScheduleIndex; using namespace DataIPShortCuts; @@ -332,12 +338,12 @@ namespace CoolingPanelSimple { if (ThisCP.RatedWaterTemp > MaxWaterTempAvg + 0.001) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(1) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxWaterTempAvg, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxWaterTempAvg)); ThisCP.RatedWaterTemp = MaxWaterTempAvg; } else if (ThisCP.RatedWaterTemp < MinWaterTempAvg - 0.001) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(1) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinWaterTempAvg, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinWaterTempAvg)); ThisCP.RatedWaterTemp = MinWaterTempAvg; } @@ -345,12 +351,12 @@ namespace CoolingPanelSimple { if (ThisCP.RatedZoneAirTemp > MaxWaterTempAvg + 0.001) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(2) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxWaterTempAvg, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxWaterTempAvg)); ThisCP.RatedZoneAirTemp = MaxWaterTempAvg; } else if (ThisCP.RatedZoneAirTemp < MinWaterTempAvg - 0.001) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(2) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinWaterTempAvg, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinWaterTempAvg)); ThisCP.RatedZoneAirTemp = MinWaterTempAvg; } @@ -358,7 +364,7 @@ namespace CoolingPanelSimple { if (ThisCP.RatedWaterFlowRate < 0.00001 || ThisCP.RatedWaterFlowRate > 10.0) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(2) + " is an invalid Standard Water mass flow rate."); - ShowContinueError(state, "...reset to a default value=[" + RoundSigDigits(WaterMassFlowDefault, 1) + "]."); + ShowContinueError(state, format("...reset to a default value=[{:.1R}].", WaterMassFlowDefault)); ThisCP.RatedWaterFlowRate = WaterMassFlowDefault; } @@ -368,7 +374,7 @@ namespace CoolingPanelSimple { ThisCP.ScaledCoolingCapacity = rNumericArgs(4); if (ThisCP.ScaledCoolingCapacity < 0.0 && ThisCP.ScaledCoolingCapacity != DataSizing::AutoSize) { ShowSevereError(state, cCMO_CoolingPanel_Simple + " = " + ThisCP.EquipID); - ShowContinueError(state, "Illegal " + cNumericFieldNames(4) + " = " + TrimSigDigits(rNumericArgs(4), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFieldNames(4), rNumericArgs(4))); ErrorsFound = true; } } else { @@ -386,7 +392,7 @@ namespace CoolingPanelSimple { if (ThisCP.CoolingCapMethod <= 0.0) { ShowSevereError(state, cCMO_CoolingPanel_Simple + " = " + ThisCP.EquipID); ShowContinueError(state, "Input for " + cAlphaFieldNames(5) + " = " + cAlphaArgs(5)); - ShowContinueError(state, "Illegal " + cNumericFieldNames(5) + " = " + TrimSigDigits(rNumericArgs(5), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFieldNames(5), rNumericArgs(5))); ErrorsFound = true; } else if (ThisCP.ScaledCoolingCapacity == DataSizing::AutoSize) { ShowSevereError(state, cCMO_CoolingPanel_Simple + " = " + ThisCP.EquipID); @@ -406,7 +412,7 @@ namespace CoolingPanelSimple { ThisCP.ScaledCoolingCapacity = rNumericArgs(6); if (ThisCP.ScaledCoolingCapacity < 0.0) { ShowSevereError(state, cCMO_CoolingPanel_Simple + " = " + ThisCP.EquipID); - ShowContinueError(state, "Illegal " + cNumericFieldNames(6) + " = " + TrimSigDigits(rNumericArgs(6), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFieldNames(6), rNumericArgs(6))); ErrorsFound = true; } } else { @@ -425,12 +431,12 @@ namespace CoolingPanelSimple { if ((ThisCP.WaterVolFlowRateMax <= MinWaterFlowRate) && ThisCP.WaterVolFlowRateMax != DataSizing::AutoSize) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(7) + " was less than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinWaterFlowRate, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinWaterFlowRate)); ThisCP.WaterVolFlowRateMax = MinWaterFlowRate; } else if (ThisCP.WaterVolFlowRateMax > MaxWaterFlowRate) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(7) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxWaterFlowRate, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxWaterFlowRate)); ThisCP.WaterVolFlowRateMax = MaxWaterFlowRate; } @@ -487,13 +493,13 @@ namespace CoolingPanelSimple { if (ThisCP.FracRadiant < MinFraction) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(10) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinFraction, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinFraction)); ThisCP.FracRadiant = MinFraction; } if (ThisCP.FracRadiant > MaxFraction) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(10) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxFraction)); ThisCP.FracRadiant = MaxFraction; } @@ -512,13 +518,13 @@ namespace CoolingPanelSimple { if (ThisCP.FracDistribPerson < MinFraction) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(11) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinFraction, 3) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.3R}].", MinFraction)); ThisCP.FracDistribPerson = MinFraction; } if (ThisCP.FracDistribPerson > MaxFraction) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(11) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 3) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.3R}].", MaxFraction)); ThisCP.FracDistribPerson = MaxFraction; } @@ -526,7 +532,7 @@ namespace CoolingPanelSimple { if ((ThisCP.TotSurfToDistrib < MinDistribSurfaces) && (ThisCP.FracRadiant > MinFraction)) { ShowSevereError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", the number of surface/radiant fraction groups entered was less than the allowable minimum."); - ShowContinueError(state, "...the minimum that must be entered=[" + RoundSigDigits(MinDistribSurfaces) + "]."); + ShowContinueError(state, format("...the minimum that must be entered=[{}].", MinDistribSurfaces)); ErrorsFound = true; ThisCP.TotSurfToDistrib = 0; // error } @@ -563,13 +569,13 @@ namespace CoolingPanelSimple { if (ThisCP.FracDistribToSurf(SurfNum) > MaxFraction) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(SurfNum + 8) + "was greater than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxFraction)); ThisCP.TotSurfToDistrib = MaxFraction; } if (ThisCP.FracDistribToSurf(SurfNum) < MinFraction) { ShowWarningError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(SurfNum + 8) + "was less than the allowable minimum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MinFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MinFraction)); ThisCP.TotSurfToDistrib = MinFraction; } if (ThisCP.SurfacePtr(SurfNum) != 0) { @@ -589,13 +595,14 @@ namespace CoolingPanelSimple { ShowSevereError(state, RoutineName + cCMO_CoolingPanel_Simple + "=\"" + cAlphaArgs(1) + "\", Summed radiant fractions for people + surface groups < 1.0"); ShowContinueError(state, "This would result in some of the radiant energy delivered by the high temp radiant heater being lost."); - ShowContinueError(state, "The sum of all radiation fractions to surfaces = " + - TrimSigDigits((AllFracsSummed - ThisCP.FracDistribPerson), 5)); - ShowContinueError(state, "The radiant fraction to people = " + TrimSigDigits(ThisCP.FracDistribPerson, 5)); - ShowContinueError(state, "So, all radiant fractions including surfaces and people = " + TrimSigDigits(AllFracsSummed, 5)); ShowContinueError(state, - "This means that the fraction of radiant energy that would be lost from the high temperature radiant heater would be = " + - TrimSigDigits((1.0 - AllFracsSummed), 5)); + format("The sum of all radiation fractions to surfaces = {:.5T}", (AllFracsSummed - ThisCP.FracDistribPerson))); + ShowContinueError(state, format("The radiant fraction to people = {:.5T}", ThisCP.FracDistribPerson)); + ShowContinueError(state, format("So, all radiant fractions including surfaces and people = {:.5T}", AllFracsSummed)); + ShowContinueError(state, + format("This means that the fraction of radiant energy that would be lost from the high temperature radiant heater " + "would be = {:.5T}", + (1.0 - AllFracsSummed))); ShowContinueError(state, "Please check and correct this so that all radiant energy is accounted for in " + cCMO_CoolingPanel_Simple + " = " + cAlphaArgs(1)); ErrorsFound = true; @@ -900,7 +907,7 @@ namespace CoolingPanelSimple { using DataHeatBalance::Zone; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -1061,10 +1068,9 @@ namespace CoolingPanelSimple { ShowMessage(state, "SizeCoolingPanel: Potential issue with equipment sizing for ZoneHVAC:CoolingPanel:RadiantConvective:Water = \"" + ThisCP.EquipID + "\"."); - ShowContinueError(state, "User-Specified Maximum Cool Water Flow of " + RoundSigDigits(WaterVolFlowMaxCoolUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Cool Water Flow of " + RoundSigDigits(WaterVolFlowMaxCoolDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Cool Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxCoolUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Cool Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxCoolDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1179,7 +1185,7 @@ namespace CoolingPanelSimple { using DataZoneEnergyDemands::CurDeadBandOrSetback; using DataZoneEnergyDemands::ZoneSysEnergyDemand; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyTdpFnWPb; using ScheduleManager::GetCurrentScheduleValue; @@ -1271,11 +1277,11 @@ namespace CoolingPanelSimple { ShowWarningMessage(state, cCMO_CoolingPanel_Simple + " [" + this->EquipID + "] inlet water temperature below dew-point temperature--potential for condensation exists"); ShowContinueError(state, "Flow to the simple cooling panel will be shut-off to avoid condensation"); - ShowContinueError(state, "Water inlet temperature = " + RoundSigDigits(waterInletTemp, 2)); - ShowContinueError(state, "Zone dew-point temperature + safety delta T= " + RoundSigDigits(DewPointTemp + this->CondDewPtDeltaT, 2)); + ShowContinueError(state, format("Water inlet temperature = {:.2R}", waterInletTemp)); + ShowContinueError(state, format("Zone dew-point temperature + safety delta T= {:.2R}", DewPointTemp + this->CondDewPtDeltaT)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Note that a " + RoundSigDigits(this->CondDewPtDeltaT, 4) + - " C safety was chosen in the input for the shut-off criteria"); + ShowContinueError( + state, format("Note that a {:.4R} C safety was chosen in the input for the shut-off criteria", this->CondDewPtDeltaT)); } ShowRecurringWarningErrorAtEnd(state, cCMO_CoolingPanel_Simple + " [" + this->EquipID + "] condensation shut-off occurrence continues.", this->CondErrIndex, @@ -1601,7 +1607,6 @@ namespace CoolingPanelSimple { using DataHeatBalFanSys::QCoolingPanelSurf; using DataHeatBalFanSys::QCoolingPanelToPerson; using DataSurfaces::Surface; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: Real64 const SmallestArea(0.001); // Smallest area in meters squared (to avoid a divide by zero) @@ -1636,16 +1641,16 @@ namespace CoolingPanelSimple { if (ThisSurfIntensity > MaxRadHeatFlux) { ShowSevereError(state, "DistributeCoolingPanelRadGains: excessive thermal radiation heat flux intensity detected"); ShowContinueError(state, "Surface = " + ThisSurf.Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(ThisSurf.Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", ThisSurf.Area)); ShowContinueError(state, "Occurs in " + cCMO_CoolingPanel_Simple + " = " + ThisCP.EquipID); - ShowContinueError(state, "Radiation intensity = " + RoundSigDigits(ThisSurfIntensity, 2) + " [W/m2]"); + ShowContinueError(state, format("Radiation intensity = {:.2R} [W/m2]", ThisSurfIntensity)); ShowContinueError(state, "Assign a larger surface area or more surfaces in " + cCMO_CoolingPanel_Simple); ShowFatalError(state, "DistributeCoolingPanelRadGains: excessive thermal radiation heat flux intensity detected"); } } else { ShowSevereError(state, "DistributeCoolingPanelRadGains: surface not large enough to receive thermal radiation heat flux"); ShowContinueError(state, "Surface = " + ThisSurf.Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(ThisSurf.Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", ThisSurf.Area)); ShowContinueError(state, "Occurs in " + cCMO_CoolingPanel_Simple + " = " + ThisCP.EquipID); ShowContinueError(state, "Assign a larger surface area or more surfaces in " + cCMO_CoolingPanel_Simple); ShowFatalError(state, "DistributeCoolingPanelRadGains: surface not large enough to receive thermal radiation heat flux"); diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index 2b4b996f361..2f32b6bdbec 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -171,10 +171,14 @@ namespace ChillerAbsorption { FirstHVACIteration); } else { - ShowFatalError(state, "SimBLASTAbsorber: Invalid LoopNum passed=" + General::TrimSigDigits(calledFromLocation.loopNum) + - ", Unit name=" + this->Name + ", stored chilled water loop=" + General::TrimSigDigits(this->CWLoopNum) + - ", stored condenser water loop=" + General::TrimSigDigits(this->CDLoopNum) + - ", stored generator loop=" + General::TrimSigDigits(this->GenLoopNum)); + ShowFatalError(state, + format("SimBLASTAbsorber: Invalid LoopNum passed={}, Unit name={}, stored chilled water loop={}, stored condenser water " + "loop={}, stored generator loop={}", + calledFromLocation.loopNum, + this->Name, + this->CWLoopNum, + this->CDLoopNum, + this->GenLoopNum)); } } @@ -281,8 +285,7 @@ namespace ChillerAbsorption { thisChiller.NomPumpPowerWasAutoSized = true; } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } @@ -458,8 +461,7 @@ namespace ChillerAbsorption { if (thisChiller.GeneratorVolFlowRate == 0.0 && thisChiller.GenHeatSourceType == DataLoopNode::NodeType_Water) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(16) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(16), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(16), DataIPShortCuts::rNumericArgs(16))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "...Generator water flow rate must be greater than 0 when absorber generator fluid type is hot water."); ErrorsFound = true; @@ -962,9 +964,8 @@ namespace ChillerAbsorption { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorption: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1014,9 +1015,8 @@ namespace ChillerAbsorption { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomPumpPower - NomPumpPowerUser) / NomPumpPowerUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorption: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Pumping Power of " + General::RoundSigDigits(NomPumpPowerUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Pumping Power of " + General::RoundSigDigits(tmpNomPumpPower, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Pumping Power of {:.2R} [W]", NomPumpPowerUser)); + ShowContinueError(state, format("differs from Design Size Nominal Pumping Power of {:.2R} [W]", tmpNomPumpPower)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1060,10 +1060,11 @@ namespace ChillerAbsorption { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorption: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Chilled Water Flow Rate of " + - General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Design Chilled Water Flow Rate of {:.5R} [m3/s]", EvapVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1135,10 +1136,11 @@ namespace ChillerAbsorption { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorption: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Condenser Water Flow Rate of " + - General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Condenser Water Flow Rate of {:.5R} [m3/s]", CondVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Condenser Water Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1209,10 +1211,12 @@ namespace ChillerAbsorption { if ((std::abs(tmpGeneratorVolFlowRate - GeneratorVolFlowRateUser) / GeneratorVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorption: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Generator Fluid Flow Rate of " + - General::RoundSigDigits(GeneratorVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Generator Fluid Flow Rate of " + - General::RoundSigDigits(tmpGeneratorVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Design Generator Fluid Flow Rate of {:.5R} [m3/s]", GeneratorVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Design Generator Fluid Flow Rate of {:.5R} [m3/s]", + tmpGeneratorVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1268,10 +1272,12 @@ namespace ChillerAbsorption { if ((std::abs(tmpGeneratorVolFlowRate - GeneratorVolFlowRateUser) / GeneratorVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorption: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Generator Fluid Flow Rate of " + - General::RoundSigDigits(GeneratorVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Generator Fluid Flow Rate of " + - General::RoundSigDigits(tmpGeneratorVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Design Generator Fluid Flow Rate of {:.5R} [m3/s]", GeneratorVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Design Generator Fluid Flow Rate of {:.5R} [m3/s]", + tmpGeneratorVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index f73c24a7a74..7e10df4974a 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -455,15 +455,13 @@ namespace ChillerElectricEIR { } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowContinueError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ErrorsFound = true; } thisChiller.RefCOP = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); + ShowContinueError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ErrorsFound = true; } thisChiller.TempRefEvapOut = DataIPShortCuts::rNumericArgs(3); @@ -486,9 +484,12 @@ namespace ChillerElectricEIR { if (thisChiller.MinPartLoadRat > thisChiller.MaxPartLoadRat) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(7) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(7), 3) + - "] > " + DataIPShortCuts::cNumericFieldNames(8) + " [" + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(8), 3) + ']'); + ShowContinueError(state, + format("{} [{:.3R}] > {} [{:.3R}]", + DataIPShortCuts::cNumericFieldNames(7), + DataIPShortCuts::rNumericArgs(7), + DataIPShortCuts::cNumericFieldNames(8), + DataIPShortCuts::rNumericArgs(8))); ShowContinueError(state, "Minimum part load ratio must be less than or equal to the maximum part load ratio "); ErrorsFound = true; } @@ -496,7 +497,7 @@ namespace ChillerElectricEIR { if (thisChiller.MinUnloadRat < thisChiller.MinPartLoadRat || thisChiller.MinUnloadRat > thisChiller.MaxPartLoadRat) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(10) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(10), 3)); + ShowContinueError(state, format("{} = {:.3R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(10) + " must be greater than or equal to the " + DataIPShortCuts::cNumericFieldNames(7)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(10) + " must be less than or equal to the " + @@ -507,7 +508,7 @@ namespace ChillerElectricEIR { if (thisChiller.OptPartLoadRat < thisChiller.MinPartLoadRat || thisChiller.OptPartLoadRat > thisChiller.MaxPartLoadRat) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(9) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(9), 3)); + ShowContinueError(state, format("{} = {:.3R}", DataIPShortCuts::cNumericFieldNames(9), DataIPShortCuts::rNumericArgs(9))); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(9) + " must be greater than or equal to the " + DataIPShortCuts::cNumericFieldNames(7)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(9) + " must be less than or equal to the " + @@ -521,7 +522,7 @@ namespace ChillerElectricEIR { if (thisChiller.CompPowerToCondenserFrac < 0.0 || thisChiller.CompPowerToCondenserFrac > 1.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(12) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(12), 3)); + ShowContinueError(state, format("{} = {:.3R}", DataIPShortCuts::cNumericFieldNames(12), DataIPShortCuts::rNumericArgs(12))); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(12) + " must be greater than or equal to zero"); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(12) + " must be less than or equal to one"); ErrorsFound = true; @@ -645,7 +646,7 @@ namespace ChillerElectricEIR { ShowWarningError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError(state, "Capacity ratio as a function of temperature curve output is not equal to 1.0 (+ or - 10%) at reference conditions."); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } } @@ -657,7 +658,7 @@ namespace ChillerElectricEIR { ShowWarningError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError(state, "Energy input ratio as a function of temperature curve output is not equal to 1.0 (+ or - 10%) at reference conditions."); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } } @@ -668,7 +669,7 @@ namespace ChillerElectricEIR { ShowWarningError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError(state, "Energy input ratio as a function of part-load ratio curve output is not equal to 1.0 (+ or - 10%) at reference conditions."); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } } @@ -1280,10 +1281,11 @@ namespace ChillerElectricEIR { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectricEIR: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Reference Chilled Water Flow Rate of " + - General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Reference Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Reference Chilled Water Flow Rate of {:.5R} [m3/s]", EvapVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Reference Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1347,9 +1349,8 @@ namespace ChillerElectricEIR { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - RefCapUser) / RefCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectricEIR: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Reference Capacity of " + General::RoundSigDigits(RefCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Reference Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Reference Capacity of {:.2R} [W]", RefCapUser)); + ShowContinueError(state, format("differs from Design Size Reference Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1414,10 +1415,11 @@ namespace ChillerElectricEIR { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectricEIR: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Reference Condenser Fluid Flow Rate of " + - General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Reference Condenser Fluid Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Reference Condenser Fluid Flow Rate of {:.5R} [m3/s]", CondVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Reference Condenser Fluid Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1499,10 +1501,10 @@ namespace ChillerElectricEIR { if ((std::abs(tempHeatRecVolFlowRate - nomHeatRecVolFlowRateUser) / nomHeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectricEIR: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Heat Recovery Water Flow Rate of " + - General::RoundSigDigits(nomHeatRecVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Heat Recovery Water Flow Rate of " + - General::RoundSigDigits(tempHeatRecVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Heat Recovery Water Flow Rate of {:.5R} [m3/s]", nomHeatRecVolFlowRateUser)); + ShowContinueError( + state, format("differs from Design Size Heat Recovery Water Flow Rate of {:.5R} [m3/s]", tempHeatRecVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1805,10 +1807,12 @@ namespace ChillerElectricEIR { !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); - ShowContinueError(state, " Chiller Capacity as a Function of Temperature curve output is negative (" + - General::RoundSigDigits(this->ChillerCapFT, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an Evaporator Outlet Temp of " + General::RoundSigDigits(EvapOutletTempSetPoint, 1) + - " and a Condenser Inlet Temp of " + General::RoundSigDigits(condInletTemp, 1) + '.'); + ShowContinueError(state, + format(" Chiller Capacity as a Function of Temperature curve output is negative ({:.3R}).", this->ChillerCapFT)); + ShowContinueError(state, + format(" Negative value occurs using an Evaporator Outlet Temp of {:.1R} and a Condenser Inlet Temp of {:.1R}.", + EvapOutletTempSetPoint, + condInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; @@ -2095,10 +2099,11 @@ namespace ChillerElectricEIR { !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); - ShowContinueError(state, " Chiller EIR as a Function of Temperature curve output is negative (" + - General::RoundSigDigits(this->ChillerEIRFT, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an Evaporator Outlet Temp of " + General::RoundSigDigits(this->EvapOutletTemp, 1) + - " and a Condenser Inlet Temp of " + General::RoundSigDigits(condInletTemp, 1) + '.'); + ShowContinueError(state, format(" Chiller EIR as a Function of Temperature curve output is negative ({:.3R}).", this->ChillerEIRFT)); + ShowContinueError(state, + format(" Negative value occurs using an Evaporator Outlet Temp of {:.1R} and a Condenser Inlet Temp of {:.1R}.", + this->EvapOutletTemp, + condInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; @@ -2117,9 +2122,8 @@ namespace ChillerElectricEIR { !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); - ShowContinueError(state, " Chiller EIR as a function of PLR curve output is negative (" + General::RoundSigDigits(this->ChillerEIRFPLR, 3) + - ")."); - ShowContinueError(state, " Negative value occurs using a part-load ratio of " + General::RoundSigDigits(PartLoadRat, 3) + '.'); + ShowContinueError(state, format(" Chiller EIR as a function of PLR curve output is negative ({:.3R}).", this->ChillerEIRFPLR)); + ShowContinueError(state, format(" Negative value occurs using a part-load ratio of {:.3R}.", PartLoadRat)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; @@ -2150,7 +2154,7 @@ namespace ChillerElectricEIR { // DSU? maybe this could be handled earlier, check if this component has a load and an evap flow rate // then if cond flow is zero, just make a request to the condenser, // then just say it couldn't run until condenser loop wakes up. - // CALL ShowFatalError('Program Terminates due to previous error condition.') + // CALL ShowFatalError(state, 'Program Terminates due to previous error condition.') } } else { // Air Cooled or Evap Cooled diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index a8df124c43e..2f1d149bae5 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -978,9 +978,8 @@ namespace ChillerExhaustAbsorption { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1045,10 +1044,11 @@ namespace ChillerExhaustAbsorption { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Chilled Water Flow Rate of " + - General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Design Chilled Water Flow Rate of {:.5R} [m3/s]", EvapVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1117,10 +1117,10 @@ namespace ChillerExhaustAbsorption { if ((std::abs(tmpHeatRecVolFlowRate - HeatRecVolFlowRateUser) / HeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Hot Water Flow Rate of " + - General::RoundSigDigits(HeatRecVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Hot Water Flow Rate of " + - General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Design Hot Water Flow Rate of {:.5R} [m3/s]", HeatRecVolFlowRateUser)); + ShowContinueError( + state, format("differs from Design Size Design Hot Water Flow Rate of {:.5R} [m3/s]", tmpHeatRecVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1200,10 +1200,11 @@ namespace ChillerExhaustAbsorption { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Condenser Water Flow Rate of " + - General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Condenser Water Flow Rate of {:.5R} [m3/s]", CondVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Condenser Water Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1602,9 +1603,9 @@ namespace ChillerExhaustAbsorption { ShowWarningError(state, "ChillerHeater:Absorption:DoubleEffect \"" + this->Name + "\""); ShowContinueError(state, "...Exhaust temperature and flow input from Micro Turbine is not sufficient during cooling to run the chiller "); - ShowContinueError(state, "...Value of Exhaust air inlet temp =" + General::TrimSigDigits(lExhaustInTemp, 4) + " C."); - ShowContinueError(state, "... and Exhaust air flow rate of " + General::TrimSigDigits(lExhaustInFlow, 2) + " kg/s."); - ShowContinueError(state, "...Value of minimum absorber leaving temp =" + General::TrimSigDigits(AbsLeavingTemp, 4) + " C."); + ShowContinueError(state, format("...Value of Exhaust air inlet temp ={:.4T} C.", lExhaustInTemp)); + ShowContinueError(state, format("... and Exhaust air flow rate of {:.2T} kg/s.", lExhaustInFlow)); + ShowContinueError(state, format("...Value of minimum absorber leaving temp ={:.4T} C.", AbsLeavingTemp)); ShowContinueError(state, "...Either increase the Exhaust temperature (min required = 350 C ) or flow or both of Micro Turbine to meet " "the min available potential criteria."); ShowContinueErrorTimeStamp(state, "... Simulation will continue."); @@ -1891,9 +1892,9 @@ namespace ChillerExhaustAbsorption { ShowWarningError(state, "ChillerHeater:Absorption:DoubleEffect \"" + this->Name + "\""); ShowContinueError(state, "...Exhaust temperature and flow input from Micro Turbine is not sufficient to run the chiller during heating ."); - ShowContinueError(state, "...Value of Exhaust air inlet temp =" + General::TrimSigDigits(lExhaustInTemp, 4) + " C."); - ShowContinueError(state, "... and Exhaust air flow rate of " + General::TrimSigDigits(lExhaustInFlow, 2) + " kg/s."); - ShowContinueError(state, "...Value of minimum absorber leaving temp =" + General::TrimSigDigits(AbsLeavingTemp, 4) + " C."); + ShowContinueError(state, format("...Value of Exhaust air inlet temp ={:.4T} C.", lExhaustInTemp)); + ShowContinueError(state, format("... and Exhaust air flow rate of {:.2T} kg/s.", lExhaustInFlow)); + ShowContinueError(state, format("...Value of minimum absorber leaving temp ={:.4T} C.", AbsLeavingTemp)); ShowContinueError(state, "...Either increase the Exhaust temperature (min required = 350 C ) or flow or both of Micro Turbine to meet " "the min available potential criteria."); ShowContinueErrorTimeStamp(state, "... Simulation will continue."); diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index 6bf05e863f6..2d272d11967 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -970,9 +970,8 @@ namespace ChillerGasAbsorption { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerHeaterAbsorptionDirectFired: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1036,10 +1035,11 @@ namespace ChillerGasAbsorption { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorptionDirectFired: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Chilled Water Flow Rate of " + - General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Design Chilled Water Flow Rate of {:.5R} [m3/s]", EvapVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1108,10 +1108,10 @@ namespace ChillerGasAbsorption { if ((std::abs(tmpHeatRecVolFlowRate - HeatRecVolFlowRateUser) / HeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerHeaterAbsorptionDirectFired: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Hot Water Flow Rate of " + - General::RoundSigDigits(HeatRecVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Hot Water Flow Rate of " + - General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Design Hot Water Flow Rate of {:.5R} [m3/s]", HeatRecVolFlowRateUser)); + ShowContinueError( + state, format("differs from Design Size Design Hot Water Flow Rate of {:.5R} [m3/s]", tmpHeatRecVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1192,10 +1192,11 @@ namespace ChillerGasAbsorption { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorptionDirectFired: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Condenser Water Flow Rate of " + - General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Condenser Water Flow Rate of {:.5R} [m3/s]", CondVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Condenser Water Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index d598636d99f..c68c9b8824b 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -165,10 +165,14 @@ namespace ChillerIndirectAbsorption { FirstHVACIteration); } else { - ShowFatalError(state, "SimIndirectAbsorber: Invalid LoopNum passed=" + General::TrimSigDigits(calledFromLocation.loopNum) + - ", Unit name=" + this->Name + ", stored chilled water loop=" + General::TrimSigDigits(this->CWLoopNum) + - ", stored condenser water loop=" + General::TrimSigDigits(this->CDLoopNum) + - ", stored generator loop=" + General::TrimSigDigits(this->GenLoopNum)); + ShowFatalError(state, + format("SimIndirectAbsorber: Invalid LoopNum passed={}, Unit name={}, stored chilled water loop={}, stored condenser " + "water loop={}, stored generator loop={}", + calledFromLocation.loopNum, + this->Name, + this->CWLoopNum, + this->CDLoopNum, + this->GenLoopNum)); } } @@ -268,8 +272,7 @@ namespace ChillerIndirectAbsorption { thisChiller.NomPumpPowerWasAutoSized = true; } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } @@ -1049,9 +1052,8 @@ namespace ChillerIndirectAbsorption { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorptionIndirect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1105,9 +1107,8 @@ namespace ChillerIndirectAbsorption { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomPumpPower - NomPumpPowerUser) / NomPumpPowerUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorptionIndirect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Pumping Power of " + General::RoundSigDigits(NomPumpPowerUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Pumping Power of " + General::RoundSigDigits(tmpNomPumpPower, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Pumping Power of {:.2R} [W]", NomPumpPowerUser)); + ShowContinueError(state, format("differs from Design Size Nominal Pumping Power of {:.2R} [W]", tmpNomPumpPower)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1152,10 +1153,11 @@ namespace ChillerIndirectAbsorption { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectricIndirect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Chilled Water Flow Rate of " + - General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Design Chilled Water Flow Rate of {:.5R} [m3/s]", EvapVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1236,10 +1238,11 @@ namespace ChillerIndirectAbsorption { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorptionIndirect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Condenser Water Flow Rate of " + - General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Condenser Water Flow Rate of {:.5R} [m3/s]", CondVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Condenser Water Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1323,10 +1326,12 @@ namespace ChillerIndirectAbsorption { if ((std::abs(tmpGeneratorVolFlowRate - GeneratorVolFlowRateUser) / GeneratorVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorptionIndirect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Generator Fluid Flow Rate of " + - General::RoundSigDigits(GeneratorVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Generator Fluid Flow Rate of " + - General::RoundSigDigits(tmpGeneratorVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Design Generator Fluid Flow Rate of {:.5R} [m3/s]", GeneratorVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Design Generator Fluid Flow Rate of {:.5R} [m3/s]", + tmpGeneratorVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1398,10 +1403,12 @@ namespace ChillerIndirectAbsorption { if ((std::abs(tmpGeneratorVolFlowRate - GeneratorVolFlowRateUser) / GeneratorVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerAbsorptionIndirect: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Generator Fluid Flow Rate of " + - General::RoundSigDigits(GeneratorVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Generator Fluid Flow Rate of " + - General::RoundSigDigits(tmpGeneratorVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Design Generator Fluid Flow Rate of {:.5R} [m3/s]", GeneratorVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Design Generator Fluid Flow Rate of {:.5R} [m3/s]", + tmpGeneratorVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1535,10 +1542,10 @@ namespace ChillerIndirectAbsorption { if (this->MinCondInletTempCtr < 1) { ++this->MinCondInletTempCtr; ShowWarningError(state, "Chiller:Absorption:Indirect \"" + this->Name + "\""); - ShowContinueError(state, "...Entering condenser water temperature below specified minimum (" + - General::RoundSigDigits(this->MinCondInletTemp, 3) + " C)."); - ShowContinueError(state, "...Entering condenser water temperature = " + - General::RoundSigDigits(DataLoopNode::Node(this->CondInletNodeNum).Temp, 3) + " C."); + ShowContinueError(state, + format("...Entering condenser water temperature below specified minimum ({:.3R} C).", this->MinCondInletTemp)); + ShowContinueError(state, + format("...Entering condenser water temperature = {:.3R} C.", DataLoopNode::Node(this->CondInletNodeNum).Temp)); ShowContinueErrorTimeStamp(state, "...simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, "Entering condenser water temperature below specified minimum error continues.", @@ -1556,10 +1563,12 @@ namespace ChillerIndirectAbsorption { if (this->MinGenInletTempCtr < 1) { ++this->MinGenInletTempCtr; ShowWarningError(state, "Chiller:Absorption:Indirect \"" + this->Name + "\""); - ShowContinueError(state, "...Entering generator fluid temperature below specified minimum (" + - General::RoundSigDigits(this->MinGeneratorInletTemp, 3) + " C)."); - ShowContinueError(state, "...Entering generator fluid temperature = " + - General::RoundSigDigits(DataLoopNode::Node(this->GeneratorInletNodeNum).Temp, 3) + " C."); + ShowContinueError( + state, + format("...Entering generator fluid temperature below specified minimum ({:.3R} C).", this->MinGeneratorInletTemp)); + ShowContinueError( + state, + format("...Entering generator fluid temperature = {:.3R} C.", DataLoopNode::Node(this->GeneratorInletNodeNum).Temp)); ShowContinueErrorTimeStamp(state, "...simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, "Entering generator fluid temperature below specified minimum error continues.", diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index b653f261a81..67a585cba77 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -410,16 +410,14 @@ namespace ChillerReformulatedEIR { } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowContinueError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ErrorsFound = true; } thisChiller.RefCOP = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); + ShowContinueError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ErrorsFound = true; } @@ -427,9 +425,12 @@ namespace ChillerReformulatedEIR { thisChiller.TempRefCondOut = DataIPShortCuts::rNumericArgs(4); if (thisChiller.TempRefEvapOut >= thisChiller.TempRefCondOut) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(3) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(3), 2) + - "] >= " + DataIPShortCuts::cNumericFieldNames(4) + " [" + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(4), 2) + ']'); + ShowContinueError(state, + format("{} [{:.2R}] >= {} [{:.2R}]", + DataIPShortCuts::cNumericFieldNames(3), + DataIPShortCuts::rNumericArgs(3), + DataIPShortCuts::cNumericFieldNames(4), + DataIPShortCuts::rNumericArgs(4))); ShowContinueError(state, "Reference Leaving Chilled Water Temperature must be less than Reference Leaving Condenser Water Temperature "); ErrorsFound = true; } @@ -451,9 +452,12 @@ namespace ChillerReformulatedEIR { if (thisChiller.MinPartLoadRat > thisChiller.MaxPartLoadRat) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(7) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(7), 3) + - "] > " + DataIPShortCuts::cNumericFieldNames(8) + " [" + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(8), 3) + ']'); + ShowContinueError(state, + format("{} [{:.3R}] > {} [{:.3R}]", + DataIPShortCuts::cNumericFieldNames(7), + DataIPShortCuts::rNumericArgs(7), + DataIPShortCuts::cNumericFieldNames(8), + DataIPShortCuts::rNumericArgs(8))); ShowContinueError(state, "Minimum part load ratio must be less than or equal to the maximum part load ratio "); ErrorsFound = true; } @@ -461,7 +465,7 @@ namespace ChillerReformulatedEIR { if (thisChiller.MinUnloadRat < thisChiller.MinPartLoadRat || thisChiller.MinUnloadRat > thisChiller.MaxPartLoadRat) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(10) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(10), 3)); + ShowContinueError(state, format("{} = {:.3R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(10) + " must be greater than or equal to the " + DataIPShortCuts::cNumericFieldNames(7)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(10) + " must be less than or equal to the " + @@ -472,7 +476,7 @@ namespace ChillerReformulatedEIR { if (thisChiller.OptPartLoadRat < thisChiller.MinPartLoadRat || thisChiller.OptPartLoadRat > thisChiller.MaxPartLoadRat) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(9) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(9), 3)); + ShowContinueError(state, format("{} = {:.3R}", DataIPShortCuts::cNumericFieldNames(9), DataIPShortCuts::rNumericArgs(9))); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(9) + " must be greater than or equal to the " + DataIPShortCuts::cNumericFieldNames(7)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(9) + " must be less than or equal to the " + @@ -485,7 +489,7 @@ namespace ChillerReformulatedEIR { if (thisChiller.CompPowerToCondenserFrac < 0.0 || thisChiller.CompPowerToCondenserFrac > 1.0) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(11) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(11), 3)); + ShowContinueError(state, format("{} = {:.3R}", DataIPShortCuts::cNumericFieldNames(11), DataIPShortCuts::rNumericArgs(11))); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(11) + " must be greater than or equal to zero"); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(11) + " must be less than or equal to one"); ErrorsFound = true; @@ -1058,10 +1062,11 @@ namespace ChillerReformulatedEIR { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Reference Chilled Water Flow Rate of " + - General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Reference Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Reference Chilled Water Flow Rate of {:.5R} [m3/s]", EvapVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Reference Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1136,9 +1141,8 @@ namespace ChillerReformulatedEIR { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - RefCapUser) / RefCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Reference Capacity of " + General::RoundSigDigits(RefCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Reference Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Reference Capacity of {:.2R} [W]", RefCapUser)); + ShowContinueError(state, format("differs from Design Size Reference Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1208,10 +1212,11 @@ namespace ChillerReformulatedEIR { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Reference Condenser Water Flow Rate of " + - General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Reference Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Reference Condenser Water Flow Rate of {:.5R} [m3/s]", CondVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Reference Condenser Water Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1271,10 +1276,12 @@ namespace ChillerReformulatedEIR { if ((std::abs(tmpHeatRecVolFlowRate - DesignHeatRecVolFlowRateUser) / DesignHeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Heat Recovery Fluid Flow Rate of " + - General::RoundSigDigits(DesignHeatRecVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Heat Recovery Fluid Flow Rate of " + - General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Design Heat Recovery Fluid Flow Rate of {:.5R} [m3/s]", DesignHeatRecVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Design Heat Recovery Fluid Flow Rate of {:.5R} [m3/s]", + tmpHeatRecVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1323,7 +1330,7 @@ namespace ChillerReformulatedEIR { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, "Capacity ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } CurveManager::GetCurveMinMaxValues(state,this->ChillerCapFTIndex, this->ChillerCAPFTXTempMin, @@ -1337,7 +1344,7 @@ namespace ChillerReformulatedEIR { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, "Energy input ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } CurveManager::GetCurveMinMaxValues(state,this->ChillerEIRFTIndex, this->ChillerEIRFTXTempMin, @@ -1356,7 +1363,7 @@ namespace ChillerReformulatedEIR { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, "Energy input ratio as a function of part-load ratio curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } if (this->PartLoadCurveType == PLR::LeavingCondenserWaterTemperature) { @@ -1376,15 +1383,19 @@ namespace ChillerReformulatedEIR { } if (this->ChillerEIRFPLRPLRMin < 0 || this->ChillerEIRFPLRPLRMin >= this->ChillerEIRFPLRPLRMax || this->ChillerEIRFPLRPLRMin > 1) { - ShowSevereError(state, "Invalid minimum value of PLR = " + General::TrimSigDigits(this->ChillerEIRFPLRPLRMin, 3) + - " in bicubic curve = " + this->EIRFPLRName + " which is used"); + ShowSevereError(state, + format("Invalid minimum value of PLR = {:.3T} in bicubic curve = {} which is used", + this->ChillerEIRFPLRPLRMin, + this->EIRFPLRName)); ShowContinueError(state, "by Chiller:Electric:ReformulatedEIR = " + equipName + '.'); ShowContinueError(state, "The minimum value of PLR [y] must be from zero to 1, and less than the maximum value of PLR."); ErrorsFound = true; } if (this->ChillerEIRFPLRPLRMax > 1.1 || this->ChillerEIRFPLRPLRMax <= this->ChillerEIRFPLRPLRMin || this->ChillerEIRFPLRPLRMax < 0) { - ShowSevereError(state, "Invalid maximum value of PLR = " + General::TrimSigDigits(this->ChillerEIRFPLRPLRMax, 3) + - " in bicubic curve = " + this->EIRFPLRName + " which is used"); + ShowSevereError(state, + format("Invalid maximum value of PLR = {:.3T} in bicubic curve = {} which is used", + this->ChillerEIRFPLRPLRMax, + this->EIRFPLRName)); ShowContinueError(state, "by Chiller:Electric:ReformulatedEIR = " + equipName + '.'); ShowContinueError(state, "The maximum value of PLR [y] must be from zero to 1.1, and greater than the minimum value of PLR."); ErrorsFound = true; @@ -2320,13 +2331,14 @@ namespace ChillerReformulatedEIR { if (this->EvapOutletTemp < CAPFTXTmin || this->EvapOutletTemp > CAPFTXTmax) { ++this->CAPFTXIter; if (this->CAPFTXIter == 1) { - ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evaporator outlet temperature (" + - General::TrimSigDigits(this->EvapOutletTemp, 2) + - " C) is outside the range of evaporator outlet temperatures (X var) given in Cooling Capacity Function of " - "Temperature biquadratic curve = " + - this->CAPFTName); - ShowContinueErrorTimeStamp(state, "The range specified = " + General::TrimSigDigits(CAPFTXTmin, 2) + " C to " + - General::TrimSigDigits(CAPFTXTmax, 2) + " C."); + ShowWarningError( + state, + format("CHILLER:ELECTRIC:REFORMULATEDEIR \"{}\": The evaporator outlet temperature ({:.2T} C) is outside the range of evaporator " + "outlet temperatures (X var) given in Cooling Capacity Function of Temperature biquadratic curve = {}", + this->Name, + this->EvapOutletTemp, + this->CAPFTName)); + ShowContinueErrorTimeStamp(state, format("The range specified = {:.2T} C to {:.2T} C.", CAPFTXTmin, CAPFTXTmax)); ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTXIterIndex, @@ -2344,13 +2356,15 @@ namespace ChillerReformulatedEIR { if (this->EvapOutletTemp < EIRFTXTmin || this->EvapOutletTemp > EIRFTXTmax) { ++this->EIRFTXIter; if (this->EIRFTXIter == 1) { - ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evaporator outlet temperature (" + - General::TrimSigDigits(this->EvapOutletTemp, 2) + - " C) is outside the range of evaporator outlet temperatures (X var) given in Electric Input to Cooling Output Ratio " - "Function of Temperature biquadratic curve = " + - this->EIRFTName); - ShowContinueErrorTimeStamp(state, "The range specified = " + General::TrimSigDigits(EIRFTXTmin, 2) + " C to " + - General::TrimSigDigits(EIRFTXTmax, 2) + " C."); + ShowWarningError( + state, + format( + "CHILLER:ELECTRIC:REFORMULATEDEIR \"{}\": The evaporator outlet temperature ({:.2T} C) is outside the range of evaporator " + "outlet temperatures (X var) given in Electric Input to Cooling Output Ratio Function of Temperature biquadratic curve = {}", + this->Name, + this->EvapOutletTemp, + this->EIRFTName)); + ShowContinueErrorTimeStamp(state, format("The range specified = {:.2T} C to {:.2T} C.", EIRFTXTmin, EIRFTXTmax)); ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Electric Input to Cooling Output Ratio Function of Temp curve error continues.", @@ -2401,13 +2415,14 @@ namespace ChillerReformulatedEIR { if (this->CondOutletTemp < CAPFTYTmin || this->CondOutletTemp > CAPFTYTmax) { ++this->CAPFTYIter; if (this->CAPFTYIter == 1) { - ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The condenser outlet temperature (" + - General::TrimSigDigits(this->CondOutletTemp, 2) + - " C) is outside the range of condenser outlet temperatures (Y var) given in Cooling Capacity Function of " - "Temperature biquadratic curve = " + - this->CAPFTName); - ShowContinueErrorTimeStamp(state, "The range specified = " + General::TrimSigDigits(CAPFTYTmin, 2) + " C to " + - General::TrimSigDigits(CAPFTYTmax, 2) + " C."); + ShowWarningError( + state, + format("CHILLER:ELECTRIC:REFORMULATEDEIR \"{}\": The condenser outlet temperature ({:.2T} C) is outside the range of condenser " + "outlet temperatures (Y var) given in Cooling Capacity Function of Temperature biquadratic curve = {}", + this->Name, + this->CondOutletTemp, + this->CAPFTName)); + ShowContinueErrorTimeStamp(state, format("The range specified = {:.2T} C to {:.2T} C.", CAPFTYTmin, CAPFTYTmax)); ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTYIterIndex, @@ -2425,13 +2440,15 @@ namespace ChillerReformulatedEIR { if (this->CondOutletTemp < EIRFTYTmin || this->CondOutletTemp > EIRFTYTmax) { ++this->EIRFTYIter; if (this->EIRFTYIter == 1) { - ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The condenser outlet temperature (" + - General::TrimSigDigits(this->CondOutletTemp, 2) + - " C) is outside the range of condenser outlet temperatures (Y var) given in Electric Input to Cooling Output Ratio " - "Function of Temperature biquadratic curve = " + - this->EIRFTName); - ShowContinueErrorTimeStamp(state, "The range specified = " + General::TrimSigDigits(EIRFTYTmin, 2) + " C to " + - General::TrimSigDigits(EIRFTYTmax, 2) + " C."); + ShowWarningError( + state, + format( + "CHILLER:ELECTRIC:REFORMULATEDEIR \"{}\": The condenser outlet temperature ({:.2T} C) is outside the range of condenser " + "outlet temperatures (Y var) given in Electric Input to Cooling Output Ratio Function of Temperature biquadratic curve = {}", + this->Name, + this->CondOutletTemp, + this->EIRFTName)); + ShowContinueErrorTimeStamp(state, format("The range specified = {:.2T} C to {:.2T} C.", EIRFTYTmin, EIRFTYTmax)); ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", @@ -2452,13 +2469,14 @@ namespace ChillerReformulatedEIR { if (this->CondOutletTemp < EIRFPLRTmin || this->CondOutletTemp > EIRFPLRTmax) { ++this->EIRFPLRTIter; if (this->EIRFPLRTIter == 1) { - ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The condenser outlet temperature (" + - General::TrimSigDigits(this->CondOutletTemp, 2) + - " C) is outside the range of condenser outlet temperatures (X var) given in Electric Input to Cooling Output " - "Ratio Function of Part-load Ratio bicubic curve = " + - this->EIRFPLRName); - ShowContinueErrorTimeStamp(state, "The range specified = " + General::TrimSigDigits(EIRFPLRTmin, 2) + " C to " + - General::TrimSigDigits(EIRFPLRTmax, 2) + " C."); + ShowWarningError(state, + format("CHILLER:ELECTRIC:REFORMULATEDEIR \"{}\": The condenser outlet temperature ({:.2T} C) is outside the " + "range of condenser outlet temperatures (X var) given in Electric Input to Cooling Output Ratio Function " + "of Part-load Ratio bicubic curve = {}", + this->Name, + this->CondOutletTemp, + this->EIRFPLRName)); + ShowContinueErrorTimeStamp(state, format("The range specified = {:.2T} C to {:.2T} C.", EIRFPLRTmin, EIRFPLRTmax)); ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", @@ -2479,13 +2497,14 @@ namespace ChillerReformulatedEIR { if (this->ChillerPartLoadRatio < EIRFPLRPLRmin || this->ChillerPartLoadRatio > EIRFPLRPLRmax) { ++this->EIRFPLRPLRIter; if (this->EIRFPLRPLRIter == 1) { - ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The part-load ratio (" + - General::TrimSigDigits(this->ChillerPartLoadRatio, 3) + - ") is outside the range of part-load ratios (Y var) given in Electric Input to Cooling Output Ratio Function of " - "Part-load Ratio bicubic curve = " + - this->EIRFPLRName); - ShowContinueErrorTimeStamp(state, "The range specified = " + General::TrimSigDigits(EIRFPLRPLRmin, 3) + " to " + - General::TrimSigDigits(EIRFPLRPLRmax, 3) + '.'); + ShowWarningError( + state, + format("CHILLER:ELECTRIC:REFORMULATEDEIR \"{}\": The part-load ratio ({:.3T}) is outside the range of part-load ratios (Y var) " + "given in Electric Input to Cooling Output Ratio Function of Part-load Ratio bicubic curve = {}", + this->Name, + this->ChillerPartLoadRatio, + this->EIRFPLRName)); + ShowContinueErrorTimeStamp(state, format("The range specified = {:.3T} to {:.3T}.", EIRFPLRPLRmin, EIRFPLRPLRmax)); ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The part-load ratio range in Electric Input to Cooling Output Ratio Function of PLRatio curve error continues.", @@ -2537,10 +2556,12 @@ namespace ChillerReformulatedEIR { if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); - ShowContinueError(state, " Chiller Capacity as a Function of Temperature curve output is negative (" + - General::RoundSigDigits(this->ChillerCapFT, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTempSetPoint, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + '.'); + ShowContinueError(state, + format(" Chiller Capacity as a Function of Temperature curve output is negative ({:.3R}).", this->ChillerCapFT)); + ShowContinueError(state, + format(" Negative value occurs using an Evaporator Leaving Temp of {:.1R} and a Condenser Leaving Temp of {:.1R}.", + EvapOutletTempSetPoint, + this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; @@ -2558,10 +2579,12 @@ namespace ChillerReformulatedEIR { if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); - ShowContinueError(state, " Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + - General::RoundSigDigits(this->ChillerEIRFT, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(this->EvapOutletTemp, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + '.'); + ShowContinueError( + state, format(" Reformulated Chiller EIR as a Function of Temperature curve output is negative ({:.3R}).", this->ChillerEIRFT)); + ShowContinueError(state, + format(" Negative value occurs using an Evaporator Leaving Temp of {:.1R} and a Condenser Leaving Temp of {:.1R}.", + this->EvapOutletTemp, + this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; @@ -2601,10 +2624,13 @@ namespace ChillerReformulatedEIR { if (this->ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); - ShowContinueError(state, " Chiller EIR as a function of PLR and condenser water temperature curve output is negative (" + - General::RoundSigDigits(this->ChillerEIRFPLR, 3) + ")."); - ShowContinueError(state, " Negative value occurs using a part-load ratio of " + General::RoundSigDigits(this->ChillerPartLoadRatio, 3) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + " C."); + ShowContinueError(state, + format(" Chiller EIR as a function of PLR and condenser water temperature curve output is negative ({:.3R}).", + this->ChillerEIRFPLR)); + ShowContinueError(state, + format(" Negative value occurs using a part-load ratio of {:.3R} and a Condenser Leaving Temp of {:.1R} C.", + this->ChillerPartLoadRatio, + this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc index edf1ac0be8c..7c5973371a3 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc @@ -144,7 +144,7 @@ void CoilCoolingDXCurveFitSpeed::instantiateFromInputSpec(EnergyPlus::EnergyPlus ShowContinueError(state, "Waste Heat Modifier Function of Temperature Curve Name = " + input_data.waste_heat_function_of_temperature_curve_name); ShowContinueError(state, "...Waste Heat Modifier Function of Temperature Curve Name output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } @@ -174,8 +174,7 @@ void CoilCoolingDXCurveFitSpeed::instantiateFromInputSpec(EnergyPlus::EnergyPlus if (MinCurveVal < 0.7) { ShowWarningError(state, routineName + this->object_name + "=\"" + this->name + "\", invalid"); ShowContinueError(state, "..." + fieldName + "=\"" + curveName + "\" has out of range values."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + General::TrimSigDigits(MinCurvePLR, 2) + " is " + - General::TrimSigDigits(MinCurveVal, 3)); + ShowContinueError(state, format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); CurveManager::SetCurveOutputMinMaxValues(state, this->indexPLRFPLF, errorsFound, 0.7, _); } @@ -183,8 +182,7 @@ void CoilCoolingDXCurveFitSpeed::instantiateFromInputSpec(EnergyPlus::EnergyPlus if (MaxCurveVal > 1.0) { ShowWarningError(state, routineName + this->object_name + "=\"" + this->name + "\", invalid"); ShowContinueError(state, "..." + fieldName + " = " + curveName + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + General::TrimSigDigits(MaxCurvePLR, 2) + " is " + - General::TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError(state, format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); CurveManager::SetCurveOutputMinMaxValues(state, this->indexPLRFPLF, errorsFound, _, 1.0); } @@ -419,7 +417,7 @@ void CoilCoolingDXCurveFitSpeed::CalcSpeedOutput(EnergyPlus::EnergyPlusData &sta A0 = -std::log(RatedCBF) * RatedAirMassFlowRate; } else { // This is bad - results in CBF = 1.0 which results in divide by zero below: hADP = inletState.h - hDelta / (1.0 - CBF) - ShowFatalError(state, RoutineName + "Rated CBF=" + General::RoundSigDigits(RatedCBF, 6) + " is <= 0.0 for " + object_name + "=" + name); + ShowFatalError(state, format("{}Rated CBF={:.6R} is <= 0.0 for {}={}", RoutineName, RatedCBF, object_name, name)); A0 = 0.0; } Real64 ADiff = -A0 / AirMassFlow; @@ -557,8 +555,8 @@ Real64 CoilCoolingDXCurveFitSpeed::CalcBypassFactor(EnergyPlus::EnergyPlusData & Real64 adjustedSHR = (Psychrometrics::PsyHFnTdbW(tdb, outw) - outh) / deltaH; ShowWarningError(state, RoutineName + object_name + " \"" + name + "\", SHR adjusted to achieve valid outlet air properties and the simulation continues."); - ShowContinueError(state, "Initial SHR = " + General::RoundSigDigits(this->grossRatedSHR, 5)); - ShowContinueError(state, "Adjusted SHR = " + General::RoundSigDigits(adjustedSHR, 5)); + ShowContinueError(state, format("Initial SHR = {:.5R}", this->grossRatedSHR)); + ShowContinueError(state, format("Adjusted SHR = {:.5R}", adjustedSHR)); } } @@ -579,7 +577,7 @@ Real64 CoilCoolingDXCurveFitSpeed::CalcBypassFactor(EnergyPlus::EnergyPlusData & if (slopeAtConds <= 0.0) { // TODO: old dx coil protects against slopeAtConds < 0, but no = 0 - not sure why, 'cause that'll cause divide by zero ShowSevereError(state, RoutineName + object_name + " \"" + name + "\" -- coil bypass factor calculation invalid input conditions."); - ShowContinueError(state, "deltaT = " + General::RoundSigDigits(deltaT, 3) + " and deltaHumRat = " + General::RoundSigDigits(deltaHumRat, 3)); + ShowContinueError(state, format("deltaT = {:.3R} and deltaHumRat = {:.3R}", deltaT, deltaHumRat)); ShowFatalError(state, "Errors found in calculating coil bypass factors"); } @@ -612,8 +610,7 @@ Real64 CoilCoolingDXCurveFitSpeed::CalcBypassFactor(EnergyPlus::EnergyPlusData & if (iter > maxIter) { ShowSevereError(state, RoutineName + object_name + " \"" + name + "\" -- coil bypass factor calculation did not converge after max iterations."); - ShowContinueError(state, "The RatedSHR of [" + General::RoundSigDigits(this->grossRatedSHR, 3) + - "], entered by the user or autosized (see *.eio file),"); + ShowContinueError(state, format("The RatedSHR of [{:.3R}], entered by the user or autosized (see *.eio file),", this->grossRatedSHR)); ShowContinueError(state, "may be causing this. The line defined by the coil rated inlet air conditions"); ShowContinueError(state, "(26.7C drybulb and 19.4C wetbulb) and the RatedSHR (i.e., slope of the line) must intersect"); ShowContinueError(state, "the saturation curve of the psychrometric chart. If the RatedSHR is too low, then this"); diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc index c5f0f217683..3644e0caf11 100644 --- a/src/EnergyPlus/CommandLineInterface.cc +++ b/src/EnergyPlus/CommandLineInterface.cc @@ -231,7 +231,7 @@ namespace CommandLineInterface { DisplayString(state, "ERROR: Multiple input files specified:"); for (size_type i = 0; i < opt.lastArgs.size(); ++i) { std::string const &arg(*opt.lastArgs[i]); - DisplayString(state, " Input file #" + std::to_string(i + 1) + ": " + arg); + DisplayString(state, format(" Input file #{}: {}", i + 1, arg)); } DisplayString(state, errorFollowUp); exit(EXIT_FAILURE); diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index d52fd0be5ff..5723e0e6a6a 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -2248,9 +2248,10 @@ namespace CondenserLoopTowers { ShowContinueError(state, "Tower Design Range Temperature specified in tower = " + this->Name); ShowContinueError(state, "is inconsistent with Design Loop Delta Temperature specified in Sizing:Plant object = " + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName + "."); - ShowContinueError(state, "..The Design Range Temperature specified in tower is = " + General::TrimSigDigits(this->DesRange, 2)); - ShowContinueError(state, "..The Design Loop Delta Temperature specified in plant sizing data is = " + - General::TrimSigDigits(DataSizing::PlantSizData(PltSizCondNum).DeltaT, 2)); + ShowContinueError(state, format("..The Design Range Temperature specified in tower is = {:.2T}", this->DesRange)); + ShowContinueError(state, + format("..The Design Loop Delta Temperature specified in plant sizing data is = {:.2T}", + DataSizing::PlantSizData(PltSizCondNum).DeltaT)); } // check if the tower approach is different from plant sizing data DesTowerApproachFromPlant = DataSizing::PlantSizData(PltSizCondNum).ExitTemp - this->DesInletAirWBTemp; @@ -2260,10 +2261,9 @@ namespace CondenserLoopTowers { ShowContinueError(state, "The Design Approach Temperature from inputs specified in Sizing:Plant object = " + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName); ShowContinueError(state, "is inconsistent with Design Approach Temperature specified in tower = " + this->Name + "."); - ShowContinueError(state, "..The Design Approach Temperature from inputs specified is = " + - General::TrimSigDigits(DesTowerApproachFromPlant, 2)); - ShowContinueError(state, "..The Design Approach Temperature specified in tower is = " + - General::TrimSigDigits(this->DesApproach, 2)); + ShowContinueError(state, + format("..The Design Approach Temperature from inputs specified is = {:.2T}", DesTowerApproachFromPlant)); + ShowContinueError(state, format("..The Design Approach Temperature specified in tower is = {:.2T}", this->DesApproach)); } } } @@ -2461,17 +2461,22 @@ namespace CondenserLoopTowers { // This conditional statement is to trap when the user specified condenser/tower water design setpoint // temperature is less than design inlet air wet bulb temperature if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesInletAirWBTemp) { - ShowSevereError(state, "Error when autosizing the UA value for cooling tower = " + this->Name + - ". Design Loop Exit Temperature must be greater than " + General::TrimSigDigits(this->DesInletAirWBTemp, 2) + - " C when autosizing the tower UA."); - ShowContinueError(state, "The Design Loop Exit Temperature specified in Sizing:Plant object = " + - DataSizing::PlantSizData(PltSizCondNum).PlantLoopName + " (" + - General::TrimSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2) + " C)"); - ShowContinueError(state, "is less than or equal to the design inlet air wet-bulb temperature of " + - General::TrimSigDigits(this->DesInletAirWBTemp, 2) + " C."); + ShowSevereError(state, + format("Error when autosizing the UA value for cooling tower = {}. Design Loop Exit Temperature must be " + "greater than {:.2T} C when autosizing the tower UA.", + this->Name, + this->DesInletAirWBTemp)); ShowContinueError(state, - "If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design Setpoint must be > " + - General::TrimSigDigits(this->DesInletAirWBTemp, 2) + " C if autosizing the cooling tower."); + format("The Design Loop Exit Temperature specified in Sizing:Plant object = {} ({:.2T} C)", + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName, + DataSizing::PlantSizData(PltSizCondNum).ExitTemp)); + ShowContinueError( + state, + format("is less than or equal to the design inlet air wet-bulb temperature of {:.2T} C.", this->DesInletAirWBTemp)); + ShowContinueError(state, + format("If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design " + "Setpoint must be > {:.2T} C if autosizing the cooling tower.", + this->DesInletAirWBTemp)); ShowFatalError(state, "Autosizing of cooling tower fails for tower = " + this->Name + '.'); } @@ -2549,28 +2554,33 @@ namespace CondenserLoopTowers { // => This basically means that approach is negative, which is impossible (must be > 0 per IDD) // * If not, hardcoded above to 21C if (DesTowerExitWaterTemp <= this->DesInletAirWBTemp) { - ShowSevereError(state, "Error when autosizing the UA value for cooling tower = " + this->Name + - ". Design Tower Exit Temperature must be greater than " + General::TrimSigDigits(this->DesInletAirWBTemp, 2) + - " C when autosizing the tower UA."); - ShowContinueError(state, "The User-specified Design Loop Exit Temperature=" + General::TrimSigDigits(DesTowerExitWaterTemp, 2)); - ShowContinueError(state, "is less than or equal to the design inlet air wet-bulb temperature of " + - General::TrimSigDigits(this->DesInletAirWBTemp, 2) + " C."); + ShowSevereError(state, + format("Error when autosizing the UA value for cooling tower = {}. Design Tower Exit Temperature must be " + "greater than {:.2T} C when autosizing the tower UA.", + this->Name, + this->DesInletAirWBTemp)); + ShowContinueError(state, format("The User-specified Design Loop Exit Temperature={:.2T}", DesTowerExitWaterTemp)); + ShowContinueError( + state, + format("is less than or equal to the design inlet air wet-bulb temperature of {:.2T} C.", this->DesInletAirWBTemp)); if (this->TowerInletCondsAutoSize) { ShowContinueError(state, - "Because you did not specify the Design Approach Temperature, and you do not have a Sizing:Plant object, " - "it was defaulted to " + - General::TrimSigDigits(DesTowerExitWaterTemp, 2) + " C."); + format("Because you did not specify the Design Approach Temperature, and you do not have a " + "Sizing:Plant object, it was defaulted to {:.2T} C.", + DesTowerExitWaterTemp)); } else { // Should never get there... ShowContinueError(state, - "The Design Loop Exit Temperature is the sum of the design air inlet wet-bulb temperature= " + - General::TrimSigDigits(this->DesInletAirWBTemp, 2) + - " C plus the cooling tower design approach temperature = " + General::TrimSigDigits(this->DesApproach, 2) + "C."); + format("The Design Loop Exit Temperature is the sum of the design air inlet wet-bulb temperature= " + "{:.2T} C plus the cooling tower design approach temperature = {:.2T}C.", + this->DesInletAirWBTemp, + this->DesApproach)); } ShowContinueError(state, - "If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design Setpoint must be > " + - General::TrimSigDigits(this->DesInletAirWBTemp, 2) + " C if autosizing the cooling tower."); + format("If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design " + "Setpoint must be > {:.2T} C if autosizing the cooling tower.", + this->DesInletAirWBTemp)); ShowFatalError(state, "Autosizing of cooling tower fails for tower = " + this->Name + '.'); } @@ -2884,19 +2894,19 @@ namespace CondenserLoopTowers { ShowContinueError(state, "Tower inlet design water temperature assumed to be 35.0 C."); ShowContinueError(state, "Tower inlet design air dry-bulb temperature assumed to be 35.0 C."); ShowContinueError(state, "Tower inlet design air wet-bulb temperature assumed to be 25.6 C."); - ShowContinueError(state, "Tower load assumed to be " + General::TrimSigDigits(this->HeatRejectCapNomCapSizingRatio, 3) + - " times free convection capacity of " + General::TrimSigDigits(this->TowerFreeConvNomCap, 0) + " W."); + ShowContinueError(state, + format("Tower load assumed to be {:.3T} times free convection capacity of {:.0T} W.", + this->HeatRejectCapNomCapSizingRatio, + this->TowerFreeConvNomCap)); Real64 OutWaterTemp; // outlet water temperature during sizing [C] OutWaterTemp = this->calculateSimpleTowerOutletTemp(state, Par(3), Par(4), UA0); Real64 CoolingOutput = Par(5) * Par(3) * (this->WaterTemp - OutWaterTemp); // tower capacity during sizing [W] - ShowContinueError(state, "Tower capacity at lower UA guess (" + General::TrimSigDigits(UA0, 4) + - ") = " + General::TrimSigDigits(CoolingOutput, 0) + " W."); + ShowContinueError(state, format("Tower capacity at lower UA guess ({:.4T}) = {:.0T} W.", UA0, CoolingOutput)); OutWaterTemp = this->calculateSimpleTowerOutletTemp(state, Par(3), Par(4), UA1); CoolingOutput = Par(5) * Par(3) * (this->WaterTemp - OutWaterTemp); - ShowContinueError(state, "Tower capacity at upper UA guess (" + General::TrimSigDigits(UA1, 4) + - ") = " + General::TrimSigDigits(CoolingOutput, 0) + " W."); + ShowContinueError(state, format("Tower capacity at upper UA guess ({:.4T}) = {:.0T} W.", UA1, CoolingOutput)); if (CoolingOutput < DesTowerLoad) { ShowContinueError(state, "Free convection capacity should be less than tower capacity at upper UA guess."); @@ -3149,9 +3159,10 @@ namespace CondenserLoopTowers { ShowContinueError(state, "Tower Design Range Temperature specified in tower = " + this->Name); ShowContinueError(state, "is inconsistent with Design Loop Delta Temperature specified in Sizing:Plant object = " + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName + "."); - ShowContinueError(state, "..The Design Range Temperature specified in tower is = " + General::TrimSigDigits(this->DesRange, 2)); - ShowContinueError(state, "..The Design Loop Delta Temperature specified iin plant sizing data is = " + - General::TrimSigDigits(DataSizing::PlantSizData(PltSizCondNum).DeltaT, 2)); + ShowContinueError(state, format("..The Design Range Temperature specified in tower is = {:.2T}", this->DesRange)); + ShowContinueError(state, + format("..The Design Loop Delta Temperature specified iin plant sizing data is = {:.2T}", + DataSizing::PlantSizData(PltSizCondNum).DeltaT)); } // check if the tower approach is different from plant sizing data DesTowerApproachFromPlant = DataSizing::PlantSizData(PltSizCondNum).ExitTemp - this->DesInletAirWBTemp; @@ -3161,9 +3172,9 @@ namespace CondenserLoopTowers { ShowContinueError(state, "The Design Approach Temperature from inputs specified in Sizing:Plant object = " + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName); ShowContinueError(state, "is inconsistent with Design Approach Temperature specified in tower = " + this->Name + "."); - ShowContinueError(state, "..The Design Approach Temperature from inputs specified is = " + - General::TrimSigDigits(DesTowerApproachFromPlant, 2)); - ShowContinueError(state, "..The Design Approach Temperature specified in tower is = " + General::TrimSigDigits(this->DesApproach, 2)); + ShowContinueError(state, + format("..The Design Approach Temperature from inputs specified is = {:.2T}", DesTowerApproachFromPlant)); + ShowContinueError(state, format("..The Design Approach Temperature specified in tower is = {:.2T}", this->DesApproach)); } } } @@ -3236,9 +3247,8 @@ namespace CondenserLoopTowers { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomTowerCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVSMerkelTower: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomTowerCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomTowerCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3275,10 +3285,10 @@ namespace CondenserLoopTowers { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpTowerFreeConvNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVSMerkelTower: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Free Convection Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Free Convection Nominal Capacity of " + - General::RoundSigDigits(tmpTowerFreeConvNomCap, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Free Convection Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError( + state, + format("differs from Design Size Free Convection Nominal Capacity of {:.2R} [W]", tmpTowerFreeConvNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3319,10 +3329,8 @@ namespace CondenserLoopTowers { if ((std::abs(tmpDesignWaterFlowRate - NomDesWaterFlowUser) / NomDesWaterFlowUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVSMerkelTower: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Water Flow Rate of " + General::RoundSigDigits(NomDesWaterFlowUser, 2) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Water Flow Rate of " + General::RoundSigDigits(tmpDesignWaterFlowRate, 2) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Design Water Flow Rate of {:.2R} [m3/s]", NomDesWaterFlowUser)); + ShowContinueError(state, format("differs from Design Water Flow Rate of {:.2R} [m3/s]", tmpDesignWaterFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3365,10 +3373,8 @@ namespace CondenserLoopTowers { if ((std::abs(tmpDesignAirFlowRate - DesignAirFlowRateUser) / DesignAirFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVSMerkelTower: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Air Flow Rate of " + General::RoundSigDigits(DesignAirFlowRateUser, 2) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Air Flow Rate of " + General::RoundSigDigits(tmpDesignAirFlowRate, 2) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Design Air Flow Rate of {:.2R} [m3/s]", DesignAirFlowRateUser)); + ShowContinueError(state, format("differs from Design Air Flow Rate of {:.2R} [m3/s]", tmpDesignAirFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3404,10 +3410,12 @@ namespace CondenserLoopTowers { if ((std::abs(tmpFreeConvAirFlowRate - FreeConvAirFlowUser) / FreeConvAirFlowUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVSMerkelTower: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Free Convection Regime Air Flow Rate of " + - General::RoundSigDigits(FreeConvAirFlowUser, 2) + " [m3/s]"); - ShowContinueError(state, "differs from Design Free Convection Regime Air Flow Rate of " + - General::RoundSigDigits(tmpFreeConvAirFlowRate, 2) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Design Free Convection Regime Air Flow Rate of {:.2R} [m3/s]", FreeConvAirFlowUser)); + ShowContinueError( + state, + format("differs from Design Free Convection Regime Air Flow Rate of {:.2R} [m3/s]", tmpFreeConvAirFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3950,8 +3958,8 @@ namespace CondenserLoopTowers { if ((std::abs(tmpHighSpeedFanPower - HighSpeedFanPowerUser) / HighSpeedFanPowerUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVSMerkelTower: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Fan Power of " + General::RoundSigDigits(HighSpeedFanPowerUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Fan Power of " + General::RoundSigDigits(tmpHighSpeedFanPower, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Design Fan Power of {:.2R} [W]", HighSpeedFanPowerUser)); + ShowContinueError(state, format("differs from Design Fan Power of {:.2R} [W]", tmpHighSpeedFanPower)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -5048,9 +5056,10 @@ namespace CondenserLoopTowers { ++this->VSMerkelAFRErrorIter; ShowWarningError(state, cCoolingTower_VariableSpeedMerkel + " - Iteration limit exceeded calculating variable speed fan ratio for unit = " + this->Name); - ShowContinueError(state, "Estimated air flow ratio = " + - General::RoundSigDigits((std::abs(MyLoad) - MinSpeedFanQdot) / (FullSpeedFanQdot - MinSpeedFanQdot), 4)); - ShowContinueError(state, "Calculated air flow ratio = " + General::RoundSigDigits(this->airFlowRateRatio, 4)); + ShowContinueError(state, + format("Estimated air flow ratio = {:.4R}", + (std::abs(MyLoad) - MinSpeedFanQdot) / (FullSpeedFanQdot - MinSpeedFanQdot))); + ShowContinueError(state, format("Calculated air flow ratio = {:.4R}", this->airFlowRateRatio)); ShowContinueErrorTimeStamp(state, "The calculated air flow ratio will be used and the simulation continues. Occurrence info:"); } ShowRecurringWarningErrorAtEnd(state, @@ -5067,7 +5076,7 @@ namespace CondenserLoopTowers { ++this->VSMerkelAFRErrorFail; ShowWarningError(state, cCoolingTower_VariableSpeedMerkel + " - solver failed calculating variable speed fan ratio for unit = " + this->Name); - ShowContinueError(state, "Estimated air flow ratio = " + General::RoundSigDigits(this->airFlowRateRatio, 4)); + ShowContinueError(state, format("Estimated air flow ratio = {:.4R}", this->airFlowRateRatio)); ShowContinueErrorTimeStamp(state, "The estimated air flow ratio will be used and the simulation continues. Occurrence info:"); } ShowRecurringWarningErrorAtEnd(state, @@ -5527,9 +5536,9 @@ namespace CondenserLoopTowers { // check boundaries of independent variables and post warnings to individual buffers to print at end of time step if (Twb < state.dataCondenserLoopTowers->towers(this->VSTower).MinInletAirWBTemp || Twb > state.dataCondenserLoopTowers->towers(this->VSTower).MaxInletAirWBTemp) { - OutputChar = General::RoundSigDigits(Twb, 2); - OutputCharLo = General::RoundSigDigits(state.dataCondenserLoopTowers->towers(this->VSTower).MinInletAirWBTemp, 2); - OutputCharHi = General::RoundSigDigits(state.dataCondenserLoopTowers->towers(this->VSTower).MaxInletAirWBTemp, 2); + OutputChar = format("{:.2R}", Twb); + OutputCharLo = format("{:.2R}", state.dataCondenserLoopTowers->towers(this->VSTower).MinInletAirWBTemp); + OutputCharHi = format("{:.2R}", state.dataCondenserLoopTowers->towers(this->VSTower).MaxInletAirWBTemp); if (Twb < state.dataCondenserLoopTowers->towers(this->VSTower).MinInletAirWBTemp) { TwbCapped = state.dataCondenserLoopTowers->towers(this->VSTower).MinInletAirWBTemp; } @@ -5543,7 +5552,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(this->VSTower).TwbBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + General::CreateSysTimeIntervalString(state); - TrimValue = General::RoundSigDigits(TwbCapped, 6); + TrimValue = format("{:.6R}", TwbCapped); state.dataCondenserLoopTowers->towers(this->VSTower).TwbBuffer3 = " ...Inlet air wet-bulb temperature passed to the model = " + TrimValue; state.dataCondenserLoopTowers->towers(this->VSTower).TwbLast = Twb; } else { @@ -5554,9 +5563,9 @@ namespace CondenserLoopTowers { } if (Tr < state.dataCondenserLoopTowers->towers(this->VSTower).MinRangeTemp || Tr > state.dataCondenserLoopTowers->towers(this->VSTower).MaxRangeTemp) { - OutputChar = General::RoundSigDigits(Tr, 2); - OutputCharLo = General::RoundSigDigits(state.dataCondenserLoopTowers->towers(this->VSTower).MinRangeTemp, 2); - OutputCharHi = General::RoundSigDigits(state.dataCondenserLoopTowers->towers(this->VSTower).MaxRangeTemp, 2); + OutputChar = format("{:.2R}", Tr); + OutputCharLo = format("{:.2R}", state.dataCondenserLoopTowers->towers(this->VSTower).MinRangeTemp); + OutputCharHi = format("{:.2R}", state.dataCondenserLoopTowers->towers(this->VSTower).MaxRangeTemp); if (Tr < state.dataCondenserLoopTowers->towers(this->VSTower).MinRangeTemp) { TrCapped = state.dataCondenserLoopTowers->towers(this->VSTower).MinRangeTemp; } @@ -5570,7 +5579,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(this->VSTower).TrBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + General::CreateSysTimeIntervalString(state); - TrimValue = General::RoundSigDigits(Tr, 5); + TrimValue = format("{:.5R}", Tr); state.dataCondenserLoopTowers->towers(this->VSTower).TrBuffer3 = " ...Tower range temperature passed to the model = " + TrimValue; state.dataCondenserLoopTowers->towers(this->VSTower).TrLast = Tr; } else { @@ -5581,9 +5590,9 @@ namespace CondenserLoopTowers { } if (Ta < state.dataCondenserLoopTowers->towers(this->VSTower).MinApproachTemp || Ta > state.dataCondenserLoopTowers->towers(this->VSTower).MaxApproachTemp) { - OutputChar = General::RoundSigDigits(Ta, 2); - OutputCharLo = General::RoundSigDigits(state.dataCondenserLoopTowers->towers(this->VSTower).MinApproachTemp, 2); - OutputCharHi = General::RoundSigDigits(state.dataCondenserLoopTowers->towers(this->VSTower).MaxApproachTemp, 2); + OutputChar = format("{:.2R}", Ta); + OutputCharLo = format("{:.2R}", state.dataCondenserLoopTowers->towers(this->VSTower).MinApproachTemp); + OutputCharHi = format("{:.2R}", state.dataCondenserLoopTowers->towers(this->VSTower).MaxApproachTemp); if (Ta < state.dataCondenserLoopTowers->towers(this->VSTower).MinApproachTemp) { TaCapped = state.dataCondenserLoopTowers->towers(this->VSTower).MinApproachTemp; } @@ -5597,7 +5606,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(this->VSTower).TaBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + General::CreateSysTimeIntervalString(state); - TrimValue = General::RoundSigDigits(Ta, 5); + TrimValue = format("{:.5R}", Ta); state.dataCondenserLoopTowers->towers(this->VSTower).TaBuffer3 = " ...Tower approach temperature passed to the model = " + TrimValue; state.dataCondenserLoopTowers->towers(this->VSTower).TaLast = Ta; } else { @@ -5613,9 +5622,9 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(this->VSTower).PrintWFRRMessage = false; } else { if (WaterFlowRateRatio < state.dataCondenserLoopTowers->towers(this->VSTower).MinWaterFlowRatio || WaterFlowRateRatio > state.dataCondenserLoopTowers->towers(this->VSTower).MaxWaterFlowRatio) { - OutputChar = General::RoundSigDigits(WaterFlowRateRatio, 2); - OutputCharLo = General::RoundSigDigits(state.dataCondenserLoopTowers->towers(this->VSTower).MinWaterFlowRatio, 2); - OutputCharHi = General::RoundSigDigits(state.dataCondenserLoopTowers->towers(this->VSTower).MaxWaterFlowRatio, 2); + OutputChar = format("{:.2R}", WaterFlowRateRatio); + OutputCharLo = format("{:.2R}", state.dataCondenserLoopTowers->towers(this->VSTower).MinWaterFlowRatio); + OutputCharHi = format("{:.2R}", state.dataCondenserLoopTowers->towers(this->VSTower).MaxWaterFlowRatio); if (WaterFlowRateRatio < state.dataCondenserLoopTowers->towers(this->VSTower).MinWaterFlowRatio) { WaterFlowRateRatioCapped = state.dataCondenserLoopTowers->towers(this->VSTower).MinWaterFlowRatio; } @@ -5629,7 +5638,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(this->VSTower).WFRRBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + General::CreateSysTimeIntervalString(state); - TrimValue = General::RoundSigDigits(WaterFlowRateRatioCapped, 5); + TrimValue = format("{:.5R}", WaterFlowRateRatioCapped); state.dataCondenserLoopTowers->towers(this->VSTower).WFRRBuffer3 = " ...Water flow rate ratio passed to the model = " + TrimValue; state.dataCondenserLoopTowers->towers(this->VSTower).WaterFlowRateRatioLast = WaterFlowRateRatio; } else { @@ -5908,9 +5917,9 @@ namespace CondenserLoopTowers { if (this->HighMassFlowErrorCount < 2) { ShowWarningError(state, this->TowerType + " \"" + this->Name + "\""); ShowContinueError(state, " Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate."); - ShowContinueError(state, " Condenser Loop Mass Flow Rate = " + - General::TrimSigDigits(DataLoopNode::Node(this->WaterOutletNodeNum).MassFlowRate, 6)); - ShowContinueError(state, " Tower Design Mass Flow Rate = " + General::TrimSigDigits(this->DesWaterMassFlowRate, 6)); + ShowContinueError(state, + format(" Condenser Loop Mass Flow Rate = {:.6T}", DataLoopNode::Node(this->WaterOutletNodeNum).MassFlowRate)); + ShowContinueError(state, format(" Tower Design Mass Flow Rate = {:.6T}", this->DesWaterMassFlowRate)); ShowContinueErrorTimeStamp(state, ""); } else { ShowRecurringWarningErrorAtEnd(state, diff --git a/src/EnergyPlus/Construction.cc b/src/EnergyPlus/Construction.cc index b13d3663212..2d7d52716ee 100644 --- a/src/EnergyPlus/Construction.cc +++ b/src/EnergyPlus/Construction.cc @@ -232,17 +232,20 @@ namespace Construction { ShowSevereError(state, "InitConductionTransferFunctions: Found Material that is too thin and/or too highly conductive, " "material name = " + dataMaterial.Material(CurrentLayer).Name); - ShowContinueError(state, "High conductivity Material layers are not well supported for internal source constructions, " - "material conductivity = " + - General::RoundSigDigits(dataMaterial.Material(CurrentLayer).Conductivity, 3) + " [W/m-K]"); - ShowContinueError(state, "Material thermal diffusivity = " + General::RoundSigDigits(Alpha, 3) + " [m2/s]"); - ShowContinueError(state, "Material with this thermal diffusivity should have thickness > " + - General::RoundSigDigits(ThicknessThreshold, 5) + " [m]"); + ShowContinueError(state, + format("High conductivity Material layers are not well supported for internal source constructions, " + "material conductivity = {:.3R} [W/m-K]", + dataMaterial.Material(CurrentLayer).Conductivity)); + ShowContinueError(state, format("Material thermal diffusivity = {:.3R} [m2/s]", Alpha)); + ShowContinueError( + state, format("Material with this thermal diffusivity should have thickness > {:.5R} [m]", ThicknessThreshold)); if (dataMaterial.Material(CurrentLayer).Thickness < DataHeatBalance::ThinMaterialLayerThreshold) { - ShowContinueError(state, "Material may be too thin to be modeled well, thickness = " + - General::RoundSigDigits(dataMaterial.Material(CurrentLayer).Thickness, 5) + " [m]"); - ShowContinueError(state, "Material with this thermal diffusivity should have thickness > " + - General::RoundSigDigits(DataHeatBalance::ThinMaterialLayerThreshold, 5) + " [m]"); + ShowContinueError(state, + format("Material may be too thin to be modeled well, thickness = {:.5R} [m]", + dataMaterial.Material(CurrentLayer).Thickness)); + ShowContinueError(state, + format("Material with this thermal diffusivity should have thickness > {:.5R} [m]", + DataHeatBalance::ThinMaterialLayerThreshold)); } dataMaterial.Material(CurrentLayer).WarnedForHighDiffusivity = true; } @@ -275,8 +278,7 @@ namespace Construction { ShowSevereError(state, "InitConductionTransferFunctions: Material=" + dataMaterial.Material(CurrentLayer).Name + "R Value below lowest allowed value"); - ShowContinueError(state, "Lowest allowed value=[" + General::RoundSigDigits(RValueLowLimit, 3) + "], Material R Value=[" + - General::RoundSigDigits(lr(Layer), 3) + "]."); + ShowContinueError(state, format("Lowest allowed value=[{:.3R}], Material R Value=[{:.3R}].", RValueLowLimit, lr(Layer))); ErrorsFound = true; } else { // A valid user defined R-value is available. @@ -956,7 +958,7 @@ namespace Construction { DoCTFErrorReport = true; ErrorsFound = true; break; - // CALL ShowFatalError('Program terminated for reasons listed (InitConductionTransferFunctions) ') + // CALL ShowFatalError(state, 'Program terminated for reasons listed (InitConductionTransferFunctions) ') } } // ... end of CTF calculation loop. diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index ba9bd349aa3..4f50f80b355 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -111,7 +111,6 @@ namespace ConvectionCoefficients { using namespace DataHeatBalance; using namespace DataSurfaces; using namespace DataVectorTypes; - using General::RoundSigDigits; // Coefficients that modify the convection coeff based on surface roughness Array1D const RoughnessMultiplier(6, {2.17, 1.67, 1.52, 1.13, 1.11, 1.0}); @@ -1273,10 +1272,14 @@ namespace ConvectionCoefficients { UserExtConvectionCoeffs(TotExtConvCoeff).WhichSurface = Found; if (Numbers(NumField) < LowHConvLimit || Numbers(NumField) > HighHConvLimit) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", out of range value"); - ShowContinueError(state, cAlphaFieldNames(Ptr) + '=' + Alphas(Ptr) + ", " + cNumericFieldNames(NumField) + "=[" + - RoundSigDigits(Numbers(NumField), 5) + "]."); - ShowContinueError(state, "Out-of-range from low/high limits=[>=" + RoundSigDigits(LowHConvLimit, 9) + - ", <=" + RoundSigDigits(HighHConvLimit, 1) + "]."); + ShowContinueError(state, + format("{}={}, {}=[{:.5R}].", + cAlphaFieldNames(Ptr), + Alphas(Ptr), + cNumericFieldNames(NumField), + Numbers(NumField))); + ShowContinueError( + state, format("Out-of-range from low/high limits=[>={:.9R}, <={:.1R}].", LowHConvLimit, HighHConvLimit)); ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object."); ErrorsFound = true; } @@ -1352,10 +1355,14 @@ namespace ConvectionCoefficients { UserIntConvectionCoeffs(TotIntConvCoeff).WhichSurface = Found; if (Numbers(NumField) < LowHConvLimit || Numbers(NumField) > HighHConvLimit) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", out of range value"); - ShowContinueError(state, cAlphaFieldNames(Ptr) + '=' + Alphas(Ptr) + ", " + cNumericFieldNames(NumField) + "=[" + - RoundSigDigits(Numbers(NumField), 5) + "]."); - ShowContinueError(state, "Out-of-range from low/high limits=[>=" + RoundSigDigits(LowHConvLimit, 9) + - ", <=" + RoundSigDigits(HighHConvLimit, 1) + "]."); + ShowContinueError(state, + format("{}={}, {}=[{:.5R}].", + cAlphaFieldNames(Ptr), + Alphas(Ptr), + cNumericFieldNames(NumField), + Numbers(NumField))); + ShowContinueError( + state, format("Out-of-range from low/high limits=[>={:.9R}, <={:.1R}].", LowHConvLimit, HighHConvLimit)); ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object."); ErrorsFound = true; } @@ -1484,10 +1491,14 @@ namespace ConvectionCoefficients { UserExtConvectionCoeffs(TotExtConvCoeff).WhichSurface = -999; if (Numbers(NumField) < LowHConvLimit || Numbers(NumField) > HighHConvLimit) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", out of range value"); - ShowContinueError(state, cAlphaFieldNames(Ptr) + '=' + Alphas(Ptr) + ", " + cNumericFieldNames(NumField) + "=[" + - RoundSigDigits(Numbers(NumField), 5) + "]."); - ShowContinueError(state, "Out-of-range from low/high limits=[>=" + RoundSigDigits(LowHConvLimit, 9) + - ", <=" + RoundSigDigits(HighHConvLimit, 1) + "]."); + ShowContinueError(state, + format("{}={}, {}=[{:.5R}].", + cAlphaFieldNames(Ptr), + Alphas(Ptr), + cNumericFieldNames(NumField), + Numbers(NumField))); + ShowContinueError( + state, format("Out-of-range from low/high limits=[>={:.9R}, <={:.1R}].", LowHConvLimit, HighHConvLimit)); ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object."); ErrorsFound = true; } @@ -1565,10 +1576,14 @@ namespace ConvectionCoefficients { UserIntConvectionCoeffs(TotIntConvCoeff).WhichSurface = -999; if (Numbers(NumField) < LowHConvLimit || Numbers(NumField) > HighHConvLimit) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", out of range value"); - ShowContinueError(state, cAlphaFieldNames(Ptr) + '=' + Alphas(Ptr) + ", " + cNumericFieldNames(NumField) + "=[" + - RoundSigDigits(Numbers(NumField), 5) + "]."); - ShowContinueError(state, "Out-of-range from low/high limits=[>=" + RoundSigDigits(LowHConvLimit, 9) + - ", <=" + RoundSigDigits(HighHConvLimit, 1) + "]."); + ShowContinueError(state, + format("{}={}, {}=[{:.5R}].", + cAlphaFieldNames(Ptr), + Alphas(Ptr), + cNumericFieldNames(NumField), + Numbers(NumField))); + ShowContinueError( + state, format("Out-of-range from low/high limits=[>={:.9R}, <={:.1R}].", LowHConvLimit, HighHConvLimit)); ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object."); ErrorsFound = true; } @@ -1656,8 +1671,8 @@ namespace ConvectionCoefficients { if (CheckScheduleValueMinMax(state, UserIntConvectionCoeffs(Loop).ScheduleIndex, ">=", LowHConvLimit, "<=", HighHConvLimit)) continue; ShowSevereError(state, RoutineName + "Surface=\"" + UserIntConvectionCoeffs(Loop).SurfaceName + "\", out-of-range convection coefficient:"); ShowContinueError(state, "Out-of-range value found in schedule=" + UserIntConvectionCoeffs(Loop).ScheduleName); - ShowContinueError(state, "User supplied convection coefficients must be in range [>=" + RoundSigDigits(LowHConvLimit, 9) + - ", <=" + RoundSigDigits(HighHConvLimit, 1) + ']'); + ShowContinueError(state, + format("User supplied convection coefficients must be in range [>={:.9R}, <={:.1R}]", LowHConvLimit, HighHConvLimit)); ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object."); ErrorsFound = true; } @@ -1668,8 +1683,8 @@ namespace ConvectionCoefficients { if (CheckScheduleValueMinMax(state, UserExtConvectionCoeffs(Loop).ScheduleIndex, ">=", LowHConvLimit, "<=", HighHConvLimit)) continue; ShowSevereError(state, RoutineName + "Surface=\"" + UserExtConvectionCoeffs(Loop).SurfaceName + "\", out-of-range convection coefficient:"); ShowContinueError(state, "Out-of-range value found in schedule=" + UserExtConvectionCoeffs(Loop).ScheduleName); - ShowContinueError(state, "User supplied convection coefficients must be in range [>=" + RoundSigDigits(LowHConvLimit, 9) + - ", <=" + RoundSigDigits(HighHConvLimit, 1) + ']'); + ShowContinueError(state, + format("User supplied convection coefficients must be in range [>={:.9R}, <={:.1R}]", LowHConvLimit, HighHConvLimit)); ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object."); ErrorsFound = true; } @@ -1696,7 +1711,7 @@ namespace ConvectionCoefficients { } } if (Count > 0) { - ShowSevereMessage(state, RoutineName + RoundSigDigits(Count) + " surfaces had different outside convection algorithms specified when"); + ShowSevereMessage(state, RoutineName + format("{} surfaces had different outside convection algorithms specified when", Count)); ShowContinueError(state, "the Zone Outside Convection Algorithm specifies \"SimpleCombined\". SimpleCombined will be used for these surfaces."); if (!state.dataGlobal->DisplayExtraWarnings) { @@ -1858,7 +1873,6 @@ namespace ConvectionCoefficients { // type to that surface. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int SurfNum; @@ -1905,10 +1919,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -1950,10 +1964,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -1995,10 +2009,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -2040,10 +2054,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -2085,10 +2099,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -2129,10 +2143,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -2174,10 +2188,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -2219,10 +2233,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -2264,10 +2278,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -2309,10 +2323,10 @@ namespace ConvectionCoefficients { } if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) { if (SurfaceCountOutside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountOutside) + " Outside"; + OverwriteMessage = format("{} Outside", SurfaceCountOutside); } if (SurfaceCountInside > 0) { - OverwriteMessage = TrimSigDigits(SurfaceCountInside) + " Inside"; + OverwriteMessage = format("{} Inside", SurfaceCountInside); } ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + "\", not overwriting already assigned values for " + OverwriteMessage + " assignments."); @@ -3256,7 +3270,7 @@ namespace ConvectionCoefficients { using Psychrometrics::PsyRhoAirFnPbTdbW; // Locals - Real64 const OneThird((1.0 / 3.0)); // 1/3 in highest precision + static constexpr Real64 OneThird((1.0 / 3.0)); // 1/3 in highest precision static Real64 const pow_5_25(0.56 * root_4(1.0E+5)); static Real64 const pow_11_25(0.56 * root_4(1.0E+11)); static Real64 const pow_11_2(0.58 * std::pow(1.0E+11, 0.2)); @@ -3397,7 +3411,7 @@ namespace ConvectionCoefficients { // for adaptive convection algorithm // Using/Aliasing - using General::RoundSigDigits; + using General::ScanForReports; using Vectors::CreateNewellAreaVector; using Vectors::CreateNewellSurfaceNormalVector; @@ -4238,7 +4252,6 @@ namespace ConvectionCoefficients { // - then calls a routine with a large case statement that calls model equations. // USE STATEMENTS: - using General::TrimSigDigits; // this next call sets up the flow regime and assigns a classification to surface // TODO: candidate for rework to do zone level calcs once rather than for each surface @@ -4251,7 +4264,7 @@ namespace ConvectionCoefficients { // if ( std::isnan( HConvIn( SurfNum ) ) ) { // Use IEEE_IS_NAN when GFortran supports it //// throw Error // ShowSevereError(state, "Inside convection coefficient is out of bound = " + Surface( SurfNum ).Name ); - // ShowFatalError( "Inside convection coefficient model number = " + TrimSigDigits( Surface( SurfNum ).IntConvHcModelEq ) ); + // ShowFatalError(state, "Inside convection coefficient model number = " + TrimSigDigits( Surface( SurfNum ).IntConvHcModelEq ) ); //} } @@ -4992,7 +5005,6 @@ namespace ConvectionCoefficients { // RE-ENGINEERED na // Using/Aliasing - using General::RoundSigDigits; { auto const SELECT_CASE_var(Surface(SurfNum).OutConvClassification); @@ -5035,8 +5047,9 @@ namespace ConvectionCoefficients { Surface(SurfNum).OutConvHfUserCurveIndex = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUstableHorizUserCurveNum; } } else { - ShowSevereError(state, "MapExtConvClassificationToHcModels: caught unknown outdoor surfce classification:" + - RoundSigDigits(Surface(SurfNum).OutConvClassification)); + ShowSevereError(state, + format("MapExtConvClassificationToHcModels: caught unknown outdoor surfce classification:{}", + Surface(SurfNum).OutConvClassification)); } } } @@ -7439,7 +7452,7 @@ namespace ConvectionCoefficients { if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWindowErrorIDX1 == 0) { ShowSevereMessage(state, "CalcGoldsteinNovoselacCeilingDiffuserWindow: Convection model not evaluated (bad relative window location)"); - ShowContinueError(state, "Value for window location = " + RoundSigDigits(WindowLocationType)); + ShowContinueError(state, format("Value for window location = {}", WindowLocationType)); ShowContinueError(state, "Occurs for zone named = " + Zone(ZoneNum).Name); ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } @@ -7452,7 +7465,7 @@ namespace ConvectionCoefficients { if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWindowErrorIDX2 == 0) { ShowSevereMessage(state, "CalcGoldsteinNovoselacCeilingDiffuserWindow: Convection model not evaluated (zero zone exterior perimeter length)"); - ShowContinueError(state, "Value for zone exterior perimeter length = " + RoundSigDigits(ZoneExtPerimLength, 5)); + ShowContinueError(state, format("Value for zone exterior perimeter length = {:.5R}", ZoneExtPerimLength)); ShowContinueError(state, "Occurs for zone named = " + Zone(ZoneNum).Name); ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } @@ -7514,7 +7527,7 @@ namespace ConvectionCoefficients { WindowLocationType != InConvWinLoc_NotSet) { if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWallErrorIDX1 == 0) { ShowSevereMessage(state, "CalcGoldsteinNovoselacCeilingDiffuserWall: Convection model not evaluated (bad relative window location)"); - ShowContinueError(state, "Value for window location = " + RoundSigDigits(WindowLocationType)); + ShowContinueError(state, format("Value for window location = {}", WindowLocationType)); ShowContinueError(state, "Occurs for zone named = " + Zone(ZoneNum).Name); ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } @@ -7525,7 +7538,7 @@ namespace ConvectionCoefficients { } else { if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWallErrorIDX2 == 0) { ShowSevereMessage(state, "CalcGoldsteinNovoselacCeilingDiffuserWall: Convection model not evaluated (zero zone exterior perimeter length)"); - ShowContinueError(state, "Value for zone exterior perimeter length = " + RoundSigDigits(ZoneExtPerimLength, 5)); + ShowContinueError(state, format("Value for zone exterior perimeter length = {:.5R}", ZoneExtPerimLength)); ShowContinueError(state, "Occurs for zone named = " + Zone(ZoneNum).Name); ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } @@ -7576,7 +7589,7 @@ namespace ConvectionCoefficients { if (ZoneExtPerimLength <= 0.0) { if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserFloorErrorIDX == 0) { ShowSevereMessage(state, "CalcGoldsteinNovoselacCeilingDiffuserFloor: Convection model not evaluated (zero zone exterior perimeter length)"); - ShowContinueError(state, "Value for zone exterior perimeter length = " + RoundSigDigits(ZoneExtPerimLength, 5)); + ShowContinueError(state, format("Value for zone exterior perimeter length = {:.5R}", ZoneExtPerimLength)); ShowContinueError(state, "Occurs for zone named = " + Zone(ZoneNum).Name); ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } @@ -7654,7 +7667,7 @@ namespace ConvectionCoefficients { } else { if (state.dataConvectionCoefficient->CalcSparrowWindwardErrorIDX == 0) { ShowSevereMessage(state, "CalcSparrowWindward: Convection model not evaluated (bad face area)"); - ShowContinueError(state, "Value for effective face area = " + RoundSigDigits(FaceArea, 5)); + ShowContinueError(state, format("Value for effective face area = {:.5R}", FaceArea)); ShowContinueError(state, "Occurs for surface named = " + Surface(SurfNum).Name); ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } @@ -7671,7 +7684,7 @@ namespace ConvectionCoefficients { } else { if (state.dataConvectionCoefficient->CalcSparrowLeewardErrorIDX == 0) { ShowSevereMessage(state, "CalcSparrowLeeward: Convection model not evaluated (bad face area)"); - ShowContinueError(state, "Value for effective face area = " + RoundSigDigits(FaceArea, 5)); + ShowContinueError(state, format("Value for effective face area = {:.5R}", FaceArea)); ShowContinueError(state, "Occurs for surface named = " + Surface(SurfNum).Name); ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } @@ -7902,7 +7915,7 @@ namespace ConvectionCoefficients { } else { if (state.dataConvectionCoefficient->CalcMitchellErrorIDX == 0) { ShowSevereMessage(state, "CalcMitchell: Convection model not evaluated (bad length scale)"); - ShowContinueError(state, "Value for effective length scale = " + RoundSigDigits(LengthScale, 5)); + ShowContinueError(state, format("Value for effective length scale = {:.5R}", LengthScale)); ShowContinueError(state, "Occurs for surface named = " + Surface(SurfNum).Name); ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } @@ -8006,7 +8019,7 @@ namespace ConvectionCoefficients { } else { if (state.dataConvectionCoefficient->CalcEmmelVerticalErrorIDX == 0) { ShowSevereMessage(state, "CalcEmmelVertical: Convection model wind angle calculation suspect (developer issue)"); - ShowContinueError(state, "Value for theta angle = " + RoundSigDigits(Theta, 5)); + ShowContinueError(state, format("Value for theta angle = {:.5R}", Theta)); ShowContinueError(state, "Occurs for surface named = " + Surface(SurfNum).Name); ShowContinueError(state, "Convection model uses high theta correlation and the simulation continues"); } @@ -8064,7 +8077,7 @@ namespace ConvectionCoefficients { } else { if (state.dataConvectionCoefficient->CalcEmmelRoofErrorIDX == 0) { ShowSevereMessage(state, "CalcEmmelRoof: Convection model wind angle calculation suspect (developer issue)"); - ShowContinueError(state, "Value for theta angle = " + RoundSigDigits(Theta, 5)); + ShowContinueError(state, format("Value for theta angle = {:.5R}", Theta)); ShowContinueError(state, "Occurs for surface named = " + Surface(SurfNum).Name); ShowContinueError(state, "Convection model uses high theta correlation and the simulation continues"); } @@ -8156,7 +8169,7 @@ namespace ConvectionCoefficients { } else { if (state.dataConvectionCoefficient->CalcClearRoofErrorIDX == 0) { ShowSevereMessage(state, "CalcClearRoof: Convection model not evaluated (bad value for distance to roof edge)"); - ShowContinueError(state, "Value for distance to roof edge =" + RoundSigDigits(x, 3)); + ShowContinueError(state, format("Value for distance to roof edge ={:.3R}", x)); ShowContinueError(state, "Occurs for surface named = " + Surface(SurfNum).Name); ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc index eb62f1d49ef..759f50b8625 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -133,7 +133,7 @@ namespace CoolTower { // and stores it in the Cooltower data structure. // Using/Aliasing - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using WaterManager::SetupTankDemandComponent; @@ -256,99 +256,99 @@ namespace CoolTower { state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxWaterFlowRate = rNumericArgs(1); // Maximum limit of water supply if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxWaterFlowRate > MaximumWaterFlowRate) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxWaterFlowRate = MaximumWaterFlowRate; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(1) + "=[" + - RoundSigDigits(rNumericArgs(1), 2) + "]."); - ShowContinueError(state, "...Maximum Allowable=[" + RoundSigDigits(MaximumWaterFlowRate, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(1), rNumericArgs(1))); + ShowContinueError(state, format("...Maximum Allowable=[{:.2R}].", MaximumWaterFlowRate)); } if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxWaterFlowRate < MinimumWaterFlowRate) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxWaterFlowRate = MinimumWaterFlowRate; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(1) + "=[" + - RoundSigDigits(rNumericArgs(1), 2) + "]."); - ShowContinueError(state, "...Minimum Allowable=[" + RoundSigDigits(MinimumWaterFlowRate, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(1), rNumericArgs(1))); + ShowContinueError(state, format("...Minimum Allowable=[{:.2R}].", MinimumWaterFlowRate)); } state.dataCoolTower->CoolTowerSys(CoolTowerNum).TowerHeight = rNumericArgs(2); // Get effctive tower height if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).TowerHeight > MaxHeight) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).TowerHeight = MaxHeight; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(2) + "=[" + - RoundSigDigits(rNumericArgs(2), 2) + "]."); - ShowContinueError(state, "...Maximum Allowable=[" + RoundSigDigits(MaxHeight, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(2), rNumericArgs(2))); + ShowContinueError(state, format("...Maximum Allowable=[{:.2R}].", MaxHeight)); } if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).TowerHeight < MinHeight) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).TowerHeight = MinHeight; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(2) + "=[" + - RoundSigDigits(rNumericArgs(2), 2) + "]."); - ShowContinueError(state, "...Minimum Allowable=[" + RoundSigDigits(MinHeight, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(2), rNumericArgs(2))); + ShowContinueError(state, format("...Minimum Allowable=[{:.2R}].", MinHeight)); } state.dataCoolTower->CoolTowerSys(CoolTowerNum).OutletArea = rNumericArgs(3); // Get outlet area if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).OutletArea > MaxValue) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).OutletArea = MaxValue; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(3) + "=[" + - RoundSigDigits(rNumericArgs(3), 2) + "]."); - ShowContinueError(state, "...Maximum Allowable=[" + RoundSigDigits(MaxValue, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(3), rNumericArgs(3))); + ShowContinueError(state, format("...Maximum Allowable=[{:.2R}].", MaxValue)); } if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).OutletArea < MinValue) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).OutletArea = MinValue; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(3) + "=[" + - RoundSigDigits(rNumericArgs(3), 2) + "]."); - ShowContinueError(state, "...Minimum Allowable=[" + RoundSigDigits(MinValue, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(3), rNumericArgs(3))); + ShowContinueError(state, format("...Minimum Allowable=[{:.2R}].", MinValue)); } state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxAirVolFlowRate = rNumericArgs(4); // Maximum limit of air flow to the space if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxAirVolFlowRate > MaxValue) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxAirVolFlowRate = MaxValue; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(4) + "=[" + - RoundSigDigits(rNumericArgs(4), 2) + "]."); - ShowContinueError(state, "...Maximum Allowable=[" + RoundSigDigits(MaxValue, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(4), rNumericArgs(4))); + ShowContinueError(state, format("...Maximum Allowable=[{:.2R}].", MaxValue)); } if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxAirVolFlowRate < MinValue) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).MaxAirVolFlowRate = MinValue; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(4) + "=[" + - RoundSigDigits(rNumericArgs(4), 2) + "]."); - ShowContinueError(state, "...Minimum Allowable=[" + RoundSigDigits(MinValue, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(4), rNumericArgs(4))); + ShowContinueError(state, format("...Minimum Allowable=[{:.2R}].", MinValue)); } state.dataCoolTower->CoolTowerSys(CoolTowerNum).MinZoneTemp = rNumericArgs(5); // Get minimum temp limit which gets this cooltower off if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).MinZoneTemp > MaxValue) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).MinZoneTemp = MaxValue; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(5) + "=[" + - RoundSigDigits(rNumericArgs(5), 2) + "]."); - ShowContinueError(state, "...Maximum Allowable=[" + RoundSigDigits(MaxValue, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(5), rNumericArgs(5))); + ShowContinueError(state, format("...Maximum Allowable=[{:.2R}].", MaxValue)); } if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).MinZoneTemp < MinValue) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).MinZoneTemp = MinValue; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(5) + "=[" + - RoundSigDigits(rNumericArgs(5), 2) + "]."); - ShowContinueError(state, "...Minimum Allowable=[" + RoundSigDigits(MinValue, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(5), rNumericArgs(5))); + ShowContinueError(state, format("...Minimum Allowable=[{:.2R}].", MinValue)); } state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracWaterLoss = rNumericArgs(6); // Fraction of water loss if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracWaterLoss > MaxFrac) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracWaterLoss = MaxFrac; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(6) + "=[" + - RoundSigDigits(rNumericArgs(6), 2) + "]."); - ShowContinueError(state, "...Maximum Allowable=[" + RoundSigDigits(MaxFrac, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(6), rNumericArgs(6))); + ShowContinueError(state, format("...Maximum Allowable=[{:.2R}].", MaxFrac)); } if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracWaterLoss < MinFrac) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracWaterLoss = MinFrac; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(6) + "=[" + - RoundSigDigits(rNumericArgs(6), 2) + "]."); - ShowContinueError(state, "...Minimum Allowable=[" + RoundSigDigits(MinFrac, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(6), rNumericArgs(6))); + ShowContinueError(state, format("...Minimum Allowable=[{:.2R}].", MinFrac)); } state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracFlowSched = rNumericArgs(7); // Fraction of loss of air flow if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracFlowSched > MaxFrac) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracFlowSched = MaxFrac; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(7) + "=[" + - RoundSigDigits(rNumericArgs(7), 2) + "]."); - ShowContinueError(state, "...Maximum Allowable=[" + RoundSigDigits(MaxFrac, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(7), rNumericArgs(7))); + ShowContinueError(state, format("...Maximum Allowable=[{:.2R}].", MaxFrac)); } if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracFlowSched < MinFrac) { state.dataCoolTower->CoolTowerSys(CoolTowerNum).FracFlowSched = MinFrac; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(7) + "=[" + - RoundSigDigits(rNumericArgs(7), 5) + "]."); - ShowContinueError(state, "...Minimum Allowable=[" + RoundSigDigits(MinFrac, 2) + "]."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.5R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(7), rNumericArgs(7))); + ShowContinueError(state, format("...Minimum Allowable=[{:.2R}].", MinFrac)); } state.dataCoolTower->CoolTowerSys(CoolTowerNum).RatedPumpPower = rNumericArgs(8); // Get rated pump power diff --git a/src/EnergyPlus/CurveManager.cc b/src/EnergyPlus/CurveManager.cc index ef721cc7fe7..2d95d75f13f 100644 --- a/src/EnergyPlus/CurveManager.cc +++ b/src/EnergyPlus/CurveManager.cc @@ -49,7 +49,6 @@ #include #include #include -#include #include // ObjexxFCL Headers @@ -66,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -262,7 +260,6 @@ namespace CurveManager { // Using/Aliasing using namespace DataIPShortCuts; // Data for field names, blank numerics - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumBiQuad; // Number of biquadratic curve objects in the input data file @@ -379,14 +376,12 @@ namespace CurveManager { if (Numbers(7) > Numbers(8)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(7) + " [" + RoundSigDigits(Numbers(7), 2) + "] > " + cNumericFieldNames(8) + " [" + - RoundSigDigits(Numbers(8), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(7), Numbers(7), cNumericFieldNames(8), Numbers(8))); ErrorsFound = true; } if (Numbers(9) > Numbers(10)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(9) + " [" + RoundSigDigits(Numbers(9), 2) + "] > " + cNumericFieldNames(10) + " [" + - RoundSigDigits(Numbers(10), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(9), Numbers(9), cNumericFieldNames(10), Numbers(10))); ErrorsFound = true; } if (NumAlphas >= 2) { @@ -520,8 +515,7 @@ namespace CurveManager { if (Numbers(5) > Numbers(6)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(5) + '[' + RoundSigDigits(Numbers(5), 2) + "] > " + cNumericFieldNames(6) + " [" + - RoundSigDigits(Numbers(6), 2) + ']'); + ShowContinueError(state, format("{}[{:.R2}] > {} [{.R2}]", cNumericFieldNames(5), Numbers(5), cNumericFieldNames(6), Numbers(6))); ErrorsFound = true; } if (NumAlphas >= 2) { @@ -576,8 +570,7 @@ namespace CurveManager { if (Numbers(6) > Numbers(7)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(6) + '[' + RoundSigDigits(Numbers(6), 2) + "] > " + cNumericFieldNames(7) + " [" + - RoundSigDigits(Numbers(7), 2) + ']'); + ShowContinueError(state, format("{}[{:.R2}] > {} [{.R2}]", cNumericFieldNames(6), Numbers(6), cNumericFieldNames(7), Numbers(7))); ErrorsFound = true; } if (NumAlphas >= 2) { @@ -630,8 +623,7 @@ namespace CurveManager { if (Numbers(4) > Numbers(5)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(4) + " [" + RoundSigDigits(Numbers(4), 2) + "] > " + cNumericFieldNames(5) + " [" + - RoundSigDigits(Numbers(5), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(4), Numbers(4), cNumericFieldNames(5), Numbers(5))); ErrorsFound = true; } if (NumAlphas >= 2) { @@ -689,14 +681,12 @@ namespace CurveManager { if (Numbers(7) > Numbers(8)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(7) + " [" + RoundSigDigits(Numbers(7), 2) + "] > " + cNumericFieldNames(8) + " [" + - RoundSigDigits(Numbers(8), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(7), Numbers(7), cNumericFieldNames(8), Numbers(8))); ErrorsFound = true; } if (Numbers(9) > Numbers(10)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(9) + " [" + RoundSigDigits(Numbers(9), 2) + "] > " + cNumericFieldNames(10) + " [" + - RoundSigDigits(Numbers(10), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(9), Numbers(9), cNumericFieldNames(10), Numbers(10))); ErrorsFound = true; } if (NumAlphas >= 2) { @@ -759,14 +749,12 @@ namespace CurveManager { if (Numbers(7) > Numbers(8)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(7) + " [" + RoundSigDigits(Numbers(7), 2) + "] > " + cNumericFieldNames(8) + " [" + - RoundSigDigits(Numbers(8), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(7), Numbers(7), cNumericFieldNames(8), Numbers(8))); ErrorsFound = true; } if (Numbers(9) > Numbers(10)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(9) + " [" + RoundSigDigits(Numbers(9), 2) + "] > " + cNumericFieldNames(10) + " [" + - RoundSigDigits(Numbers(10), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(9), Numbers(9), cNumericFieldNames(10), Numbers(10))); ErrorsFound = true; } if (NumAlphas >= 2) { @@ -823,8 +811,7 @@ namespace CurveManager { if (Numbers(3) > Numbers(4)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(3) + " [" + RoundSigDigits(Numbers(3), 2) + "] > " + cNumericFieldNames(4) + " [" + - RoundSigDigits(Numbers(4), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(3), Numbers(3), cNumericFieldNames(4), Numbers(4))); ErrorsFound = true; } if (NumAlphas >= 2) { @@ -886,14 +873,14 @@ namespace CurveManager { if (Numbers(11) > Numbers(12)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(11) + " [" + RoundSigDigits(Numbers(11), 2) + "] > " + cNumericFieldNames(12) + " [" + - RoundSigDigits(Numbers(12), 2) + ']'); + ShowContinueError(state, + format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(11), Numbers(11), cNumericFieldNames(12), Numbers(12))); ErrorsFound = true; } if (Numbers(13) > Numbers(14)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(13) + " [" + RoundSigDigits(Numbers(13), 2) + "] > " + cNumericFieldNames(14) + " [" + - RoundSigDigits(Numbers(14), 2) + ']'); + ShowContinueError(state, + format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(13), Numbers(13), cNumericFieldNames(14), Numbers(14))); ErrorsFound = true; } if (NumAlphas >= 2) { @@ -982,20 +969,20 @@ namespace CurveManager { if (Numbers(28) > Numbers(29)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(28) + " [" + RoundSigDigits(Numbers(28), 2) + "] > " + cNumericFieldNames(29) + " [" + - RoundSigDigits(Numbers(29), 2) + ']'); + ShowContinueError(state, + format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(28), Numbers(28), cNumericFieldNames(29), Numbers(29))); ErrorsFound = true; } if (Numbers(30) > Numbers(31)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(30) + " [" + RoundSigDigits(Numbers(30), 2) + "] > " + cNumericFieldNames(31) + " [" + - RoundSigDigits(Numbers(31), 2) + ']'); + ShowContinueError(state, + format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(30), Numbers(30), cNumericFieldNames(31), Numbers(31))); ErrorsFound = true; } if (Numbers(32) > Numbers(33)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(32) + " [" + RoundSigDigits(Numbers(32), 2) + "] > " + cNumericFieldNames(33) + " [" + - RoundSigDigits(Numbers(33), 2) + ']'); + ShowContinueError(state, + format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(32), Numbers(32), cNumericFieldNames(33), Numbers(33))); ErrorsFound = true; } if (NumAlphas >= 2) { @@ -1067,26 +1054,24 @@ namespace CurveManager { if (Numbers(6) > Numbers(7)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(6) + " [" + RoundSigDigits(Numbers(6), 2) + "] > " + cNumericFieldNames(7) + " [" + - RoundSigDigits(Numbers(7), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(6), Numbers(6), cNumericFieldNames(7), Numbers(7))); ErrorsFound = true; } if (Numbers(8) > Numbers(9)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(8) + " [" + RoundSigDigits(Numbers(8), 2) + "] > " + cNumericFieldNames(9) + " [" + - RoundSigDigits(Numbers(9), 2) + ']'); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(8), Numbers(8), cNumericFieldNames(9), Numbers(9))); ErrorsFound = true; } if (Numbers(10) > Numbers(11)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(10) + " [" + RoundSigDigits(Numbers(10), 2) + "] > " + cNumericFieldNames(11) + " [" + - RoundSigDigits(Numbers(11), 2) + ']'); + ShowContinueError(state, + format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(10), Numbers(10), cNumericFieldNames(11), Numbers(11))); ErrorsFound = true; } if (Numbers(12) > Numbers(13)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(12) + " [" + RoundSigDigits(Numbers(12), 2) + "] > " + cNumericFieldNames(13) + " [" + - RoundSigDigits(Numbers(13), 2) + ']'); + ShowContinueError(state, + format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(12), Numbers(12), cNumericFieldNames(13), Numbers(13))); ErrorsFound = true; } @@ -1205,14 +1190,12 @@ namespace CurveManager { if (Numbers(5) > Numbers(6)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(5) + '[' + RoundSigDigits(Numbers(5), 2) + "] > " + cNumericFieldNames(6) + " [" + - RoundSigDigits(Numbers(6), 2) + ']'); + ShowContinueError(state, format("{}[{:.R2}] > {} [{.R2}]", cNumericFieldNames(5), Numbers(5), cNumericFieldNames(6), Numbers(6))); ErrorsFound = true; } if (Numbers(7) > Numbers(8)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(7) + '[' + RoundSigDigits(Numbers(7), 2) + "] > " + cNumericFieldNames(8) + " [" + - RoundSigDigits(Numbers(8), 2) + ']'); + ShowContinueError(state, format("{}[{:.R2}] > {} [{.R2}]", cNumericFieldNames(7), Numbers(7), cNumericFieldNames(8), Numbers(8))); ErrorsFound = true; } @@ -1258,8 +1241,7 @@ namespace CurveManager { if (Numbers(5) > Numbers(6)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(5) + '[' + RoundSigDigits(Numbers(5), 2) + "] > " + cNumericFieldNames(6) + " [" + - RoundSigDigits(Numbers(6), 2) + ']'); + ShowContinueError(state, format("{}[{:.R2}] > {} [{.R2}]", cNumericFieldNames(5), Numbers(5), cNumericFieldNames(6), Numbers(6))); ErrorsFound = true; } @@ -1316,8 +1298,7 @@ namespace CurveManager { if (Numbers(6) > Numbers(7)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(6) + '[' + RoundSigDigits(Numbers(6), 2) + "] > " + cNumericFieldNames(7) + " [" + - RoundSigDigits(Numbers(7), 2) + ']'); + ShowContinueError(state, format("{}[{:.R2}] > {} [{.R2}]", cNumericFieldNames(6), Numbers(6), cNumericFieldNames(7), Numbers(7))); ErrorsFound = true; } @@ -1372,8 +1353,7 @@ namespace CurveManager { if (Numbers(4) > Numbers(5)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(4) + '[' + RoundSigDigits(Numbers(4), 2) + "] > " + cNumericFieldNames(5) + " [" + - RoundSigDigits(Numbers(5), 2) + ']'); + ShowContinueError(state, format("{}[{:.R2}] > {} [{.R2}]", cNumericFieldNames(4), Numbers(4), cNumericFieldNames(5), Numbers(5))); ErrorsFound = true; } @@ -1428,8 +1408,7 @@ namespace CurveManager { if (Numbers(4) > Numbers(5)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(4) + '[' + RoundSigDigits(Numbers(4), 2) + "] > " + cNumericFieldNames(5) + " [" + - RoundSigDigits(Numbers(5), 2) + ']'); + ShowContinueError(state, format("{}[{:.R2}] > {} [{.R2}]", cNumericFieldNames(4), Numbers(4), cNumericFieldNames(5), Numbers(5))); ErrorsFound = true; } @@ -1484,8 +1463,7 @@ namespace CurveManager { if (Numbers(4) > Numbers(5)) { // error ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, cNumericFieldNames(4) + '[' + RoundSigDigits(Numbers(4), 2) + "] > " + cNumericFieldNames(5) + " [" + - RoundSigDigits(Numbers(5), 2) + ']'); + ShowContinueError(state, format("{}[{:.R2}] > {} [{.R2}]", cNumericFieldNames(4), Numbers(4), cNumericFieldNames(5), Numbers(5))); ErrorsFound = true; } @@ -1592,8 +1570,10 @@ namespace CurveManager { ShowContinueError(state, "has either the same values for two consecutive wind directions, or a lower wind direction value after " "a higher wind direction value."); ShowContinueError(state, "Wind direction values must be entered in ascending order."); - ShowContinueError(state, cNumericFieldNames(j) + " = " + RoundSigDigits(windDirs[j - 2], 2) + ' ' + cNumericFieldNames[j + 1] + - " = " + RoundSigDigits(windDirs[j - 1], 2)); + ShowContinueError( + state, + format( + "{} = {:.2R} {} = {:.2R}", cNumericFieldNames(j), windDirs[j - 2], cNumericFieldNames[j + 1], windDirs[j - 1])); ErrorsFound = true; } } @@ -1601,7 +1581,7 @@ namespace CurveManager { // Check that the first table value is zero if (dirMin != 0.0) { ShowSevereError(state, "GetCurveInput: An " + CurrentModuleObject + " object "); - ShowContinueError(state, "has a nonzero minimum value of " + RoundSigDigits(dirMin, 2)); + ShowContinueError(state, format("has a nonzero minimum value of {:.2R}", dirMin)); ShowContinueError(state, "Wind direction values must begin at zero."); ErrorsFound = true; } @@ -1656,9 +1636,10 @@ namespace CurveManager { MaxTableNums = NumNumbers; if (NumNumbers != numWindDir) { ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, "The number of data entries must match the number of wind directions given in the wind pressure " - "coefficient array. Number of data entries = " + - RoundSigDigits(NumNumbers)); + ShowContinueError(state, + format("The number of data entries must match the number of wind directions given in the wind pressure " + "coefficient array. Number of data entries = {}", + NumNumbers)); ErrorsFound = true; } else { std::vector axis; @@ -2101,10 +2082,12 @@ namespace CurveManager { std::size_t row = colAndRow.second; // 0 indexed auto &content = contents[col]; if (col >= numColumns) { - ShowFatalError(state, "File \"" + filePath + "\" : Requested column (" + General::RoundSigDigits(col+1) + ") exceeds the number of columns (" + General::RoundSigDigits(numColumns) + ")."); + ShowFatalError(state, + format("File \"{}\" : Requested column ({}) exceeds the number of columns ({}).", filePath, col + 1, numColumns)); } if (row >= numRows) { - ShowFatalError(state, "File \"" + filePath + "\" : Requested starting row (" + General::RoundSigDigits(row+1) + ") exceeds the number of rows (" + General::RoundSigDigits(numRows) + ")."); + ShowFatalError(state, + format("File \"{}\" : Requested starting row ({}) exceeds the number of rows ({}).", filePath, row + 1, numRows)); } std::vector array(numRows - row); std::transform(content.begin() + row, content.end(), array.begin(), [](const std::string &str) { @@ -2146,7 +2129,7 @@ namespace CurveManager { for (CurveIndex = 1; CurveIndex <= state.dataCurveManager->NumCurves; ++CurveIndex) { for (int dim = 1; dim <= state.dataCurveManager->PerfCurve(CurveIndex).NumDims; ++dim) { - std::string numStr = std::to_string(dim); + std::string numStr = fmt::to_string(dim); // TODO: Make CurveInput an Array for better looping here... switch (dim) { @@ -2520,13 +2503,14 @@ namespace CurveManager { // Not compatible ShowSevereError(state, routineName + objectType + "=\"" + objectName + "\""); ShowContinueError(state, "...Invalid curve for " + curveFieldText + "."); - std::string validString = std::to_string(validDims[0]); + std::string validString = fmt::to_string(validDims[0]); for (std::size_t i = 1; i < validDims.size(); i++) { - validString += " or " + std::to_string(validDims[i]); + validString += format(" or {}", validDims[i]); } std::string plural1 = curveDim > 1 ? "s" : ""; std::string plural2 = validDims[validDims.size()-1] > 1 ? "s" : ""; - ShowContinueError(state, "...Input curve=\"" + state.dataCurveManager->PerfCurve(CurveIndex).Name + "\" has " + std::to_string(curveDim) + " dimension" + plural1 + "."); + ShowContinueError( + state, format("...Input curve=\"{}\" has {} dimension{}.", state.dataCurveManager->PerfCurve(CurveIndex).Name, curveDim, plural1)); ShowContinueError(state, "...Curve type must have " + validString + " dimension" + plural2 + "."); return true; } @@ -2668,7 +2652,6 @@ namespace CurveManager { // Certain curve types have set limits (e.g., PLF curve should not be greater than 1 or less than 0.7). // Using/Aliasing - using General::TrimSigDigits; if (CurveIndex > 0 && CurveIndex <= state.dataCurveManager->NumCurves) { @@ -2684,8 +2667,9 @@ namespace CurveManager { } else { - ShowSevereError(state, "SetCurveOutputMinMaxValues: CurveIndex=[" + TrimSigDigits(CurveIndex) + - "] not in range of curves=[1:" + TrimSigDigits(state.dataCurveManager->NumCurves) + "]."); + ShowSevereError( + state, + format("SetCurveOutputMinMaxValues: CurveIndex=[{}] not in range of curves=[1:{}].", CurveIndex, state.dataCurveManager->NumCurves)); ErrorsFound = true; } } @@ -2944,7 +2928,6 @@ namespace CurveManager { // Trans. ASIVIE, J. of Fluids Engineering 103: 89-90. // Using/Aliasing - using General::RoundSigDigits; // Return value Real64 CalculateMoodyFrictionFactor; @@ -2975,8 +2958,8 @@ namespace CurveManager { CalculateMoodyFrictionFactor = std::pow(Term3, -2.0); } else { if (!state.dataCurveManager->FrictionFactorErrorHasOccurred) { - RR = RoundSigDigits(RoughnessRatio, 7); - Re = RoundSigDigits(ReynoldsNumber, 1); + RR = format("{:.7R}", RoughnessRatio); + Re = format("{:.1R}", ReynoldsNumber); ShowSevereError(state, "Plant Pressure System: Error in moody friction factor calculation"); ShowContinueError(state, "Current Conditions: Roughness Ratio=" + RR + "; Reynolds Number=" + Re); ShowContinueError(state, "These conditions resulted in an unhandled numeric issue."); @@ -3019,7 +3002,7 @@ namespace CurveManager { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, callingRoutineObj + "=\"" + objectName + "\" curve values"); ShowContinueError(state, "... " + cFieldName + " = " + cFieldValue + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "... Curve output at rated conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("... Curve output at rated conditions = {:.3T}", CurveVal)); } } } diff --git a/src/EnergyPlus/DElightManagerF.cc b/src/EnergyPlus/DElightManagerF.cc index 27f852ec863..50b4e624d31 100644 --- a/src/EnergyPlus/DElightManagerF.cc +++ b/src/EnergyPlus/DElightManagerF.cc @@ -132,7 +132,7 @@ namespace DElightManagerF { using namespace DataSurfaces; // Gives access to Surface data using namespace DataStringGlobals; // Gives access to Program Path and Current Time/Date using namespace DataDaylighting; - using General::RoundSigDigits; + using InternalHeatGains::CheckLightsReplaceableMinMaxForZone; using InternalHeatGains::GetDesignLightingLevelForZone; @@ -579,20 +579,29 @@ namespace DElightManagerF { // Validate that Reference Point coordinates are within the host Zone if (RefPt_WCS_Coord(1) < zn.MinimumX || RefPt_WCS_Coord(1) > zn.MaximumX) { ShowWarningError(state, "DElightInputGenerator:Reference point X Value outside Zone Min/Max X, Zone=" + zn.Name); - ShowSevereError(state, "...X Reference Point= " + RoundSigDigits(RefPt_WCS_Coord(1), 2) + ", Zone Minimum X= " + - RoundSigDigits(zn.MinimumX, 2) + ", Zone Maximum X= " + RoundSigDigits(zn.MaximumX, 2)); + ShowSevereError(state, + format("...X Reference Point= {:.2R}, Zone Minimum X= {:.2R}, Zone Maximum X= {:.2R}", + zn.MinimumX, + RefPt_WCS_Coord(1), + zn.MaximumX)); ErrorsFound = true; } if (RefPt_WCS_Coord(2) < zn.MinimumY || RefPt_WCS_Coord(2) > zn.MaximumY) { ShowWarningError(state, "DElightInputGenerator:Reference point Y Value outside Zone Min/Max Y, Zone=" + zn.Name); - ShowSevereError(state, "...Y Reference Point= " + RoundSigDigits(RefPt_WCS_Coord(2), 2) + ", Zone Minimum Y= " + - RoundSigDigits(zn.MinimumY, 2) + ", Zone Maximum Y= " + RoundSigDigits(zn.MaximumY, 2)); + ShowSevereError(state, + format("...Y Reference Point= {:.2R}, Zone Minimum Y= {:.2R}, Zone Maximum Y= {:.2R}", + zn.MinimumY, + RefPt_WCS_Coord(2), + zn.MaximumY)); ErrorsFound = true; } if (RefPt_WCS_Coord(3) < Zone(izone).MinimumZ || RefPt_WCS_Coord(3) > zn.MaximumZ) { ShowWarningError(state, "DElightInputGenerator:Reference point Z Value outside Zone Min/Max Z, Zone=" + zn.Name); - ShowSevereError(state, "...Z Reference Point= " + RoundSigDigits(RefPt_WCS_Coord(3), 2) + ", Zone Minimum Z= " + - RoundSigDigits(zn.MinimumZ, 2) + ", Zone Maximum Z= " + RoundSigDigits(zn.MaximumZ, 2)); + ShowSevereError(state, + format("...Z Reference Point= {:.2R}, Zone Minimum Z= {:.2R}, Zone Maximum Z= {:.2R}", + zn.MinimumZ, + RefPt_WCS_Coord(3), + zn.MaximumZ)); ErrorsFound = true; } diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 55d0a306caa..bc955d9aff0 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -263,7 +263,6 @@ namespace DXCoils { // Manages the simulation of a single speed on/off DX coil. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int DXCoilNum; // index of fan coil unit being simulated @@ -285,13 +284,16 @@ namespace DXCoils { } else { DXCoilNum = CompIndex; if (DXCoilNum > NumDXCoils || DXCoilNum < 1) { - ShowFatalError(state, "SimDXCoil: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of DX Coils=" + TrimSigDigits(NumDXCoils) + ", Coil name=" + CompName); + ShowFatalError( + state, format("SimDXCoil: Invalid CompIndex passed={}, Number of DX Coils={}, Coil name={}", DXCoilNum, NumDXCoils, CompName)); } if (CheckEquipName(DXCoilNum)) { if (!CompName.empty() && CompName != DXCoil(DXCoilNum).Name) { - ShowFatalError(state, "SimDXCoil: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + ", Coil name=" + CompName + - ", stored Coil Name for that index=" + DXCoil(DXCoilNum).Name); + ShowFatalError(state, + format("SimDXCoil: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + DXCoilNum, + CompName, + DXCoil(DXCoilNum).Name)); } CheckEquipName(DXCoilNum) = false; } @@ -389,7 +391,6 @@ namespace DXCoils { // Manages the simulation of a multi speed DX coil. // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -420,13 +421,17 @@ namespace DXCoils { } else { DXCoilNum = CompIndex; if (DXCoilNum > NumDXCoils || DXCoilNum < 1) { - ShowFatalError(state, "SimDXCoilMultiSpeed: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of DX Coils=" + TrimSigDigits(NumDXCoils) + ", Coil name=" + CompName); + ShowFatalError( + state, + format("SimDXCoilMultiSpeed: Invalid CompIndex passed={}, Number of DX Coils={}, Coil name={}", DXCoilNum, NumDXCoils, CompName)); } if (CheckEquipName(DXCoilNum)) { if (!CompName.empty() && CompName != DXCoil(DXCoilNum).Name) { - ShowFatalError(state, "SimDXCoilMultiSpeed: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + ", Coil name=" + CompName + - ", stored Coil Name for that index=" + DXCoil(DXCoilNum).Name); + ShowFatalError(state, + format("SimDXCoilMultiSpeed: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + DXCoilNum, + CompName, + DXCoil(DXCoilNum).Name)); } CheckEquipName(DXCoilNum) = false; } @@ -506,7 +511,6 @@ namespace DXCoils { // multiple stages, or sub-cool reheat for humidity control. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("SimDXCoilMultiMode"); @@ -569,13 +573,17 @@ namespace DXCoils { } else { DXCoilNum = CompIndex; if (DXCoilNum > NumDXCoils || DXCoilNum < 1) { - ShowFatalError(state, "SimDXCoilMultiMode: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of DX Coils=" + TrimSigDigits(NumDXCoils) + ", Coil name=" + CompName); + ShowFatalError( + state, + format("SimDXCoilMultiMode: Invalid CompIndex passed={}, Number of DX Coils={}, Coil name={}", DXCoilNum, NumDXCoils, CompName)); } if (CheckEquipName(DXCoilNum)) { if ((CompName != "") && (CompName != DXCoil(DXCoilNum).Name)) { - ShowFatalError(state, "SimDXCoilMultiMode: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + ", Coil name=" + CompName + - ", stored Coil Name for that index=" + DXCoil(DXCoilNum).Name); + ShowFatalError(state, + format("SimDXCoilMultiMode: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + DXCoilNum, + CompName, + DXCoil(DXCoilNum).Name)); } CheckEquipName(DXCoilNum) = false; } @@ -848,7 +856,7 @@ namespace DXCoils { using DataHeatBalance::Zone; using DataSizing::AutoSize; using EMSManager::ManageEMS; - using General::TrimSigDigits; + using GlobalNames::VerifyUniqueCoilName; using NodeInputManager::GetOnlySingleNode; using OutAirNodeManager::CheckOutAirNodeNumber; @@ -1057,7 +1065,7 @@ namespace DXCoils { DXCoil(DXCoilNum).RatedCOP(1) = Numbers(3); if (DXCoil(DXCoilNum).RatedCOP(1) <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(3) + " must be > 0.0, entered value=[" + TrimSigDigits(Numbers(3), 2) + "]."); + ShowContinueError(state, format("...{} must be > 0.0, entered value=[{:.2T}].", cNumericFields(3), Numbers(3))); ErrorsFound = true; } @@ -1223,8 +1231,8 @@ namespace DXCoils { if (MinCurveVal < 0.7) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(9) + "=\"" + Alphas(9) + "\" has out of range values."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + " is " + - TrimSigDigits(MinCurveVal, 3)); + ShowContinueError(state, + format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, 0.7, _); } @@ -1232,8 +1240,8 @@ namespace DXCoils { if (MaxCurveVal > 1.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(9) + " = " + Alphas(9) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + " is " + - TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError(state, + format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, _, 1.0); } @@ -1296,7 +1304,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondEffect(1) < 0.0 || DXCoil(DXCoilNum).EvapCondEffect(1) > 1.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(11) + " cannot be < 0.0 or > 1.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(11), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(11))); ErrorsFound = true; } @@ -1304,7 +1312,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondAirFlow(1) < 0.0 && DXCoil(DXCoilNum).EvapCondAirFlow(1) != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(12) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(12), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(12))); ErrorsFound = true; } @@ -1312,7 +1320,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondPumpElecNomPower(1) < 0.0 && DXCoil(DXCoilNum).EvapCondPumpElecNomPower(1) != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(13) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(13), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(13))); ErrorsFound = true; } @@ -1321,7 +1329,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(14) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(14), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(14))); ErrorsFound = true; } @@ -1366,7 +1374,7 @@ namespace DXCoils { if (Numbers(16) < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(16) + " must be >= 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(16), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(16))); ErrorsFound = true; } @@ -1378,7 +1386,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).BasinHeaterSetPointTemp < 2.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", freeze possible"); ShowContinueError(state, "..." + cNumericFields(17) + " is < 2 {C}. Freezing could occur."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(17), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(17))); } } @@ -1510,7 +1518,7 @@ namespace DXCoils { DXCoil(DXCoilNum).CrankcaseHeaterCapacity = Numbers(1); if (DXCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(1) + " must be >= 0.0, entered value=[" + TrimSigDigits(Numbers(1), 2) + "]."); + ShowContinueError(state, format("...{} must be >= 0.0, entered value=[{:.2T}].", cNumericFields(1), Numbers(1))); ErrorsFound = true; } @@ -1522,8 +1530,8 @@ namespace DXCoils { // Check if requested number of capacity stages exceeds limits if ((DXCoil(DXCoilNum).NumCapacityStages > MaxCapacityStages) || (DXCoil(DXCoilNum).NumCapacityStages < 1)) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "...illegal " + cNumericFields(3) + " = " + TrimSigDigits(DXCoil(DXCoilNum).NumCapacityStages)); - ShowContinueError(state, "...Valid range is 1 to " + TrimSigDigits(MaxCapacityStages)); + ShowContinueError(state, format("...illegal {} = {}", cNumericFields(3), DXCoil(DXCoilNum).NumCapacityStages)); + ShowContinueError(state, format("...Valid range is 1 to {}", MaxCapacityStages)); ErrorsFound = true; } @@ -1532,8 +1540,8 @@ namespace DXCoils { // Check if requested number of enhanced dehumidification modes exceeds limits if ((DXCoil(DXCoilNum).NumDehumidModes > MaxDehumidModes) || (DXCoil(DXCoilNum).NumDehumidModes < 0)) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "...illegal " + cNumericFields(4) + " = " + TrimSigDigits(DXCoil(DXCoilNum).NumDehumidModes)); - ShowContinueError(state, "...Valid range is 0 to " + TrimSigDigits(MaxDehumidModes)); + ShowContinueError(state, format("...illegal {} = {}", cNumericFields(4), DXCoil(DXCoilNum).NumDehumidModes)); + ShowContinueError(state, format("...Valid range is 0 to {}", MaxDehumidModes)); ErrorsFound = true; } @@ -1754,8 +1762,9 @@ namespace DXCoils { if (MinCurveVal < 0.7) { ShowWarningError(state, RoutineName + PerfObjectType + "=\"" + PerfObjectName + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields2(6) + " = " + Alphas2(6) + " has out of range value."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + - " is " + TrimSigDigits(MinCurveVal, 3)); + ShowContinueError( + state, + format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(PerfModeNum), ErrorsFound, 0.7, _); } @@ -1763,8 +1772,9 @@ namespace DXCoils { if (MaxCurveVal > 1.0) { ShowWarningError(state, RoutineName + PerfObjectType + "=\"" + PerfObjectName + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields2(6) + " = " + Alphas2(6) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + - " is " + TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError( + state, + format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(PerfModeNum), ErrorsFound, _, 1.0); } @@ -1819,7 +1829,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondEffect(PerfModeNum) < 0.0 || DXCoil(DXCoilNum).EvapCondEffect(PerfModeNum) > 1.0) { ShowSevereError(state, RoutineName + PerfObjectType + "=\"" + PerfObjectName + "\", invalid"); ShowContinueError(state, "..." + cNumericFields2(10) + " cannot be < 0.0 or > 1.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers2(10), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers2(10))); ErrorsFound = true; } @@ -1827,7 +1837,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondAirFlow(PerfModeNum) < 0.0 && DXCoil(DXCoilNum).EvapCondAirFlow(PerfModeNum) != AutoSize) { ShowSevereError(state, RoutineName + PerfObjectType + "=\"" + PerfObjectName + "\", invalid"); ShowContinueError(state, "..." + cNumericFields2(11) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers2(11), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers2(11))); ErrorsFound = true; } @@ -1836,7 +1846,7 @@ namespace DXCoils { DXCoil(DXCoilNum).EvapCondAirFlow(PerfModeNum) != AutoSize) { ShowSevereError(state, RoutineName + PerfObjectType + "=\"" + PerfObjectName + "\", invalid"); ShowContinueError(state, "..." + cNumericFields2(12) + " cannot be less than zero."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers2(12), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers2(12))); ErrorsFound = true; } @@ -1892,8 +1902,7 @@ namespace DXCoils { for (CapacityStageNum = (DXCoil(DXCoilNum).NumCapacityStages + 1); CapacityStageNum <= MaxCapacityStages; ++CapacityStageNum) { if ((AlphaIndex <= NumAlphas) && ((!Alphas(AlphaIndex).empty()) || (!Alphas(AlphaIndex + 1).empty()))) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\":"); - ShowContinueError(state, "...Capacity Stage " + TrimSigDigits(CapacityStageNum) + " not active. Therefore," + - cAlphaFields(AlphaIndex)); + ShowContinueError(state, format("...Capacity Stage {} not active. Therefore,{}", CapacityStageNum, cAlphaFields(AlphaIndex))); ShowContinueError(state, "... and " + cAlphaFields(AlphaIndex + 1) + " fields will be ignored."); } AlphaIndex += 2; @@ -1946,7 +1955,7 @@ namespace DXCoils { if (Numbers(6) < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(6) + " must be >= 0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(6), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(6))); ErrorsFound = true; } @@ -1958,7 +1967,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).BasinHeaterSetPointTemp < 2.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", freeze possible"); ShowContinueError(state, "..." + cNumericFields(7) + " is < 2 {C}. Freezing could occur."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(7), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(7))); } } @@ -2193,8 +2202,8 @@ namespace DXCoils { if (MinCurveVal < 0.7) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(9) + " = " + Alphas(9) + " has out of range value."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + " is " + - TrimSigDigits(MinCurveVal, 3)); + ShowContinueError(state, + format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, 0.7, _); } @@ -2202,8 +2211,8 @@ namespace DXCoils { if (MaxCurveVal > 1.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(9) + " = " + Alphas(9) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + " is " + - TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError(state, + format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, _, 1.0); } @@ -2290,7 +2299,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(8) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(8), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(8))); ErrorsFound = true; } @@ -2611,8 +2620,8 @@ namespace DXCoils { if (MinCurveVal < 0.7) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(9) + " = " + Alphas(9) + " has out of range value."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + " is " + - TrimSigDigits(MinCurveVal, 3)); + ShowContinueError(state, + format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, 0.7, _); } @@ -2620,8 +2629,8 @@ namespace DXCoils { if (MaxCurveVal > 1.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(9) + " = " + Alphas(9) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + " is " + - TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError(state, + format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, _, 1.0); } @@ -2737,7 +2746,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondEffect(1) < 0.0 || DXCoil(DXCoilNum).EvapCondEffect(1) > 1.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(11) + " cannot be < 0.0 or > 1.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(11), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(11))); ErrorsFound = true; } @@ -2745,7 +2754,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondAirFlow(1) < 0.0 && DXCoil(DXCoilNum).EvapCondAirFlow(1) != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(12) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(12), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(12))); ErrorsFound = true; } @@ -2753,7 +2762,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondPumpElecNomPower(1) < 0.0 && DXCoil(DXCoilNum).EvapCondPumpElecNomPower(1) != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(13) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(13), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(13))); ErrorsFound = true; } @@ -2761,7 +2770,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondEffect2 < 0.0 || DXCoil(DXCoilNum).EvapCondEffect2 > 1.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(14) + " cannot be cannot be < 0.0 or > 1.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(14), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(14))); ErrorsFound = true; } @@ -2769,7 +2778,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondAirFlow2 < 0.0 && DXCoil(DXCoilNum).EvapCondAirFlow2 != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(15) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(15), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(15))); ErrorsFound = true; } @@ -2777,7 +2786,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondPumpElecNomPower2 < 0.0 && DXCoil(DXCoilNum).EvapCondPumpElecNomPower2 != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(16) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(16), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(16))); ErrorsFound = true; } @@ -2817,7 +2826,7 @@ namespace DXCoils { if (Numbers(17) < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(17) + " must be >= 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(17), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(17))); ErrorsFound = true; } @@ -2829,7 +2838,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).BasinHeaterSetPointTemp < 2.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", freeze possible"); ShowContinueError(state, "..." + cNumericFields(18) + " is < 2 {C}. Freezing could occur."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(18), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(18))); } } @@ -2971,21 +2980,21 @@ namespace DXCoils { DXCoil(DXCoilNum).RatedTotCap2 = Numbers(1); if (DXCoil(DXCoilNum).RatedTotCap2 <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(1) + " must be > 0.0, entered value=[" + TrimSigDigits(Numbers(1), 2) + "]."); + ShowContinueError(state, format("...{} must be > 0.0, entered value=[{:.2T}].", cNumericFields(1), Numbers(1))); ErrorsFound = true; } DXCoil(DXCoilNum).RatedCOP(1) = Numbers(2); if (DXCoil(DXCoilNum).RatedCOP(1) <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(2) + " must be > 0.0, entered value=[" + TrimSigDigits(Numbers(2), 2) + "]."); + ShowContinueError(state, format("...{} must be > 0.0, entered value=[{:.2T}].", cNumericFields(2), Numbers(2))); ErrorsFound = true; } DXCoil(DXCoilNum).RatedSHR(1) = Numbers(3); if (DXCoil(DXCoilNum).RatedSHR(1) <= 0.0 || DXCoil(DXCoilNum).RatedSHR(1) > 1.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(3) + " must be > 0 and <= 1. entered value=[" + TrimSigDigits(Numbers(3), 3) + "]."); + ShowContinueError(state, format("...{} must be > 0 and <= 1. entered value=[{:.3T}].", cNumericFields(3), Numbers(3))); ErrorsFound = true; } @@ -2993,21 +3002,21 @@ namespace DXCoils { DXCoil(DXCoilNum).RatedInletDBTemp = Numbers(4); if (DXCoil(DXCoilNum).RatedInletDBTemp <= 5.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(4) + " must be > 5 {C}. entered value=[" + TrimSigDigits(Numbers(4), 1) + "]."); + ShowContinueError(state, format("...{} must be > 5 {{C}}. entered value=[{:.1T}].", cNumericFields(4), Numbers(4))); ErrorsFound = true; } DXCoil(DXCoilNum).RatedInletWBTemp = Numbers(5); if (DXCoil(DXCoilNum).RatedInletWBTemp <= 5.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(5) + " must be > 5 {C}. entered value=[" + TrimSigDigits(Numbers(5), 1) + "]."); + ShowContinueError(state, format("...{} must be > 5 {{C}}. entered value=[{:.1T}].", cNumericFields(5), Numbers(5))); ErrorsFound = true; } DXCoil(DXCoilNum).RatedInletWaterTemp = Numbers(6); if (DXCoil(DXCoilNum).RatedInletWaterTemp <= 25.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(6) + " must be > 25 {C}. entered value=[" + TrimSigDigits(Numbers(6), 1) + "]."); + ShowContinueError(state, format("...{} must be > 25 {{C}}. entered value=[{:.1T}].", cNumericFields(6), Numbers(6))); ErrorsFound = true; } @@ -3015,7 +3024,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) != DataGlobalConstants::AutoCalculate()) { if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(7) + " must be > 0.0. entered value=[" + TrimSigDigits(Numbers(7), 3) + "]."); + ShowContinueError(state, format("...{} must be > 0.0. entered value=[{:.3T}].", cNumericFields(7), Numbers(7))); ErrorsFound = true; } } @@ -3025,7 +3034,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).RatedHPWHCondWaterFlow != DataGlobalConstants::AutoCalculate()) { if (DXCoil(DXCoilNum).RatedHPWHCondWaterFlow <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(8) + " must be > 0.0 entered value=[" + TrimSigDigits(Numbers(8), 3) + "]."); + ShowContinueError(state, format("...{} must be > 0.0 entered value=[{:.3T}].", cNumericFields(8), Numbers(8))); ErrorsFound = true; } // check the range of flow rate to be >= 1 gpm/ton and <= 5 gpm/ton @@ -3035,8 +3044,9 @@ namespace DXCoils { ShowContinueError(state, "..." + cNumericFields(8) + " per watt of " + cNumericFields(1) + " is outside the recommended range of >= 1.79405E-8 m3/s/W (0.083 gpm/MBH) and <= 8.97024E-8 m3/s/W (0.417 gpm/MBH)."); - ShowContinueError(state, "...Entered Flow rate per watt = [" + - TrimSigDigits((DXCoil(DXCoilNum).RatedHPWHCondWaterFlow / DXCoil(DXCoilNum).RatedTotCap2), 10) + "]."); + ShowContinueError(state, + format("...Entered Flow rate per watt = [{:.10T}].", + (DXCoil(DXCoilNum).RatedHPWHCondWaterFlow / DXCoil(DXCoilNum).RatedTotCap2))); } } @@ -3073,14 +3083,14 @@ namespace DXCoils { DXCoil(DXCoilNum).HPWHCondPumpElecNomPower = Numbers(9); if (DXCoil(DXCoilNum).HPWHCondPumpElecNomPower < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(9) + " must be >= 0.0 entered value=[" + TrimSigDigits(Numbers(9), 3) + "]."); + ShowContinueError(state, format("...{} must be >= 0.0 entered value=[{:.3T}].", cNumericFields(9), Numbers(9))); ErrorsFound = true; } DXCoil(DXCoilNum).HPWHCondPumpFracToWater = Numbers(10); if (DXCoil(DXCoilNum).HPWHCondPumpFracToWater <= 0.0 || DXCoil(DXCoilNum).HPWHCondPumpFracToWater > 1.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(10) + " must be >= 0 and <= 1. entered value=[" + TrimSigDigits(Numbers(10), 3) + "]."); + ShowContinueError(state, format("...{} must be >= 0 and <= 1. entered value=[{:.3T}].", cNumericFields(10), Numbers(10))); ErrorsFound = true; } @@ -3108,14 +3118,14 @@ namespace DXCoils { DXCoil(DXCoilNum).CrankcaseHeaterCapacity = Numbers(11); if (DXCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(11) + " must be >= 0.0 entered value=[" + TrimSigDigits(Numbers(11), 1) + "]."); + ShowContinueError(state, format("...{} must be >= 0.0 entered value=[{:.1T}].", cNumericFields(11), Numbers(11))); ErrorsFound = true; } DXCoil(DXCoilNum).MaxOATCrankcaseHeater = Numbers(12); if (DXCoil(DXCoilNum).MaxOATCrankcaseHeater < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(12) + " must be >= 0 {C}. entered value=[" + TrimSigDigits(Numbers(12), 1) + "]."); + ShowContinueError(state, format("...{} must be >= 0 {{C}}. entered value=[{:.1T}].", cNumericFields(12), Numbers(12))); ErrorsFound = true; } @@ -3351,8 +3361,8 @@ namespace DXCoils { if (MinCurveVal < 0.7) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(16) + " = " + Alphas(16) + " has out of range value."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + " is " + - TrimSigDigits(MinCurveVal, 3)); + ShowContinueError( + state, format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, 0.7, _); } @@ -3360,8 +3370,8 @@ namespace DXCoils { if (MaxCurveVal > 1.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(16) + " = " + Alphas(16) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + " is " + - TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError( + state, format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, _, 1.0); } @@ -3417,21 +3427,21 @@ namespace DXCoils { DXCoil(DXCoilNum).RatedTotCap2 = Numbers(1); if (DXCoil(DXCoilNum).RatedTotCap2 <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(1) + " must be > 0.0, entered value=[" + TrimSigDigits(Numbers(1), 2) + "]."); + ShowContinueError(state, format("...{} must be > 0.0, entered value=[{:.2T}].", cNumericFields(1), Numbers(1))); ErrorsFound = true; } DXCoil(DXCoilNum).RatedCOP(1) = Numbers(2); if (DXCoil(DXCoilNum).RatedCOP(1) <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(2) + " must be > 0.0, entered value=[" + TrimSigDigits(Numbers(2), 2) + "]."); + ShowContinueError(state, format("...{} must be > 0.0, entered value=[{:.2T}].", cNumericFields(2), Numbers(2))); ErrorsFound = true; } DXCoil(DXCoilNum).RatedSHR(1) = Numbers(3); if (DXCoil(DXCoilNum).RatedSHR(1) <= 0.0 || DXCoil(DXCoilNum).RatedSHR(1) > 1.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(3) + " must be > 0 and <= 1. entered value=[" + TrimSigDigits(Numbers(3), 3) + "]."); + ShowContinueError(state, format("...{} must be > 0 and <= 1. entered value=[{:.3T}].", cNumericFields(3), Numbers(3))); ErrorsFound = true; } @@ -3439,21 +3449,21 @@ namespace DXCoils { DXCoil(DXCoilNum).RatedInletDBTemp = Numbers(4); if (DXCoil(DXCoilNum).RatedInletDBTemp <= 5.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(4) + " must be > 5 {C}. entered value=[" + TrimSigDigits(Numbers(4), 1) + "]."); + ShowContinueError(state, format("...{} must be > 5 {{C}}. entered value=[{:.1T}].", cNumericFields(4), Numbers(4))); ErrorsFound = true; } DXCoil(DXCoilNum).RatedInletWBTemp = Numbers(5); if (DXCoil(DXCoilNum).RatedInletWBTemp <= 5.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(5) + " must be > 5 {C}. entered value=[" + TrimSigDigits(Numbers(5), 1) + "]."); + ShowContinueError(state, format("...{} must be > 5 {{C}}. entered value=[{:.1T}].", cNumericFields(5), Numbers(5))); ErrorsFound = true; } DXCoil(DXCoilNum).RatedInletWaterTemp = Numbers(6); if (DXCoil(DXCoilNum).RatedInletWaterTemp <= 25.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(6) + " must be > 25 {C}. entered value=[" + TrimSigDigits(Numbers(6), 1) + "]."); + ShowContinueError(state, format("...{} must be > 25 {{C}}. entered value=[{:.1T}].", cNumericFields(6), Numbers(6))); ErrorsFound = true; } @@ -3461,7 +3471,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) != DataGlobalConstants::AutoCalculate()) { if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(7) + " must be > 0.0. entered value=[" + TrimSigDigits(Numbers(7), 3) + "]."); + ShowContinueError(state, format("...{} must be > 0.0. entered value=[{:.3T}].", cNumericFields(7), Numbers(7))); ErrorsFound = true; } } @@ -3507,14 +3517,14 @@ namespace DXCoils { DXCoil(DXCoilNum).CrankcaseHeaterCapacity = Numbers(8); if (DXCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(8) + " must be >= 0.0 entered value=[" + TrimSigDigits(Numbers(8), 1) + "]."); + ShowContinueError(state, format("...{} must be >= 0.0 entered value=[{:.1T}].", cNumericFields(8), Numbers(8))); ErrorsFound = true; } DXCoil(DXCoilNum).MaxOATCrankcaseHeater = Numbers(9); if (DXCoil(DXCoilNum).MaxOATCrankcaseHeater < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(9) + " must be >= 0 {C}. entered value=[" + TrimSigDigits(Numbers(9), 1) + "]."); + ShowContinueError(state, format("...{} must be >= 0 {{C}}. entered value=[{:.1T}].", cNumericFields(9), Numbers(9))); ErrorsFound = true; } @@ -3698,8 +3708,8 @@ namespace DXCoils { if (MinCurveVal < 0.7) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(10) + " = " + Alphas(10) + " has out of range value."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + " is " + - TrimSigDigits(MinCurveVal, 3)); + ShowContinueError( + state, format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, 0.7, _); } @@ -3707,8 +3717,8 @@ namespace DXCoils { if (MaxCurveVal > 1.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(10) + " = " + Alphas(10) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + " is " + - TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError( + state, format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, _, 1.0); } @@ -3850,7 +3860,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(2) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(2), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(2))); ErrorsFound = true; } @@ -3883,7 +3893,7 @@ namespace DXCoils { DXCoil(DXCoilNum).BasinHeaterPowerFTempDiff = Numbers(4); if (Numbers(4) < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(4) + " must be >= 0.0, entered value=[" + TrimSigDigits(Numbers(4), 3) + "]."); + ShowContinueError(state, format("...{} must be >= 0.0, entered value=[{:.3T}].", cNumericFields(4), Numbers(4))); ErrorsFound = true; } @@ -3895,7 +3905,7 @@ namespace DXCoils { if (DXCoil(DXCoilNum).BasinHeaterSetPointTemp < 2.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", freeze possible"); ShowContinueError(state, "..." + cNumericFields(5) + " is less than 2 {C}. Freezing could occur."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(Numbers(5), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", Numbers(5))); } } @@ -3923,7 +3933,7 @@ namespace DXCoils { DXCoil(DXCoilNum).NumOfSpeeds = Numbers(6); // Number of speeds if (DXCoil(DXCoilNum).NumOfSpeeds < 2) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(6) + " must be >= 2. entered number is " + TrimSigDigits(Numbers(6), 0)); + ShowContinueError(state, format("...{} must be >= 2. entered number is {:.0T}", cNumericFields(6), Numbers(6))); ErrorsFound = true; } @@ -4118,8 +4128,8 @@ namespace DXCoils { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields2(17 + (I - 1) * 6) + " = " + Alphas2(17 + (I - 1) * 6) + " has out of range value."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + " is " + - TrimSigDigits(MinCurveVal, 3)); + ShowContinueError( + state, format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(PerfModeNum), ErrorsFound, 0.7, _); } @@ -4128,8 +4138,8 @@ namespace DXCoils { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields2(17 + (I - 1) * 6) + " = " + Alphas2(17 + (I - 1) * 6) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + " is " + - TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError( + state, format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).MSPLFFPLR(I), ErrorsFound, _, 1.0); } @@ -4140,29 +4150,37 @@ namespace DXCoils { DXCoil(DXCoilNum).MSTwet_Rated(I) = Numbers(12 + (I - 1) * 13); if (DXCoil(DXCoilNum).MSTwet_Rated(I) < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(12 + (I - 1) * 13) + " cannot be < 0.0, entered value=[" + - TrimSigDigits(DXCoil(DXCoilNum).MSTwet_Rated(I), 4) + "]."); + ShowContinueError(state, + format("...{} cannot be < 0.0, entered value=[{:.4T}].", + cNumericFields(12 + (I - 1) * 13), + DXCoil(DXCoilNum).MSTwet_Rated(I))); ErrorsFound = true; } DXCoil(DXCoilNum).MSGamma_Rated(I) = Numbers(13 + (I - 1) * 13); if (DXCoil(DXCoilNum).MSGamma_Rated(I) < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(13 + (I - 1) * 13) + " cannot be < 0.0, entered value=[" + - TrimSigDigits(DXCoil(DXCoilNum).MSGamma_Rated(I), 4) + "]."); + ShowContinueError(state, + format("...{} cannot be < 0.0, entered value=[{:.4T}].", + cNumericFields(13 + (I - 1) * 13), + DXCoil(DXCoilNum).MSGamma_Rated(I))); ErrorsFound = true; } DXCoil(DXCoilNum).MSMaxONOFFCyclesperHour(I) = Numbers(14 + (I - 1) * 13); if (DXCoil(DXCoilNum).Gamma_Rated(I) < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(14 + (I - 1) * 13) + " cannot be < 0.0, entered value=[" + - TrimSigDigits(DXCoil(DXCoilNum).MSMaxONOFFCyclesperHour(I), 2) + "]."); + ShowContinueError(state, + format("...{} cannot be < 0.0, entered value=[{:.2T}].", + cNumericFields(14 + (I - 1) * 13), + DXCoil(DXCoilNum).MSMaxONOFFCyclesperHour(I))); ErrorsFound = true; } DXCoil(DXCoilNum).MSLatentCapacityTimeConstant(I) = Numbers(15 + (I - 1) * 13); if (DXCoil(DXCoilNum).Gamma_Rated(I) < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(15 + (I - 1) * 13) + " cannot be < 0.0, entered value=[" + - TrimSigDigits(DXCoil(DXCoilNum).MSLatentCapacityTimeConstant(I), 2) + "]."); + ShowContinueError(state, + format("...{} cannot be < 0.0, entered value=[{:.2T}].", + cNumericFields(15 + (I - 1) * 13), + DXCoil(DXCoilNum).MSLatentCapacityTimeConstant(I))); ErrorsFound = true; } @@ -4187,7 +4205,7 @@ namespace DXCoils { ShowContinueError(state, cAlphaFields(18 + (I - 1) * 6) + " = " + Alphas(18 + (I - 1) * 6)); ShowContinueError(state, "..." + cAlphaFields(18 + (I - 1) * 6) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -4196,24 +4214,28 @@ namespace DXCoils { DXCoil(DXCoilNum).MSEvapCondEffect(I) = Numbers(17 + (I - 1) * 13); if (DXCoil(DXCoilNum).MSEvapCondEffect(I) < 0.0 || DXCoil(DXCoilNum).MSEvapCondEffect(I) > 1.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(17 + (I - 1) * 13) + " cannot be < 0.0 or > 1.0, entered value=[" + - TrimSigDigits(Numbers(17 + (I - 1) * 13), 3) + "]."); + ShowContinueError(state, + format("...{} cannot be < 0.0 or > 1.0, entered value=[{:.3T}].", + cNumericFields(17 + (I - 1) * 13), + Numbers(17 + (I - 1) * 13))); ErrorsFound = true; } DXCoil(DXCoilNum).MSEvapCondAirFlow(I) = Numbers(18 + (I - 1) * 13); if (DXCoil(DXCoilNum).MSEvapCondAirFlow(I) < 0.0 && DXCoil(DXCoilNum).MSEvapCondAirFlow(I) != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(18 + (I - 1) * 13) + " cannot be < 0.0, entered value=[" + - TrimSigDigits(Numbers(18 + (I - 1) * 13), 3) + "]."); + ShowContinueError( + state, + format("...{} cannot be < 0.0, entered value=[{:.3T}].", cNumericFields(18 + (I - 1) * 13), Numbers(18 + (I - 1) * 13))); ErrorsFound = true; } DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(I) = Numbers(19 + (I - 1) * 13); if (DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(I) < 0.0 && DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(I) != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(19 + (I - 1) * 13) + " cannot be < 0.0, entered value=[" + - TrimSigDigits(Numbers(19 + (I - 1) * 13), 3) + "]."); + ShowContinueError( + state, + format("...{} cannot be < 0.0, entered value=[{:.3T}].", cNumericFields(19 + (I - 1) * 13), Numbers(19 + (I - 1) * 13))); ErrorsFound = true; } } @@ -4301,7 +4323,7 @@ namespace DXCoils { DXCoil(DXCoilNum).CrankcaseHeaterCapacity = Numbers(3); if (DXCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(3) + " cannot be < 0.0, entered value=[" + TrimSigDigits(Numbers(3), 2) + "]."); + ShowContinueError(state, format("...{} cannot be < 0.0, entered value=[{:.2T}].", cNumericFields(3), Numbers(3))); ErrorsFound = true; } @@ -4403,7 +4425,7 @@ namespace DXCoils { DXCoil(DXCoilNum).NumOfSpeeds = Numbers(9); // Number of speeds if (DXCoil(DXCoilNum).NumOfSpeeds < 2) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(9) + " must be >= 2. entered number is " + TrimSigDigits(Numbers(9), 0)); + ShowContinueError(state, format("...{} must be >= 2. entered number is {:.0T}", cNumericFields(9), Numbers(9))); ErrorsFound = true; } @@ -4609,8 +4631,8 @@ namespace DXCoils { if (MinCurveVal < 0.7) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(14 + (I - 1) * 6) + " = " + Alphas(14 + (I - 1) * 6) + " has out of range value."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + " is " + - TrimSigDigits(MinCurveVal, 3)); + ShowContinueError( + state, format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).PLFFPLR(1), ErrorsFound, 0.7, _); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).MSPLFFPLR(I), ErrorsFound, 0.7, _); @@ -4619,8 +4641,8 @@ namespace DXCoils { if (MaxCurveVal > 1.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFields(14 + (I - 1) * 6) + " = " + Alphas(14 + (I - 1) * 6) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + " is " + - TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError( + state, format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, DXCoil(DXCoilNum).MSPLFFPLR(I), ErrorsFound, _, 1.0); } @@ -6022,7 +6044,6 @@ namespace DXCoils { // Using/Aliasing using DataHeatBalFanSys::ZoneAirHumRat; using DataHeatBalFanSys::ZT; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static Real64 SmallDifferenceTest(0.00000001); @@ -6069,9 +6090,12 @@ namespace DXCoils { ((RatedVolFlowPerRatedTotCap - MaxHeatVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { ShowWarningError(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + "\": Rated air volume flow rate per watt of rated total water heating capacity is out of range"); - ShowContinueError(state, "Min Rated Vol Flow Per Watt=[" + TrimSigDigits(MinRatedVolFlowPerRatedTotCap(DXCT), 3) + - "], Rated Vol Flow Per Watt=[" + TrimSigDigits(RatedVolFlowPerRatedTotCap, 3) + "], Max Rated Vol Flow Per Watt=[" + - TrimSigDigits(MaxHeatVolFlowPerRatedTotCap(DXCT), 3) + "]. See Input-Output Reference Manual for valid range."); + ShowContinueError(state, + format("Min Rated Vol Flow Per Watt=[{:.3T}], Rated Vol Flow Per Watt=[{:.3T}], Max Rated Vol Flow Per " + "Watt=[{:.3T}]. See Input-Output Reference Manual for valid range.", + MinRatedVolFlowPerRatedTotCap(DXCT), + RatedVolFlowPerRatedTotCap, + MaxHeatVolFlowPerRatedTotCap(DXCT))); } HPInletAirHumRat = PsyWFnTdbTwbPb(state, DXCoil(DXCoilNum).RatedInletDBTemp, DXCoil(DXCoilNum).RatedInletWBTemp, StdPressureSeaLevel, RoutineName); @@ -6198,10 +6222,12 @@ namespace DXCoils { ((RatedVolFlowPerRatedTotCap - MaxRatedVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { ShowWarningError(state, "Sizing: " + DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + "\": Rated air volume flow rate per watt of rated total cooling capacity is out of range."); - ShowContinueError(state, "Min Rated Vol Flow Per Watt=[" + TrimSigDigits(MinRatedVolFlowPerRatedTotCap(DXCT), 3) + - "], Rated Vol Flow Per Watt=[" + TrimSigDigits(RatedVolFlowPerRatedTotCap, 3) + - "], Max Rated Vol Flow Per Watt=[" + TrimSigDigits(MaxRatedVolFlowPerRatedTotCap(DXCT), 3) + - "]. See Input Output Reference Manual for valid range."); + ShowContinueError(state, + format("Min Rated Vol Flow Per Watt=[{:.3T}], Rated Vol Flow Per Watt=[{:.3T}], Max Rated Vol Flow Per " + "Watt=[{:.3T}]. See Input Output Reference Manual for valid range.", + MinRatedVolFlowPerRatedTotCap(DXCT), + RatedVolFlowPerRatedTotCap, + MaxRatedVolFlowPerRatedTotCap(DXCT))); } } @@ -6312,10 +6338,12 @@ namespace DXCoils { ((RatedVolFlowPerRatedTotCap - MaxRatedVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { ShowWarningError(state, "Sizing: " + DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + "\": Rated air volume flow rate per watt of rated total cooling capacity is out of range."); - ShowContinueError(state, "Min Rated Vol Flow Per Watt=[" + TrimSigDigits(MinRatedVolFlowPerRatedTotCap(DXCT), 3) + - "], Rated Vol Flow Per Watt=[" + TrimSigDigits(RatedVolFlowPerRatedTotCap, 3) + - "], Max Rated Vol Flow Per Watt=[" + TrimSigDigits(MaxRatedVolFlowPerRatedTotCap(DXCT), 3) + - "]. See Input Output Reference Manual for valid range."); + ShowContinueError(state, + format("Min Rated Vol Flow Per Watt=[{:.3T}], Rated Vol Flow Per Watt=[{:.3T}], Max Rated Vol Flow Per " + "Watt=[{:.3T}]. See Input Output Reference Manual for valid range.", + MinRatedVolFlowPerRatedTotCap(DXCT), + RatedVolFlowPerRatedTotCap, + MaxRatedVolFlowPerRatedTotCap(DXCT))); ShowContinueError(state, "for CoilPerformance:DX:Cooling mode: " + DXCoil(DXCoilNum).CoilPerformanceName(Mode)); } DXCoil(DXCoilNum).RatedAirMassFlowRate(Mode) = @@ -6363,10 +6391,12 @@ namespace DXCoils { ((RatedVolFlowPerRatedTotCap - MaxRatedVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { ShowWarningError(state, "Sizing: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ": Rated air volume flow rate per watt of rated total heating capacity is out of range."); - ShowContinueError(state, "Min Rated Vol Flow Per Watt=[" + TrimSigDigits(MinRatedVolFlowPerRatedTotCap(DXCT), 3) + - "], Rated Vol Flow Per Watt=[" + TrimSigDigits(RatedVolFlowPerRatedTotCap, 3) + - "], Max Rated Vol Flow Per Watt=[" + TrimSigDigits(MaxRatedVolFlowPerRatedTotCap(DXCT), 3) + - "]. See Input-Output Reference Manual for valid range."); + ShowContinueError(state, + format("Min Rated Vol Flow Per Watt=[{:.3T}], Rated Vol Flow Per Watt=[{:.3T}], Max Rated Vol Flow Per " + "Watt=[{:.3T}]. See Input-Output Reference Manual for valid range.", + MinRatedVolFlowPerRatedTotCap(DXCT), + RatedVolFlowPerRatedTotCap, + MaxRatedVolFlowPerRatedTotCap(DXCT))); } } @@ -6444,10 +6474,12 @@ namespace DXCoils { ((RatedVolFlowPerRatedTotCap - MaxRatedVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { ShowWarningError(state, "Coil:Cooling:DX:TwoSpeed \"" + DXCoil(DXCoilNum).Name + "\": At low speed rated air volume flow rate per watt of rated total cooling capacity is out of range."); - ShowContinueError(state, "Min Rated Vol Flow Per Watt=[" + TrimSigDigits(MinRatedVolFlowPerRatedTotCap(DXCT), 3) + - "], Rated Vol Flow Per Watt=[" + TrimSigDigits(RatedVolFlowPerRatedTotCap, 3) + - "], Max Rated Vol Flow Per Watt=[" + TrimSigDigits(MaxRatedVolFlowPerRatedTotCap(DXCT), 3) + - "]. See Input-Output Reference Manual for valid range."); + ShowContinueError(state, + format("Min Rated Vol Flow Per Watt=[{:.3T}], Rated Vol Flow Per Watt=[{:.3T}], Max Rated Vol Flow Per " + "Watt=[{:.3T}]. See Input-Output Reference Manual for valid range.", + MinRatedVolFlowPerRatedTotCap(DXCT), + RatedVolFlowPerRatedTotCap, + MaxRatedVolFlowPerRatedTotCap(DXCT))); } DXCoil(DXCoilNum).RatedAirMassFlowRate2 = @@ -6473,13 +6505,19 @@ namespace DXCoils { for (Mode = 1; Mode <= DXCoil(DXCoilNum).NumOfSpeeds; ++Mode) { // Check for zero capacity or zero max flow rate if (DXCoil(DXCoilNum).MSRatedTotCap(Mode) <= 0.0) { - ShowSevereError(state, "Sizing: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + - " has zero rated total capacity at speed " + TrimSigDigits(Mode)); + ShowSevereError(state, + format("Sizing: {} {} has zero rated total capacity at speed {}", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + Mode)); ErrorsFound = true; } if (DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) <= 0.0) { - ShowSevereError(state, "Sizing: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + - " has zero rated air flow rate at speed " + TrimSigDigits(Mode)); + ShowSevereError(state, + format("Sizing: {} {} has zero rated air flow rate at speed {}", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + Mode)); ErrorsFound = true; } if (ErrorsFound) { @@ -6489,13 +6527,19 @@ namespace DXCoils { RatedVolFlowPerRatedTotCap = DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / DXCoil(DXCoilNum).MSRatedTotCap(Mode); if (((MinRatedVolFlowPerRatedTotCap(DXCT) - RatedVolFlowPerRatedTotCap) > SmallDifferenceTest) || ((RatedVolFlowPerRatedTotCap - MaxRatedVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { - ShowWarningError(state, "Sizing: " + DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\": Rated air volume flow rate per watt of rated total cooling capacity is out of range at speed " + - TrimSigDigits(Mode)); - ShowContinueError(state, "Min Rated Vol Flow Per Watt=[" + TrimSigDigits(MinRatedVolFlowPerRatedTotCap(DXCT), 3) + - "], Rated Vol Flow Per Watt=[" + TrimSigDigits(RatedVolFlowPerRatedTotCap, 3) + - "], Max Rated Vol Flow Per Watt=[" + TrimSigDigits(MaxRatedVolFlowPerRatedTotCap(DXCT), 3) + - "]. See Input Output Reference Manual for valid range."); + ShowWarningError( + state, + format( + "Sizing: {} \"{}\": Rated air volume flow rate per watt of rated total cooling capacity is out of range at speed {}", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + Mode)); + ShowContinueError(state, + format("Min Rated Vol Flow Per Watt=[{:.3T}], Rated Vol Flow Per Watt=[{:.3T}], Max Rated Vol Flow Per " + "Watt=[{:.3T}]. See Input Output Reference Manual for valid range.", + MinRatedVolFlowPerRatedTotCap(DXCT), + RatedVolFlowPerRatedTotCap, + MaxRatedVolFlowPerRatedTotCap(DXCT))); } DXCoil(DXCoilNum).MSRatedAirMassFlowRate(Mode) = DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * @@ -6525,13 +6569,17 @@ namespace DXCoils { RatedVolFlowPerRatedTotCap = DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) / DXCoil(DXCoilNum).MSRatedTotCap(Mode); if (((MinRatedVolFlowPerRatedTotCap(DXCT) - RatedVolFlowPerRatedTotCap) > SmallDifferenceTest) || ((RatedVolFlowPerRatedTotCap - MaxRatedVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { - ShowWarningError(state, "Coil:Heating:DX:MultiSpeed " + DXCoil(DXCoilNum).Name + - ": Rated air volume flow rate per watt of rated total heating capacity is out of range at speed " + - TrimSigDigits(Mode)); - ShowContinueError(state, "Min Rated Vol Flow Per Watt=[" + TrimSigDigits(MinRatedVolFlowPerRatedTotCap(DXCT), 3) + - "], Rated Vol Flow Per Watt=[" + TrimSigDigits(RatedVolFlowPerRatedTotCap, 3) + - "], Max Rated Vol Flow Per Watt=[" + TrimSigDigits(MaxRatedVolFlowPerRatedTotCap(DXCT), 3) + - "]. See Input Output Reference Manual for valid range."); + ShowWarningError(state, + format("Coil:Heating:DX:MultiSpeed {}: Rated air volume flow rate per watt of rated total heating capacity " + "is out of range at speed {}", + DXCoil(DXCoilNum).Name, + Mode)); + ShowContinueError(state, + format("Min Rated Vol Flow Per Watt=[{:.3T}], Rated Vol Flow Per Watt=[{:.3T}], Max Rated Vol Flow Per " + "Watt=[{:.3T}]. See Input Output Reference Manual for valid range.", + MinRatedVolFlowPerRatedTotCap(DXCT), + RatedVolFlowPerRatedTotCap, + MaxRatedVolFlowPerRatedTotCap(DXCT))); } } } @@ -6629,8 +6677,7 @@ namespace DXCoils { // Using/Aliasing using namespace DataSizing; using CurveManager::CurveValue; - using General::RoundSigDigits; - using General::TrimSigDigits; + using namespace OutputReportPredefined; using StandardRatings::CalcDXCoilStandardRating; @@ -7099,10 +7146,10 @@ namespace DXCoils { if ((std::abs(SecCoilAirFlowDes - SecCoilAirFlowUser) / SecCoilAirFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeDxCoil: Potential issue with equipment sizing for " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Secondary Coil Air Flow Rate of " + RoundSigDigits(SecCoilAirFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Secondary Coil Air Flow Rate of " + - RoundSigDigits(SecCoilAirFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Secondary Coil Air Flow Rate of {:.5R} [m3/s]", SecCoilAirFlowUser)); + ShowContinueError( + state, format("differs from Design Size Secondary Coil Air Flow Rate of {:.5R} [m3/s]", SecCoilAirFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7216,16 +7263,18 @@ namespace DXCoils { if (DXCoil(DXCoilNum).EvapCondAirFlow2 > DXCoil(DXCoilNum).EvapCondAirFlow(Mode)) { ShowSevereError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Evaporative Condenser low speed air flow must be less than or equal to high speed air flow."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).EvapCondAirFlow2, 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).EvapCondAirFlow(Mode), 2)); + ShowContinueError( + state, format("Instead, {:.2R} > {:.2R}", DXCoil(DXCoilNum).EvapCondAirFlow2, DXCoil(DXCoilNum).EvapCondAirFlow(Mode))); ShowFatalError(state, "Preceding conditions cause termination."); } if (DXCoil(DXCoilNum).EvapCondPumpElecNomPower2 > DXCoil(DXCoilNum).EvapCondPumpElecNomPower(Mode)) { ShowSevereError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Evaporative Condenser low speed pump power must be less than or equal to high speed pump power."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).EvapCondPumpElecNomPower2, 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).EvapCondPumpElecNomPower(Mode), 2)); + ShowContinueError(state, + format("Instead, {:.2R} > {:.2R}", + DXCoil(DXCoilNum).EvapCondPumpElecNomPower2, + DXCoil(DXCoilNum).EvapCondPumpElecNomPower(Mode))); ShowFatalError(state, "Preceding conditions cause termination."); } @@ -7233,8 +7282,8 @@ namespace DXCoils { ShowSevereError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Rated Total Cooling Capacity, Low Speed must be less than or equal to Rated Total Cooling Capacity, High Speed."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).RatedTotCap2, 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).RatedTotCap(Mode), 2)); + ShowContinueError(state, + format("Instead, {:.2R} > {:.2R}", DXCoil(DXCoilNum).RatedTotCap2, DXCoil(DXCoilNum).RatedTotCap(Mode))); ShowFatalError(state, "Preceding conditions cause termination."); } @@ -7242,8 +7291,9 @@ namespace DXCoils { ShowFatalError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Rated Air Volume Flow Rate, low speed must be less than or equal to Rated Air Volume Flow Rate, high speed."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).RatedAirVolFlowRate2, 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).RatedAirVolFlowRate(Mode), 2)); + ShowContinueError( + state, + format("Instead, {:.2R} > {:.2R}", DXCoil(DXCoilNum).RatedAirVolFlowRate2, DXCoil(DXCoilNum).RatedAirVolFlowRate(Mode))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -7361,10 +7411,17 @@ namespace DXCoils { // Ensure flow rate at lower speed must be lower or equal to the flow rate at higher speed. Otherwise, a severe error is isssued. for (Mode = 1; Mode <= DXCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { if (DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) > DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1)) { - ShowWarningError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Speed " + TrimSigDigits(Mode) + - " Rated Air Flow Rate must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + " Rated Air Flow Rate."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1), 2)); + ShowWarningError( + state, + format("SizeDXCoil: {} {}, Speed {} Rated Air Flow Rate must be less than or equal to Speed {} Rated Air Flow Rate.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + Mode, + Mode + 1)); + ShowContinueError(state, + format("Instead, {:.2R} > {:.2R}", + DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), + DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -7450,11 +7507,15 @@ namespace DXCoils { // Ensure capacity at lower speed must be lower or equal to the capacity at higher speed. for (Mode = 1; Mode <= DXCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { if (DXCoil(DXCoilNum).MSRatedTotCap(Mode) > DXCoil(DXCoilNum).MSRatedTotCap(Mode + 1)) { - ShowWarningError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Speed " + TrimSigDigits(Mode) + - " Rated Total Cooling Capacity must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + - " Rated Total Cooling Capacity."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).MSRatedTotCap(Mode), 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).MSRatedTotCap(Mode + 1), 2)); + ShowWarningError(state, + format("SizeDXCoil: {} {}, Speed {} Rated Total Cooling Capacity must be less than or equal to Speed {} Rated " + "Total Cooling Capacity.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + Mode, + Mode + 1)); + ShowContinueError( + state, format("Instead, {:.2R} > {:.2R}", DXCoil(DXCoilNum).MSRatedTotCap(Mode), DXCoil(DXCoilNum).MSRatedTotCap(Mode + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -7516,27 +7577,30 @@ namespace DXCoils { } if (IsAutoSize) { DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode) = MSEvapCondAirFlowDes; - BaseSizer::reportSizerOutput(state, DXCoil(DXCoilNum).DXCoilType, + BaseSizer::reportSizerOutput(state, + DXCoil(DXCoilNum).DXCoilType, DXCoil(DXCoilNum).Name, - "Design Size Speed " + TrimSigDigits(Mode) + " Evaporative Condenser Air Flow Rate [m3/s]", + format("Design Size Speed {} Evaporative Condenser Air Flow Rate [m3/s]", Mode), MSEvapCondAirFlowDes); } else { if (DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode) > 0.0 && MSEvapCondAirFlowDes > 0.0 && !HardSizeNoDesRun) { MSEvapCondAirFlowUser = DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode); - BaseSizer::reportSizerOutput(state, DXCoil(DXCoilNum).DXCoilType, + BaseSizer::reportSizerOutput(state, + DXCoil(DXCoilNum).DXCoilType, DXCoil(DXCoilNum).Name, - "Design Size Speed " + TrimSigDigits(Mode) + " Evaporative Condenser Air Flow Rate [m3/s]", + format("Design Size Speed {} Evaporative Condenser Air Flow Rate [m3/s]", Mode), MSEvapCondAirFlowDes, - "User-Specified Speed " + TrimSigDigits(Mode) + " Evaporative Condenser Air Flow Rate [m3/s]", + format("User-Specified Speed {} Evaporative Condenser Air Flow Rate [m3/s]", Mode), MSEvapCondAirFlowUser); if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(MSEvapCondAirFlowDes - MSEvapCondAirFlowUser) / MSEvapCondAirFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeDxCoil: Potential issue with equipment sizing for " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Evaporative Condenser Air Flow Rate of " + - RoundSigDigits(MSEvapCondAirFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Evaporative Condenser Air Flow Rate of " + - RoundSigDigits(MSEvapCondAirFlowDes, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Evaporative Condenser Air Flow Rate of {:.5R} [m3/s]", MSEvapCondAirFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Evaporative Condenser Air Flow Rate of {:.5R} [m3/s]", MSEvapCondAirFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7548,11 +7612,16 @@ namespace DXCoils { // Ensure evaporative condenser airflow rate at lower speed must be lower or equal to one at higher speed. for (Mode = 1; Mode <= DXCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { if (DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode) > DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode + 1)) { - ShowWarningError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Speed " + TrimSigDigits(Mode) + - " Evaporative Condenser Air Flow Rate must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + - " Evaporative Condenser Air Flow Rate."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode), 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode + 1), 2)); + ShowWarningError(state, + format("SizeDXCoil: {} {}, Speed {} Evaporative Condenser Air Flow Rate must be less than or equal to Speed {} " + "Evaporative Condenser Air Flow Rate.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + Mode, + Mode + 1)); + ShowContinueError( + state, + format("Instead, {:.2R} > {:.2R}", DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode), DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -7574,30 +7643,32 @@ namespace DXCoils { // Design Size data is always available if (IsAutoSize) { DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode) = MSEvapCondPumpElecNomPowerDes; - BaseSizer::reportSizerOutput(state, DXCoil(DXCoilNum).DXCoilType, + BaseSizer::reportSizerOutput(state, + DXCoil(DXCoilNum).DXCoilType, DXCoil(DXCoilNum).Name, - "Design Size Speed " + TrimSigDigits(Mode) + - " Rated Evaporative Condenser Pump Power Consumption [W]", + format("Design Size Speed {} Rated Evaporative Condenser Pump Power Consumption [W]", Mode), MSEvapCondPumpElecNomPowerDes); } else { if (DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode) > 0.0 && MSEvapCondPumpElecNomPowerDes > 0.0 && !HardSizeNoDesRun) { MSEvapCondPumpElecNomPowerUser = DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode); BaseSizer::reportSizerOutput(state, - DXCoil(DXCoilNum).DXCoilType, - DXCoil(DXCoilNum).Name, - "Design Size Speed " + TrimSigDigits(Mode) + " Rated Evaporative Condenser Pump Power Consumption [W]", - MSEvapCondPumpElecNomPowerDes, - "User-Specified Speed " + TrimSigDigits(Mode) + " Rated Evaporative Condenser Pump Power Consumption [W]", - MSEvapCondPumpElecNomPowerUser); + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + format("Design Size Speed {} Rated Evaporative Condenser Pump Power Consumption [W]", Mode), + MSEvapCondPumpElecNomPowerDes, + format("User-Specified Speed {} Rated Evaporative Condenser Pump Power Consumption [W]", Mode), + MSEvapCondPumpElecNomPowerUser); if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(MSEvapCondPumpElecNomPowerDes - MSEvapCondPumpElecNomPowerUser) / MSEvapCondPumpElecNomPowerUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeDxCoil: Potential issue with equipment sizing for " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Evaporative Condenser Pump Rated Power Consumption of " + - RoundSigDigits(MSEvapCondPumpElecNomPowerUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Evaporative Condenser Pump Rated Power Consumption of " + - RoundSigDigits(MSEvapCondPumpElecNomPowerDes, 2) + " [W]"); + ShowContinueError(state, + format("User-Specified Evaporative Condenser Pump Rated Power Consumption of {:.2R} [W]", + MSEvapCondPumpElecNomPowerUser)); + ShowContinueError(state, + format("differs from Design Size Evaporative Condenser Pump Rated Power Consumption of {:.2R} [W]", + MSEvapCondPumpElecNomPowerDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7609,11 +7680,17 @@ namespace DXCoils { // Ensure evaporative condesner pump power at lower speed must be lower or equal to one at higher speed. for (Mode = 1; Mode <= DXCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { if (DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode) > DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode + 1)) { - ShowWarningError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Speed " + TrimSigDigits(Mode) + - " Rated Evaporative Condenser Pump Power Consumption must be less than or equal to Speed " + - TrimSigDigits(Mode + 1) + " Rated Evaporative Condenser Pump Power Consumption."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode), 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode + 1), 2)); + ShowWarningError(state, + format("SizeDXCoil: {} {}, Speed {} Rated Evaporative Condenser Pump Power Consumption must be less than or " + "equal to Speed {} Rated Evaporative Condenser Pump Power Consumption.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + Mode, + Mode + 1)); + ShowContinueError(state, + format("Instead, {:.2R} > {:.2R}", + DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode), + DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -7683,10 +7760,17 @@ namespace DXCoils { // Ensure flow rate at lower speed must be lower or equal to the flow rate at higher speed. Otherwise, a severe error is isssued. for (Mode = 1; Mode <= DXCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { if (DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) > DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1)) { - ShowWarningError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Speed " + TrimSigDigits(Mode) + - " Rated Air Flow Rate must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + " Rated Air Flow Rate."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1), 2)); + ShowWarningError( + state, + format("SizeDXCoil: {} {}, Speed {} Rated Air Flow Rate must be less than or equal to Speed {} Rated Air Flow Rate.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + Mode, + Mode + 1)); + ShowContinueError(state, + format("Instead, {:.2R} > {:.2R}", + DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), + DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -7701,27 +7785,29 @@ namespace DXCoils { SecCoilAirFlowDes = DXCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) * DXCoil(DXCoilNum).MSSecCoilAirFlowScalingFactor(Mode); if (IsAutoSize) { DXCoil(DXCoilNum).MSSecCoilAirFlow(Mode) = SecCoilAirFlowDes; - BaseSizer::reportSizerOutput(state, DXCoil(DXCoilNum).DXCoilType, + BaseSizer::reportSizerOutput(state, + DXCoil(DXCoilNum).DXCoilType, DXCoil(DXCoilNum).Name, - "Design Size Speed " + TrimSigDigits(Mode) + " Secondary Coil Air Flow Rate [m3/s]", + format("Design Size Speed {} Secondary Coil Air Flow Rate [m3/s]", Mode), SecCoilAirFlowDes); } else { if (DXCoil(DXCoilNum).MSSecCoilAirFlow(Mode) > 0.0 && SecCoilAirFlowDes > 0.0 && !HardSizeNoDesRun) { SecCoilAirFlowUser = DXCoil(DXCoilNum).MSSecCoilAirFlow(Mode); - BaseSizer::reportSizerOutput(state, DXCoil(DXCoilNum).DXCoilType, + BaseSizer::reportSizerOutput(state, + DXCoil(DXCoilNum).DXCoilType, DXCoil(DXCoilNum).Name, - "Design Size Speed " + TrimSigDigits(Mode) + " Secondary Coil Air Flow Rate [m3/s]", + format("Design Size Speed {} Secondary Coil Air Flow Rate [m3/s]", Mode), SecCoilAirFlowDes, - "User-Specified Speed " + TrimSigDigits(Mode) + " Secondary Coil Air Flow Rate [m3/s]", + format("User-Specified Speed {} Secondary Coil Air Flow Rate [m3/s]", Mode), SecCoilAirFlowUser); if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(SecCoilAirFlowDes - SecCoilAirFlowUser) / SecCoilAirFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeDxCoil: Potential issue with equipment sizing for " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Secondary Coil Air Flow Rate of " + RoundSigDigits(SecCoilAirFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Secondary Coil Air Flow Rate of " + - RoundSigDigits(SecCoilAirFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Secondary Coil Air Flow Rate of {:.5R} [m3/s]", SecCoilAirFlowUser)); + ShowContinueError( + state, format("differs from Design Size Secondary Coil Air Flow Rate of {:.5R} [m3/s]", SecCoilAirFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7817,11 +7903,15 @@ namespace DXCoils { // Ensure capacity at lower speed must be lower or equal to the capacity at higher speed. for (Mode = 1; Mode <= DXCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { if (DXCoil(DXCoilNum).MSRatedTotCap(Mode) > DXCoil(DXCoilNum).MSRatedTotCap(Mode + 1)) { - ShowWarningError(state, "SizeDXCoil: " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name + ", Speed " + TrimSigDigits(Mode) + - " Rated Total Heating Capacity must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + - " Rated Total Heating Capacity."); - ShowContinueError(state, "Instead, " + RoundSigDigits(DXCoil(DXCoilNum).MSRatedTotCap(Mode), 2) + " > " + - RoundSigDigits(DXCoil(DXCoilNum).MSRatedTotCap(Mode + 1), 2)); + ShowWarningError(state, + format("SizeDXCoil: {} {}, Speed {} Rated Total Heating Capacity must be less than or equal to Speed {} Rated " + "Total Heating Capacity.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + Mode, + Mode + 1)); + ShowContinueError( + state, format("Instead, {:.2R} > {:.2R}", DXCoil(DXCoilNum).MSRatedTotCap(Mode), DXCoil(DXCoilNum).MSRatedTotCap(Mode + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -7854,10 +7944,9 @@ namespace DXCoils { if ((std::abs(DefrostCapacityDes - DefrostCapacityUser) / DefrostCapacityUser) > AutoVsHardSizingThreshold) { ShowWarningMessage(state, "SizeDxCoil: Potential issue with equipment sizing for " + DXCoil(DXCoilNum).DXCoilType + ' ' + DXCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Resistive Defrost Heater Capacity of " + RoundSigDigits(DefrostCapacityUser, 2) + - "[W]"); - ShowContinueError(state, "differs from Design Size Resistive Defrost Heater Capacity of " + - RoundSigDigits(DefrostCapacityDes, 2) + "[W]"); + ShowContinueError(state, format("User-Specified Resistive Defrost Heater Capacity of {:.2R}[W]", DefrostCapacityUser)); + ShowContinueError(state, + format("differs from Design Size Resistive Defrost Heater Capacity of {:.2R}[W]", DefrostCapacityDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -8007,7 +8096,6 @@ namespace DXCoils { using DataHVACGlobals::DXCoilTotalCapacity; using DataHVACGlobals::HPWHInletDBTemp; using DataHVACGlobals::HPWHInletWBTemp; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcHPWHDXCoil"); @@ -8084,13 +8172,16 @@ namespace DXCoils { if (HeatCapFTemp < 0.0) { if (Coil.HCapFTempErrorIndex == 0) { ShowWarningMessage(state, Coil.DXCoilType + " \"" + Coil.Name + "\":"); - ShowContinueError(state, " HPWH Heating Capacity Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(HeatCapFTemp, 3) + ")."); + ShowContinueError( + state, format(" HPWH Heating Capacity Modifier curve (function of temperature) output is negative ({:.3T}).", HeatCapFTemp)); if (state.dataCurveManager->PerfCurve(Coil.HCapFTemp).NumDims == 2) { - ShowContinueError(state, " Negative value occurs using an inlet air temperature of " + TrimSigDigits(InletAirTemp, 1) + - " and an inlet water temperature of " + TrimSigDigits(InletWaterTemp, 1) + '.'); + ShowContinueError( + state, + format(" Negative value occurs using an inlet air temperature of {:.1T} and an inlet water temperature of {:.1T}.", + InletAirTemp, + InletWaterTemp)); } else { - ShowContinueError(state, " Negative value occurs using an inlet air temperature of " + TrimSigDigits(InletAirTemp, 1) + '.'); + ShowContinueError(state, format(" Negative value occurs using an inlet air temperature of {:.1T}.", InletAirTemp)); } ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } @@ -8119,13 +8210,16 @@ namespace DXCoils { if (HeatCOPFTemp < 0.0) { if (Coil.HCOPFTempErrorIndex == 0) { ShowWarningMessage(state, Coil.DXCoilType + " \"" + Coil.Name + "\":"); - ShowContinueError(state, " HPWH Heating COP Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(HeatCOPFTemp, 3) + ")."); + ShowContinueError( + state, format(" HPWH Heating COP Modifier curve (function of temperature) output is negative ({:.3T}).", HeatCOPFTemp)); if (state.dataCurveManager->PerfCurve(Coil.HCOPFTemp).NumDims == 2) { - ShowContinueError(state, " Negative value occurs using an inlet air temperature of " + TrimSigDigits(InletAirTemp, 1) + - " and an inlet water temperature of " + TrimSigDigits(InletWaterTemp, 1) + '.'); + ShowContinueError( + state, + format(" Negative value occurs using an inlet air temperature of {:.1T} and an inlet water temperature of {:.1T}.", + InletAirTemp, + InletWaterTemp)); } else { - ShowContinueError(state, " Negative value occurs using an inlet air temperature of " + TrimSigDigits(InletAirTemp, 1) + '.'); + ShowContinueError(state, format(" Negative value occurs using an inlet air temperature of {:.1T}.", InletAirTemp)); } ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } @@ -8151,9 +8245,10 @@ namespace DXCoils { if (HeatCapFAirFlow < 0.0) { if (Coil.HCapFAirFlowErrorIndex == 0) { ShowWarningMessage(state, Coil.DXCoilType + " \"" + Coil.Name + "\":"); - ShowContinueError(state, " HPWH Heating Capacity Modifier curve (function of air flow fraction) output is negative (" + - TrimSigDigits(HeatCapFAirFlow, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an air flow fraction of " + TrimSigDigits(AirFlowRateRatio, 3) + '.'); + ShowContinueError(state, + format(" HPWH Heating Capacity Modifier curve (function of air flow fraction) output is negative ({:.3T}).", + HeatCapFAirFlow)); + ShowContinueError(state, format(" Negative value occurs using an air flow fraction of {:.3T}.", AirFlowRateRatio)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -8175,9 +8270,10 @@ namespace DXCoils { if (HeatCOPFAirFlow < 0.0) { if (Coil.HCOPFAirFlowErrorIndex == 0) { ShowWarningMessage(state, Coil.DXCoilType + " \"" + Coil.Name + "\":"); - ShowContinueError(state, " HPWH Heating COP Modifier curve (function of air flow fraction) output is negative (" + - TrimSigDigits(HeatCOPFAirFlow, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an air flow fraction of " + TrimSigDigits(AirFlowRateRatio, 3) + '.'); + ShowContinueError( + state, + format(" HPWH Heating COP Modifier curve (function of air flow fraction) output is negative ({:.3T}).", HeatCOPFAirFlow)); + ShowContinueError(state, format(" Negative value occurs using an air flow fraction of {:.3T}.", AirFlowRateRatio)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -8199,9 +8295,10 @@ namespace DXCoils { if (HeatCapFWaterFlow < 0.0) { if (Coil.HCapFWaterFlowErrorIndex == 0) { ShowWarningMessage(state, Coil.DXCoilType + " \"" + Coil.Name + "\":"); - ShowContinueError(state, " HPWH Heating Capacity Modifier curve (function of water flow fraction) output is negative (" + - TrimSigDigits(HeatCapFWaterFlow, 3) + ")."); - ShowContinueError(state, " Negative value occurs using a water flow fraction of " + TrimSigDigits(WaterFlowRateRatio, 3) + '.'); + ShowContinueError(state, + format(" HPWH Heating Capacity Modifier curve (function of water flow fraction) output is negative ({:.3T}).", + HeatCapFWaterFlow)); + ShowContinueError(state, format(" Negative value occurs using a water flow fraction of {:.3T}.", WaterFlowRateRatio)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -8223,9 +8320,10 @@ namespace DXCoils { if (HeatCOPFWaterFlow < 0.0) { if (Coil.HCOPFWaterFlowErrorIndex == 0) { ShowWarningMessage(state, Coil.DXCoilType + " \"" + Coil.Name + "\":"); - ShowContinueError(state, " HPWH Heating COP Modifier curve (function of water flow fraction) output is negative (" + - TrimSigDigits(HeatCOPFWaterFlow, 3) + ")."); - ShowContinueError(state, " Negative value occurs using a water flow fraction of " + TrimSigDigits(WaterFlowRateRatio, 3) + '.'); + ShowContinueError( + state, + format(" HPWH Heating COP Modifier curve (function of water flow fraction) output is negative ({:.3T}).", HeatCOPFWaterFlow)); + ShowContinueError(state, format(" Negative value occurs using a water flow fraction of {:.3T}.", WaterFlowRateRatio)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -8396,8 +8494,6 @@ namespace DXCoils { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcDoe2DXCoil: "); @@ -8623,8 +8719,9 @@ namespace DXCoils { ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).LowOutTempBuffer1); ShowContinueError(state, DXCoil(DXCoilNum).LowOutTempBuffer2); ShowContinueError(state, "... Possible reasons for low outlet air dry-bulb temperatures are: This DX coil"); - ShowContinueError(state, " 1) may have a low inlet air dry-bulb temperature. Inlet air temperature = " + - TrimSigDigits(DXCoil(DXCoilNum).FullLoadInletAirTempLast, 3) + " C."); + ShowContinueError(state, + format(" 1) may have a low inlet air dry-bulb temperature. Inlet air temperature = {:.3T} C.", + DXCoil(DXCoilNum).FullLoadInletAirTempLast)); ShowContinueError(state, " 2) may have a low air flow rate per watt of cooling capacity. Check inputs."); ShowContinueError(state, " 3) is used as part of a HX assisted cooling coil which uses a high sensible effectiveness. Check inputs."); } @@ -8679,12 +8776,18 @@ namespace DXCoils { DXCoil(DXCoilNum).DXCoilType_Num != CoilDX_HeatPumpWaterHeaterWrapped && ((VolFlowperRatedTotCap < MinOperVolFlowPerRatedTotCap(DXCT)) || (VolFlowperRatedTotCap > MaxCoolVolFlowPerRatedTotCap(DXCT)))) { if (DXCoil(DXCoilNum).ErrIndex1 == 0) { - ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + "=\"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total cooling capacity is out of range at " + - RoundSigDigits(VolFlowperRatedTotCap, 3) + " m3/s/W."); + ShowWarningMessage( + state, + format("{}{}=\"{}\" - Air volume flow rate per watt of rated total cooling capacity is out of range at {:.3R} m3/s/W.", + RoutineName, + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + VolFlowperRatedTotCap)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Expected range for VolumeFlowPerRatedTotalCapacity=[" + RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + - "--" + RoundSigDigits(MaxCoolVolFlowPerRatedTotCap(DXCT), 3) + ']'); + ShowContinueError(state, + format("Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}]", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxCoolVolFlowPerRatedTotCap(DXCT))); ShowContinueError(state, "Possible causes include inconsistent air flow rates in system components,"); ShowContinueError(state, "or variable air volume [VAV] system using incorrect coil type."); } @@ -8699,12 +8802,18 @@ namespace DXCoils { ((VolFlowperRatedTotCap < MinOperVolFlowPerRatedTotCap(DXCT)) || (VolFlowperRatedTotCap > MaxHeatVolFlowPerRatedTotCap(DXCT)))) { if (DXCoil(DXCoilNum).ErrIndex1 == 0) { - ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + "=\"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total water heating capacity is out of range at " + - RoundSigDigits(VolFlowperRatedTotCap, 2) + " m3/s/W."); + ShowWarningMessage( + state, + format("{}{}=\"{}\" - Air volume flow rate per watt of rated total water heating capacity is out of range at {:.2R} m3/s/W.", + RoutineName, + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + VolFlowperRatedTotCap)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Expected range for VolumeFlowPerRatedTotalCapacity=[" + RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + - "--" + RoundSigDigits(MaxHeatVolFlowPerRatedTotCap(DXCT), 3) + ']'); + ShowContinueError(state, + format("Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}]", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxHeatVolFlowPerRatedTotCap(DXCT))); ShowContinueError(state, "Possible causes may be that the parent object is calling for an actual supply air flow rate that is much " "higher or lower than the DX coil rated supply air flow rate."); } @@ -8738,9 +8847,10 @@ namespace DXCoils { DXCoil(DXCoilNum).LowTempLast = OutdoorDryBulb; if (DXCoil(DXCoilNum).LowAmbErrIndex == 0) { DXCoil(DXCoilNum).LowAmbBuffer1 = - DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air-cooled condenser inlet dry-bulb temperature below 0 C. Outdoor dry-bulb temperature = " + - RoundSigDigits(OutdoorDryBulb, 2); + format("{} \"{}\" - Air-cooled condenser inlet dry-bulb temperature below 0 C. Outdoor dry-bulb temperature = {:.2R}", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + OutdoorDryBulb); DXCoil(DXCoilNum).LowAmbBuffer2 = " ... Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); } @@ -8751,9 +8861,10 @@ namespace DXCoils { DXCoil(DXCoilNum).LowTempLast = OutdoorWetBulb; if (DXCoil(DXCoilNum).LowAmbErrIndex == 0) { DXCoil(DXCoilNum).LowAmbBuffer1 = - DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Evap-cooled condenser inlet wet-bulb temperature below 10 C. Outdoor wet-bulb temperature = " + - RoundSigDigits(OutdoorWetBulb, 2); + format("{} \"{}\" - Evap-cooled condenser inlet wet-bulb temperature below 10 C. Outdoor wet-bulb temperature = {:.2R}", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + OutdoorWetBulb); DXCoil(DXCoilNum).LowAmbBuffer2 = " ... Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); } @@ -8781,18 +8892,21 @@ namespace DXCoils { if (TotCapTempModFac < 0.0) { if (DXCoil(DXCoilNum).CCapFTempErrorIndex == 0) { ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + "\":"); - ShowContinueError(state, " Total Cooling Capacity Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(TotCapTempModFac, 3) + ")."); + ShowContinueError(state, + format(" Total Cooling Capacity Modifier curve (function of temperature) output is negative ({:.3T}).", + TotCapTempModFac)); if (state.dataCurveManager->PerfCurve(DXCoil(DXCoilNum).CCapFTemp(Mode)).NumDims == 2) { - ShowContinueError(state, " Negative value occurs using a condenser inlet air temperature of " + - TrimSigDigits(CondInletTemp, 1) + " and an inlet air wet-bulb temperature of " + - TrimSigDigits(InletAirWetBulbC, 1) + '.'); + ShowContinueError(state, + format(" Negative value occurs using a condenser inlet air temperature of {:.1T} and an inlet air " + "wet-bulb temperature of {:.1T}.", + CondInletTemp, + InletAirWetBulbC)); } else { - ShowContinueError(state, " Negative value occurs using a condenser inlet air temperature of " + - TrimSigDigits(CondInletTemp, 1) + '.'); + ShowContinueError(state, + format(" Negative value occurs using a condenser inlet air temperature of {:.1T}.", CondInletTemp)); } if (Mode > 1) { - ShowContinueError(state, " Negative output results from stage " + TrimSigDigits(Mode) + " compressor operation."); + ShowContinueError(state, format(" Negative output results from stage {} compressor operation.", Mode)); } ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } @@ -8811,12 +8925,14 @@ namespace DXCoils { if (TotCapFlowModFac < 0.0) { if (DXCoil(DXCoilNum).CCapFFlowErrorIndex == 0) { ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + "\":"); - ShowContinueError(state, " Total Cooling Capacity Modifier curve (function of flow fraction) output is negative (" + - TrimSigDigits(TotCapFlowModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an air flow fraction of " + TrimSigDigits(AirMassFlowRatio, 3) + '.'); + ShowContinueError( + state, + format(" Total Cooling Capacity Modifier curve (function of flow fraction) output is negative ({:.3T}).", + TotCapFlowModFac)); + ShowContinueError(state, format(" Negative value occurs using an air flow fraction of {:.3T}.", AirMassFlowRatio)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); if (Mode > 1) { - ShowContinueError(state, " Negative output results from stage " + TrimSigDigits(Mode) + " compressor operation."); + ShowContinueError(state, format(" Negative output results from stage {} compressor operation.", Mode)); } } ShowRecurringWarningErrorAtEnd(state, @@ -8885,14 +9001,12 @@ namespace DXCoils { if (DXCoil(DXCoilNum).DXCoilType_Num == CoilDX_HeatPumpWaterHeaterPumped || DXCoil(DXCoilNum).DXCoilType_Num == CoilDX_HeatPumpWaterHeaterWrapped) { ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + "=\"" + DXCoil(DXCoilNum).Name + "\", PLF curve value"); - ShowContinueError(state, "The PLF curve value = " + TrimSigDigits(PLF, 3) + - " for part-load ratio = " + TrimSigDigits(PartLoadRatio, 3)); + ShowContinueError(state, format("The PLF curve value = {:.3T} for part-load ratio = {:.3T}", PLF, PartLoadRatio)); ShowContinueErrorTimeStamp(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [" + DXCoil(DXCoilNum).DXCoilType + "]."); } else { ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + "=\"" + DXCoil(DXCoilNum).Name + "\", PLF curve value"); - ShowContinueError(state, "The PLF curve value = " + TrimSigDigits(PLF, 3) + - " for part-load ratio = " + TrimSigDigits(PartLoadRatio, 3)); + ShowContinueError(state, format("The PLF curve value = {:.3T} for part-load ratio = {:.3T}", PLF, PartLoadRatio)); ShowContinueErrorTimeStamp(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [" + DXCoil(DXCoilNum).DXCoilType + "]."); } @@ -8921,15 +9035,15 @@ namespace DXCoils { if (DXCoil(DXCoilNum).DXCoilType_Num == CoilDX_HeatPumpWaterHeaterPumped || DXCoil(DXCoilNum).DXCoilType_Num == CoilDX_HeatPumpWaterHeaterWrapped) { ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + "=\"" + DXCoil(DXCoilNum).Name + "\", runtime fraction"); - ShowWarningMessage(state, "The runtime fraction exceeded 1.0. [" + RoundSigDigits(DXCoil(DXCoilNum).CoolingCoilRuntimeFraction, 4) + - "]."); + ShowWarningMessage(state, + format("The runtime fraction exceeded 1.0. [{:.4R}].", DXCoil(DXCoilNum).CoolingCoilRuntimeFraction)); ShowContinueError(state, "Runtime fraction reset to 1 and the simulation will continue."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [" + DXCoil(DXCoilNum).DXCoilType + "]."); ShowContinueErrorTimeStamp(state, ""); } else { ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + "=\"" + DXCoil(DXCoilNum).Name + "\", runtime fraction"); - ShowWarningMessage(state, "The runtime fraction exceeded 1.0. [" + RoundSigDigits(DXCoil(DXCoilNum).CoolingCoilRuntimeFraction, 4) + - "]."); + ShowWarningMessage(state, + format("The runtime fraction exceeded 1.0. [{:.4R}].", DXCoil(DXCoilNum).CoolingCoilRuntimeFraction)); ShowContinueError(state, "Runtime fraction reset to 1 and the simulation will continue."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [" + DXCoil(DXCoilNum).DXCoilType + "]."); ShowContinueErrorTimeStamp(state, ""); @@ -9001,10 +9115,11 @@ namespace DXCoils { DXCoil(DXCoilNum).FullLoadOutAirTempLast = FullLoadOutAirTemp; if (DXCoil(DXCoilNum).LowOutletTempIndex == 0) { DXCoil(DXCoilNum).FullLoadInletAirTempLast = InletAirDryBulbTemp; - DXCoil(DXCoilNum).LowOutTempBuffer1 = DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Full load outlet air dry-bulb temperature < 2C. This indicates the possibility of " - "coil frost/freeze. Outlet temperature = " + - RoundSigDigits(FullLoadOutAirTemp, 2) + " C."; + DXCoil(DXCoilNum).LowOutTempBuffer1 = format("{} \"{}\" - Full load outlet air dry-bulb temperature < 2C. This indicates the " + "possibility of coil frost/freeze. Outlet temperature = {:.2R} C.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + FullLoadOutAirTemp); DXCoil(DXCoilNum).LowOutTempBuffer2 = " ...Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); } @@ -9154,17 +9269,21 @@ namespace DXCoils { if (EIRTempModFac < 0.0) { if (DXCoil(DXCoilNum).EIRFTempErrorIndex == 0) { ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + "=\"" + DXCoil(DXCoilNum).Name + "\":"); - ShowContinueError(state, " Energy Input Ratio Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(EIRTempModFac, 3) + ")."); + ShowContinueError( + state, + format(" Energy Input Ratio Modifier curve (function of temperature) output is negative ({:.3T}).", EIRTempModFac)); if (state.dataCurveManager->PerfCurve(DXCoil(DXCoilNum).EIRFTemp(Mode)).NumDims == 2) { - ShowContinueError(state, " Negative value occurs using a condenser inlet air temperature of " + TrimSigDigits(CondInletTemp, 1) + - " and an inlet air wet-bulb temperature of " + TrimSigDigits(InletAirWetBulbC, 1) + '.'); + ShowContinueError(state, + format(" Negative value occurs using a condenser inlet air temperature of {:.1T} and an inlet air " + "wet-bulb temperature of {:.1T}.", + CondInletTemp, + InletAirWetBulbC)); } else { - ShowContinueError(state, " Negative value occurs using a condenser inlet air temperature of " + TrimSigDigits(CondInletTemp, 1) + - '.'); + ShowContinueError(state, + format(" Negative value occurs using a condenser inlet air temperature of {:.1T}.", CondInletTemp)); } if (Mode > 1) { - ShowContinueError(state, " Negative output results from stage " + TrimSigDigits(Mode) + " compressor operation."); + ShowContinueError(state, format(" Negative output results from stage {} compressor operation.", Mode)); } ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } @@ -9183,12 +9302,13 @@ namespace DXCoils { if (EIRFlowModFac < 0.0) { if (DXCoil(DXCoilNum).EIRFFlowErrorIndex == 0) { ShowWarningMessage(state, RoutineName + DXCoil(DXCoilNum).DXCoilType + "=\"" + DXCoil(DXCoilNum).Name + "\":"); - ShowContinueError(state, " Energy Input Ratio Modifier curve (function of flow fraction) output is negative (" + - TrimSigDigits(EIRFlowModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an air flow fraction of " + TrimSigDigits(AirMassFlowRatio, 3) + '.'); + ShowContinueError( + state, + format(" Energy Input Ratio Modifier curve (function of flow fraction) output is negative ({:.3T}).", EIRFlowModFac)); + ShowContinueError(state, format(" Negative value occurs using an air flow fraction of {:.3T}.", AirMassFlowRatio)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); if (Mode > 1) { - ShowContinueError(state, " Negative output results from stage " + TrimSigDigits(Mode) + " compressor operation."); + ShowContinueError(state, format(" Negative output results from stage {} compressor operation.", Mode)); } } ShowRecurringWarningErrorAtEnd(state, @@ -9384,8 +9504,6 @@ namespace DXCoils { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; - using General::TrimSigDigits; // SUBROUTINE ARGUMENT DEFINITIONS: // REAL(r64), INTENT(IN), OPTIONAL :: CoolingHeatingPLR ! used for cycling fan RH control @@ -9586,8 +9704,9 @@ namespace DXCoils { ShowWarningMessage(state, DXCoil(DXCoilNum).LowOutTempBuffer1); ShowContinueError(state, DXCoil(DXCoilNum).LowOutTempBuffer2); ShowContinueError(state, "... Possible reasons for low outlet air dry-bulb temperatures are: This DX coil"); - ShowContinueError(state, " 1) may have a low inlet air dry-bulb temperature. Inlet air temperature = " + - TrimSigDigits(DXCoil(DXCoilNum).FullLoadInletAirTempLast, 3) + " C."); + ShowContinueError(state, + format(" 1) may have a low inlet air dry-bulb temperature. Inlet air temperature = {:.3T} C.", + DXCoil(DXCoilNum).FullLoadInletAirTempLast)); ShowContinueError(state, " 2) may have a low air flow rate per watt of cooling capacity. Check inputs."); ShowContinueError(state, " 3) is used as part of a HX assisted cooling coil which uses a high sensible effectiveness. Check inputs."); } @@ -9632,28 +9751,33 @@ namespace DXCoils { if (!FirstHVACIteration && !state.dataGlobal->WarmupFlag && ((VolFlowperRatedTotCap < MinOperVolFlowPerRatedTotCap(DXCT)) || (VolFlowperRatedTotCap > MaxCoolVolFlowPerRatedTotCap(DXCT)))) { if (DXCoil(DXCoilNum).ErrIndex1 == 0) { - ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total cooling capacity is out of range at " + - RoundSigDigits(VolFlowperRatedTotCap, 3) + " m3/s/W."); + ShowWarningMessage( + state, + format("{} \"{}\" - Air volume flow rate per watt of rated total cooling capacity is out of range at {:.3R} m3/s/W.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + VolFlowperRatedTotCap)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "...Expected range for VolumeFlowPerRatedTotalCapacity=[" + - RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + "--" + - RoundSigDigits(MaxCoolVolFlowPerRatedTotCap(DXCT), 3) + ']'); + ShowContinueError(state, + format("...Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}]", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxCoolVolFlowPerRatedTotCap(DXCT))); ShowContinueError(state, "...Possible causes include inconsistent air flow rates in system components,"); ShowContinueError(state, "...or mixing manual inputs with autosize inputs. Also check the following values and calculations."); ShowContinueError(state, "...Volume Flow Rate per Rated Total Capacity = Volume Flow Rate / Rated Total Capacity"); ShowContinueError(state, "...Volume Flow Rate = Air Mass Flow Rate / Air Density"); ShowContinueError(state, "...Data used for calculations:"); - ShowContinueError(state, "...Rated Total Capacity = " + RoundSigDigits(DXCoil(DXCoilNum).RatedTotCap(Mode), 2) + " W."); + ShowContinueError(state, format("...Rated Total Capacity = {:.2R} W.", DXCoil(DXCoilNum).RatedTotCap(Mode))); ShowContinueError(state, "...Volume Flow Rate = Air Mass Flow Rate / Air Density"); - ShowContinueError(state, "...Volume Flow Rate = " + RoundSigDigits(AirVolumeFlowRate, 8) + " m3/s."); - ShowContinueError(state, "...Air Mass Flow Rate = " + RoundSigDigits(AirMassFlow, 8) + " kg/s."); - ShowContinueError(state, "...Air Density = " + - RoundSigDigits(PsyRhoAirFnPbTdbW(state, OutdoorPressure, InletAirDryBulbTemp, InletAirHumRat), 8) + " kg/m3."); + ShowContinueError(state, format("...Volume Flow Rate = {:.8R} m3/s.", AirVolumeFlowRate)); + ShowContinueError(state, format("...Air Mass Flow Rate = {:.8R} kg/s.", AirMassFlow)); + ShowContinueError(state, + format("...Air Density = {:.8R} kg/m3.", + PsyRhoAirFnPbTdbW(state, OutdoorPressure, InletAirDryBulbTemp, InletAirHumRat))); ShowContinueError(state, "...Data used for air density calculation:"); - ShowContinueError(state, "...Outdoor Air Pressure = " + RoundSigDigits(OutdoorPressure, 3) + " Pa."); - ShowContinueError(state, "...Inlet Air Dry-Bulb Temp = " + RoundSigDigits(InletAirDryBulbTemp, 3) + " C."); - ShowContinueError(state, "...Inlet Air Humidity Ratio = " + RoundSigDigits(InletAirHumRat, 8) + " kgWater/kgDryAir."); + ShowContinueError(state, format("...Outdoor Air Pressure = {:.3R} Pa.", OutdoorPressure)); + ShowContinueError(state, format("...Inlet Air Dry-Bulb Temp = {:.3R} C.", InletAirDryBulbTemp)); + ShowContinueError(state, format("...Inlet Air Humidity Ratio = {:.8R} kgWater/kgDryAir.", InletAirHumRat)); } ShowRecurringWarningErrorAtEnd(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + @@ -9683,10 +9807,12 @@ namespace DXCoils { DXCoil(DXCoilNum).PrintLowAmbMessage = true; DXCoil(DXCoilNum).LowTempLast = OutdoorDryBulb; if (DXCoil(DXCoilNum).LowAmbErrIndex == 0) { - DXCoil(DXCoilNum).LowAmbBuffer1 = DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Condenser inlet temperature below " + - RoundSigDigits(DXCoil(DXCoilNum).MinOATCompressor, 2) + - " C. Condenser inlet temperature = " + RoundSigDigits(OutdoorDryBulb, 2); + DXCoil(DXCoilNum).LowAmbBuffer1 = + format("{} \"{}\" - Condenser inlet temperature below {:.2R} C. Condenser inlet temperature = {:.2R}", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + DXCoil(DXCoilNum).MinOATCompressor, + OutdoorDryBulb); DXCoil(DXCoilNum).LowAmbBuffer2 = " ... Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); } @@ -9698,8 +9824,11 @@ namespace DXCoils { DXCoil(DXCoilNum).HighTempLast = OutdoorDryBulb; if (DXCoil(DXCoilNum).HighAmbErrIndex == 0) { DXCoil(DXCoilNum).HighAmbBuffer1 = - DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + "\" - Condenser inlet temperature above " + - RoundSigDigits(DXCoil(DXCoilNum).MaxOATCompressor, 2) + " C. Condenser temperature = " + RoundSigDigits(OutdoorDryBulb, 2); + format("{} \"{}\" - Condenser inlet temperature above {:.2R} C. Condenser temperature = {:.2R}", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + DXCoil(DXCoilNum).MaxOATCompressor, + OutdoorDryBulb); DXCoil(DXCoilNum).HighAmbBuffer2 = " ... Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); } @@ -9717,12 +9846,17 @@ namespace DXCoils { if (TotCapTempModFac < 0.0) { if (DXCoil(DXCoilNum).CCapFTempErrorIndex == 0) { ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + "\":"); - ShowContinueError(state, " Total Cooling Capacity Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(TotCapTempModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using a condenser inlet temperature of " + TrimSigDigits(CondInletTemp, 1) + - " and an inlet air wet-bulb temperature of " + TrimSigDigits(InletAirWetBulbC, 1) + '.'); + ShowContinueError( + state, + format(" Total Cooling Capacity Modifier curve (function of temperature) output is negative ({:.3T}).", TotCapTempModFac)); + ShowContinueError( + state, + format( + " Negative value occurs using a condenser inlet temperature of {:.1T} and an inlet air wet-bulb temperature of {:.1T}.", + CondInletTemp, + InletAirWetBulbC)); if (Mode > 1) { - ShowContinueError(state, " Negative output results from stage " + TrimSigDigits(Mode) + " compressor operation."); + ShowContinueError(state, format(" Negative output results from stage {} compressor operation.", Mode)); } ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } @@ -9743,12 +9877,13 @@ namespace DXCoils { if (TotCapFlowModFac < 0.0) { if (DXCoil(DXCoilNum).CCapFFlowErrorIndex == 0) { ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + "\":"); - ShowContinueError(state, " Total Cooling Capacity Modifier curve (function of flow fraction) output is negative (" + - TrimSigDigits(TotCapFlowModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an air flow fraction of " + TrimSigDigits(AirMassFlowRatio, 3) + '.'); + ShowContinueError( + state, + format(" Total Cooling Capacity Modifier curve (function of flow fraction) output is negative ({:.3T}).", TotCapFlowModFac)); + ShowContinueError(state, format(" Negative value occurs using an air flow fraction of {:.3T}.", AirMassFlowRatio)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); if (Mode > 1) { - ShowContinueError(state, " Negative output results from stage " + TrimSigDigits(Mode) + " compressor operation."); + ShowContinueError(state, format(" Negative output results from stage {} compressor operation.", Mode)); } } ShowRecurringWarningErrorAtEnd(state, @@ -9806,8 +9941,11 @@ namespace DXCoils { if (PLF < 0.7) { if (DXCoil(DXCoilNum).ErrIndex2 == 0) { - ShowWarningMessage(state, "The PLF curve value for the DX cooling coil " + DXCoil(DXCoilNum).Name + " =" + RoundSigDigits(PLF, 3) + - " for part-load ratio =" + RoundSigDigits(PartLoadRatio, 3)); + ShowWarningMessage(state, + format("The PLF curve value for the DX cooling coil {} ={:.3R} for part-load ratio ={:.3R}", + DXCoil(DXCoilNum).Name, + PLF, + PartLoadRatio)); ShowContinueErrorTimeStamp(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Cooling:DX:SingleSpeed]."); } @@ -9820,8 +9958,10 @@ namespace DXCoils { DXCoil(DXCoilNum).CoolingCoilRuntimeFraction = CompCycRatio / PLF; if (DXCoil(DXCoilNum).CoolingCoilRuntimeFraction > 1.0 && std::abs(DXCoil(DXCoilNum).CoolingCoilRuntimeFraction - 1.0) > 0.001) { if (DXCoil(DXCoilNum).ErrIndex3 == 0) { - ShowWarningMessage(state, "The runtime fraction for DX cooling coil " + DXCoil(DXCoilNum).Name + " exceeded 1.0. [" + - RoundSigDigits(DXCoil(DXCoilNum).CoolingCoilRuntimeFraction, 4) + "]."); + ShowWarningMessage(state, + format("The runtime fraction for DX cooling coil {} exceeded 1.0. [{:.4R}].", + DXCoil(DXCoilNum).Name, + DXCoil(DXCoilNum).CoolingCoilRuntimeFraction)); ShowContinueError(state, "Runtime fraction reset to 1 and the simulation will continue."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Cooling:DX:SingleSpeed]."); ShowContinueErrorTimeStamp(state, ""); @@ -9869,10 +10009,11 @@ namespace DXCoils { DXCoil(DXCoilNum).FullLoadOutAirTempLast = FullLoadOutAirTemp; if (DXCoil(DXCoilNum).LowOutletTempIndex == 0) { DXCoil(DXCoilNum).FullLoadInletAirTempLast = InletAirDryBulbTemp; - DXCoil(DXCoilNum).LowOutTempBuffer1 = DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Full load outlet air dry-bulb temperature < 2C. This indicates the possibility of " - "coil frost/freeze. Outlet temperature = " + - RoundSigDigits(FullLoadOutAirTemp, 2) + " C."; + DXCoil(DXCoilNum).LowOutTempBuffer1 = format("{} \"{}\" - Full load outlet air dry-bulb temperature < 2C. This indicates the " + "possibility of coil frost/freeze. Outlet temperature = {:.2R} C.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + FullLoadOutAirTemp); DXCoil(DXCoilNum).LowOutTempBuffer2 = " ...Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); } @@ -10037,7 +10178,6 @@ namespace DXCoils { using CurveManager::CurveValue; using DataHeatBalFanSys::ZoneAirHumRat; using DataHeatBalFanSys::ZT; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcDXHeatingCoil"); @@ -10168,12 +10308,17 @@ namespace DXCoils { if ((VolFlowperRatedTotCap < MinOperVolFlowPerRatedTotCap(DXCT)) || (VolFlowperRatedTotCap > MaxHeatVolFlowPerRatedTotCap(DXCT))) { if (DXCoil(DXCoilNum).ErrIndex1 == 0) { - ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total heating capacity is out of range at " + - RoundSigDigits(VolFlowperRatedTotCap, 3) + " m3/s/W."); + ShowWarningMessage( + state, + format("{} \"{}\" - Air volume flow rate per watt of rated total heating capacity is out of range at {:.3R} m3/s/W.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + VolFlowperRatedTotCap)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Expected range for VolumeFlowPerRatedTotalCapacity=[" + RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + - "--" + RoundSigDigits(MaxHeatVolFlowPerRatedTotCap(DXCT), 3) + ']'); + ShowContinueError(state, + format("Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}]", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxHeatVolFlowPerRatedTotCap(DXCT))); ShowContinueError(state, "Possible causes include inconsistent air flow rates in system components or"); ShowContinueError(state, "inconsistent supply air fan operation modes in coil and unitary system objects."); } @@ -10223,8 +10368,8 @@ namespace DXCoils { if (TotCapTempModFac < 0.0) { if (DXCoil(DXCoilNum).CAPFTErrIndex == 0) { - ShowWarningMessage(state, "The TotCapTempModFac curve value for DX heating coil " + DXCoil(DXCoilNum).Name + " =" + - RoundSigDigits(TotCapTempModFac, 2)); + ShowWarningMessage( + state, format("The TotCapTempModFac curve value for DX heating coil {} ={:.2R}", DXCoil(DXCoilNum).Name, TotCapTempModFac)); ShowContinueError(state, "TotCapTempModFac curve value must be > 0. TotCapTempModFac curve value has been reset to 0.0 and " "simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for TotCapTempModFac curve guidance [ " + DXCoil(DXCoilNum).DXCoilType + " ]."); @@ -10340,8 +10485,8 @@ namespace DXCoils { if (EIRTempModFac < 0.0) { if (DXCoil(DXCoilNum).EIRFTErrIndex == 0) { - ShowWarningMessage(state, "The EIRTempModFac curve value for DX heating coil " + DXCoil(DXCoilNum).Name + " =" + - RoundSigDigits(EIRTempModFac, 2)); + ShowWarningMessage(state, + format("The EIRTempModFac curve value for DX heating coil {} ={:.2R}", DXCoil(DXCoilNum).Name, EIRTempModFac)); ShowContinueError(state, "EIRTempModFac curve value must be > 0. EIRTempModFac curve value has been reset to 0.0 and simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for EIRTempModFac curve guidance [ " + DXCoil(DXCoilNum).DXCoilType + " ]."); @@ -10369,8 +10514,11 @@ namespace DXCoils { if (PLF < 0.7) { if (DXCoil(DXCoilNum).PLRErrIndex == 0) { - ShowWarningMessage(state, "The PLF curve value for DX heating coil " + DXCoil(DXCoilNum).Name + " =" + RoundSigDigits(PLF, 2) + - " for part-load ratio =" + RoundSigDigits(PLRHeating, 2)); + ShowWarningMessage(state, + format("The PLF curve value for DX heating coil {} ={:.2R} for part-load ratio ={:.2R}", + DXCoil(DXCoilNum).Name, + PLF, + PLRHeating)); ShowContinueError(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:DX:SingleSpeed]."); ShowContinueErrorTimeStamp(state, ""); @@ -10382,8 +10530,10 @@ namespace DXCoils { DXCoil(DXCoilNum).HeatingCoilRuntimeFraction = (PLRHeating / PLF); if (DXCoil(DXCoilNum).HeatingCoilRuntimeFraction > 1.0 && std::abs(DXCoil(DXCoilNum).HeatingCoilRuntimeFraction - 1.0) > 0.001) { if (DXCoil(DXCoilNum).ErrIndex4 == 0) { - ShowWarningMessage(state, "The runtime fraction for DX heating coil " + DXCoil(DXCoilNum).Name + " exceeded 1.0. [" + - RoundSigDigits(DXCoil(DXCoilNum).HeatingCoilRuntimeFraction, 4) + "]."); + ShowWarningMessage(state, + format("The runtime fraction for DX heating coil {} exceeded 1.0. [{:.4R}].", + DXCoil(DXCoilNum).Name, + DXCoil(DXCoilNum).HeatingCoilRuntimeFraction)); ShowContinueError(state, "Runtime fraction is set to 1.0 and the simulation continues..."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:DX:SingleSpeed]."); ShowContinueErrorTimeStamp(state, ""); @@ -11091,7 +11241,6 @@ namespace DXCoils { // conditions. From this information, coil bypass factor is calculated. // Using/Aliasing - using General::RoundSigDigits; // Return value Real64 CBF(0.0); // the result - the coil bypass factor @@ -11145,18 +11294,19 @@ namespace DXCoils { ShowContinueError(state, "capacity, increase the rated air volume flow rate, or reduce the rated sensible heat ratio for this coil."); ShowContinueError(state, "If autosizing, it is recommended that all three of these values be autosized."); ShowContinueError(state, "...Inputs used for calculating cooling coil bypass factor."); - ShowContinueError(state, "...Inlet Air Temperature = " + RoundSigDigits(InletAirTemp, 2) + " C"); - ShowContinueError(state, "...Outlet Air Temperature = " + RoundSigDigits(OutletAirTemp, 2) + " C"); - ShowContinueError(state, "...Inlet Air Humidity Ratio = " + RoundSigDigits(InletAirHumRat, 6) + " kgWater/kgDryAir"); - ShowContinueError(state, "...Outlet Air Humidity Ratio = " + RoundSigDigits(OutletAirHumRat, 6) + " kgWater/kgDryAir"); - ShowContinueError(state, "...Total Cooling Capacity used in calculation = " + RoundSigDigits(TotCap, 2) + " W"); - ShowContinueError(state, "...Air Mass Flow Rate used in calculation = " + RoundSigDigits(AirMassFlowRate, 6) + " kg/s"); - ShowContinueError(state, "...Air Volume Flow Rate used in calculation = " + RoundSigDigits(AirVolFlowRate, 6) + " m3/s"); + ShowContinueError(state, format("...Inlet Air Temperature = {:.2R} C", InletAirTemp)); + ShowContinueError(state, format("...Outlet Air Temperature = {:.2R} C", OutletAirTemp)); + ShowContinueError(state, format("...Inlet Air Humidity Ratio = {:.6R} kgWater/kgDryAir", InletAirHumRat)); + ShowContinueError(state, format("...Outlet Air Humidity Ratio = {:.6R} kgWater/kgDryAir", OutletAirHumRat)); + ShowContinueError(state, format("...Total Cooling Capacity used in calculation = {:.2R} W", TotCap)); + ShowContinueError(state, format("...Air Mass Flow Rate used in calculation = {:.6R} kg/s", AirMassFlowRate)); + ShowContinueError(state, format("...Air Volume Flow Rate used in calculation = {:.6R} m3/s", AirVolFlowRate)); if (TotCap > 0.0) { if (((MinRatedVolFlowPerRatedTotCap(DXCT) - AirVolFlowRate / TotCap) > SmallDifferenceTest) || ((AirVolFlowRate / TotCap - MaxRatedVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { - ShowContinueError(state, "...Air Volume Flow Rate per Watt of Rated Cooling Capacity is also out of bounds at = " + - RoundSigDigits(AirVolFlowRate / TotCap, 7) + " m3/s/W"); + ShowContinueError(state, + format("...Air Volume Flow Rate per Watt of Rated Cooling Capacity is also out of bounds at = {:.7R} m3/s/W", + AirVolFlowRate / TotCap)); } } ShowContinueErrorTimeStamp(state, ""); @@ -11168,8 +11318,8 @@ namespace DXCoils { HTinHumRatOut = PsyHFnTdbW(InletAirTemp, OutletAirHumRat); adjustedSHR = (HTinHumRatOut - OutletAirEnthalpy) / DeltaH; ShowContinueError(state, "CalcCBF: SHR adjusted to achieve valid outlet air properties and the simulation continues."); - ShowContinueError(state, "CalcCBF: initial SHR = " + RoundSigDigits(SHR, 5)); - ShowContinueError(state, "CalcCBF: adjusted SHR = " + RoundSigDigits(adjustedSHR, 5)); + ShowContinueError(state, format("CalcCBF: initial SHR = {:.5R}", SHR)); + ShowContinueError(state, format("CalcCBF: adjusted SHR = {:.5R}", adjustedSHR)); } } DeltaT = InletAirTemp - OutletAirTemp; @@ -11181,18 +11331,19 @@ namespace DXCoils { ShowContinueError(state, "capacity, rated air volume flow rate, or rated sensible heat ratio for this coil."); ShowContinueError(state, "If autosizing, it is recommended that all three of these values be autosized."); ShowContinueError(state, "...Inputs used for calculating cooling coil bypass factor."); - ShowContinueError(state, "...Inlet Air Temperature = " + RoundSigDigits(InletAirTemp, 2) + " C"); - ShowContinueError(state, "...Outlet Air Temperature = " + RoundSigDigits(OutletAirTemp, 2) + " C"); - ShowContinueError(state, "...Inlet Air Humidity Ratio = " + RoundSigDigits(InletAirHumRat, 6) + " kgWater/kgDryAir"); - ShowContinueError(state, "...Outlet Air Humidity Ratio = " + RoundSigDigits(OutletAirHumRat, 6) + " kgWater/kgDryAir"); - ShowContinueError(state, "...Total Cooling Capacity used in calculation = " + RoundSigDigits(TotCap, 2) + " W"); - ShowContinueError(state, "...Air Mass Flow Rate used in calculation = " + RoundSigDigits(AirMassFlowRate, 6) + " kg/s"); - ShowContinueError(state, "...Air Volume Flow Rate used in calculation = " + RoundSigDigits(AirVolFlowRate, 6) + " m3/s"); + ShowContinueError(state, format("...Inlet Air Temperature = {:.2R} C", InletAirTemp)); + ShowContinueError(state, format("...Outlet Air Temperature = {:.2R} C", OutletAirTemp)); + ShowContinueError(state, format("...Inlet Air Humidity Ratio = {:.6R} kgWater/kgDryAir", InletAirHumRat)); + ShowContinueError(state, format("...Outlet Air Humidity Ratio = {:.6R} kgWater/kgDryAir", OutletAirHumRat)); + ShowContinueError(state, format("...Total Cooling Capacity used in calculation = {:.2R} W", TotCap)); + ShowContinueError(state, format("...Air Mass Flow Rate used in calculation = {:.6R} kg/s", AirMassFlowRate)); + ShowContinueError(state, format("...Air Volume Flow Rate used in calculation = {:.6R} m3/s", AirVolFlowRate)); if (TotCap > 0.0) { if (((MinRatedVolFlowPerRatedTotCap(DXCT) - AirVolFlowRate / TotCap) > SmallDifferenceTest) || ((AirVolFlowRate / TotCap - MaxRatedVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { - ShowContinueError(state, "...Air Volume Flow Rate per Watt of Rated Cooling Capacity is also out of bounds at = " + - RoundSigDigits(AirVolFlowRate / TotCap, 7) + " m3/s/W"); + ShowContinueError(state, + format("...Air Volume Flow Rate per Watt of Rated Cooling Capacity is also out of bounds at = {:.7R} m3/s/W", + AirVolFlowRate / TotCap)); } } ShowContinueErrorTimeStamp(state, ""); @@ -11207,19 +11358,20 @@ namespace DXCoils { // outlet air humidity ratio can't be less than zero. ShowSevereError(state, UnitType + " \"" + UnitName + "\""); ShowContinueError(state, "...Invalid slope or outlet air condition when calculating cooling coil bypass factor."); - ShowContinueError(state, "...Slope = " + RoundSigDigits(SlopeAtConds, 8)); - ShowContinueError(state, "...Inlet Air Temperature = " + RoundSigDigits(InletAirTemp, 2) + " C"); - ShowContinueError(state, "...Outlet Air Temperature = " + RoundSigDigits(OutletAirTemp, 2) + " C"); - ShowContinueError(state, "...Inlet Air Humidity Ratio = " + RoundSigDigits(InletAirHumRat, 6) + " kgWater/kgDryAir"); - ShowContinueError(state, "...Outlet Air Humidity Ratio = " + RoundSigDigits(OutletAirHumRat, 6) + " kgWater/kgDryAir"); - ShowContinueError(state, "...Total Cooling Capacity used in calculation = " + RoundSigDigits(TotCap, 2) + " W"); - ShowContinueError(state, "...Air Mass Flow Rate used in calculation = " + RoundSigDigits(AirMassFlowRate, 6) + " kg/s"); - ShowContinueError(state, "...Air Volume Flow Rate used in calculation = " + RoundSigDigits(AirVolFlowRate, 6) + " m3/s"); + ShowContinueError(state, format("...Slope = {:.8R}", SlopeAtConds)); + ShowContinueError(state, format("...Inlet Air Temperature = {:.2R} C", InletAirTemp)); + ShowContinueError(state, format("...Outlet Air Temperature = {:.2R} C", OutletAirTemp)); + ShowContinueError(state, format("...Inlet Air Humidity Ratio = {:.6R} kgWater/kgDryAir", InletAirHumRat)); + ShowContinueError(state, format("...Outlet Air Humidity Ratio = {:.6R} kgWater/kgDryAir", OutletAirHumRat)); + ShowContinueError(state, format("...Total Cooling Capacity used in calculation = {:.2R} W", TotCap)); + ShowContinueError(state, format("...Air Mass Flow Rate used in calculation = {:.6R} kg/s", AirMassFlowRate)); + ShowContinueError(state, format("...Air Volume Flow Rate used in calculation = {:.6R} m3/s", AirVolFlowRate)); if (TotCap > 0.0) { if (((MinRatedVolFlowPerRatedTotCap(DXCT) - AirVolFlowRate / TotCap) > SmallDifferenceTest) || ((AirVolFlowRate / TotCap - MaxRatedVolFlowPerRatedTotCap(DXCT)) > SmallDifferenceTest)) { - ShowContinueError(state, "...Air Volume Flow Rate per Watt of Rated Cooling Capacity is also out of bounds at = " + - RoundSigDigits(AirVolFlowRate / TotCap, 7) + " m3/s/W"); + ShowContinueError(state, + format("...Air Volume Flow Rate per Watt of Rated Cooling Capacity is also out of bounds at = {:.7R} m3/s/W", + AirVolFlowRate / TotCap)); } } ShowContinueErrorTimeStamp(state, ""); @@ -11271,7 +11423,7 @@ namespace DXCoils { CBF = min(1.0, (OutletAirEnthalpy - ADPEnthalpy) / (InletAirEnthalpy - ADPEnthalpy)); if (Iter > IterMax && PrintFlag) { ShowSevereError(state, UnitType + " \"" + UnitName + "\" -- coil bypass factor calculation did not converge after max iterations."); - ShowContinueError(state, "The RatedSHR of [" + RoundSigDigits(SHR, 3) + "], entered by the user or autosized (see *.eio file),"); + ShowContinueError(state, format("The RatedSHR of [{:.3R}], entered by the user or autosized (see *.eio file),", SHR)); ShowContinueError(state, "may be causing this. The line defined by the coil rated inlet air conditions"); ShowContinueError(state, "(26.7C drybulb and 19.4C wetbulb) and the RatedSHR (i.e., slope of the line) must intersect"); ShowContinueError(state, "the saturation curve of the psychrometric chart. If the RatedSHR is too low, then this"); @@ -11710,8 +11862,6 @@ namespace DXCoils { using DataHVACGlobals::MSHPMassFlowRateHigh; using DataHVACGlobals::MSHPMassFlowRateLow; using DataHVACGlobals::MSHPWasteHeat; - using General::RoundSigDigits; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -11850,15 +12000,20 @@ namespace DXCoils { ShowContinueError(state, "When AirMassFlow > 0.0 and CycRatio > 0.0 and SpeedNum > 1, then MSHPMassFlowRateLow and MSHPMassFlowRateHigh " "must also be > 0.0"); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "AirMassFlow=" + RoundSigDigits(AirMassFlow, 3) + ",CycRatio=" + RoundSigDigits(CycRatio, 3) + ",SpeedNum=" + - RoundSigDigits(double(SpeedNum), 0) + ", MSHPMassFlowRateLow=" + RoundSigDigits(MSHPMassFlowRateLow, 3) + - ", MSHPMassFlowRateHigh=" + RoundSigDigits(MSHPMassFlowRateHigh, 3)); + ShowContinueError( + state, + format("AirMassFlow={:.3R},CycRatio={:.3R},SpeedNum={:.0R}, MSHPMassFlowRateLow={:.3R}, MSHPMassFlowRateHigh={:.3R}", + AirMassFlow, + double(SpeedNum), + CycRatio, + MSHPMassFlowRateLow, + MSHPMassFlowRateHigh)); ShowFatalError(state, "Preceding condition(s) causes termination."); } else { ShowContinueError(state, "When AirMassFlow > 0.0 and CycRatio > 0.0, then MSHPMassFlowRateHigh must also be > 0.0"); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "AirMassFlow=" + RoundSigDigits(AirMassFlow, 3) + ",CycRatio=" + RoundSigDigits(CycRatio, 3) + - ", MSHPMassFlowRateHigh=" + RoundSigDigits(MSHPMassFlowRateHigh, 3)); + ShowContinueError( + state, format("AirMassFlow={:.3R},CycRatio={:.3R}, MSHPMassFlowRateHigh={:.3R}", AirMassFlow, CycRatio, MSHPMassFlowRateHigh)); ShowFatalError(state, "Preceding condition(s) causes termination."); } } else if (CycRatio > 1.0 || SpeedRatio > 1.0) { @@ -11866,7 +12021,7 @@ namespace DXCoils { " Developer error - inconsistent speed ratios."); ShowContinueError(state, "CycRatio and SpeedRatio must be between 0.0 and 1.0"); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "CycRatio=" + RoundSigDigits(CycRatio, 1) + ", SpeedRatio = " + RoundSigDigits(SpeedRatio, 1)); + ShowContinueError(state, format("CycRatio={:.1R}, SpeedRatio = {:.1R}", CycRatio, SpeedRatio)); ShowFatalError(state, "Preceding condition(s) causes termination."); } @@ -11907,24 +12062,29 @@ namespace DXCoils { VolFlowperRatedTotCap = AirVolumeFlowRate / DXCoil(DXCoilNum).MSRatedTotCap(SpeedNumLS); if ((VolFlowperRatedTotCap < MinOperVolFlowPerRatedTotCap(DXCT)) || (VolFlowperRatedTotCap > MaxCoolVolFlowPerRatedTotCap(DXCT))) { if (DXCoil(DXCoilNum).MSErrIndex(SpeedNumLS) == 0) { - ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed " + - TrimSigDigits(SpeedNumLS) + '.'); + ShowWarningMessage( + state, + format("{} \"{}\" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed {}.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNumLS)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Expected range for VolumeFlowPerRatedTotalCapacity=[" + - RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + "--" + - RoundSigDigits(MaxCoolVolFlowPerRatedTotCap(DXCT), 3) + "] Current value is " + - RoundSigDigits(VolFlowperRatedTotCap, 3) + " m3/s/W"); + ShowContinueError(state, + format("Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}] Current value is {:.3R} m3/s/W", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxCoolVolFlowPerRatedTotCap(DXCT), + VolFlowperRatedTotCap)); ShowContinueError(state, "Possible causes include inconsistent air flow rates in system components or"); ShowContinueError(state, "inconsistent supply air fan operation modes in coil and unitary system objects."); } - ShowRecurringWarningErrorAtEnd(state, - DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed " + - TrimSigDigits(SpeedNumLS) + " error continues...", - DXCoil(DXCoilNum).MSErrIndex(SpeedNumLS), - VolFlowperRatedTotCap, - VolFlowperRatedTotCap); + ShowRecurringWarningErrorAtEnd(state, format("{} \"{}\" - Air volume flow rate per watt of rated total cooling capacity is out of range " + "at speed {} error continues...", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNumLS), + DXCoil(DXCoilNum).MSErrIndex(SpeedNumLS), + VolFlowperRatedTotCap, + VolFlowperRatedTotCap); } // Check for valid air volume flow per rated total cooling capacity (200 - 500 cfm/ton) at high speed @@ -11934,24 +12094,29 @@ namespace DXCoils { VolFlowperRatedTotCap = AirVolumeFlowRate / DXCoil(DXCoilNum).MSRatedTotCap(SpeedNumHS); if ((VolFlowperRatedTotCap < MinOperVolFlowPerRatedTotCap(DXCT)) || (VolFlowperRatedTotCap > MaxCoolVolFlowPerRatedTotCap(DXCT))) { if (DXCoil(DXCoilNum).MSErrIndex(SpeedNumHS) == 0) { - ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed " + - TrimSigDigits(SpeedNumHS) + '.'); + ShowWarningMessage( + state, + format("{} \"{}\" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed {}.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNumHS)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Expected range for VolumeFlowPerRatedTotalCapacity=[" + - RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + "--" + - RoundSigDigits(MaxCoolVolFlowPerRatedTotCap(DXCT), 3) + "] Current value is " + - RoundSigDigits(VolFlowperRatedTotCap, 3) + " m3/s/W"); + ShowContinueError(state, + format("Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}] Current value is {:.3R} m3/s/W", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxCoolVolFlowPerRatedTotCap(DXCT), + VolFlowperRatedTotCap)); ShowContinueError(state, "Possible causes include inconsistent air flow rates in system components or"); ShowContinueError(state, "inconsistent supply air fan operation modes in coil and unitary system objects."); } - ShowRecurringWarningErrorAtEnd(state, - DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed " + - TrimSigDigits(SpeedNumHS) + " error continues...", - DXCoil(DXCoilNum).MSErrIndex(SpeedNumHS), - VolFlowperRatedTotCap, - VolFlowperRatedTotCap); + ShowRecurringWarningErrorAtEnd(state, format("{} \"{}\" - Air volume flow rate per watt of rated total cooling capacity is out of range " + "at speed {} error continues...", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNumHS), + DXCoil(DXCoilNum).MSErrIndex(SpeedNumHS), + VolFlowperRatedTotCap, + VolFlowperRatedTotCap); } // Adjust high speed coil bypass factor for actual maximum air flow rate. @@ -12229,24 +12394,29 @@ namespace DXCoils { VolFlowperRatedTotCap = AirVolumeFlowRate / DXCoil(DXCoilNum).MSRatedTotCap(SpeedNum); if ((VolFlowperRatedTotCap < MinOperVolFlowPerRatedTotCap(DXCT)) || (VolFlowperRatedTotCap > MaxCoolVolFlowPerRatedTotCap(DXCT))) { if (DXCoil(DXCoilNum).MSErrIndex(SpeedNum) == 0) { - ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed " + - TrimSigDigits(SpeedNum) + '.'); + ShowWarningMessage( + state, + format("{} \"{}\" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed {}.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNum)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Expected range for VolumeFlowPerRatedTotalCapacity=[" + - RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + "--" + - RoundSigDigits(MaxCoolVolFlowPerRatedTotCap(DXCT), 3) + "] Current value is " + - RoundSigDigits(VolFlowperRatedTotCap, 3) + " m3/s/W"); + ShowContinueError(state, + format("Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}] Current value is {:.3R} m3/s/W", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxCoolVolFlowPerRatedTotCap(DXCT), + VolFlowperRatedTotCap)); ShowContinueError(state, "Possible causes include inconsistent air flow rates in system components or"); ShowContinueError(state, "inconsistent supply air fan operation modes in coil and unitary system objects."); } - ShowRecurringWarningErrorAtEnd(state, - DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed " + - TrimSigDigits(SpeedNumHS) + " error continues...", - DXCoil(DXCoilNum).MSErrIndex(SpeedNumHS), - VolFlowperRatedTotCap, - VolFlowperRatedTotCap); + ShowRecurringWarningErrorAtEnd(state, format("{} \"{}\" - Air volume flow rate per watt of rated total cooling capacity is out of range " + "at speed {} error continues...", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNumHS), + DXCoil(DXCoilNum).MSErrIndex(SpeedNumHS), + VolFlowperRatedTotCap, + VolFlowperRatedTotCap); } if (DXCoil(DXCoilNum).CondenserType(SpeedNum) == EvapCooled) { @@ -12300,8 +12470,8 @@ namespace DXCoils { PLF = CurveValue(state, DXCoil(DXCoilNum).MSPLFFPLR(SpeedNum), CycRatio); if (FanOpMode == CycFanCycCoil && CycRatio == 1.0 && PLF != 1.0) { if (DXCoil(DXCoilNum).PLFErrIndex == 0) { - ShowWarningMessage(state, "The PLF curve value for DX cooling coil " + DXCoil(DXCoilNum).Name + " =" + RoundSigDigits(PLF, 2) + - " for part-load ratio = 1"); + ShowWarningMessage( + state, format("The PLF curve value for DX cooling coil {} ={:.2R} for part-load ratio = 1", DXCoil(DXCoilNum).Name, PLF)); ShowContinueError(state, "PLF curve value must be = 1.0 and has been reset to 1.0. Simulation is continuing."); ShowContinueErrorTimeStamp(state, ""); } @@ -12541,8 +12711,6 @@ namespace DXCoils { using DataHVACGlobals::MSHPMassFlowRateHigh; using DataHVACGlobals::MSHPMassFlowRateLow; using DataHVACGlobals::MSHPWasteHeat; - using General::RoundSigDigits; - using General::TrimSigDigits; // SUBROUTINE ARGUMENT DEFINITIONS: // SpeedRatio varies between 1.0 (maximum speed) and 0.0 (minimum speed) @@ -12636,15 +12804,20 @@ namespace DXCoils { ShowContinueError(state, "When AirMassFlow > 0.0 and CycRatio > 0.0 and SpeedNum > 1, then MSHPMassFlowRateLow and MSHPMassFlowRateHigh " "must also be > 0.0"); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "AirMassFlow=" + RoundSigDigits(AirMassFlow, 3) + ",CycRatio=" + RoundSigDigits(CycRatio, 3) + ",SpeedNum=" + - RoundSigDigits(double(SpeedNum), 0) + ", MSHPMassFlowRateLow=" + RoundSigDigits(MSHPMassFlowRateLow, 3) + - ", MSHPMassFlowRateHigh=" + RoundSigDigits(MSHPMassFlowRateHigh, 3)); + ShowContinueError( + state, + format("AirMassFlow={:.3R},CycRatio={:.3R},SpeedNum={:.0R}, MSHPMassFlowRateLow={:.3R}, MSHPMassFlowRateHigh={:.3R}", + AirMassFlow, + double(SpeedNum), + CycRatio, + MSHPMassFlowRateLow, + MSHPMassFlowRateHigh)); ShowFatalError(state, "Preceding condition(s) causes termination."); } else { ShowContinueError(state, "When AirMassFlow > 0.0 and CycRatio > 0.0, then MSHPMassFlowRateHigh must also be > 0.0"); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "AirMassFlow=" + RoundSigDigits(AirMassFlow, 3) + ",CycRatio=" + RoundSigDigits(CycRatio, 3) + - ", MSHPMassFlowRateHigh=" + RoundSigDigits(MSHPMassFlowRateHigh, 3)); + ShowContinueError( + state, format("AirMassFlow={:.3R},CycRatio={:.3R}, MSHPMassFlowRateHigh={:.3R}", AirMassFlow, CycRatio, MSHPMassFlowRateHigh)); ShowFatalError(state, "Preceding condition(s) causes termination."); } } else if (CycRatio > 1.0 || SpeedRatio > 1.0) { @@ -12652,7 +12825,7 @@ namespace DXCoils { " Developer error - inconsistent speed ratios."); ShowContinueError(state, "CycRatio and SpeedRatio must be between 0.0 and 1.0"); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "CycRatio=" + RoundSigDigits(CycRatio, 1) + ", SpeedRatio = " + RoundSigDigits(SpeedRatio, 1)); + ShowContinueError(state, format("CycRatio={:.1R}, SpeedRatio = {:.1R}", CycRatio, SpeedRatio)); ShowFatalError(state, "Preceding condition(s) causes termination."); } @@ -12718,24 +12891,29 @@ namespace DXCoils { VolFlowperRatedTotCap = AirVolumeFlowRate / DXCoil(DXCoilNum).MSRatedTotCap(SpeedNumLS); if ((VolFlowperRatedTotCap < MinOperVolFlowPerRatedTotCap(DXCT)) || (VolFlowperRatedTotCap > MaxHeatVolFlowPerRatedTotCap(DXCT))) { if (DXCoil(DXCoilNum).MSErrIndex(SpeedNumLS) == 0) { - ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total heating capacity is out of range at speed " + - TrimSigDigits(SpeedNumLS) + '.'); + ShowWarningMessage( + state, + format("{} \"{}\" - Air volume flow rate per watt of rated total heating capacity is out of range at speed {}.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNumLS)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Expected range for VolumeFlowPerRatedTotalCapacity=[" + - RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + "--" + - RoundSigDigits(MaxHeatVolFlowPerRatedTotCap(DXCT), 3) + "] Current value is " + - RoundSigDigits(VolFlowperRatedTotCap, 3) + " m3/s/W"); + ShowContinueError(state, + format("Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}] Current value is {:.3R} m3/s/W", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxHeatVolFlowPerRatedTotCap(DXCT), + VolFlowperRatedTotCap)); ShowContinueError(state, "Possible causes include inconsistent air flow rates in system components or"); ShowContinueError(state, "inconsistent supply air fan operation modes in coil and unitary system objects."); } - ShowRecurringWarningErrorAtEnd(state, - DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total heating capacity is out of range at speed " + - TrimSigDigits(SpeedNumLS) + " error continues...", - DXCoil(DXCoilNum).MSErrIndex(SpeedNumLS), - VolFlowperRatedTotCap, - VolFlowperRatedTotCap); + ShowRecurringWarningErrorAtEnd(state, format("{} \"{}\" - Air volume flow rate per watt of rated total heating capacity is out of range " + "at speed {} error continues...", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNumLS), + DXCoil(DXCoilNum).MSErrIndex(SpeedNumLS), + VolFlowperRatedTotCap, + VolFlowperRatedTotCap); } // Check for valid air volume flow per rated total cooling capacity (200 - 600 cfm/ton) at high speed @@ -12745,24 +12923,29 @@ namespace DXCoils { VolFlowperRatedTotCap = AirVolumeFlowRate / DXCoil(DXCoilNum).MSRatedTotCap(SpeedNumHS); if ((VolFlowperRatedTotCap < MinOperVolFlowPerRatedTotCap(DXCT)) || (VolFlowperRatedTotCap > MaxHeatVolFlowPerRatedTotCap(DXCT))) { if (DXCoil(DXCoilNum).MSErrIndex(SpeedNumHS) == 0) { - ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total heating capacity is out of range at speed " + - TrimSigDigits(SpeedNumHS) + '.'); + ShowWarningMessage( + state, + format("{} \"{}\" - Air volume flow rate per watt of rated total heating capacity is out of range at speed {}.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNumHS)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Expected range for VolumeFlowPerRatedTotalCapacity=[" + - RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + "--" + - RoundSigDigits(MaxHeatVolFlowPerRatedTotCap(DXCT), 3) + "] Current value is " + - RoundSigDigits(VolFlowperRatedTotCap, 3) + " m3/s/W"); + ShowContinueError(state, + format("Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}] Current value is {:.3R} m3/s/W", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxHeatVolFlowPerRatedTotCap(DXCT), + VolFlowperRatedTotCap)); ShowContinueError(state, "Possible causes include inconsistent air flow rates in system components or"); ShowContinueError(state, "inconsistent supply air fan operation modes in coil and unitary system objects."); } - ShowRecurringWarningErrorAtEnd(state, - DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Air volume flow rate per watt of rated total heating capacity is out of range at speed " + - TrimSigDigits(SpeedNumHS) + " error continues...", - DXCoil(DXCoilNum).MSErrIndex(SpeedNumHS), - VolFlowperRatedTotCap, - VolFlowperRatedTotCap); + ShowRecurringWarningErrorAtEnd(state, format("{} \"{}\" - Air volume flow rate per watt of rated total heating capacity is out of range " + "at speed {} error continues...", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + SpeedNumHS), + DXCoil(DXCoilNum).MSErrIndex(SpeedNumHS), + VolFlowperRatedTotCap, + VolFlowperRatedTotCap); } // Get total capacity modifying factor (function of temperature) for off-rated conditions @@ -12867,8 +13050,12 @@ namespace DXCoils { if (PLF < 0.7) { if (DXCoil(DXCoilNum).PLRErrIndex == 0) { - ShowWarningMessage(state, "The PLF curve value at high speed for DX multispeed heating coil " + DXCoil(DXCoilNum).Name + " =" + - RoundSigDigits(PLF, 2) + " for part-load ratio =" + RoundSigDigits(PLRHeating, 2)); + ShowWarningMessage( + state, + format("The PLF curve value at high speed for DX multispeed heating coil {} ={:.2R} for part-load ratio ={:.2R}", + DXCoil(DXCoilNum).Name, + PLF, + PLRHeating)); ShowContinueError(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:DX:MultiSpeed]."); ShowContinueErrorTimeStamp(state, ""); @@ -12880,8 +13067,10 @@ namespace DXCoils { DXCoil(DXCoilNum).HeatingCoilRuntimeFraction = (PLRHeating / PLF); if (DXCoil(DXCoilNum).HeatingCoilRuntimeFraction > 1.0 && std::abs(DXCoil(DXCoilNum).HeatingCoilRuntimeFraction - 1.0) > 0.001) { if (DXCoil(DXCoilNum).ErrIndex4 == 0) { - ShowWarningMessage(state, "The runtime fraction at high speed for DX multispeed heating coil " + DXCoil(DXCoilNum).Name + - " exceeded 1.0. [" + RoundSigDigits(DXCoil(DXCoilNum).HeatingCoilRuntimeFraction, 4) + "]."); + ShowWarningMessage(state, + format("The runtime fraction at high speed for DX multispeed heating coil {} exceeded 1.0. [{:.4R}].", + DXCoil(DXCoilNum).Name, + DXCoil(DXCoilNum).HeatingCoilRuntimeFraction)); ShowContinueError(state, "Runtime fraction is set to 1.0 and the simulation continues..."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:DX:SingleSpeed]."); ShowContinueErrorTimeStamp(state, ""); @@ -12984,10 +13173,11 @@ namespace DXCoils { ShowWarningMessage(state, DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + "\" - Air volume flow rate per watt of rated total heating capacity is out of range at speed 1."); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Expected range for VolumeFlowPerRatedTotalCapacity=[" + - RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT), 3) + "--" + - RoundSigDigits(MaxHeatVolFlowPerRatedTotCap(DXCT), 3) + "] Current value is " + - RoundSigDigits(VolFlowperRatedTotCap, 3) + " m3/s/W"); + ShowContinueError(state, + format("Expected range for VolumeFlowPerRatedTotalCapacity=[{:.3R}--{:.3R}] Current value is {:.3R} m3/s/W", + MinOperVolFlowPerRatedTotCap(DXCT), + MaxHeatVolFlowPerRatedTotCap(DXCT), + VolFlowperRatedTotCap)); ShowContinueError(state, "Possible causes include inconsistent air flow rates in system components or"); ShowContinueError(state, "inconsistent supply air fan operation modes in coil and unitary system objects."); } @@ -13096,8 +13286,8 @@ namespace DXCoils { PLF = CurveValue(state, DXCoil(DXCoilNum).MSPLFFPLR(1), PLRHeating); // Calculate part-load factor if (FanOpMode == CycFanCycCoil && CycRatio == 1.0 && PLF != 1.0) { if (DXCoil(DXCoilNum).PLFErrIndex == 0) { - ShowWarningMessage(state, "The PLF curve value for DX heating coil " + DXCoil(DXCoilNum).Name + " =" + RoundSigDigits(PLF, 2) + - " for part-load ratio = 1"); + ShowWarningMessage( + state, format("The PLF curve value for DX heating coil {} ={:.2R} for part-load ratio = 1", DXCoil(DXCoilNum).Name, PLF)); ShowContinueError(state, "PLF curve value must be = 1.0 and has been reset to 1.0. Simulation is continuing."); ShowContinueErrorTimeStamp(state, ""); } @@ -13110,8 +13300,11 @@ namespace DXCoils { if (PLF < 0.7) { if (DXCoil(DXCoilNum).PLRErrIndex == 0) { - ShowWarningMessage(state, "The PLF curve value for DX heating coil " + DXCoil(DXCoilNum).Name + " =" + RoundSigDigits(PLF, 2) + - " for part-load ratio =" + RoundSigDigits(PLRHeating, 2)); + ShowWarningMessage(state, + format("The PLF curve value for DX heating coil {} ={:.2R} for part-load ratio ={:.2R}", + DXCoil(DXCoilNum).Name, + PLF, + PLRHeating)); ShowContinueError(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:DX:SingleSpeed]."); ShowContinueErrorTimeStamp(state, ""); @@ -13123,8 +13316,10 @@ namespace DXCoils { DXCoil(DXCoilNum).HeatingCoilRuntimeFraction = (PLRHeating / PLF); if (DXCoil(DXCoilNum).HeatingCoilRuntimeFraction > 1.0 && std::abs(DXCoil(DXCoilNum).HeatingCoilRuntimeFraction - 1.0) > 0.001) { if (DXCoil(DXCoilNum).ErrIndex4 == 0) { - ShowWarningMessage(state, "The runtime fraction for DX heating coil " + DXCoil(DXCoilNum).Name + " exceeded 1.0. [" + - RoundSigDigits(DXCoil(DXCoilNum).HeatingCoilRuntimeFraction, 4) + "]."); + ShowWarningMessage(state, + format("The runtime fraction for DX heating coil {} exceeded 1.0. [{:.4R}].", + DXCoil(DXCoilNum).Name, + DXCoil(DXCoilNum).HeatingCoilRuntimeFraction)); ShowContinueError(state, "Runtime fraction is set to 1.0 and the simulation continues..."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:DX:SingleSpeed]."); ShowContinueErrorTimeStamp(state, ""); @@ -13419,7 +13614,7 @@ namespace DXCoils { // Using/Aliasing using CurveManager::CurveValue; using DataEnvironment::OutBaroPress; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; using namespace OutputReportPredefined; @@ -14991,7 +15186,6 @@ namespace DXCoils { // Also, this is an illustration of setting Data from an outside source. // Using/Aliasing - using General::TrimSigDigits; // Obtains and Allocates DXCoils if (GetCoilsInputFlag) { @@ -15000,8 +15194,9 @@ namespace DXCoils { } if (DXCoilNum <= 0 || DXCoilNum > NumDXCoils) { - ShowSevereError(state, "SetDXCoolingCoilData: called with DX Cooling Coil Number out of range=" + TrimSigDigits(DXCoilNum) + - " should be >0 and <" + TrimSigDigits(NumDXCoils)); + ShowSevereError( + state, + format("SetDXCoolingCoilData: called with DX Cooling Coil Number out of range={} should be >0 and <{}", DXCoilNum, NumDXCoils)); ErrorsFound = true; return; } @@ -15673,8 +15868,7 @@ namespace DXCoils { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; - using General::TrimSigDigits; + using HVACVariableRefrigerantFlow::OACompOffMassFlow; using HVACVariableRefrigerantFlow::OACompOnMassFlow; using namespace HVACVariableRefrigerantFlow; @@ -15849,8 +16043,9 @@ namespace DXCoils { ShowWarningMessage(state, DXCoil(DXCoilNum).LowOutTempBuffer1); ShowContinueError(state, DXCoil(DXCoilNum).LowOutTempBuffer2); ShowContinueError(state, "... Possible reasons for low outlet air dry-bulb temperatures are: This DX coil"); - ShowContinueError(state, " 1) may have a low inlet air dry-bulb temperature. Inlet air temperature = " + - TrimSigDigits(DXCoil(DXCoilNum).FullLoadInletAirTempLast, 3) + " C."); + ShowContinueError(state, + format(" 1) may have a low inlet air dry-bulb temperature. Inlet air temperature = {:.3T} C.", + DXCoil(DXCoilNum).FullLoadInletAirTempLast)); ShowContinueError(state, " 2) may have a low air flow rate per watt of cooling capacity. Check inputs."); ShowContinueError(state, " 3) is used as part of a HX assisted cooling coil which uses a high sensible effectiveness. Check inputs."); } @@ -15979,8 +16174,11 @@ namespace DXCoils { if (PLF < 0.7) { if (DXCoil(DXCoilNum).ErrIndex2 == 0) { - ShowWarningMessage(state, "The PLF curve value for the DX cooling coil " + DXCoil(DXCoilNum).Name + " =" + RoundSigDigits(PLF, 3) + - " for part-load ratio =" + RoundSigDigits(PartLoadRatio, 3)); + ShowWarningMessage(state, + format("The PLF curve value for the DX cooling coil {} ={:.3R} for part-load ratio ={:.3R}", + DXCoil(DXCoilNum).Name, + PLF, + PartLoadRatio)); ShowContinueErrorTimeStamp(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Cooling:DX:SingleSpeed]."); } @@ -15993,8 +16191,10 @@ namespace DXCoils { DXCoil(DXCoilNum).CoolingCoilRuntimeFraction = CompCycRatio / PLF; if (DXCoil(DXCoilNum).CoolingCoilRuntimeFraction > 1.0 && std::abs(DXCoil(DXCoilNum).CoolingCoilRuntimeFraction - 1.0) > 0.001) { if (DXCoil(DXCoilNum).ErrIndex3 == 0) { - ShowWarningMessage(state, "The runtime fraction for DX cooling coil " + DXCoil(DXCoilNum).Name + " exceeded 1.0. [" + - RoundSigDigits(DXCoil(DXCoilNum).CoolingCoilRuntimeFraction, 4) + "]."); + ShowWarningMessage(state, + format("The runtime fraction for DX cooling coil {} exceeded 1.0. [{:.4R}].", + DXCoil(DXCoilNum).Name, + DXCoil(DXCoilNum).CoolingCoilRuntimeFraction)); ShowContinueError(state, "Runtime fraction reset to 1 and the simulation will continue."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Cooling:DX:SingleSpeed]."); ShowContinueErrorTimeStamp(state, ""); @@ -16030,10 +16230,11 @@ namespace DXCoils { DXCoil(DXCoilNum).FullLoadOutAirTempLast = OutletAirTemp; if (DXCoil(DXCoilNum).LowOutletTempIndex == 0) { DXCoil(DXCoilNum).FullLoadInletAirTempLast = InletAirDryBulbTemp; - DXCoil(DXCoilNum).LowOutTempBuffer1 = DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + - "\" - Full load outlet air dry-bulb temperature < 2C. This indicates the possibility of " - "coil frost/freeze. Outlet temperature = " + - RoundSigDigits(OutletAirTemp, 2) + " C."; + DXCoil(DXCoilNum).LowOutTempBuffer1 = format("{} \"{}\" - Full load outlet air dry-bulb temperature < 2C. This indicates the " + "possibility of coil frost/freeze. Outlet temperature = {:.2R} C.", + DXCoil(DXCoilNum).DXCoilType, + DXCoil(DXCoilNum).Name, + OutletAirTemp); DXCoil(DXCoilNum).LowOutTempBuffer2 = " ...Occurrence info = " + EnvironmentName + ", " + CurMnDy + " " + CreateSysTimeIntervalString(state); } @@ -16121,7 +16322,7 @@ namespace DXCoils { // Using/Aliasing using CurveManager::CurveValue; - using General::RoundSigDigits; + using HVACVariableRefrigerantFlow::OACompOffMassFlow; using HVACVariableRefrigerantFlow::OACompOnMassFlow; using namespace HVACVariableRefrigerantFlow; @@ -16307,8 +16508,11 @@ namespace DXCoils { if (PLF < 0.7) { if (DXCoil(DXCoilNum).PLRErrIndex == 0) { - ShowWarningMessage(state, "The PLF curve value for DX heating coil " + DXCoil(DXCoilNum).Name + " =" + RoundSigDigits(PLF, 2) + - " for part-load ratio =" + RoundSigDigits(PLRHeating, 2)); + ShowWarningMessage(state, + format("The PLF curve value for DX heating coil {} ={:.2R} for part-load ratio ={:.2R}", + DXCoil(DXCoilNum).Name, + PLF, + PLRHeating)); ShowContinueError(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and simulation is continuing."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:DX:SingleSpeed]."); ShowContinueErrorTimeStamp(state, ""); @@ -16320,8 +16524,10 @@ namespace DXCoils { DXCoil(DXCoilNum).HeatingCoilRuntimeFraction = (PLRHeating / PLF); if (DXCoil(DXCoilNum).HeatingCoilRuntimeFraction > 1.0 && std::abs(DXCoil(DXCoilNum).HeatingCoilRuntimeFraction - 1.0) > 0.001) { if (DXCoil(DXCoilNum).ErrIndex4 == 0) { - ShowWarningMessage(state, "The runtime fraction for DX heating coil " + DXCoil(DXCoilNum).Name + " exceeded 1.0. [" + - RoundSigDigits(DXCoil(DXCoilNum).HeatingCoilRuntimeFraction, 4) + "]."); + ShowWarningMessage(state, + format("The runtime fraction for DX heating coil {} exceeded 1.0. [{:.4R}].", + DXCoil(DXCoilNum).Name, + DXCoil(DXCoilNum).HeatingCoilRuntimeFraction)); ShowContinueError(state, "Runtime fraction is set to 1.0 and the simulation continues..."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:DX:SingleSpeed]."); ShowContinueErrorTimeStamp(state, ""); diff --git a/src/EnergyPlus/DataEnvironment.cc b/src/EnergyPlus/DataEnvironment.cc index 7421de17b48..636ee9ad9d2 100644 --- a/src/EnergyPlus/DataEnvironment.cc +++ b/src/EnergyPlus/DataEnvironment.cc @@ -370,7 +370,6 @@ namespace DataEnvironment { // 1976 U.S. Standard Atmosphere. 1976. U.S. Government Printing Office, Washington, D.C. // Using/Aliasing - using General::RoundSigDigits; // Return value Real64 LocalOutDryBulbTemp; // Return result for function (C) @@ -393,7 +392,7 @@ namespace DataEnvironment { if (LocalOutDryBulbTemp < -100.0) { ShowSevereError(state, "OutDryBulbTempAt: outdoor drybulb temperature < -100 C"); - ShowContinueError(state, "...check heights, this height=[" + RoundSigDigits(Z, 0) + "]."); + ShowContinueError(state, format("...check heights, this height=[{:.0R}].", Z)); ShowFatalError(state, "Program terminates due to preceding condition(s)."); } @@ -419,7 +418,6 @@ namespace DataEnvironment { // 1976 U.S. Standard Atmosphere. 1976. U.S. Government Printing Office, Washington, D.C. // Using/Aliasing - using General::RoundSigDigits; // Return value Real64 LocalOutWetBulbTemp; // Return result for function (C) @@ -442,7 +440,7 @@ namespace DataEnvironment { if (LocalOutWetBulbTemp < -100.0) { ShowSevereError(state, "OutWetBulbTempAt: outdoor wetbulb temperature < -100 C"); - ShowContinueError(state, "...check heights, this height=[" + RoundSigDigits(Z, 0) + "]."); + ShowContinueError(state, format("...check heights, this height=[{:.0R}].", Z)); ShowFatalError(state, "Program terminates due to preceding condition(s)."); } @@ -469,7 +467,6 @@ namespace DataEnvironment { // 1976 U.S. Standard Atmosphere. 1976. U.S. Government Printing Office, Washington, D.C. // Using/Aliasing - using General::RoundSigDigits; // Return value Real64 LocalOutDewPointTemp; // Return result for function (C) @@ -492,7 +489,7 @@ namespace DataEnvironment { if (LocalOutDewPointTemp < -100.0) { ShowSevereError(state, "OutDewPointTempAt: outdoor dewpoint temperature < -100 C"); - ShowContinueError(state, "...check heights, this height=[" + RoundSigDigits(Z, 0) + "]."); + ShowContinueError(state, format("...check heights, this height=[{:.0R}].", Z)); ShowFatalError(state, "Program terminates due to preceding condition(s)."); } @@ -589,10 +586,9 @@ namespace DataEnvironment { void SetOutBulbTempAt_error(EnergyPlusData &state, std::string const &Settings, Real64 const max_height, std::string const &SettingsName) { // Using/Aliasing - using General::RoundSigDigits; ShowSevereError(state, "SetOutBulbTempAt: " + Settings + " Outdoor Temperatures < -100 C"); - ShowContinueError(state, "...check " + Settings + " Heights - Maximum " + Settings + " Height=[" + RoundSigDigits(max_height, 0) + "]."); + ShowContinueError(state, format("...check {} Heights - Maximum {} Height=[{:.0R}].", Settings, Settings, max_height)); if (max_height >= 20000.0) { ShowContinueError(state, "...according to your maximum Z height, your building is somewhere in the Stratosphere."); ShowContinueError(state, "...look at " + Settings + " Name= " + SettingsName); diff --git a/src/EnergyPlus/DataHeatBalance.cc b/src/EnergyPlus/DataHeatBalance.cc index 0368b3872ea..45aa8029e4b 100644 --- a/src/EnergyPlus/DataHeatBalance.cc +++ b/src/EnergyPlus/DataHeatBalance.cc @@ -1783,7 +1783,6 @@ namespace DataHeatBalance { // na // Using/Aliasing - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1829,8 +1828,10 @@ namespace DataHeatBalance { if (Blind(TotBlinds).MaxSlatAngle < Blind(TotBlinds).MinSlatAngle) { errFlag = true; ShowSevereError(state, "WindowMaterial:Blind=\"" + Blind(inBlindNumber).Name + "\", Illegal value combination."); - ShowContinueError(state, "Minimum Slat Angle=[" + RoundSigDigits(Blind(TotBlinds).MinSlatAngle, 1) + - "], is greater than Maximum Slat Angle=[" + RoundSigDigits(Blind(TotBlinds).MaxSlatAngle, 1) + "] deg."); + ShowContinueError(state, + format("Minimum Slat Angle=[{:.1R}], is greater than Maximum Slat Angle=[{:.1R}] deg.", + Blind(TotBlinds).MinSlatAngle, + Blind(TotBlinds).MaxSlatAngle)); } // Error if input slat angle not in input min/max range @@ -1839,19 +1840,23 @@ namespace DataHeatBalance { (Blind(TotBlinds).SlatAngle < Blind(TotBlinds).MinSlatAngle || Blind(TotBlinds).SlatAngle > Blind(TotBlinds).MaxSlatAngle)) { errFlag = true; ShowSevereError(state, "WindowMaterial:Blind=\"" + Blind(inBlindNumber).Name + "\", Illegal value combination."); - ShowContinueError(state, "Slat Angle=[" + RoundSigDigits(Blind(TotBlinds).SlatAngle, 1) + "] is outside of the input min/max range, min=[" + - RoundSigDigits(Blind(TotBlinds).MinSlatAngle, 1) + "], max=[" + RoundSigDigits(Blind(TotBlinds).MaxSlatAngle, 1) + - "] deg."); + ShowContinueError(state, + format("Slat Angle=[{:.1R}] is outside of the input min/max range, min=[{:.1R}], max=[{:.1R}] deg.", + Blind(TotBlinds).SlatAngle, + Blind(TotBlinds).MinSlatAngle, + Blind(TotBlinds).MaxSlatAngle)); } // Warning if input minimum slat angle is less than that allowed by slat geometry if (Blind(TotBlinds).MinSlatAngle < MinSlatAngGeom) { ShowWarningError(state, "WindowMaterial:Blind=\"" + Blind(inBlindNumber).Name + "\", Illegal value combination."); - ShowContinueError(state, "Minimum Slat Angle=[" + RoundSigDigits(Blind(TotBlinds).MinSlatAngle, 1) + - "] is less than the smallest allowed by slat dimensions and spacing, min=[" + RoundSigDigits(MinSlatAngGeom, 1) + - "] deg."); - ShowContinueError(state, "Minimum Slat Angle will be set to " + RoundSigDigits(MinSlatAngGeom, 1) + " deg."); + ShowContinueError( + state, + format("Minimum Slat Angle=[{:.1R}] is less than the smallest allowed by slat dimensions and spacing, min=[{:.1R}] deg.", + Blind(TotBlinds).MinSlatAngle, + MinSlatAngGeom)); + ShowContinueError(state, format("Minimum Slat Angle will be set to {:.1R} deg.", MinSlatAngGeom)); Blind(TotBlinds).MinSlatAngle = MinSlatAngGeom; } @@ -1859,10 +1864,12 @@ namespace DataHeatBalance { if (Blind(TotBlinds).MaxSlatAngle > MaxSlatAngGeom) { ShowWarningError(state, "WindowMaterial:Blind=\"" + Blind(inBlindNumber).Name + "\", Illegal value combination."); - ShowContinueError(state, "Maximum Slat Angle=[" + RoundSigDigits(Blind(TotBlinds).MaxSlatAngle, 1) + - "] is greater than the largest allowed by slat dimensions and spacing, [" + RoundSigDigits(MaxSlatAngGeom, 1) + - "] deg."); - ShowContinueError(state, "Maximum Slat Angle will be set to " + RoundSigDigits(MaxSlatAngGeom, 1) + " deg."); + ShowContinueError( + state, + format("Maximum Slat Angle=[{:.1R}] is greater than the largest allowed by slat dimensions and spacing, [{:.1R}] deg.", + Blind(TotBlinds).MaxSlatAngle, + MaxSlatAngGeom)); + ShowContinueError(state, format("Maximum Slat Angle will be set to {:.1R} deg.", MaxSlatAngGeom)); Blind(TotBlinds).MaxSlatAngle = MaxSlatAngGeom; } } else { diff --git a/src/EnergyPlus/DataRuntimeLanguage.cc b/src/EnergyPlus/DataRuntimeLanguage.cc index f4e2addaee8..e2f68a60268 100644 --- a/src/EnergyPlus/DataRuntimeLanguage.cc +++ b/src/EnergyPlus/DataRuntimeLanguage.cc @@ -462,8 +462,8 @@ namespace DataRuntimeLanguage { } // pos=SCAN(cFieldValue(1:1),InvalidStartCharacters) // IF (pos > 0) THEN - // CALL ShowSevereError(TRIM(cModuleObject)//'="'//TRIM(cFieldValue)//'", Invalid variable name entered.') - // CALL ShowContinueError('...'//TRIM(cFieldName)//'; Names used as EMS variables cannot start with numeric characters.') + // CALL ShowSevereError(state, TRIM(cModuleObject)//'="'//TRIM(cFieldValue)//'", Invalid variable name entered.') + // CALL ShowContinueError(state, '...'//TRIM(cFieldName)//'; Names used as EMS variables cannot start with numeric characters.') // errFlag=.TRUE. // ErrorsFound = .TRUE. // ENDIF diff --git a/src/EnergyPlus/DataSurfaceLists.cc b/src/EnergyPlus/DataSurfaceLists.cc index 9ceb2119941..ad93d4765b5 100644 --- a/src/EnergyPlus/DataSurfaceLists.cc +++ b/src/EnergyPlus/DataSurfaceLists.cc @@ -123,7 +123,6 @@ namespace EnergyPlus::DataSurfaceLists { // Using/Aliasing using namespace DataSurfaces; using DataHeatBalance::Zone; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: constexpr auto CurrentModuleObject1("ZoneHVAC:LowTemperatureRadiant:SurfaceGroup"); @@ -237,8 +236,10 @@ namespace EnergyPlus::DataSurfaceLists { if (SurfList(Item).SurfFlowFrac(SurfNum) < SurfListMinFlowFrac) { ShowSevereError(state, "The Flow Fraction for Surface " + SurfList(Item).SurfName(SurfNum) + " in Surface Group " + SurfList(Item).Name + " is too low"); - ShowContinueError(state, "Flow fraction of " + RoundSigDigits(SurfList(Item).SurfFlowFrac(SurfNum), 6) + - " is less than minimum criteria = " + RoundSigDigits(SurfListMinFlowFrac, 6)); + ShowContinueError(state, + format("Flow fraction of {:.6R} is less than minimum criteria = {:.6R}", + SurfList(Item).SurfFlowFrac(SurfNum), + SurfListMinFlowFrac)); ShowContinueError(state, "Zero or extremely low flow fractions are not allowed. Remove this surface from the surface group or " "combine small surfaces together."); ErrorsFound = true; diff --git a/src/EnergyPlus/DataTimings.cc b/src/EnergyPlus/DataTimings.cc index 1df7a9ce877..a4dc612903d 100644 --- a/src/EnergyPlus/DataTimings.cc +++ b/src/EnergyPlus/DataTimings.cc @@ -266,6 +266,24 @@ namespace DataTimings { // METHODOLOGY EMPLOYED: // structure similar to recurring error structure. + // REFERENCES: + // na + + // Using/Aliasing + + // Locals + // SUBROUTINE ARGUMENT DEFINITIONS: + + // SUBROUTINE PARAMETER DEFINITIONS: + + // INTERFACE BLOCK SPECIFICATIONS: + // na + + // DERIVED TYPE DEFINITIONS: + // na + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + #ifdef EP_NO_Timings return; #endif diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index 3aeec075e7f..811480aa89c 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -280,8 +279,7 @@ namespace DataZoneEquipment { using namespace DataHVACGlobals; using BranchNodeConnections::SetUpCompSets; using namespace DataLoopNode; - using General::RoundSigDigits; - using General::TrimSigDigits; + using namespace ScheduleManager; // SUBROUTINE PARAMETER DEFINITIONS: @@ -399,15 +397,19 @@ namespace DataZoneEquipment { UniqueZoneEquipListNames.reserve(state.dataGlobal->NumOfZones); if (NumOfZoneEquipLists != NumOfControlledZones) { - ShowSevereError(state, RoutineName + "Number of Zone Equipment lists [" + TrimSigDigits(NumOfZoneEquipLists) + - "] not equal Number of Controlled Zones [" + TrimSigDigits(NumOfControlledZones) + ']'); + ShowSevereError(state, + format("{}Number of Zone Equipment lists [{}] not equal Number of Controlled Zones [{}]", + RoutineName, + NumOfZoneEquipLists, + NumOfControlledZones)); ShowContinueError(state, "..Each Controlled Zone [ZoneHVAC:EquipmentConnections] must have a corresponding (unique) ZoneHVAC:EquipmentList"); ShowFatalError(state, "GetZoneEquipment: Incorrect number of zone equipment lists"); } if (NumOfControlledZones > state.dataGlobal->NumOfZones) { - ShowSevereError(state, RoutineName + "Number of Controlled Zone objects [" + TrimSigDigits(NumOfControlledZones) + - "] greater than Number of Zones [" + TrimSigDigits(state.dataGlobal->NumOfZones) + ']'); + ShowSevereError( + state, + format("{}Number of Controlled Zone objects [{}] greater than Number of Zones [{}]", RoutineName, NumOfControlledZones, state.dataGlobal->NumOfZones)); ShowFatalError(state, RoutineName + "Too many ZoneHVAC:EquipmentConnections objects."); } @@ -555,8 +557,12 @@ namespace DataZoneEquipment { ++maxEquipCount; continue; } - ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + thisZoneEquipList.Name + - "\", truncated list at blank field; object count=" + RoundSigDigits(maxEquipCount)); + ShowWarningError(state, + format("{}{}=\"{}\", truncated list at blank field; object count={}", + RoutineName, + CurrentModuleObject, + thisZoneEquipList.Name, + maxEquipCount)); break; } @@ -601,11 +607,13 @@ namespace DataZoneEquipment { if ((thisZoneEquipList.CoolingPriority(ZoneEquipTypeNum) < 0) || (thisZoneEquipList.CoolingPriority(ZoneEquipTypeNum) > thisZoneEquipList.NumOfEquipTypes)) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphArray(1) + "\"."); - ShowContinueError(state, "invalid " + cNumericFields(nNumsInExtensible * ZoneEquipTypeIdx + nNumsBeforeExtensible + 1) + "=[" + - RoundSigDigits(thisZoneEquipList.CoolingPriority(ZoneEquipTypeNum)) + "]."); + ShowContinueError(state, + format("invalid {}=[{}].", + cNumericFields(nNumsInExtensible * ZoneEquipTypeIdx + nNumsBeforeExtensible + 1), + thisZoneEquipList.CoolingPriority(ZoneEquipTypeNum))); ShowContinueError(state, "equipment sequence must be > 0 and <= number of equipments in the list."); if (thisZoneEquipList.CoolingPriority(ZoneEquipTypeNum) > 0) - ShowContinueError(state, "only " + RoundSigDigits(thisZoneEquipList.NumOfEquipTypes) + " in the list."); + ShowContinueError(state, format("only {} in the list.", thisZoneEquipList.NumOfEquipTypes)); GetZoneEquipmentDataErrorsFound = true; } @@ -613,11 +621,13 @@ namespace DataZoneEquipment { if ((thisZoneEquipList.HeatingPriority(ZoneEquipTypeNum) < 0) || (thisZoneEquipList.HeatingPriority(ZoneEquipTypeNum) > thisZoneEquipList.NumOfEquipTypes)) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphArray(1) + "\"."); - ShowContinueError(state, "invalid " + cNumericFields(nNumsInExtensible * ZoneEquipTypeIdx + nNumsBeforeExtensible + 2) + "=[" + - RoundSigDigits(thisZoneEquipList.HeatingPriority(ZoneEquipTypeNum)) + "]."); + ShowContinueError(state, + format("invalid {}=[{}].", + cNumericFields(nNumsInExtensible * ZoneEquipTypeIdx + nNumsBeforeExtensible + 2), + thisZoneEquipList.HeatingPriority(ZoneEquipTypeNum))); ShowContinueError(state, "equipment sequence must be > 0 and <= number of equipments in the list."); if (thisZoneEquipList.HeatingPriority(ZoneEquipTypeNum) > 0) - ShowContinueError(state, "only " + RoundSigDigits(thisZoneEquipList.NumOfEquipTypes) + " in the list."); + ShowContinueError(state, format("only {} in the list.", thisZoneEquipList.NumOfEquipTypes)); GetZoneEquipmentDataErrorsFound = true; } @@ -769,24 +779,31 @@ namespace DataZoneEquipment { for (ZoneEquipTypeNum = 1; ZoneEquipTypeNum <= thisZoneEquipList.NumOfEquipTypes; ++ZoneEquipTypeNum) { if (count_eq(thisZoneEquipList.CoolingPriority, ZoneEquipTypeNum) > 1) { ShowSevereError(state, RoutineName + CurrentModuleObject + " = " + thisZoneEquipList.Name); - ShowContinueError(state, "...multiple assignments for Zone Equipment Cooling Sequence=" + RoundSigDigits(ZoneEquipTypeNum) + - ", must be 1-1 correspondence between sequence assignments and number of equipments."); + ShowContinueError(state, + format("...multiple assignments for Zone Equipment Cooling Sequence={}, must be 1-1 correspondence between " + "sequence assignments and number of equipments.", + ZoneEquipTypeNum)); GetZoneEquipmentDataErrorsFound = true; } else if (count_eq(thisZoneEquipList.CoolingPriority, ZoneEquipTypeNum) == 0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " = " + thisZoneEquipList.Name); - ShowContinueError(state, "...zero assigned to Zone Equipment Cooling Sequence=" + RoundSigDigits(ZoneEquipTypeNum) + - ", apparent gap in sequence assignments in this equipment list."); + ShowContinueError(state, + format("...zero assigned to Zone Equipment Cooling Sequence={}, apparent gap in sequence assignments in " + "this equipment list.", + ZoneEquipTypeNum)); } if (count_eq(thisZoneEquipList.HeatingPriority, ZoneEquipTypeNum) > 1) { ShowSevereError(state, RoutineName + CurrentModuleObject + " = " + thisZoneEquipList.Name); ShowContinueError(state, - "...multiple assignments for Zone Equipment Heating or No-Load Sequence=" + RoundSigDigits(ZoneEquipTypeNum) + - ", must be 1-1 correspondence between sequence assignments and number of equipments."); + format("...multiple assignments for Zone Equipment Heating or No-Load Sequence={}, must be 1-1 " + "correspondence between sequence assignments and number of equipments.", + ZoneEquipTypeNum)); GetZoneEquipmentDataErrorsFound = true; } else if (count_eq(thisZoneEquipList.HeatingPriority, ZoneEquipTypeNum) == 0) { ShowWarningError(state, RoutineName + CurrentModuleObject + " = " + thisZoneEquipList.Name); - ShowContinueError(state, "...zero assigned to Zone Equipment Heating or No-Load Sequence=" + RoundSigDigits(ZoneEquipTypeNum) + - ", apparent gap in sequence assignments in this equipment list."); + ShowContinueError(state, + format("...zero assigned to Zone Equipment Heating or No-Load Sequence={}, apparent gap in sequence " + "assignments in this equipment list.", + ZoneEquipTypeNum)); } } @@ -1378,8 +1395,10 @@ namespace DataZoneEquipment { ReturnAirNodeNumber = thisZoneEquip.ReturnNode(1); if (thisZoneEquip.NumReturnNodes > 1) { ShowWarningError(state, "GetReturnAirNodeForZone: " + calledFromDescription + ", request for zone return node is ambiguous."); - ShowContinueError(state, "Zone=" + thisZoneEquip.ZoneName + " has " + General::RoundSigDigits(thisZoneEquip.NumReturnNodes) + - " return nodes. First return node will be used."); + ShowContinueError(state, + format("Zone={} has {} return nodes. First return node will be used.", + thisZoneEquip.ZoneName, + thisZoneEquip.NumReturnNodes)); } } else { for (int nodeCount = 1; nodeCount <= thisZoneEquip.NumReturnNodes; ++nodeCount) { @@ -1486,7 +1505,7 @@ namespace DataZoneEquipment { using DataSizing::ZOAM_IAQP; using DataSizing::ZOAM_ProportionalControlDesOcc; using DataSizing::ZOAM_ProportionalControlSchOcc; - using General::RoundSigDigits; + using ScheduleManager::GetCurrentScheduleValue; using ScheduleManager::GetScheduleMaxValue; @@ -1703,11 +1722,12 @@ namespace DataZoneEquipment { if (OARequirements(DSOAPtr).CO2MaxMinLimitErrorCount < 2) { ShowSevereError(state, "CalcDesignSpecificationOutdoorAir DesignSpecification:OutdoorAir = \"" + OARequirements(DSOAPtr).Name + "\"."); - ShowContinueError(state, "For System Outdoor Air Method = ProportionalControlBasedonOccupancySchedule, maximum " - "target CO2 concentration (" + - RoundSigDigits(ZoneMaxCO2, 2) + - "), is not greater than minimum target CO2 concentration (" + - RoundSigDigits(ZoneMinCO2, 2) + ")."); + ShowContinueError( + state, + format("For System Outdoor Air Method = ProportionalControlBasedonOccupancySchedule, maximum target " + "CO2 concentration ({:.2R}), is not greater than minimum target CO2 concentration ({:.2R}).", + ZoneMaxCO2, + ZoneMinCO2)); ShowContinueError(state, "\"ProportionalControlBasedonOccupancySchedule\" will not be modeled. Default " "\"Flow/Person+Flow/Area\" will be modeled. Simulation continues..."); ShowContinueErrorTimeStamp(state, ""); @@ -1723,11 +1743,12 @@ namespace DataZoneEquipment { if (OARequirements(DSOAPtr).CO2MaxMinLimitErrorCount < 2) { ShowSevereError(state, "CalcDesignSpecificationOutdoorAir DesignSpecification:OutdoorAir = \"" + OARequirements(DSOAPtr).Name + "\"."); - ShowContinueError(state, "For System Outdoor Air Method = ProportionalControlBasedonDesignOccupancy, maximum " - "target CO2 concentration (" + - RoundSigDigits(ZoneMaxCO2, 2) + - "), is not greater than minimum target CO2 concentration (" + - RoundSigDigits(ZoneMinCO2, 2) + ")."); + ShowContinueError( + state, + format("For System Outdoor Air Method = ProportionalControlBasedonDesignOccupancy, maximum target " + "CO2 concentration ({:.2R}), is not greater than minimum target CO2 concentration ({:.2R}).", + ZoneMaxCO2, + ZoneMinCO2)); ShowContinueError(state, "\"ProportionalControlBasedonDesignOccupancy\" will not be modeled. Default " "\"Flow/Person+Flow/Area\" will be modeled. Simulation continues..."); ShowContinueErrorTimeStamp(state, ""); diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index e6a3f873a2d..483ab2004d8 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -219,7 +219,6 @@ namespace DaylightingDevices { // Using/Aliasing using DataHeatBalance::IntGainTypeOf_DaylightingDeviceTubular; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: na @@ -428,10 +427,14 @@ namespace DaylightingDevices { if (Shelf(ShelfNum).ViewFactor < 0) CalcViewFactorToShelf(state, ShelfNum); if (Shelf(ShelfNum).ViewFactor + Surface(WinSurf).ViewFactorSky + Surface(WinSurf).ViewFactorGround > 1.0) { - ShowWarningError(state, "DaylightingDevice:Shelf = " + Shelf(ShelfNum).Name + ": Window view factors to sky [" + - RoundSigDigits(Surface(WinSurf).ViewFactorSky, 2) + "],"); - ShowContinueError(state, "ground [" + RoundSigDigits(Surface(WinSurf).ViewFactorGround, 2) + "], and outside shelf [" + - RoundSigDigits(Shelf(ShelfNum).ViewFactor, 2) + "] add up to > 1.0."); + ShowWarningError(state, + format("DaylightingDevice:Shelf = {}: Window view factors to sky [{:.2R}],", + Shelf(ShelfNum).Name, + Surface(WinSurf).ViewFactorSky)); + ShowContinueError(state, + format("ground [{:.2R}], and outside shelf [{:.2R}] add up to > 1.0.", + Surface(WinSurf).ViewFactorGround, + Shelf(ShelfNum).ViewFactor)); } // Report calculated view factor so that user knows what to make the view factor to ground @@ -480,7 +483,7 @@ namespace DaylightingDevices { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using General::SafeDivide; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -599,8 +602,9 @@ namespace DaylightingDevices { if (state.dataConstruction->Construct(Surface(SurfNum).Construction).TransDiff <= 1.0e-10) { ShowSevereError(state, cCurrentModuleObject + " = " + cAlphaArgs(1) + ": Diffuser " + cAlphaArgs(3) + " construction (" + state.dataConstruction->Construct(Surface(SurfNum).Construction).Name + ") invalid value."); - ShowContinueError(state, "Diffuse solar transmittance of construction [" + - RoundSigDigits(state.dataConstruction->Construct(Surface(SurfNum).Construction).TransDiff, 4) + "] too small for calculations."); + ShowContinueError(state, + format("Diffuse solar transmittance of construction [{:.4R}] too small for calculations.", + state.dataConstruction->Construct(Surface(SurfNum).Construction).TransDiff)); ErrorsFound = true; } @@ -609,13 +613,15 @@ namespace DaylightingDevices { 0.1) { // greater than 10% ShowSevereError(state, cCurrentModuleObject + " = " + cAlphaArgs(1) + ": Dome and diffuser areas are significantly different (>10%)."); - ShowContinueError(state, "...Diffuser Area=[" + RoundSigDigits(Surface(SurfNum).Area, 4) + "]; Dome Area=[" + - RoundSigDigits(Surface(TDDPipe(PipeNum).Dome).Area, 4) + "]."); + ShowContinueError( + state, + format("...Diffuser Area=[{:.4R}]; Dome Area=[{:.4R}].", Surface(SurfNum).Area, Surface(TDDPipe(PipeNum).Dome).Area)); ErrorsFound = true; } else { ShowWarningError(state, cCurrentModuleObject + " = " + cAlphaArgs(1) + ": Dome and diffuser areas differ by > .1 m2."); - ShowContinueError(state, "...Diffuser Area=[" + RoundSigDigits(Surface(SurfNum).Area, 4) + "]; Dome Area=[" + - RoundSigDigits(Surface(TDDPipe(PipeNum).Dome).Area, 4) + "]."); + ShowContinueError( + state, + format("...Diffuser Area=[{:.4R}]; Dome Area=[{:.4R}].", Surface(SurfNum).Area, Surface(TDDPipe(PipeNum).Dome).Area)); } } @@ -666,13 +672,13 @@ namespace DaylightingDevices { 0.1) { // greater than 10% ShowSevereError(state, cCurrentModuleObject + " = " + cAlphaArgs(1) + ": Pipe and dome/diffuser areas are significantly different (>10%)."); - ShowContinueError(state, "...Pipe Area=[" + RoundSigDigits(PipeArea, 4) + "]; Dome/Diffuser Area=[" + - RoundSigDigits(Surface(TDDPipe(PipeNum).Dome).Area, 4) + "]."); + ShowContinueError( + state, format("...Pipe Area=[{:.4R}]; Dome/Diffuser Area=[{:.4R}].", PipeArea, Surface(TDDPipe(PipeNum).Dome).Area)); ErrorsFound = true; } else { ShowWarningError(state, cCurrentModuleObject + " = " + cAlphaArgs(1) + ": Pipe and dome/diffuser areas differ by > .1 m2."); - ShowContinueError(state, "...Pipe Area=[" + RoundSigDigits(PipeArea, 4) + "]; Dome/Diffuser Area=[" + - RoundSigDigits(Surface(TDDPipe(PipeNum).Dome).Area, 4) + "]."); + ShowContinueError( + state, format("...Pipe Area=[{:.4R}]; Dome/Diffuser Area=[{:.4R}].", PipeArea, Surface(TDDPipe(PipeNum).Dome).Area)); } } diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index c817e07bdd2..2ff893104cf 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -62,7 +62,6 @@ #include // EnergyPlus Headers -#include #include #include #include @@ -520,7 +519,6 @@ namespace DaylightingManager { using DataSystemVariables::DetailedSolarTimestepIntegration; using DaylightingDevices::TransTDD; using General::BlindBeamBeamTrans; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -867,7 +865,7 @@ namespace DaylightingManager { // Using/Aliasing using DaylightingDevices::TransTDD; using General::BlindBeamBeamTrans; - using General::RoundSigDigits; + using General::SafeDivide; // Locals @@ -953,7 +951,7 @@ namespace DaylightingManager { // Using/Aliasing using DaylightingDevices::TransTDD; using General::BlindBeamBeamTrans; - using General::RoundSigDigits; + using General::SafeDivide; using DataEnvironment::SunIsUp; using DataSystemVariables::DetailedSolarTimestepIntegration; @@ -1351,7 +1349,7 @@ namespace DaylightingManager { // Using/Aliasing using DaylightingDevices::TransTDD; using General::BlindBeamBeamTrans; - using General::RoundSigDigits; + using General::SafeDivide; using DataEnvironment::SunIsUp; using DataSystemVariables::DetailedSolarTimestepIntegration; @@ -1786,7 +1784,7 @@ namespace DaylightingManager { using DataSystemVariables::DetailedSolarTimestepIntegration; using General::BlindBeamBeamTrans; using General::POLYF; - using General::RoundSigDigits; + using General::SafeDivide; // Locals @@ -1962,10 +1960,13 @@ namespace DaylightingManager { // ! Error message if ref pt is too close to window. if (D1a > 0.0 && D1b > 0.0 && D1b <= HW && D1a <= WW) { - ShowSevereError(state, "CalcDaylightCoeffRefPoints: Daylighting calculation cannot be done for zone " + Zone(ZoneNum).Name + - " because reference point #" + RoundSigDigits(iRefPoint) + " is less than 0.15m (6\") from window plane " + - Surface(IWin).Name); - ShowContinueError(state, "Distance=[" + RoundSigDigits(ALF, 5) + "]. This is too close; check position of reference point."); + ShowSevereError(state, + format("CalcDaylightCoeffRefPoints: Daylighting calculation cannot be done for zone {} because reference point " + "#{} is less than 0.15m (6\") from window plane {}", + Zone(ZoneNum).Name, + iRefPoint, + Surface(IWin).Name)); + ShowContinueError(state, format("Distance=[{:.5R}]. This is too close; check position of reference point.", ALF)); ShowFatalError(state, "Program terminates due to preceding condition."); } } else if (ALF < 0.1524 && ExtWinType == AdjZoneExtWin) { @@ -1973,9 +1974,12 @@ namespace DaylightingManager { ShowWarningError(state, "CalcDaylightCoeffRefPoints: For Zone=\"" + Zone(ZoneNum).Name + "\" External Window=\"" + Surface(IWin).Name + "\"in Zone=\"" + Zone(Surface(IWin).Zone).Name + "\" reference point is less than 0.15m (6\") from window plane "); - ShowContinueError(state, "Distance=[" + RoundSigDigits(ALF, 1) + " m] to ref point=[" + RoundSigDigits(RREF(1), 1) + ',' + - RoundSigDigits(RREF(2), 1) + ',' + RoundSigDigits(RREF(3), 1) + - "], Inaccuracy in Daylighting Calcs may result."); + ShowContinueError(state, + format("Distance=[{:.1R} m] to ref point=[{:.1R},{:.1R},{:.1R}], Inaccuracy in Daylighting Calcs may result.", + ALF, + RREF(1), + RREF(2), + RREF(3))); RefErrIndex(iRefPoint, IWin) = 1; } } @@ -1984,8 +1988,12 @@ namespace DaylightingManager { if (MapErrIndex(iRefPoint, IWin) == 0) { // only show error message once ShowWarningError(state, "CalcDaylightCoeffMapPoints: For Zone=\"" + Zone(ZoneNum).Name + "\" External Window=\"" + Surface(IWin).Name + "\"in Zone=\"" + Zone(Surface(IWin).Zone).Name + "\" map point is less than 0.15m (6\") from window plane "); - ShowContinueError(state, "Distance=[" + RoundSigDigits(ALF, 1) + " m] map point=[" + RoundSigDigits(RREF(1), 1) + ',' + - RoundSigDigits(RREF(2), 1) + ',' + RoundSigDigits(RREF(3), 1) + "], Inaccuracy in Map Calcs may result."); + ShowContinueError(state, + format("Distance=[{:.1R} m] map point=[{:.1R},{:.1R},{:.1R}], Inaccuracy in Map Calcs may result.", + ALF, + RREF(1), + RREF(2), + RREF(3))); MapErrIndex(iRefPoint, IWin) = 1; } } @@ -4517,13 +4525,15 @@ namespace DaylightingManager { if (ZoneDaylight(zoneOfSurf).TotalDaylRefPoints > 0 && !Zone(zoneOfSurf).HasInterZoneWindow && ZoneDaylight(zoneOfSurf).DaylightMethod == SplitFluxDaylighting) { for (int refPtNum = 1; refPtNum <= ZoneDaylight(zoneOfSurf).TotalDaylRefPoints; ++refPtNum) { - SetupOutputVariable(state, "Daylighting Window Reference Point " + std::to_string(refPtNum) + " Illuminance", + SetupOutputVariable(state, + format("Daylighting Window Reference Point {} Illuminance", refPtNum), OutputProcessor::Unit::lux, SurfaceWindow(SurfLoop).IllumFromWinAtRefPtRep(refPtNum), "Zone", "Average", Surface(SurfLoop).Name); - SetupOutputVariable(state, "Daylighting Window Reference Point " + std::to_string(refPtNum) + " View Luminance", + SetupOutputVariable(state, + format("Daylighting Window Reference Point {} View Luminance", refPtNum), OutputProcessor::Unit::cd_m2, SurfaceWindow(SurfLoop).LumWinFromRefPtRep(refPtNum), "Zone", @@ -4660,8 +4670,6 @@ namespace DaylightingManager { using DataStringGlobals::CharComma; using DataStringGlobals::CharSpace; using DataStringGlobals::CharTab; - using General::RoundSigDigits; - using General::TrimSigDigits; Array1D_int ZoneMapCount; int MapNum; @@ -4745,8 +4753,9 @@ namespace DaylightingManager { IllumMap(MapNum).Xmax = rNumericArgs(3); if (rNumericArgs(2) > rNumericArgs(3)) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid entry."); - ShowContinueError(state, "..." + cNumericFieldNames(2) + '[' + RoundSigDigits(rNumericArgs(2), 2) + - "] must be <= " + cNumericFieldNames(3) + '[' + RoundSigDigits(rNumericArgs(3), 2) + "]."); + ShowContinueError( + state, + format("...{}[:.2R] must be <= {} [:.2R].", cNumericFieldNames(2), rNumericArgs(2), cNumericFieldNames(3), rNumericArgs(3))); ErrorsFound = true; } IllumMap(MapNum).Xnum = rNumericArgs(4); @@ -4760,8 +4769,9 @@ namespace DaylightingManager { IllumMap(MapNum).Ymax = rNumericArgs(6); if (rNumericArgs(5) > rNumericArgs(6)) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid entry."); - ShowContinueError(state, "..." + cNumericFieldNames(5) + '[' + RoundSigDigits(rNumericArgs(5), 2) + - "] must be <= " + cNumericFieldNames(6) + '[' + RoundSigDigits(rNumericArgs(6), 2) + "]."); + ShowContinueError( + state, + format("...{}[:.2R] must be <= {} [:.2R].", cNumericFieldNames(5), rNumericArgs(5), cNumericFieldNames(6), rNumericArgs(6))); ErrorsFound = true; } IllumMap(MapNum).Ynum = rNumericArgs(7); @@ -4772,10 +4782,14 @@ namespace DaylightingManager { } if (IllumMap(MapNum).Xnum * IllumMap(MapNum).Ynum > MaxMapRefPoints) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", too many map points specified."); - ShowContinueError(state, "..." + cNumericFieldNames(4) + '[' + RoundSigDigits(IllumMap(MapNum).Xnum) + "] * " + cNumericFieldNames(7) + - '[' + RoundSigDigits(IllumMap(MapNum).Ynum) + "].= [" + - RoundSigDigits(IllumMap(MapNum).Xnum * IllumMap(MapNum).Ynum) + "] must be <= [" + - RoundSigDigits(MaxMapRefPoints) + "]."); + ShowContinueError(state, + format("...{}[{}] * {}[{}].= [{}] must be <= [{}].", + cNumericFieldNames(4), + IllumMap(MapNum).Xnum, + cNumericFieldNames(7), + IllumMap(MapNum).Ynum, + IllumMap(MapNum).Xnum * IllumMap(MapNum).Ynum, + MaxMapRefPoints)); ErrorsFound = true; } } // MapNum @@ -4858,8 +4872,10 @@ namespace DaylightingManager { if (AddMapPoints > MaxMapRefPoints) { ShowSevereError(state, "GetDaylighting Parameters: Total Map Reference points entered is greater than maximum allowed."); ShowContinueError(state, "Occurs in Zone=" + zone.Name); - ShowContinueError(state, "Maximum reference points allowed=" + TrimSigDigits(MaxMapRefPoints) + - ", entered amount ( when error first occurred )=" + TrimSigDigits(AddMapPoints)); + ShowContinueError(state, + format("Maximum reference points allowed={}, entered amount ( when error first occurred )={}", + MaxMapRefPoints, + AddMapPoints)); ErrorsFound = true; break; } @@ -4948,49 +4964,70 @@ namespace DaylightingManager { if ((IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt) < zone.MinimumX || IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt) > zone.MaximumX) && !IllumMapCalc(MapNum).MapRefPtInBounds(RefPt)) { - ShowWarningError(state, "GetInputIlluminanceMap: Reference Map point #[" + RoundSigDigits(RefPt) + - "], X Value outside Zone Min/Max X, Zone=" + zone.Name); - ShowContinueError(state, "...X Reference Point= " + RoundSigDigits(IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt), 2) + - ", Zone Minimum X= " + RoundSigDigits(zone.MinimumX, 2) + - ", Zone Maximum X= " + RoundSigDigits(zone.MaximumX, 2)); + ShowWarningError( + state, + format("GetInputIlluminanceMap: Reference Map point #[{}], X Value outside Zone Min/Max X, Zone={}", + RefPt, + zone.Name)); + ShowContinueError(state, + format("...X Reference Point= {:.2R}, Zone Minimum X= {:.2R}, Zone Maximum X= {:.2R}", + IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt), + zone.MinimumX, + zone.MaximumX)); if (IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt) < zone.MinimumX) { - ShowContinueError(state, "...X Reference Distance Outside MinimumX= " + - RoundSigDigits(zone.MinimumX - IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt), 4) + " m."); + ShowContinueError(state, + format("...X Reference Distance Outside MinimumX= {:.4R} m.", + zone.MinimumX - IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt))); } else { - ShowContinueError(state, "...X Reference Distance Outside MaximumX= " + - RoundSigDigits(IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt) - zone.MaximumX, 4) + " m."); + ShowContinueError(state, + format("...X Reference Distance Outside MaximumX= {:.4R} m.", + IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt) - zone.MaximumX)); } } if ((IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt) < zone.MinimumY || IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt) > zone.MaximumY) && !IllumMapCalc(MapNum).MapRefPtInBounds(RefPt)) { - ShowWarningError(state, "GetInputIlluminanceMap: Reference Map point #[" + RoundSigDigits(RefPt) + - "], Y Value outside Zone Min/Max Y, Zone=" + zone.Name); - ShowContinueError(state, "...Y Reference Point= " + RoundSigDigits(IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt), 2) + - ", Zone Minimum Y= " + RoundSigDigits(zone.MinimumY, 2) + - ", Zone Maximum Y= " + RoundSigDigits(zone.MaximumY, 2)); + ShowWarningError( + state, + format("GetInputIlluminanceMap: Reference Map point #[{}], Y Value outside Zone Min/Max Y, Zone={}", + RefPt, + zone.Name)); + ShowContinueError(state, + format("...Y Reference Point= {:.2R}, Zone Minimum Y= {:.2R}, Zone Maximum Y= {:.2R}", + IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt), + zone.MinimumY, + zone.MaximumY)); if (IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt) < zone.MinimumY) { - ShowContinueError(state, "...Y Reference Distance Outside MinimumY= " + - RoundSigDigits(zone.MinimumY - IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt), 4) + " m."); + ShowContinueError(state, + format("...Y Reference Distance Outside MinimumY= {:.4R} m.", + zone.MinimumY - IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt))); } else { - ShowContinueError(state, "...Y Reference Distance Outside MaximumY= " + - RoundSigDigits(IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt) - zone.MaximumY, 4) + " m."); + ShowContinueError(state, + format("...Y Reference Distance Outside MaximumY= {:.4R} m.", + IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt) - zone.MaximumY)); } } if ((IllumMapCalc(MapNum).MapRefPtAbsCoord(3, RefPt) < zone.MinimumZ || IllumMapCalc(MapNum).MapRefPtAbsCoord(3, RefPt) > zone.MaximumZ) && !IllumMapCalc(MapNum).MapRefPtInBounds(RefPt)) { - ShowWarningError(state, "GetInputIlluminanceMap: Reference Map point #[" + RoundSigDigits(RefPt) + - "], Z Value outside Zone Min/Max Z, Zone=" + zone.Name); - ShowContinueError(state, "...Z Reference Point= " + RoundSigDigits(IllumMapCalc(MapNum).MapRefPtAbsCoord(3, RefPt), 2) + - ", Zone Minimum Z= " + RoundSigDigits(zone.MinimumZ, 2) + - ", Zone Maximum Z= " + RoundSigDigits(zone.MaximumZ, 2)); + ShowWarningError( + state, + format("GetInputIlluminanceMap: Reference Map point #[{}], Z Value outside Zone Min/Max Z, Zone={}", + RefPt, + zone.Name)); + ShowContinueError(state, + format("...Z Reference Point= {:.2R}, Zone Minimum Z= {:.2R}, Zone Maximum Z= {:.2R}", + IllumMapCalc(MapNum).MapRefPtAbsCoord(3, RefPt), + zone.MinimumZ, + zone.MaximumZ)); if (IllumMapCalc(MapNum).MapRefPtAbsCoord(3, RefPt) < zone.MinimumZ) { - ShowContinueError(state, "...Z Reference Distance Outside MinimumZ= " + - RoundSigDigits(zone.MinimumZ - IllumMapCalc(MapNum).MapRefPtAbsCoord(3, RefPt), 4) + " m."); + ShowContinueError(state, + format("...Z Reference Distance Outside MinimumZ= {:.4R} m.", + zone.MinimumZ - IllumMapCalc(MapNum).MapRefPtAbsCoord(3, RefPt))); } else { - ShowContinueError(state, "...Z Reference Distance Outside MaximumZ= " + - RoundSigDigits(IllumMapCalc(MapNum).MapRefPtAbsCoord(3, RefPt) - zone.MaximumZ, 4) + " m."); + ShowContinueError(state, + format("...Z Reference Distance Outside MaximumZ= {:.4R} m.", + IllumMapCalc(MapNum).MapRefPtAbsCoord(3, RefPt) - zone.MaximumZ)); } } } @@ -5042,7 +5079,6 @@ namespace DaylightingManager { // MODIFIED Glazer - July 2016 - Move geometry transformation portion, rearrange input, allow more than three reference points // Obtain the user input data for Daylighting:Controls object in the input file. using namespace DataIPShortCuts; - using General::RoundSigDigits; int IOStat; int NumAlpha; @@ -5200,25 +5236,29 @@ namespace DaylightingManager { zone_daylight.IllumSetPoint(refPtNum) = rNumericArgs(7 + refPtNum * 2); // Field: Illuminance Setpoint at Reference Point if (zone_daylight.DaylightMethod == SplitFluxDaylighting) { - SetupOutputVariable(state, "Daylighting Reference Point " + std::to_string(refPtNum) + " Illuminance", + SetupOutputVariable(state, + format("Daylighting Reference Point {} Illuminance", refPtNum), OutputProcessor::Unit::lux, zone_daylight.DaylIllumAtRefPt(refPtNum), "Zone", "Average", zone_daylight.Name); - SetupOutputVariable(state, "Daylighting Reference Point " + std::to_string(refPtNum) + " Daylight Illuminance Setpoint Exceeded Time", + SetupOutputVariable(state, + format("Daylighting Reference Point {} Daylight Illuminance Setpoint Exceeded Time", refPtNum), OutputProcessor::Unit::hr, zone_daylight.TimeExceedingDaylightIlluminanceSPAtRefPt(refPtNum), "Zone", "Sum", zone_daylight.Name); - SetupOutputVariable(state, "Daylighting Reference Point " + std::to_string(refPtNum) + " Glare Index", + SetupOutputVariable(state, + format("Daylighting Reference Point {} Glare Index", refPtNum), OutputProcessor::Unit::None, zone_daylight.GlareIndexAtRefPt(refPtNum), "Zone", "Average", zone_daylight.Name); - SetupOutputVariable(state, "Daylighting Reference Point " + std::to_string(refPtNum) + " Glare Index Setpoint Exceeded Time", + SetupOutputVariable(state, + format("Daylighting Reference Point {} Glare Index Setpoint Exceeded Time", refPtNum), OutputProcessor::Unit::hr, zone_daylight.TimeExceedingGlareIndexSPAtRefPt(refPtNum), "Zone", @@ -5235,12 +5275,18 @@ namespace DaylightingManager { Real64 sumFracs = sum(zone_daylight.FracZoneDaylit); if ( (1.0 - sumFracs) > FractionTolerance) { ShowWarningError(state, "GetDaylightingControls: Fraction of Zone controlled by the Daylighting reference points is < 1.0."); - ShowContinueError(state, "..discovered in \"" + cCurrentModuleObject + "\" for Zone=\"" + cAlphaArgs(2) + "\", only " + - RoundSigDigits(sum(zone_daylight.FracZoneDaylit), 3) + " of the zone is controlled."); + ShowContinueError(state, + format("..discovered in \"{}\" for Zone=\"{}\", only {:.3R} of the zone is controlled.", + cCurrentModuleObject, + cAlphaArgs(2), + sum(zone_daylight.FracZoneDaylit))); } else if ((sumFracs - 1.0) > FractionTolerance) { ShowSevereError(state, "GetDaylightingControls: Fraction of Zone controlled by the Daylighting reference points is > 1.0."); - ShowContinueError(state, "..discovered in \"" + cCurrentModuleObject + "\" for Zone=\"" + cAlphaArgs(2) + "\", trying to control " + - RoundSigDigits(sum(zone_daylight.FracZoneDaylit), 3) + " of the zone."); + ShowContinueError(state, + format("..discovered in \"{}\" for Zone=\"{}\", trying to control {:.3R} of the zone.", + cCurrentModuleObject, + cAlphaArgs(2), + sum(zone_daylight.FracZoneDaylit))); ErrorsFound = true; } @@ -5265,8 +5311,6 @@ namespace DaylightingManager { // MODIFIED Glazer - July 2016 - separated this from GetInput function // For splitflux daylighting, transform the geometry - using General::RoundSigDigits; - using General::TrimSigDigits; using InternalHeatGains::CheckLightsReplaceableMinMaxForZone; using InternalHeatGains::GetDesignLightingLevelForZone; using namespace OutputReportPredefined; @@ -5372,43 +5416,55 @@ namespace DaylightingManager { if (daylCntrl.DaylRefPtAbsCoord(1, refPtNum) < zone.MinimumX || daylCntrl.DaylRefPtAbsCoord(1, refPtNum) > zone.MaximumX) { daylCntrl.DaylRefPtInBounds(refPtNum) = false; ShowWarningError(state, "GeometryTransformForDaylighting: Reference point X Value outside Zone Min/Max X, Zone=" + zone.Name); - ShowContinueError(state, "...X Reference Point= " + RoundSigDigits(daylCntrl.DaylRefPtAbsCoord(1, refPtNum), 2) + - ", Zone Minimum X= " + RoundSigDigits(zone.MinimumX, 2) + - ", Zone Maximum X= " + RoundSigDigits(zone.MaximumX, 2)); + ShowContinueError(state, + format("...X Reference Point= {:.2R}, Zone Minimum X= {:.2R}, Zone Maximum X= {:.2R}", + daylCntrl.DaylRefPtAbsCoord(1, refPtNum), + zone.MinimumX, + zone.MaximumX)); if (daylCntrl.DaylRefPtAbsCoord(1, refPtNum) < zone.MinimumX) { - ShowContinueError(state, "...X Reference Distance Outside MinimumX= " + - RoundSigDigits(zone.MinimumX - daylCntrl.DaylRefPtAbsCoord(1, refPtNum), 4) + " m."); + ShowContinueError(state, + format("...X Reference Distance Outside MinimumX= {:.4R} m.", + zone.MinimumX - daylCntrl.DaylRefPtAbsCoord(1, refPtNum))); } else { - ShowContinueError(state, "...X Reference Distance Outside MaximumX= " + - RoundSigDigits(daylCntrl.DaylRefPtAbsCoord(1, refPtNum) - zone.MaximumX, 4) + " m."); + ShowContinueError(state, + format("...X Reference Distance Outside MaximumX= {:.4R} m.", + daylCntrl.DaylRefPtAbsCoord(1, refPtNum) - zone.MaximumX)); } } if (daylCntrl.DaylRefPtAbsCoord(2, refPtNum) < zone.MinimumY || daylCntrl.DaylRefPtAbsCoord(2, refPtNum) > zone.MaximumY) { daylCntrl.DaylRefPtInBounds(refPtNum) = false; ShowWarningError(state, "GeometryTransformForDaylighting: Reference point Y Value outside Zone Min/Max Y, Zone=" + zone.Name); - ShowContinueError(state, "...Y Reference Point= " + RoundSigDigits(daylCntrl.DaylRefPtAbsCoord(2, refPtNum), 2) + - ", Zone Minimum Y= " + RoundSigDigits(zone.MinimumY, 2) + - ", Zone Maximum Y= " + RoundSigDigits(zone.MaximumY, 2)); + ShowContinueError(state, + format("...Y Reference Point= {:.2R}, Zone Minimum Y= {:.2R}, Zone Maximum Y= {:.2R}", + daylCntrl.DaylRefPtAbsCoord(2, refPtNum), + zone.MinimumY, + zone.MaximumY)); if (daylCntrl.DaylRefPtAbsCoord(2, refPtNum) < zone.MinimumY) { - ShowContinueError(state, "...Y Reference Distance Outside MinimumY= " + - RoundSigDigits(zone.MinimumY - daylCntrl.DaylRefPtAbsCoord(2, refPtNum), 4) + " m."); + ShowContinueError(state, + format("...Y Reference Distance Outside MinimumY= {:.4R} m.", + zone.MinimumY - daylCntrl.DaylRefPtAbsCoord(2, refPtNum))); } else { - ShowContinueError(state, "...Y Reference Distance Outside MaximumY= " + - RoundSigDigits(daylCntrl.DaylRefPtAbsCoord(2, refPtNum) - zone.MaximumY, 4) + " m."); + ShowContinueError(state, + format("...Y Reference Distance Outside MaximumY= {:.4R} m.", + daylCntrl.DaylRefPtAbsCoord(2, refPtNum) - zone.MaximumY)); } } if (daylCntrl.DaylRefPtAbsCoord(3, refPtNum) < zone.MinimumZ || daylCntrl.DaylRefPtAbsCoord(3, refPtNum) > zone.MaximumZ) { daylCntrl.DaylRefPtInBounds(refPtNum) = false; ShowWarningError(state, "GeometryTransformForDaylighting: Reference point Z Value outside Zone Min/Max Z, Zone=" + zone.Name); - ShowContinueError(state, "...Z Reference Point= " + RoundSigDigits(daylCntrl.DaylRefPtAbsCoord(3, refPtNum), 2) + - ", Zone Minimum Z= " + RoundSigDigits(zone.MinimumZ, 2) + - ", Zone Maximum Z= " + RoundSigDigits(zone.MaximumZ, 2)); + ShowContinueError(state, + format("...Z Reference Point= {:.2R}, Zone Minimum Z= {:.2R}, Zone Maximum Z= {:.2R}", + daylCntrl.DaylRefPtAbsCoord(3, refPtNum), + zone.MinimumZ, + zone.MaximumZ)); if (daylCntrl.DaylRefPtAbsCoord(3, refPtNum) < zone.MinimumZ) { - ShowContinueError(state, "...Z Reference Distance Outside MinimumZ= " + - RoundSigDigits(zone.MinimumZ - daylCntrl.DaylRefPtAbsCoord(3, refPtNum), 4) + " m."); + ShowContinueError(state, + format("...Z Reference Distance Outside MinimumZ= {:.4R} m.", + zone.MinimumZ - daylCntrl.DaylRefPtAbsCoord(3, refPtNum))); } else { - ShowContinueError(state, "...Z Reference Distance Outside MaximumZ= " + - RoundSigDigits(daylCntrl.DaylRefPtAbsCoord(3, refPtNum) - zone.MaximumZ, 4) + " m."); + ShowContinueError(state, + format("...Z Reference Distance Outside MaximumZ= {:.4R} m.", + daylCntrl.DaylRefPtAbsCoord(3, refPtNum) - zone.MaximumZ)); } } } // refPtNum @@ -5491,7 +5547,6 @@ namespace DaylightingManager { using DataDaylighting::ZoneDaylight; using DataHeatBalance::Zone; using namespace DataDaylightingDevices; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -5589,7 +5644,6 @@ namespace DaylightingManager { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -5655,8 +5709,8 @@ namespace DaylightingManager { // Warning if light well area is less than window area if (AreaWell < (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum) - 0.1)) { ShowSevereError(state, cCurrentModuleObject + ": invalid " + cAlphaFieldNames(1) + "=\"" + cAlphaArgs(1) + "\" - Areas."); - ShowContinueError(state, "has Area of Bottom of Well=" + RoundSigDigits(Surface(SurfNum).Area, 1) + - " that is less than window area=" + RoundSigDigits(AreaWell, 1)); + ShowContinueError( + state, format("has Area of Bottom of Well={:.1R} that is less than window area={:.1R}", Surface(SurfNum).Area, AreaWell)); } if (HeightWell >= 0.0 && PerimWell > 0.0 && AreaWell > 0.0) { @@ -6674,7 +6728,7 @@ namespace DaylightingManager { int count = 0; for (std::size_t igroup = 1; igroup <= ZoneDaylight(ZoneNum).ShadeDeployOrderExtWins.size(); igroup++) { std::vector listOfExtWin = ZoneDaylight(ZoneNum).ShadeDeployOrderExtWins[igroup - 1]; - for (auto IWin : listOfExtWin) { + for (const auto IWin : listOfExtWin) { ++count; // need to map back to the original order of the "loop" to not change all the other data structures loop = ZoneDaylight(ZoneNum).MapShdOrdToLoopNum(count); @@ -6719,7 +6773,7 @@ namespace DaylightingManager { std::vector listOfExtWin = ZoneDaylight(ZoneNum).ShadeDeployOrderExtWins[igroup - 1]; - for (auto IWin : listOfExtWin) { + for (const auto IWin : listOfExtWin) { ++count; // need to map back to the original order of the "loop" to not change all the other data structures loop = ZoneDaylight(ZoneNum).MapShdOrdToLoopNum(count); @@ -6839,7 +6893,7 @@ namespace DaylightingManager { int countBeforeListOfExtWinLoop = count; bool atLeastOneGlareControlIsActive = false; - for (auto IWin : listOfExtWin) { + for (const auto IWin : listOfExtWin) { ++count; // need to map back to the original order of the "loop" to not change all the other data structures loop = ZoneDaylight(ZoneNum).MapShdOrdToLoopNum(count); @@ -6954,7 +7008,7 @@ namespace DaylightingManager { count = countBeforeListOfExtWinLoop; breakOuterLoop = false; - for (auto IWin : listOfExtWin) { + for (const auto IWin : listOfExtWin) { ++count; // need to map back to the original order of the "loop" to not change all the other data structures loop = ZoneDaylight(ZoneNum).MapShdOrdToLoopNum(count); @@ -9922,7 +9976,6 @@ namespace DaylightingManager { using DataStringGlobals::CharComma; using DataStringGlobals::CharSpace; using DataStringGlobals::CharTab; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -9993,7 +10046,7 @@ namespace DaylightingManager { SavedMnDy(MapNum) = CurMnDyHr.substr(0, 5); - IllumMap(MapNum).Name = IllumMap(MapNum).Name + " at " + RoundSigDigits(IllumMap(MapNum).Z, 2) + 'm'; + IllumMap(MapNum).Name = format("{} at {:.2R}m", IllumMap(MapNum).Name, IllumMap(MapNum).Z); for (R = 1; R <= ZoneDaylight(IllumMap(MapNum).Zone).TotalDaylRefPoints; ++R) { RefPts(IllumMap(MapNum).Zone, R) = format("RefPt{}=({:.2R}:{:.2R}:{:.2R})", R, @@ -10038,11 +10091,12 @@ namespace DaylightingManager { if (IllumMap(MapNum).HeaderXLineLengthNeeded) { IllumMap(MapNum).HeaderXLineLength = linelen; if (static_cast(IllumMap(MapNum).HeaderXLineLength) > len(mapLine)) { - ShowWarningError(state, "ReportIllumMap: Map=\"" + IllumMap(MapNum).Name + - "\" -- the X Header overflows buffer -- will be truncated at " + RoundSigDigits(int(len(mapLine))) + - " characters."); - ShowContinueError(state, "...needed " + RoundSigDigits(IllumMap(MapNum).HeaderXLineLength) + - " characters. Please contact EnergyPlus support."); + ShowWarningError(state, + format("ReportIllumMap: Map=\"{}\" -- the X Header overflows buffer -- will be truncated at {} characters.", + IllumMap(MapNum).Name, + int(len(mapLine)))); + ShowContinueError(state, + format("...needed {} characters. Please contact EnergyPlus support.", IllumMap(MapNum).HeaderXLineLength)); } IllumMap(MapNum).HeaderXLineLengthNeeded = false; } @@ -10052,14 +10106,14 @@ namespace DaylightingManager { // Write Y scale prefix and illuminance values RefPt = 1; for (Y = 1; Y <= IllumMap(MapNum).Ynum; ++Y) { - mapLine = "(" + RoundSigDigits(IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt), 2) + ';' + - RoundSigDigits(IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt), 2) + ")="; + mapLine = + format("({:.2R};{:.2R})=", IllumMapCalc(MapNum).MapRefPtAbsCoord(1, RefPt), IllumMapCalc(MapNum).MapRefPtAbsCoord(2, RefPt)); for (R = RefPt; R <= RefPt + IllumMap(MapNum).Xnum - 1; ++R) { IllumOut = nint(IllumMapCalc(MapNum).DaylIllumAtMapPtHr(R)); if (IllumMapCalc(MapNum).MapRefPtInBounds(R)) { - String = RoundSigDigits(IllumOut); + String = fmt::to_string(IllumOut); } else { - String = RoundSigDigits(IllumOut); + String = fmt::to_string(IllumOut); String = "*" + String; } mapLine += MapColSep + String; @@ -10130,7 +10184,6 @@ namespace DaylightingManager { using DataStringGlobals::CharComma; using DataStringGlobals::CharSpace; using DataStringGlobals::CharTab; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -10238,8 +10291,6 @@ namespace DaylightingManager { // may be associated with an exterior window in a daylit target zone's enclosure or an exterior window in // an adjacent enclosure, daylit or not, that shares interior windows with the target zone's enclosure. - using General::RoundSigDigits; - Array1D_int ZoneExtWin; int WinSize; int RefSize; diff --git a/src/EnergyPlus/DemandManager.cc b/src/EnergyPlus/DemandManager.cc index bc910823f16..c5ffd0f1b89 100644 --- a/src/EnergyPlus/DemandManager.cc +++ b/src/EnergyPlus/DemandManager.cc @@ -641,7 +641,7 @@ namespace EnergyPlus::DemandManager { using DataHeatBalance::ZoneElectricObjects; using DataZoneControls::TempControlledZone; using DataZoneControls::TStatObjects; - using General::RoundSigDigits; + using MixedAir::GetOAController; using ScheduleManager::GetScheduleIndex; @@ -1169,8 +1169,8 @@ namespace EnergyPlus::DemandManager { if (DemandMgr(MgrNum).LowerLimit > DemandMgr(MgrNum).UpperLimit) { ShowSevereError(state, "Invalid input for " + CurrentModuleObject + " = " + AlphArray(1)); - ShowContinueError(state, cNumericFieldNames(2) + " [" + RoundSigDigits(NumArray(2), 2) + "] > " + cNumericFieldNames(3) + " [" + - RoundSigDigits(NumArray(3), 2) + ']'); + ShowContinueError(state, + format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(2), NumArray(2), cNumericFieldNames(3), NumArray(3))); ShowContinueError(state, cNumericFieldNames(2) + " cannot be greater than " + cNumericFieldNames(3)); ErrorsFound = true; } diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index 716acc1c94a..4443e3f74a9 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -149,8 +149,6 @@ namespace DesiccantDehumidifiers { using namespace CurveManager; using namespace Psychrometrics; using FluidProperties::GetSatDensityRefrig; - using General::RoundSigDigits; - using General::TrimSigDigits; // Data // MODULE PARAMETER DEFINITIONS @@ -234,12 +232,18 @@ namespace DesiccantDehumidifiers { } else { DesicDehumNum = CompIndex; if (DesicDehumNum > NumDesicDehums || DesicDehumNum < 1) { - ShowFatalError(state, "SimDesiccantDehumidifier: Invalid CompIndex passed=" + TrimSigDigits(DesicDehumNum) + - ", Number of Units=" + TrimSigDigits(NumDesicDehums) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimDesiccantDehumidifier: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + DesicDehumNum, + NumDesicDehums, + CompName)); } if (CompName != DesicDehum(DesicDehumNum).Name) { - ShowFatalError(state, "SimDesiccantDehumidifier: Invalid CompIndex passed=" + TrimSigDigits(DesicDehumNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + DesicDehum(DesicDehumNum).Name); + ShowFatalError(state, + format("SimDesiccantDehumidifier: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + DesicDehumNum, + CompName, + DesicDehum(DesicDehumNum).Name)); } } @@ -685,14 +689,14 @@ namespace DesiccantDehumidifiers { } if (DesicDehum(DesicDehumNum).NomProcAirVel > 4.064) { ShowWarningError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, cNumericFields(3) + - " > 4.064 m/s.; Value in input=" + RoundSigDigits(DesicDehum(DesicDehumNum).NomProcAirVel, 3)); + ShowContinueError(state, + format("{} > 4.064 m/s.; Value in input={:.3R}", cNumericFields(3), DesicDehum(DesicDehumNum).NomProcAirVel)); ShowContinueError(state, "DEFAULT performance curves not valid outside 2.032 to 4.064 m/s (400 to 800 fpm)."); } if (DesicDehum(DesicDehumNum).NomProcAirVel < 2.032) { ShowWarningError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, cNumericFields(3) + - " < 2.032 m/s.; Value in input=" + RoundSigDigits(DesicDehum(DesicDehumNum).NomProcAirVel, 3)); + ShowContinueError(state, + format("{} < 2.032 m/s.; Value in input={:.3R}", cNumericFields(3), DesicDehum(DesicDehumNum).NomProcAirVel)); ShowContinueError(state, "DEFAULT performance curves not valid outside 2.032 to 4.064 m/s (400 to 800 fpm)."); } // Validate regen fan type, for default curves, can only variable volume @@ -996,8 +1000,9 @@ namespace DesiccantDehumidifiers { if (RegenCoilControlNodeNum > 0) { ShowSevereError(state, DesicDehum(DesicDehumNum).DehumType + " \"" + DesicDehum(DesicDehumNum).Name + "\""); - ShowContinueError(state, cNumericFields(1) + " is specified as " + RoundSigDigits(DesicDehum(DesicDehumNum).RegenSetPointTemp, 3) + - " C in this object."); + ShowContinueError( + state, + format("{} is specified as {:.3R} C in this object.", cNumericFields(1), DesicDehum(DesicDehumNum).RegenSetPointTemp)); ShowContinueError(state, " Do not specify a coil temperature setpoint node name in the regeneration air heater object."); ShowContinueError(state, "..." + cAlphaFields(9) + " = " + DesicDehum(DesicDehumNum).RegenCoilType); ShowContinueError(state, "..." + cAlphaFields(10) + " = " + DesicDehum(DesicDehumNum).RegenCoilName); @@ -1141,8 +1146,9 @@ namespace DesiccantDehumidifiers { if (RegenCoilControlNodeNum > 0) { ShowSevereError(state, DesicDehum(DesicDehumNum).DehumType + " \"" + DesicDehum(DesicDehumNum).Name + "\""); - ShowContinueError(state, cNumericFields(1) + " is specified as " + RoundSigDigits(DesicDehum(DesicDehumNum).RegenSetPointTemp, 3) + - " C in this object."); + ShowContinueError( + state, + format("{} is specified as {:.3R} C in this object.", cNumericFields(1), DesicDehum(DesicDehumNum).RegenSetPointTemp)); ShowContinueError(state, " Do not specify a coil temperature setpoint node name in the regeneration air heater object."); ShowContinueError(state, "..." + cAlphaFields(9) + " = " + DesicDehum(DesicDehumNum).RegenCoilType); ShowContinueError(state, "..." + cAlphaFields(10) + " = " + DesicDehum(DesicDehumNum).RegenCoilName); @@ -2077,7 +2083,7 @@ namespace DesiccantDehumidifiers { HumRatNeeded = DesicDehum(DesicDehumNum).HumRatSet; if (HumRatNeeded <= 0.0) { ShowSevereError(state, "Dehumidifier:Desiccant:NoFans: " + DesicDehum(DesicDehumNum).Name); - ShowContinueError(state, "Invalid Leaving Max Humidity Ratio Setpoint=" + TrimSigDigits(HumRatNeeded, 8)); + ShowContinueError(state, format("Invalid Leaving Max Humidity Ratio Setpoint={:.8T}", HumRatNeeded)); ShowFatalError(state, "must be > 0.0"); } @@ -2333,8 +2339,8 @@ namespace DesiccantDehumidifiers { } else { - ShowFatalError(state, "Invalid performance model in desiccant dehumidifier = " + - TrimSigDigits(DesicDehum(DesicDehumNum).PerformanceModel_Num)); + ShowFatalError( + state, format("Invalid performance model in desiccant dehumidifier = {}", DesicDehum(DesicDehumNum).PerformanceModel_Num)); } } // Performance Model Part A @@ -2447,8 +2453,8 @@ namespace DesiccantDehumidifiers { } else { - ShowFatalError(state, "Invalid performance model in desiccant dehumidifier = " + - TrimSigDigits(DesicDehum(DesicDehumNum).PerformanceModel_Num)); + ShowFatalError( + state, format("Invalid performance model in desiccant dehumidifier = {}", DesicDehum(DesicDehumNum).PerformanceModel_Num)); // Suppress uninitialized warnings ProcAirOutTemp = 0.0; @@ -3230,7 +3236,7 @@ namespace DesiccantDehumidifiers { // Using/Aliasing using DataHVACGlobals::SmallLoad; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; @@ -3302,21 +3308,23 @@ namespace DesiccantDehumidifiers { ShowWarningMessage(state, "CalcNonDXHeatingCoils: Hot water coil control failed for " + DesicDehum(DesicDehumNum).DehumType + "=\"" + DesicDehum(DesicDehumNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "...Iteration limit [" + RoundSigDigits(SolveMaxIter) + - "] exceeded in calculating hot water mass flow rate"); + ShowContinueError(state, + format("...Iteration limit [{}] exceeded in calculating hot water mass flow rate", SolveMaxIter)); } - ShowRecurringWarningErrorAtEnd(state, "CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + DesicDehum(DesicDehumNum).DehumType + - "=\"" + DesicDehum(DesicDehumNum).Name + "\"", - DesicDehum(DesicDehumNum).HotWaterCoilMaxIterIndex); + ShowRecurringWarningErrorAtEnd(state, + format("CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [{}]) for {}=\"{}\"", + SolveMaxIter, + DesicDehum(DesicDehumNum).DehumType, + DesicDehum(DesicDehumNum).Name), + DesicDehum(DesicDehumNum).HotWaterCoilMaxIterIndex); } else if (SolFlag == -2) { if (DesicDehum(DesicDehumNum).HotWaterCoilMaxIterIndex2 == 0) { ShowWarningMessage(state, "CalcNonDXHeatingCoils: Hot water coil control failed (maximum flow limits) for " + DesicDehum(DesicDehumNum).DehumType + "=\"" + DesicDehum(DesicDehumNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad hot water maximum flow rate limits"); - ShowContinueError(state, "...Given minimum water flow rate=" + RoundSigDigits(MinWaterFlow, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum water flow rate=" + RoundSigDigits(MaxHotWaterFlow, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum water flow rate={:.3R} kg/s", MinWaterFlow)); + ShowContinueError(state, format("...Given maximum water flow rate={:.3R} kg/s", MaxHotWaterFlow)); } ShowRecurringWarningErrorAtEnd(state, "CalcNonDXHeatingCoils: Hot water coil control failed (flow limits) for " + DesicDehum(DesicDehumNum).DehumType + "=\"" + DesicDehum(DesicDehumNum).Name + "\"", diff --git a/src/EnergyPlus/DualDuct.cc b/src/EnergyPlus/DualDuct.cc index b9db22e899b..1b68f59c7bc 100644 --- a/src/EnergyPlus/DualDuct.cc +++ b/src/EnergyPlus/DualDuct.cc @@ -56,7 +56,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -172,7 +171,6 @@ namespace DualDuct { // at the system time step. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int DDNum; // The Damper that you are currently loading input into @@ -195,13 +193,19 @@ namespace DualDuct { } else { DDNum = CompIndex; if (DDNum > NumDDAirTerminal || DDNum < 1) { - ShowFatalError(state, "SimulateDualDuct: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + - ", Number of Dampers=" + TrimSigDigits(NumDDAirTerminal) + ", Damper name=" + CompName); + ShowFatalError(state, + format("SimulateDualDuct: Invalid CompIndex passed={}, Number of Dampers={}, Damper name={}", + CompIndex, + NumDDAirTerminal, + CompName)); } if (CheckEquipName(DDNum)) { if (CompName != dd_airterminal(DDNum).Name) { - ShowFatalError(state, "SimulateDualDuct: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + ", Damper name=" + CompName + - ", stored Damper Name for that index=" + dd_airterminal(DDNum).Name); + ShowFatalError(state, + format("SimulateDualDuct: Invalid CompIndex passed={}, Damper name={}, stored Damper Name for that index={}", + CompIndex, + CompName, + dd_airterminal(DDNum).Name)); } CheckEquipName(DDNum) = false; } @@ -267,7 +271,6 @@ namespace DualDuct { using DataZoneEquipment::ZoneEquipConfig; using NodeInputManager::GetOnlySingleNode; using namespace DataHeatBalance; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetDualDuctInput: "); // include trailing bla @@ -771,11 +774,13 @@ namespace DualDuct { dd_airterminal(DDNum).DesignRecircFlowRate); } else { if (dd_airterminal(DDNum).MaxAirVolFlowRate < dd_airterminal(DDNum).DesignOAFlowRate) { - ShowSevereError(state, "The value " + RoundSigDigits(dd_airterminal(DDNum).MaxAirVolFlowRate, 5) + " in " + - cNumericFields(1) + "is lower than the outdoor air requirement."); + ShowSevereError(state, + format("The value {:.5R} in {}is lower than the outdoor air requirement.", + dd_airterminal(DDNum).MaxAirVolFlowRate, + cNumericFields(1))); ShowContinueError(state, "Occurs in " + cCMO_DDVarVolOA + " = " + dd_airterminal(DDNum).Name); - ShowContinueError(state, "The design outdoor air requirement is " + - RoundSigDigits(dd_airterminal(DDNum).DesignOAFlowRate, 5)); + ShowContinueError(state, + format("The design outdoor air requirement is {:.5R}", dd_airterminal(DDNum).DesignOAFlowRate)); ErrorsFound = true; } } @@ -1581,7 +1586,6 @@ namespace DualDuct { using DataHeatBalFanSys::ZoneThermostatSetPointHi; using DataHeatBalFanSys::ZoneThermostatSetPointLo; using DataHVACGlobals::SmallTempDiff; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index 987ce6be9bc..388e80b9c52 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -840,7 +840,8 @@ namespace EMSManager { int nHandle = EMSActuatorAvailable(ActuatorVariableNum).handleCount; if (nHandle > 0) { - EnergyPlus::ShowWarningError(state, "Seems like you already tried to get a Handle on this Actuator " + std::to_string(nHandle) + "times."); + EnergyPlus::ShowWarningError(state, + format("Seems like you already tried to get a Handle on this Actuator {}times.", nHandle)); EnergyPlus::ShowContinueError(state, "Occurred for componentType='" + EMSActuatorUsed(ActuatorNum).ComponentTypeName + "', controlType='" + EMSActuatorUsed(ActuatorNum).ControlTypeName + "', uniqueKey='" + EMSActuatorUsed(ActuatorNum).UniqueIDName + "'."); @@ -1214,7 +1215,7 @@ namespace EMSManager { EMSActuatorUsed(ActuatorNum).CheckedOkay = true; int nHandle = EMSActuatorAvailable(ActuatorVariableNum).handleCount; if (nHandle > 0) { - EnergyPlus::ShowWarningError(state, "Seems like you already tried to get a Handle on this Actuator " + std::to_string(nHandle) + "times."); + EnergyPlus::ShowWarningError(state, format("Seems like you already tried to get a Handle on this Actuator {}times.", nHandle)); EnergyPlus::ShowContinueError(state, "Occurred for componentType='" + EMSActuatorUsed(ActuatorNum).ComponentTypeName + "', controlType='" + EMSActuatorUsed(ActuatorNum).ControlTypeName + "', uniqueKey='" + EMSActuatorUsed(ActuatorNum).UniqueIDName + "'."); diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index f7ed46816ca..0740881b7f8 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -161,7 +161,7 @@ namespace EarthTube { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleValuesForDay; @@ -225,19 +225,27 @@ namespace EarthTube { EarthTubeSys(Loop).MinTemperature = rNumericArgs(2); if ((EarthTubeSys(Loop).MinTemperature < -EarthTubeTempLimit) || (EarthTubeSys(Loop).MinTemperature > EarthTubeTempLimit)) { - ShowSevereError(state, cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + - " must have a minimum temperature between -" + RoundSigDigits(EarthTubeTempLimit, 0) + "C and " + - RoundSigDigits(EarthTubeTempLimit, 0) + 'C'); - ShowContinueError(state, "Entered value=" + RoundSigDigits(EarthTubeSys(Loop).MinTemperature, 0)); + ShowSevereError(state, + format("{}: {}={} must have a minimum temperature between -{:.0R}C and {:.0R}C", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + EarthTubeTempLimit, + EarthTubeTempLimit)); + ShowContinueError(state, format("Entered value={:.0R}", EarthTubeSys(Loop).MinTemperature)); ErrorsFound = true; } EarthTubeSys(Loop).MaxTemperature = rNumericArgs(3); if ((EarthTubeSys(Loop).MaxTemperature < -EarthTubeTempLimit) || (EarthTubeSys(Loop).MaxTemperature > EarthTubeTempLimit)) { - ShowSevereError(state, cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + - " must have a maximum temperature between -" + RoundSigDigits(EarthTubeTempLimit, 0) + "C and " + - RoundSigDigits(EarthTubeTempLimit, 0) + 'C'); - ShowContinueError(state, "Entered value=" + RoundSigDigits(EarthTubeSys(Loop).MaxTemperature, 0)); + ShowSevereError(state, + format("{}: {}={} must have a maximum temperature between -{:.0R}C and {:.0R}C", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + EarthTubeTempLimit, + EarthTubeTempLimit)); + ShowContinueError(state, format("Entered value={:.0R}", EarthTubeSys(Loop).MaxTemperature)); ErrorsFound = true; } @@ -260,30 +268,49 @@ namespace EarthTube { EarthTubeSys(Loop).FanPressure = rNumericArgs(5); if (EarthTubeSys(Loop).FanPressure < 0.0) { - ShowSevereError(state, cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + ", " + cNumericFieldNames(5) + - " must be positive, entered value=" + RoundSigDigits(EarthTubeSys(Loop).FanPressure, 2)); + ShowSevereError(state, + format("{}: {}={}, {} must be positive, entered value={:.2R}", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + cNumericFieldNames(5), + EarthTubeSys(Loop).FanPressure)); ErrorsFound = true; } EarthTubeSys(Loop).FanEfficiency = rNumericArgs(6); if ((EarthTubeSys(Loop).FanEfficiency <= 0.0) || (EarthTubeSys(Loop).FanEfficiency > 1.0)) { ShowSevereError(state, - cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + ", " + cNumericFieldNames(6) + - " must be greater than zero and less than or equal to one, entered value=" + RoundSigDigits(EarthTubeSys(Loop).FanEfficiency, 2)); + format("{}: {}={}, {} must be greater than zero and less than or equal to one, entered value={:.2R}", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + cNumericFieldNames(6), + EarthTubeSys(Loop).FanEfficiency)); ErrorsFound = true; } EarthTubeSys(Loop).r1 = rNumericArgs(7); if (EarthTubeSys(Loop).r1 <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + ", " + cNumericFieldNames(7) + - " must be positive, entered value=" + RoundSigDigits(EarthTubeSys(Loop).r1, 2)); + ShowSevereError(state, + format("{}: {}={}, {} must be positive, entered value={:.2R}", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + cNumericFieldNames(7), + EarthTubeSys(Loop).r1)); ErrorsFound = true; } EarthTubeSys(Loop).r2 = rNumericArgs(8); if (EarthTubeSys(Loop).r2 <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + ", " + cNumericFieldNames(8) + - " must be positive, entered value=" + RoundSigDigits(EarthTubeSys(Loop).r2, 2)); + ShowSevereError(state, + format("{}: {}={}, {} must be positive, entered value={:.2R}", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + cNumericFieldNames(8), + EarthTubeSys(Loop).r2)); ErrorsFound = true; } @@ -291,29 +318,50 @@ namespace EarthTube { EarthTubeSys(Loop).PipeLength = rNumericArgs(9); if (EarthTubeSys(Loop).PipeLength <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + ", " + cNumericFieldNames(9) + - " must be positive, entered value=" + RoundSigDigits(EarthTubeSys(Loop).PipeLength, 2)); + ShowSevereError(state, + format("{}: {}={}, {} must be positive, entered value={:.2R}", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + cNumericFieldNames(9), + EarthTubeSys(Loop).PipeLength)); ErrorsFound = true; } EarthTubeSys(Loop).PipeThermCond = rNumericArgs(10); if (EarthTubeSys(Loop).PipeThermCond <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + ", " + cNumericFieldNames(10) + - " must be positive, entered value=" + RoundSigDigits(EarthTubeSys(Loop).PipeThermCond, 2)); + ShowSevereError(state, + format("{}: {}={}, {} must be positive, entered value={:.2R}", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + cNumericFieldNames(10), + EarthTubeSys(Loop).PipeThermCond)); ErrorsFound = true; } EarthTubeSys(Loop).z = rNumericArgs(11); if (EarthTubeSys(Loop).z <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + ", " + cNumericFieldNames(11) + - " must be positive, entered value=" + RoundSigDigits(EarthTubeSys(Loop).z, 2)); + ShowSevereError(state, + format("{}: {}={}, {} must be positive, entered value={:.2R}", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + cNumericFieldNames(11), + EarthTubeSys(Loop).z)); ErrorsFound = true; } if (EarthTubeSys(Loop).z <= (EarthTubeSys(Loop).r1 + EarthTubeSys(Loop).r2 + EarthTubeSys(Loop).r3)) { - ShowSevereError(state, cCurrentModuleObject + ": " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + ", " + cNumericFieldNames(11) + - " must be greater than 3*" + cNumericFieldNames(7) + " + " + cNumericFieldNames(8) + - " entered value=" + RoundSigDigits(EarthTubeSys(Loop).z, 2) + - " ref sum=" + RoundSigDigits(EarthTubeSys(Loop).r1 + EarthTubeSys(Loop).r2 + EarthTubeSys(Loop).r3, 2)); + ShowSevereError(state, + format("{}: {}={}, {} must be greater than 3*{} + {} entered value={:.2R} ref sum={:.2R}", + cCurrentModuleObject, + cAlphaFieldNames(1), + cAlphaArgs(1), + cNumericFieldNames(11), + cNumericFieldNames(7), + cNumericFieldNames(8), + EarthTubeSys(Loop).z, + EarthTubeSys(Loop).r1 + EarthTubeSys(Loop).r2 + EarthTubeSys(Loop).r3)); ErrorsFound = true; } diff --git a/src/EnergyPlus/EcoRoofManager.cc b/src/EnergyPlus/EcoRoofManager.cc index 2fe2cc5f6e4..c5b6cff9036 100644 --- a/src/EnergyPlus/EcoRoofManager.cc +++ b/src/EnergyPlus/EcoRoofManager.cc @@ -60,14 +60,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include namespace EnergyPlus { @@ -97,7 +95,6 @@ namespace EcoRoofManager { // Use statements for data only modules // Using/Aliasing using namespace DataSurfaces; - using namespace DataLoopNode; using namespace DataHeatBalance; Real64 CumRunoff(0.0); // Cumulative runoff, updated each time step (m) mult by roof area to get volume @@ -158,7 +155,6 @@ namespace EcoRoofManager { using namespace DataHeatBalance; using namespace DataHeatBalSurface; using namespace DataSurfaces; - using namespace Psychrometrics; using ConvectionCoefficients::InitExteriorConvectionCoeff; using ConvectionCoefficients::SetExtConvectionCoeff; using ConvectionCoefficients::SetIntConvectionCoeff; @@ -703,7 +699,6 @@ namespace EcoRoofManager { // Using/Aliasing using namespace DataEnvironment; using namespace DataSurfaces; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -804,16 +799,20 @@ namespace EcoRoofManager { ShowWarningError(state, "CalcEcoRoof: Too few time steps per hour for stability."); if (ceil(60 * index1 / state.dataGlobal->MinutesPerTimeStep) <= 60) { - ShowContinueError(state, "...Entered Timesteps per hour=[" + RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + - "], Change to some value greater than or equal to [" + RoundSigDigits(60 * index1 / state.dataGlobal->MinutesPerTimeStep) + - "] for assured stability."); + ShowContinueError( + state, + format("...Entered Timesteps per hour=[{}], Change to some value greater than or equal to [{}] for assured stability.", + state.dataGlobal->NumOfTimeStepInHour, + 60 * index1 / state.dataGlobal->MinutesPerTimeStep)); ShowContinueError(state, "...Note that EnergyPlus has a maximum of 60 timesteps per hour"); ShowContinueError(state, "...The program will continue, but if the simulation fails due to too low/high temperatures, instability " "here could be the reason."); } else { - ShowContinueError(state, "...Entered Timesteps per hour=[" + RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + - "], however the required frequency for stability [" + RoundSigDigits(60 * index1 / state.dataGlobal->MinutesPerTimeStep) + - "] is over the EnergyPlus maximum of 60."); + ShowContinueError(state, + format("...Entered Timesteps per hour=[{}], however the required frequency for stability [{}] is over the " + "EnergyPlus maximum of 60.", + state.dataGlobal->NumOfTimeStepInHour, + 60 * index1 / state.dataGlobal->MinutesPerTimeStep)); ShowContinueError(state, "...Consider using the simple moisture diffusion calculation method for this application"); ShowContinueError(state, "...The program will continue, but if the simulation fails due to too low/high temperatures, instability " "here could be the reason."); @@ -951,8 +950,9 @@ namespace EcoRoofManager { RelativeSoilSaturationTop = (Moisture - MoistureResidual) / (MoistureMax - MoistureResidual); if (RelativeSoilSaturationTop < 0.0001) { if (ErrIndex == 0) { - ShowWarningMessage(state, "EcoRoof: UpdateSoilProps: Relative Soil Saturation Top Moisture <= 0.0001, Value=[" + - RoundSigDigits(RelativeSoilSaturationTop, 5) + "]."); + ShowWarningMessage(state, + format("EcoRoof: UpdateSoilProps: Relative Soil Saturation Top Moisture <= 0.0001, Value=[{:.5R}].", + RelativeSoilSaturationTop)); ShowContinueError(state, "Value is set to 0.0001 and simulation continues."); ShowContinueError(state, "You may wish to increase the number of timesteps to attempt to alleviate the problem."); } diff --git a/src/EnergyPlus/EconomicLifeCycleCost.cc b/src/EnergyPlus/EconomicLifeCycleCost.cc index 01a7681fa1b..1a81bcf05f3 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.cc +++ b/src/EnergyPlus/EconomicLifeCycleCost.cc @@ -2178,9 +2178,9 @@ namespace EconomicLifeCycleCost { } else { tableBody(1, 6) = "-- N/A --"; } - tableBody(1, 7) = MonthNames(baseDateMonth) + ' ' + std::to_string(baseDateYear); - tableBody(1, 8) = MonthNames(serviceDateMonth) + ' ' + std::to_string(serviceDateYear); - tableBody(1, 9) = std::to_string(lengthStudyYears); + tableBody(1, 7) = format("{} {}", MonthNames(baseDateMonth), baseDateYear); + tableBody(1, 8) = format("{} {}", MonthNames(serviceDateMonth), serviceDateYear); + tableBody(1, 9) = fmt::to_string(lengthStudyYears); tableBody(1, 10) = RealToStr(taxRate, 4); { auto const SELECT_CASE_var(depreciationMethod); @@ -2235,13 +2235,13 @@ namespace EconomicLifeCycleCost { rowHead(1) = "Resource"; rowHead(2) = "Start Date"; for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear + 2) = std::to_string(iYear); + rowHead(iYear + 2) = fmt::to_string(iYear); } for (jObj = 1; jObj <= numUsePriceEscalation; ++jObj) { // loop through objects not columns to add names columnHead(jObj) = UsePriceEscalation(jObj).name; tableBody(jObj, 1) = GetResourceTypeChar(UsePriceEscalation(jObj).resource); tableBody(jObj, 2) = - MonthNames(UsePriceEscalation(jObj).escalationStartMonth) + ' ' + std::to_string(UsePriceEscalation(jObj).escalationStartYear); + format("{} {}", MonthNames(UsePriceEscalation(jObj).escalationStartMonth), UsePriceEscalation(jObj).escalationStartYear); } for (jObj = 1; jObj <= numUsePriceEscalation; ++jObj) { for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { @@ -2274,7 +2274,7 @@ namespace EconomicLifeCycleCost { columnHead = "none"; rowHead(1) = ""; for (iYear = 1; iYear <= numYears; ++iYear) { - rowHead(iYear + 1) = MonthNames(serviceDateMonth) + ' ' + std::to_string(serviceDateYear + iYear - 1); + rowHead(iYear + 1) = format("{} {}", MonthNames(serviceDateMonth), serviceDateYear + iYear - 1); } for (jObj = 1; jObj <= numUseAdjustment; ++jObj) { // loop through objects not columns to add names columnHead(jObj) = UseAdjustment(jObj).name; @@ -2309,7 +2309,7 @@ namespace EconomicLifeCycleCost { tableBody = ""; rowHead(1) = ""; for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear + 1) = MonthNames(baseDateMonth) + ' ' + std::to_string(baseDateYear + iYear - 1); + rowHead(iYear + 1) = format("{} {}", MonthNames(baseDateMonth), baseDateYear + iYear - 1); } for (jObj = 1; jObj <= (numRecurringCosts + numNonrecurringCost); ++jObj) { curCashFlow = countOfCostCat + jObj; @@ -2357,7 +2357,7 @@ namespace EconomicLifeCycleCost { tableBody.allocate(numColumns, lengthStudyYears); tableBody = ""; for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear) = MonthNames(baseDateMonth) + ' ' + std::to_string(baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", MonthNames(baseDateMonth), baseDateYear + iYear - 1); } for (jObj = 1; jObj <= numResourcesUsed; ++jObj) { curCashFlow = countOfCostCat + numRecurringCosts + numNonrecurringCost + jObj; @@ -2400,7 +2400,7 @@ namespace EconomicLifeCycleCost { tableBody.allocate(numColumns, lengthStudyYears); tableBody = ""; for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear) = MonthNames(baseDateMonth) + ' ' + std::to_string(baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", MonthNames(baseDateMonth), baseDateYear + iYear - 1); } for (int jObj = 1; jObj <= numResourcesUsed; ++jObj) { curCashFlow = countOfCostCat + numRecurringCosts + numNonrecurringCost + jObj; @@ -2455,7 +2455,7 @@ namespace EconomicLifeCycleCost { columnHead(3) = "OtherCapital"; columnHead(4) = "Total"; for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear) = MonthNames(baseDateMonth) + ' ' + std::to_string(baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", MonthNames(baseDateMonth), baseDateYear + iYear - 1); tableBody(1, iYear) = RealToStr(CashFlow(costCatConstruction).yrAmount(iYear), 2); tableBody(2, iYear) = RealToStr(CashFlow(costCatSalvage).yrAmount(iYear), 2); tableBody(3, iYear) = RealToStr(CashFlow(costCatOtherCapital).yrAmount(iYear), 2); @@ -2502,7 +2502,7 @@ namespace EconomicLifeCycleCost { columnHead(10) = "Total"; for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear) = MonthNames(baseDateMonth) + ' ' + std::to_string(baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", MonthNames(baseDateMonth), baseDateYear + iYear - 1); tableBody(1, iYear) = RealToStr(CashFlow(costCatEnergy).yrAmount(iYear), 2); tableBody(2, iYear) = RealToStr(CashFlow(costCatWater).yrAmount(iYear), 2); tableBody(3, iYear) = RealToStr(CashFlow(costCatMaintenance).yrAmount(iYear), 2); @@ -2555,7 +2555,7 @@ namespace EconomicLifeCycleCost { columnHead(10) = "Total"; for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear) = MonthNames(baseDateMonth) + ' ' + std::to_string(baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", MonthNames(baseDateMonth), baseDateYear + iYear - 1); tableBody(1, iYear) = RealToStr(EscalatedTotEnergy(iYear), 2); tableBody(2, iYear) = RealToStr(CashFlow(costCatWater).yrAmount(iYear), 2); tableBody(3, iYear) = RealToStr(CashFlow(costCatMaintenance).yrAmount(iYear), 2); @@ -2619,7 +2619,7 @@ namespace EconomicLifeCycleCost { columnHead(jObj) = CashFlow(jObj).name; } for (kMonth = 1; kMonth <= lengthStudyTotalMonths; ++kMonth) { - rowHead(kMonth) = MonthNames(1 + (kMonth + baseDateMonth - 2) % 12) + ' ' + std::to_string(baseDateYear + int((kMonth - 1) / 12)); + rowHead(kMonth) = format("{} {}", MonthNames(1 + (kMonth + baseDateMonth - 2) % 12), baseDateYear + int((kMonth - 1) / 12)); } for (kMonth = 1; kMonth <= lengthStudyTotalMonths; ++kMonth) { for (jObj = 1; jObj <= numCashFlow; ++jObj) { @@ -2652,7 +2652,7 @@ namespace EconomicLifeCycleCost { columnHead(kMonth) = MonthNames(kMonth); } for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear) = std::to_string(baseDateYear + iYear - 1); + rowHead(iYear) = fmt::to_string(baseDateYear + iYear - 1); } for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { for (kMonth = 1; kMonth <= 12; ++kMonth) { @@ -2839,7 +2839,7 @@ namespace EconomicLifeCycleCost { totalPV = 0.0; for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear) = MonthNames(baseDateMonth) + ' ' + std::to_string(baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", MonthNames(baseDateMonth), baseDateYear + iYear - 1); tableBody(1, iYear) = RealToStr(CashFlow(costCatTotGrand).yrAmount(iYear), 2); // adjust for escalated energy costs Real64 yearly_total_cost = @@ -2882,7 +2882,7 @@ namespace EconomicLifeCycleCost { totalPV = 0.0; for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - rowHead(iYear) = MonthNames(baseDateMonth) + ' ' + std::to_string(baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", MonthNames(baseDateMonth), baseDateYear + iYear - 1); tableBody(1, iYear) = RealToStr(DepreciatedCapital(iYear), 2); tableBody(2, iYear) = RealToStr(TaxableIncome(iYear), 2); tableBody(3, iYear) = RealToStr(Taxes(iYear), 2); diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index 90ee01564b5..915f72815b1 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -381,7 +381,6 @@ namespace EconomicTariff { using OutputReportTabular::AddTOCEntry; using OutputReportTabular::displayTariffReport; using namespace DataIPShortCuts; - using General::RoundSigDigits; std::string const RoutineName("GetInputEconomicsTariff: "); int iInObj; // loop index variable for reading in objects @@ -715,15 +714,17 @@ namespace EconomicTariff { tariff(iInObj).demandWindow = demandWindowHour; tariff(iInObj).demWinTime = 1.00; ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid data"); - ShowContinueError(state, "Demand window of QuarterHour is not consistent with number of timesteps per hour [" + - RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + "]."); + ShowContinueError( + state, + format("Demand window of QuarterHour is not consistent with number of timesteps per hour [{}].", state.dataGlobal->NumOfTimeStepInHour)); ShowContinueError(state, "Demand window will be set to FullHour, and the simulation continues."); } else if ((SELECT_CASE_var == 2) || (SELECT_CASE_var == 6) || (SELECT_CASE_var == 10) || (SELECT_CASE_var == 30)) { tariff(iInObj).demandWindow = demandWindowHalf; tariff(iInObj).demWinTime = 0.50; ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid data"); - ShowContinueError(state, "Demand window of QuarterHour is not consistent with number of timesteps per hour [" + - RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + "]."); + ShowContinueError( + state, + format("Demand window of QuarterHour is not consistent with number of timesteps per hour [{}].", state.dataGlobal->NumOfTimeStepInHour)); ShowContinueError(state, "Demand window will be set to HalfHour, and the simulation continues."); } else if ((SELECT_CASE_var == 4) || (SELECT_CASE_var == 12) || (SELECT_CASE_var == 20) || (SELECT_CASE_var == 60)) { tariff(iInObj).demandWindow = demandWindowQuarter; @@ -737,8 +738,9 @@ namespace EconomicTariff { tariff(iInObj).demandWindow = demandWindowHour; tariff(iInObj).demWinTime = 1.00; ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid data"); - ShowContinueError(state, "Demand window of HalfHour is not consistent with number of timesteps per hour [" + - RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + "]."); + ShowContinueError( + state, + format("Demand window of HalfHour is not consistent with number of timesteps per hour [{}].", state.dataGlobal->NumOfTimeStepInHour)); ShowContinueError(state, "Demand window will be set to FullHour, and the simulation continues."); } else if ((SELECT_CASE_var == 2) || (SELECT_CASE_var == 4) || (SELECT_CASE_var == 6) || (SELECT_CASE_var == 10) || (SELECT_CASE_var == 12) || (SELECT_CASE_var == 20) || (SELECT_CASE_var == 30) || (SELECT_CASE_var == 60)) { @@ -3294,9 +3296,10 @@ namespace EconomicTariff { (SELECT_CASE_var == kindAssignCompute) || (SELECT_CASE_var == kindTariff) || (SELECT_CASE_var == kindComputation)) { // do nothing } else { - ShowWarningError(state, "UtilityCost Debugging issue. Invalid kind of variable used (pushStack). " + - std::to_string(econVar(variablePointer).kindOfObj) + - " in tariff: " + tariff(econVar(variablePointer).tariffIndx).tariffName); + ShowWarningError(state, + format("UtilityCost Debugging issue. Invalid kind of variable used (pushStack). {} in tariff: {}", + econVar(variablePointer).kindOfObj, + tariff(econVar(variablePointer).tariffIndx).tariffName)); } } // if the serviceCharges are being evaluated add in the monthly charges diff --git a/src/EnergyPlus/ElectricBaseboardRadiator.cc b/src/EnergyPlus/ElectricBaseboardRadiator.cc index e7a46f6fa8c..7b266f42ab9 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -163,7 +163,6 @@ namespace ElectricBaseboardRadiator { // Water baseboard module // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int BaseboardNum; // Index of unit in baseboard array @@ -183,13 +182,19 @@ namespace ElectricBaseboardRadiator { } else { BaseboardNum = CompIndex; if (BaseboardNum > NumElecBaseboards || BaseboardNum < 1) { - ShowFatalError(state, "SimElectricBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + - ", Number of Units=" + TrimSigDigits(NumElecBaseboards) + ", Entered Unit name=" + EquipName); + ShowFatalError(state, + format("SimElectricBaseboard: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + BaseboardNum, + NumElecBaseboards, + EquipName)); } if (CheckEquipName(BaseboardNum)) { if (EquipName != ElecBaseboard(BaseboardNum).EquipName) { - ShowFatalError(state, "SimElectricBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + ", Unit name=" + EquipName + - ", stored Unit Name for that index=" + ElecBaseboard(BaseboardNum).EquipName); + ShowFatalError(state, + format("SimElectricBaseboard: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + BaseboardNum, + EquipName, + ElecBaseboard(BaseboardNum).EquipName)); } CheckEquipName(BaseboardNum) = false; } @@ -230,7 +235,7 @@ namespace ElectricBaseboardRadiator { // Using/Aliasing using DataSurfaces::Surface; - using General::RoundSigDigits; + using GlobalNames::VerifyUniqueBaseboardName; using ScheduleManager::GetScheduleIndex; using namespace DataIPShortCuts; @@ -238,7 +243,6 @@ namespace ElectricBaseboardRadiator { using DataSizing::CapacityPerFloorArea; using DataSizing::FractionOfAutosizedHeatingCapacity; using DataSizing::HeatingDesignCapacity; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetBaseboardInput: "); // include trailing blank space @@ -319,8 +323,10 @@ namespace ElectricBaseboardRadiator { ElecBaseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatDesignCapacityNumericNum); if (ElecBaseboard(BaseboardNum).ScaledHeatingCapacity < 0.0 && ElecBaseboard(BaseboardNum).ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + ElecBaseboard(BaseboardNum).EquipName); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatDesignCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatDesignCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatDesignCapacityNumericNum), + rNumericArgs(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } } else { @@ -336,8 +342,10 @@ namespace ElectricBaseboardRadiator { if (ElecBaseboard(BaseboardNum).ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + ElecBaseboard(BaseboardNum).EquipName); ShowContinueError(state, "Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum), + rNumericArgs(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } else if (ElecBaseboard(BaseboardNum).ScaledHeatingCapacity == AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + ElecBaseboard(BaseboardNum).EquipName); @@ -357,8 +365,10 @@ namespace ElectricBaseboardRadiator { ElecBaseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); if (ElecBaseboard(BaseboardNum).ScaledHeatingCapacity < 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + ElecBaseboard(BaseboardNum).EquipName); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum), + rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -378,13 +388,13 @@ namespace ElectricBaseboardRadiator { if (ElecBaseboard(BaseboardNum).FracRadiant < MinFraction) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(5) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinFraction, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinFraction)); ElecBaseboard(BaseboardNum).FracRadiant = MinFraction; } if (ElecBaseboard(BaseboardNum).FracRadiant > MaxFraction) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(5) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxFraction)); ElecBaseboard(BaseboardNum).FracRadiant = MaxFraction; } @@ -403,19 +413,19 @@ namespace ElectricBaseboardRadiator { if (ElecBaseboard(BaseboardNum).FracDistribPerson < MinFraction) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(6) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinFraction, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinFraction)); ElecBaseboard(BaseboardNum).FracDistribPerson = MinFraction; } if (ElecBaseboard(BaseboardNum).FracDistribPerson > MaxFraction) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(6) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxFraction)); ElecBaseboard(BaseboardNum).FracDistribPerson = MaxFraction; } ElecBaseboard(BaseboardNum).TotSurfToDistrib = NumNumbers - 6; // IF (ElecBaseboard(BaseboardNum)%TotSurfToDistrib > MaxDistribSurfaces) THEN - // CALL ShowWarningError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & + // CALL ShowWarningError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & // '", the number of surface/radiant fraction groups entered was higher than the allowable maximum.') // CALL ShowContinueError(state, '...only the maximum value=['//TRIM(RoundSigDigits(MaxDistribSurfaces))// & // '] will be processed.') @@ -424,7 +434,7 @@ namespace ElectricBaseboardRadiator { if ((ElecBaseboard(BaseboardNum).TotSurfToDistrib < MinDistribSurfaces) && (ElecBaseboard(BaseboardNum).FracRadiant > MinFraction)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", the number of surface/radiant fraction groups entered was less than the allowable minimum."); - ShowContinueError(state, "...the minimum that must be entered=[" + RoundSigDigits(MinDistribSurfaces) + "]."); + ShowContinueError(state, format("...the minimum that must be entered=[{}].", MinDistribSurfaces)); ErrorsFound = true; ElecBaseboard(BaseboardNum).TotSurfToDistrib = 0; // error } @@ -465,13 +475,13 @@ namespace ElectricBaseboardRadiator { if (ElecBaseboard(BaseboardNum).FracDistribToSurf(SurfNum) > MaxFraction) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(SurfNum + 6) + "was greater than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxFraction)); ElecBaseboard(BaseboardNum).TotSurfToDistrib = MaxFraction; } if (ElecBaseboard(BaseboardNum).FracDistribToSurf(SurfNum) < MinFraction) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(SurfNum + 6) + "was less than the allowable minimum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MinFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MinFraction)); ElecBaseboard(BaseboardNum).TotSurfToDistrib = MinFraction; } if (ElecBaseboard(BaseboardNum).SurfacePtr(SurfNum) != 0) { @@ -690,7 +700,6 @@ namespace ElectricBaseboardRadiator { using namespace DataSizing; using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("SizeElectricBaseboard"); @@ -1046,7 +1055,6 @@ namespace ElectricBaseboardRadiator { using DataHeatBalFanSys::QElecBaseboardToPerson; using DataSurfaces::Surface; using DataZoneEquipment::ZoneEquipConfig; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: Real64 const SmallestArea(0.001); // Smallest area in meters squared (to avoid a divide by zero) @@ -1078,16 +1086,16 @@ namespace ElectricBaseboardRadiator { if (ThisSurfIntensity > MaxRadHeatFlux) { ShowSevereError(state, "DistributeBBElecRadGains: excessive thermal radiation heat flux intensity detected"); ShowContinueError(state, "Surface = " + Surface(SurfNum).Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(Surface(SurfNum).Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", Surface(SurfNum).Area)); ShowContinueError(state, "Occurs in " + cCMO_BBRadiator_Electric + " = " + ElecBaseboard(BaseboardNum).EquipName); - ShowContinueError(state, "Radiation intensity = " + RoundSigDigits(ThisSurfIntensity, 2) + " [W/m2]"); + ShowContinueError(state, format("Radiation intensity = {:.2R} [W/m2]", ThisSurfIntensity)); ShowContinueError(state, "Assign a larger surface area or more surfaces in " + cCMO_BBRadiator_Electric); ShowFatalError(state, "DistributeBBElecRadGains: excessive thermal radiation heat flux intensity detected"); } } else { ShowSevereError(state, "DistributeBBElecRadGains: surface not large enough to receive thermal radiation heat flux"); ShowContinueError(state, "Surface = " + Surface(SurfNum).Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(Surface(SurfNum).Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", Surface(SurfNum).Area)); ShowContinueError(state, "Occurs in " + cCMO_BBRadiator_Electric + " = " + ElecBaseboard(BaseboardNum).EquipName); ShowContinueError(state, "Assign a larger surface area or more surfaces in " + cCMO_BBRadiator_Electric); ShowFatalError(state, "DistributeBBElecRadGains: surface not large enough to receive thermal radiation heat flux"); diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index 66ffd449b83..14c31539a01 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -2233,7 +2233,7 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, if (electricPowerOutput < 0.0) { if (errCountNegElectProd_ == 0) { ShowWarningMessage(state, typeOfName + " named " + name + " is producing negative electric power, check generator inputs."); - ShowContinueError(state, "Electric power production rate =" + General::RoundSigDigits(electricPowerOutput, 4)); + ShowContinueError(state, format("Electric power production rate ={:.4R}", electricPowerOutput)); ShowContinueError(state, "The power will be set to zero, and the simulation continues... "); } ShowRecurringWarningErrorAtEnd(state, typeOfName + " named " + name + " is producing negative electric power ", @@ -3768,15 +3768,15 @@ bool ElectricStorage::determineCurrentForBatteryDischarge(EnergyPlusData &state, // Issue #5301 need more diagnostics for this case ShowWarningError(state, "ElectricStorage::determineCurrentForBatteryDischarge, iteration limit exceeded, failed to solve for discharge current."); - ShowContinueError(state, "Last timestep charge available, q0 = " + General::RoundSigDigits(q0, 5)); - ShowContinueError(state, "New Current, Inew = " + General::RoundSigDigits(Inew, 5) + " [Amps]"); - ShowContinueError(state, "Power discharge per module cell, Pw = " + General::RoundSigDigits(Pw, 5) + " "); - ShowContinueError(state, "Charge Conversion Rate, [1/h] change rate from bound charge energy to available charge, parameter k = " + - General::RoundSigDigits(k, 5)); - ShowContinueError(state, "parameter c = " + General::RoundSigDigits(c, 5)); - ShowContinueError(state, "parameter qmax = " + General::RoundSigDigits(qmax, 5)); - ShowContinueError(state, "Fully charged open circuit voltage, parameter E0c = " + General::RoundSigDigits(E0c, 5)); - ShowContinueError(state, "parameter InternalR = " + General::RoundSigDigits(InternalR, 5)); + ShowContinueError(state, format("Last timestep charge available, q0 = {:.5R}", q0)); + ShowContinueError(state, format("New Current, Inew = {:.5R} [Amps]", Inew)); + ShowContinueError(state, format("Power discharge per module cell, Pw = {:.5R} ", Pw)); + ShowContinueError( + state, format("Charge Conversion Rate, [1/h] change rate from bound charge energy to available charge, parameter k = {:.5R}", k)); + ShowContinueError(state, format("parameter c = {:.5R}", c)); + ShowContinueError(state, format("parameter qmax = {:.5R}", qmax)); + ShowContinueError(state, format("Fully charged open circuit voltage, parameter E0c = {:.5R}", E0c)); + ShowContinueError(state, format("parameter InternalR = {:.5R}", InternalR)); if (qmaxf == 0.0) { ShowContinueError(state, "qmaxf was zero, would have divided by zero."); } @@ -4009,7 +4009,7 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons if (performanceInputMode_ == TransformerPerformanceInput::lossesMethod) { ShowWarningError(state, routineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\"."); ShowContinueError(state, "Specified " + DataIPShortCuts::cAlphaFieldNames(6) + " = " + DataIPShortCuts::cAlphaArgs(6)); - ShowContinueError(state, "Specified " + DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(ratedCapacity_, 1)); + ShowContinueError(state, format("Specified {} = {:.1R}", DataIPShortCuts::cNumericFieldNames(2), ratedCapacity_)); ShowContinueError(state, "Transformer load and no load losses cannot be calculated with 0.0 rated capacity."); ShowContinueError(state, "Simulation continues but transformer losses will be set to zero."); } @@ -4026,8 +4026,7 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons maxPUL_ = ratedPUL_; } else if (maxPUL_ <= 0 || maxPUL_ > 1) { ShowSevereError(state, routineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\", invalid entry."); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(11) + "=[" + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(11), 3) + "]."); + ShowContinueError(state, format("Invalid {}=[{:.3R}].", DataIPShortCuts::cNumericFieldNames(11), DataIPShortCuts::rNumericArgs(11))); ShowContinueError(state, "Entered value must be > 0 and <= 1."); errorsFound = true; } diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index 005dd9749d4..4b6733f02fe 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -201,7 +201,6 @@ namespace EvaporativeCoolers { // at the system time step. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int EvapCoolNum; // The EvapCooler that you are currently loading input into @@ -224,13 +223,18 @@ namespace EvaporativeCoolers { } else { EvapCoolNum = CompIndex; if (EvapCoolNum > NumEvapCool || EvapCoolNum < 1) { - ShowFatalError(state, "SimEvapCooler: Invalid CompIndex passed=" + TrimSigDigits(EvapCoolNum) + - ", Number of Units=" + TrimSigDigits(NumEvapCool) + ", Entered Unit name=" + CompName); + ShowFatalError( + state, + format( + "SimEvapCooler: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", EvapCoolNum, NumEvapCool, CompName)); } if (CheckEquipName(EvapCoolNum)) { if (CompName != EvapCond(EvapCoolNum).EvapCoolerName) { - ShowFatalError(state, "SimEvapCooler: Invalid CompIndex passed=" + TrimSigDigits(EvapCoolNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + EvapCond(EvapCoolNum).EvapCoolerName); + ShowFatalError(state, + format("SimEvapCooler: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + EvapCoolNum, + CompName, + EvapCond(EvapCoolNum).EvapCoolerName)); } CheckEquipName(EvapCoolNum) = false; } @@ -1101,7 +1105,6 @@ namespace EvaporativeCoolers { // Using/Aliasing using namespace DataSizing; using Fans::SetFanData; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool CoolerOnOApath(false); @@ -1262,9 +1265,9 @@ namespace EvaporativeCoolers { if ((std::abs(IndirectVolFlowRateDes - IndirectVolFlowRateUser) / IndirectVolFlowRateUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeEvaporativeCooler:Indirect:ResearchSpecial: Potential issue with equipment sizing for " + EvapCond(EvapCoolNum).EvapCoolerName); - ShowContinueError(state, "User-Specified Secondary Fan Flow Rate of " + RoundSigDigits(IndirectVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Secondary Fan Flow Rate of " + RoundSigDigits(IndirectVolFlowRateDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Secondary Fan Flow Rate of {:.5R} [m3/s]", IndirectVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Secondary Fan Flow Rate of {:.5R} [m3/s]", IndirectVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1341,11 +1344,12 @@ namespace EvaporativeCoolers { //"User-Specified Secondary Fan Flow Rate [m3/s]", IndirectVolFlowRateUser ); // if ( DisplayExtraWarnings ) { // if ( ( std::abs( IndirectVolFlowRateDes - IndirectVolFlowRateUser ) / IndirectVolFlowRateUser ) > AutoVsHardSizingThreshold ) { - // ShowMessage( "SizeEvaporativeCooler:Indirect:ResearchSpecial: \nPotential issue with equipment sizing for " + EvapCond( EvapCoolNum - // ).EvapCoolerName ); ShowContinueError(state, "User-Specified Secondary Fan Flow Rate of " + RoundSigDigits( IndirectVolFlowRateUser, 5 - // ) + " [m3/s]" ); ShowContinueError(state, "differs from Design Size Secondary Fan Flow Rate of " + RoundSigDigits( - // IndirectVolFlowRateDes, 5 ) + " [m3/s]" ); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes." ); - // ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components." ); + // ShowMessage(state, "SizeEvaporativeCooler:Indirect:ResearchSpecial: \nPotential issue with equipment sizing for " + EvapCond( + // EvapCoolNum + // ).EvapCoolerName ); ShowContinueError(state, "User-Specified Secondary Fan Flow Rate of " + RoundSigDigits( + // IndirectVolFlowRateUser, 5 ) + " [m3/s]" ); ShowContinueError(state, format("differs from Design Size Secondary Fan Flow Rate of + // {:.5R}", IndirectVolFlowRateDes) + " [m3/s]" ); ShowContinueError(state, "This may, or may not, indicate mismatched component + // sizes." ); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components." ); //} //} //} @@ -1422,8 +1426,8 @@ namespace EvaporativeCoolers { if ((std::abs(PadAreaDes - PadAreaUser) / PadAreaUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeEvaporativeCooler:Direct:CelDekPad: Potential issue with equipment sizing for " + EvapCond(EvapCoolNum).EvapCoolerName); - ShowContinueError(state, "User-Specified Celdek Pad Area of" + RoundSigDigits(PadAreaUser, 2) + " [m2]"); - ShowContinueError(state, "differs from Design Size Celdek Pad Area of " + RoundSigDigits(PadAreaDes, 2) + " [m2]"); + ShowContinueError(state, format("User-Specified Celdek Pad Area of{:.2R} [m2]", PadAreaUser)); + ShowContinueError(state, format("differs from Design Size Celdek Pad Area of {:.2R} [m2]", PadAreaDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1461,8 +1465,8 @@ namespace EvaporativeCoolers { if ((std::abs(PadDepthDes - PadDepthUser) / PadDepthUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeEvaporativeCooler:Direct:CelDekPad: Potential issue with equipment sizing for " + EvapCond(EvapCoolNum).EvapCoolerName); - ShowContinueError(state, "User-Specified Celdek Pad Depth of" + RoundSigDigits(PadDepthUser, 2) + " [m]"); - ShowContinueError(state, "differs from Design Size Celdek Pad Depth of " + RoundSigDigits(PadDepthDes, 2) + " [m]"); + ShowContinueError(state, format("User-Specified Celdek Pad Depth of{:.2R} [m]", PadDepthUser)); + ShowContinueError(state, format("differs from Design Size Celdek Pad Depth of {:.2R} [m]", PadDepthDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1553,8 +1557,8 @@ namespace EvaporativeCoolers { if ((std::abs(PadAreaDes - PadAreaUser) / PadAreaUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeEvaporativeCooler:Indirect:CelDekPad: Potential issue with equipment sizing for " + EvapCond(EvapCoolNum).EvapCoolerName); - ShowContinueError(state, "User-Specified Celdek Pad Area " + RoundSigDigits(PadAreaUser, 2) + " [m2]"); - ShowContinueError(state, "differs from Design Size Celdek Pad Area of " + RoundSigDigits(PadAreaDes, 2) + " [m2]"); + ShowContinueError(state, format("User-Specified Celdek Pad Area {:.2R} [m2]", PadAreaUser)); + ShowContinueError(state, format("differs from Design Size Celdek Pad Area of {:.2R} [m2]", PadAreaDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1590,8 +1594,8 @@ namespace EvaporativeCoolers { if ((std::abs(PadDepthDes - PadDepthUser) / PadDepthUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeEvaporativeCooler:Indirect:CelDekPad: Potential issue with equipment sizing for " + EvapCond(EvapCoolNum).EvapCoolerName); - ShowContinueError(state, "User-Specified Celdek Pad Depth of" + RoundSigDigits(PadDepthUser, 2) + " [m]"); - ShowContinueError(state, "differs from Design Size Celdek Pad Depth of " + RoundSigDigits(PadDepthDes, 2) + " [m]"); + ShowContinueError(state, format("User-Specified Celdek Pad Depth of{:.2R} [m]", PadDepthUser)); + ShowContinueError(state, format("differs from Design Size Celdek Pad Depth of {:.2R} [m]", PadDepthDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1657,7 +1661,6 @@ namespace EvaporativeCoolers { // na // Using/Aliasing - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1704,8 +1707,8 @@ namespace EvaporativeCoolers { if (SatEff < 0.0) { // we have a serious problem. Pad Area and/or depth not suitable for system air flow rates ShowSevereError(state, "EVAPCOOLER:DIRECT:CELDEKPAD: " + EvapCond(EvapCoolNum).EvapCoolerName + " has a problem"); ShowContinueError(state, "Check size of Pad Area and/or Pad Depth in input"); - ShowContinueError(state, "Cooler Effectiveness calculated as: " + RoundSigDigits(SatEff, 2)); - ShowContinueError(state, "Air velocity (m/s) through pads calculated as: " + RoundSigDigits(AirVel, 2)); + ShowContinueError(state, format("Cooler Effectiveness calculated as: {:.2R}", SatEff)); + ShowContinueError(state, format("Air velocity (m/s) through pads calculated as: {:.2R}", AirVel)); ShowFatalError(state, "Program Terminates due to previous error condition"); } EvapCond(EvapCoolNum).SatEff = SatEff; @@ -2460,7 +2463,7 @@ namespace EvaporativeCoolers { using DataEnvironment::OutBaroPress; using DataEnvironment::OutDryBulbTemp; using DataHVACGlobals::SmallLoad; - using General::RoundSigDigits; + using General::SolveRoot; using Psychrometrics::PsyHfgAirFnWTdb; @@ -2548,8 +2551,7 @@ namespace EvaporativeCoolers { "Evaporative Cooler Research Special = " + EvapCond(EvapCoolNum).EvapCoolerName); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(MaxIte) + - "] exceeded in calculating secondary air mass flow rate"); + ShowContinueError(state, format(" Iteration limit [{}] exceeded in calculating secondary air mass flow rate", MaxIte)); ShowContinueError(state, " Simulation continues"); } ShowRecurringWarningErrorAtEnd(state, @@ -2565,8 +2567,8 @@ namespace EvaporativeCoolers { EvapCond(EvapCoolNum).EvapCoolerName); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad secondary air mass flow rate limits"); - ShowContinueError(state, "...Given minimum secondary air mass flow rate=" + RoundSigDigits(MassFlowRateSecMin, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum secondary air mass flow rate=" + RoundSigDigits(MassFlowRateSecMax, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum secondary air mass flow rate={:.3R} kg/s", MassFlowRateSecMin)); + ShowContinueError(state, format("...Given maximum secondary air mass flow rate={:.3R} kg/s", MassFlowRateSecMax)); ShowContinueError(state, " Simulation continues"); } ShowRecurringWarningErrorAtEnd(state, "Secondary air mass flow control failed in Indirect Evaporative Cooler Research Special = " + @@ -2610,8 +2612,7 @@ namespace EvaporativeCoolers { "Evaporative Cooler Research Special = " + EvapCond(EvapCoolNum).EvapCoolerName); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(MaxIte) + - "] exceeded in calculating secondary air mass flow rate"); + ShowContinueError(state, format(" Iteration limit [{}] exceeded in calculating secondary air mass flow rate", MaxIte)); ShowContinueError(state, " Simulation continues"); } ShowRecurringWarningErrorAtEnd(state, @@ -2627,8 +2628,8 @@ namespace EvaporativeCoolers { EvapCond(EvapCoolNum).EvapCoolerName); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad secondary air mass flow rate limits"); - ShowContinueError(state, "...Given minimum secondary air mass flow rate=" + RoundSigDigits(MassFlowRateSecMin, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum secondary air mass flow rate=" + RoundSigDigits(MassFlowRateSecMax, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum secondary air mass flow rate={:.3R} kg/s", MassFlowRateSecMin)); + ShowContinueError(state, format("...Given maximum secondary air mass flow rate={:.3R} kg/s", MassFlowRateSecMax)); ShowContinueError(state, " Simulation continues"); } ShowRecurringWarningErrorAtEnd(state, "Secondary air mass flow control failed in Indirect Evaporative Cooler Research Special = " + @@ -2659,8 +2660,7 @@ namespace EvaporativeCoolers { "Evaporative Cooler Research Special = " + EvapCond(EvapCoolNum).EvapCoolerName); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(MaxIte) + - "] exceeded in calculating secondary air mass flow rate"); + ShowContinueError(state, format(" Iteration limit [{}] exceeded in calculating secondary air mass flow rate", MaxIte)); ShowContinueError(state, " Simulation continues"); } ShowRecurringWarningErrorAtEnd(state, @@ -2676,8 +2676,8 @@ namespace EvaporativeCoolers { EvapCond(EvapCoolNum).EvapCoolerName); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad secondary air mass flow rate limits"); - ShowContinueError(state, "...Given minimum secondary air mass flow rate=" + RoundSigDigits(MassFlowRateSecMin, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum secondary air mass flow rate=" + RoundSigDigits(MassFlowRateSecMax, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum secondary air mass flow rate={:.3R} kg/s", MassFlowRateSecMin)); + ShowContinueError(state, format("...Given maximum secondary air mass flow rate={:.3R} kg/s", MassFlowRateSecMax)); ShowContinueError(state, " Simulation continues"); } ShowRecurringWarningErrorAtEnd(state, "Secondary air mass flow control failed in Indirect Evaporative Cooler Research Special = " + @@ -2731,8 +2731,7 @@ namespace EvaporativeCoolers { "Evaporative Cooler Research Special = " + EvapCond(EvapCoolNum).EvapCoolerName); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(MaxIte) + - "] exceeded in calculating secondary air mass flow rate"); + ShowContinueError(state, format(" Iteration limit [{}] exceeded in calculating secondary air mass flow rate", MaxIte)); ShowContinueError(state, " Simulation continues"); } ShowRecurringWarningErrorAtEnd(state, @@ -2748,8 +2747,8 @@ namespace EvaporativeCoolers { EvapCond(EvapCoolNum).EvapCoolerName); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad secondary air mass flow rate limits"); - ShowContinueError(state, "...Given minimum secondary air mass flow rate=" + RoundSigDigits(MassFlowRateSecMin, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum secondary air mass flow rate=" + RoundSigDigits(MassFlowRateSecMax, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum secondary air mass flow rate={:.3R} kg/s", MassFlowRateSecMin)); + ShowContinueError(state, format("...Given maximum secondary air mass flow rate={:.3R} kg/s", MassFlowRateSecMax)); ShowContinueError(state, " Simulation continues"); } ShowRecurringWarningErrorAtEnd(state, "Secondary air mass flow control failed in Indirect Evaporative Cooler Research Special = " + @@ -3586,7 +3585,6 @@ namespace EvaporativeCoolers { // public simulation routine for managing zone hvac evaporative cooler unit // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CompNum; @@ -3606,13 +3604,20 @@ namespace EvaporativeCoolers { } else { CompNum = CompIndex; if (CompNum < 1 || CompNum > NumZoneEvapUnits) { - ShowFatalError(state, "SimZoneEvaporativeCoolerUnit: Invalid CompIndex passed=" + TrimSigDigits(CompNum) + - ", Number of units =" + TrimSigDigits(NumZoneEvapUnits) + ", Entered Unit name = " + CompName); + ShowFatalError(state, + format("SimZoneEvaporativeCoolerUnit: Invalid CompIndex passed={}, Number of units ={}, Entered Unit name = {}", + CompNum, + NumZoneEvapUnits, + CompName)); } if (CheckZoneEvapUnitName(CompNum)) { if (CompName != ZoneEvapUnit(CompNum).Name) { - ShowFatalError(state, "SimZoneEvaporativeCoolerUnit: Invalid CompIndex passed=" + TrimSigDigits(CompNum) + ", Unit name=" + CompName + - ", stored unit name for that index=" + ZoneEvapUnit(CompNum).Name); + ShowFatalError( + state, + format("SimZoneEvaporativeCoolerUnit: Invalid CompIndex passed={}, Unit name={}, stored unit name for that index={}", + CompNum, + CompName, + ZoneEvapUnit(CompNum).Name)); } CheckZoneEvapUnitName(CompNum) = false; } @@ -3647,7 +3652,7 @@ namespace EvaporativeCoolers { using Fans::GetFanOutletNode; using Fans::GetFanType; using Fans::GetFanVolFlow; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; // SUBROUTINE PARAMETER DEFINITIONS: @@ -4091,7 +4096,6 @@ namespace EvaporativeCoolers { using DataZoneEquipment::ZoneEquipInputsFilled; using DataZoneEquipment::ZoneEvaporativeCoolerUnit_Num; using Fans::GetFanVolFlow; - using General::TrimSigDigits; // Locals @@ -4142,9 +4146,9 @@ namespace EvaporativeCoolers { if (ZoneEvapUnit(UnitNum).ActualFanVolFlowRate < ZoneEvapUnit(UnitNum).DesignAirVolumeFlowRate) { ShowSevereError(state, "InitZoneEvaporativeCoolerUnit: ZoneHVAC:EvaporativeCoolerUnit = " + ZoneEvapUnit(UnitNum).Name); ShowContinueError(state, "...unit fan volumetric flow rate less than evaporative cooler unit design supply air flow rate."); - ShowContinueError(state, "...fan volumetric flow rate = " + TrimSigDigits(ZoneEvapUnit(UnitNum).ActualFanVolFlowRate, 5) + " m3/s."); - ShowContinueError(state, - "...evap cooler unit volumetric flow rate = " + TrimSigDigits(ZoneEvapUnit(UnitNum).DesignAirVolumeFlowRate, 5) + " m3/s."); + ShowContinueError(state, format("...fan volumetric flow rate = {:.5T} m3/s.", ZoneEvapUnit(UnitNum).ActualFanVolFlowRate)); + ShowContinueError( + state, format("...evap cooler unit volumetric flow rate = {:.5T} m3/s.", ZoneEvapUnit(UnitNum).DesignAirVolumeFlowRate)); ZoneEvapUnit(UnitNum).DesignAirVolumeFlowRate = ZoneEvapUnit(UnitNum).ActualFanVolFlowRate; ShowContinueError(state, "...evaporative cooler unit design supply air flow rate will match fan flow rate and simulation continues."); ZoneEvapUnit(UnitNum).MyEnvrn = true; // re-initialize to set mass flow rate and max mass flow rate @@ -4281,7 +4285,6 @@ namespace EvaporativeCoolers { using DataSizing::CurZoneEqNum; using DataSizing::FinalZoneSizing; using DataSizing::ZoneSizingRunDone; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4665,13 +4668,15 @@ namespace EvaporativeCoolers { if (ZoneEvapUnit(UnitNum).UnitLoadControlMaxIterErrorIndex == 0) { ShowWarningError(state, "Iteration limit exceeded calculating evap unit part load ratio, for unit=" + ZoneEvapUnit(UnitNum).Name); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Unit part load ratio returned=" + General::RoundSigDigits(PartLoadRatio, 2)); + ShowContinueError(state, format("Unit part load ratio returned={:.2R}", PartLoadRatio)); ShowContinueError(state, "Check input for Fan Placement."); } - ShowRecurringWarningErrorAtEnd(state, "Zone Evaporative Cooler unit part load ratio control failed (iteration limit [" + - General::RoundSigDigits(MaxIte) + "]) for ZoneHVAC:EvaporativeCoolerUnit =\"" + - ZoneEvapUnit(UnitNum).Name, - ZoneEvapUnit(UnitNum).UnitLoadControlMaxIterErrorIndex); + ShowRecurringWarningErrorAtEnd(state, + format( + "Zone Evaporative Cooler unit part load ratio control failed (iteration limit [{}]) for ZoneHVAC:EvaporativeCoolerUnit =\"{}", + MaxIte, + ZoneEvapUnit(UnitNum).Name), + ZoneEvapUnit(UnitNum).UnitLoadControlMaxIterErrorIndex); } else if (SolFla == -2) { if (ZoneEvapUnit(UnitNum).UnitLoadControlLimitsErrorIndex == 0) { @@ -4742,7 +4747,7 @@ namespace EvaporativeCoolers { // Using/Aliasing using DataHVACGlobals::ZoneCompTurnFansOff; using DataHVACGlobals::ZoneCompTurnFansOn; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; @@ -4825,12 +4830,14 @@ namespace EvaporativeCoolers { ShowWarningError(state, "Iteration limit exceeded calculating variable speed evap unit fan speed ratio, for unit=" + ZoneEvapUnit(UnitNum).Name); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Fan speed ratio returned=" + RoundSigDigits(FanSpeedRatio, 2)); + ShowContinueError(state, format("Fan speed ratio returned={:.2R}", FanSpeedRatio)); ShowContinueError(state, "Check input for Fan Placement."); } - ShowRecurringWarningErrorAtEnd(state, "Zone Evaporative Cooler unit control failed (iteration limit [" + RoundSigDigits(MaxIte) + - "]) for ZoneHVAC:EvaporativeCoolerUnit =\"" + ZoneEvapUnit(UnitNum).Name, - ZoneEvapUnit(UnitNum).UnitVSControlMaxIterErrorIndex); + ShowRecurringWarningErrorAtEnd(state, + format("Zone Evaporative Cooler unit control failed (iteration limit [{}]) for ZoneHVAC:EvaporativeCoolerUnit =\"{}", + MaxIte, + ZoneEvapUnit(UnitNum).Name), + ZoneEvapUnit(UnitNum).UnitVSControlMaxIterErrorIndex); } else if (SolFla == -2) { if (ZoneEvapUnit(UnitNum).UnitVSControlLimitsErrorIndex == 0) { diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 532f2385cc9..0439c624b76 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -1248,9 +1248,11 @@ namespace EvaporativeFluidCoolers { } if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= DesignEnteringAirWetBulb) { ShowSevereError(state, "Error when autosizing the UA value for Evaporative Fluid Cooler = " + this->Name + '.'); - ShowContinueError(state, "Design Loop Exit Temperature (" + General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2) + - " C) must be greater than design entering air wet-bulb temperature (" + - General::RoundSigDigits(DesignEnteringAirWetBulb, 2) + " C) when autosizing the Evaporative Fluid Cooler UA."); + ShowContinueError(state, + format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air wet-bulb temperature " + "({:.2R} C) when autosizing the Evaporative Fluid Cooler UA.", + DataSizing::PlantSizData(PltSizCondNum).ExitTemp, + DesignEnteringAirWetBulb)); ShowContinueError(state, "It is recommended that the Design Loop Exit Temperature = Design Entering Air Wet-bulb Temp plus the Evaporative " "Fluid Cooler design approach temperature (e.g., 4 C)."); ShowContinueError(state, "If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design Setpoint must be " @@ -1419,9 +1421,10 @@ namespace EvaporativeFluidCoolers { // temperature is less than design inlet air wet bulb temperature of 25.6 C if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= 25.6) { ShowSevereError(state, "Error when autosizing the UA value for Evaporative Fluid Cooler = " + this->Name + '.'); - ShowContinueError(state, "Design Loop Exit Temperature (" + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2) + - " C) must be greater than 25.6 C when autosizing the Evaporative Fluid Cooler UA."); + ShowContinueError(state, + format("Design Loop Exit Temperature ({:.2R} C) must be greater than 25.6 C when autosizing the " + "Evaporative Fluid Cooler UA.", + DataSizing::PlantSizData(PltSizCondNum).ExitTemp)); ShowContinueError(state, "The Design Loop Exit Temperature specified in Sizing:Plant object = " + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName); ShowContinueError(state, "It is recommended that the Design Loop Exit Temperature = 25.6 C plus the Evaporative Fluid Cooler design " @@ -1459,7 +1462,7 @@ namespace EvaporativeFluidCoolers { if (SolFla == -1) { ShowWarningError(state, "Iteration limit exceeded in calculating evaporative fluid cooler UA."); ShowContinueError(state, "Autosizing of fluid cooler UA failed for evaporative fluid cooler = " + this->Name); - ShowContinueError(state, "The final UA value = " + General::RoundSigDigits(UA, 2) + "W/C, and the simulation continues..."); + ShowContinueError(state, format("The final UA value = {:.2R}W/C, and the simulation continues...", UA)); } else if (SolFla == -2) { this->SimSimpleEvapFluidCooler(state, Par(2), Par(3), UA0, OutWaterTempAtUA0); this->SimSimpleEvapFluidCooler(state, Par(2), Par(3), UA1, OutWaterTempAtUA1); @@ -1477,25 +1480,27 @@ namespace EvaporativeFluidCoolers { "based on the autosized values shown below or to adjust design evaporative fluid cooler air inlet wet-bulb temperature."); ShowContinueError(state, "Plant:Sizing object inputs also influence these results (e.g. DeltaT and ExitTemp)."); ShowContinueError(state, "Inputs to the evaporative fluid cooler object:"); - ShowContinueError(state, "Design Evaporative Fluid Cooler Load [W] = " + General::RoundSigDigits(Par(1), 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Water Volume Flow Rate [m3/s] = " + - General::RoundSigDigits(this->DesignWaterFlowRate, 6)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Air Volume Flow Rate [m3/s] = " + General::RoundSigDigits(Par(3), 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Air Inlet Wet-bulb Temp [C] = " + - General::RoundSigDigits(this->inletConds.AirWetBulb, 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Water Inlet Temp [C] = " + - General::RoundSigDigits(this->inletConds.WaterTemp, 2)); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Load [W] = {:.2R}", Par(1))); + ShowContinueError( + state, format("Design Evaporative Fluid Cooler Water Volume Flow Rate [m3/s] = {:.6R}", this->DesignWaterFlowRate)); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Air Volume Flow Rate [m3/s] = {:.2R}", Par(3))); + ShowContinueError( + state, format("Design Evaporative Fluid Cooler Air Inlet Wet-bulb Temp [C] = {:.2R}", this->inletConds.AirWetBulb)); + ShowContinueError( + state, format("Design Evaporative Fluid Cooler Water Inlet Temp [C] = {:.2R}", this->inletConds.WaterTemp)); ShowContinueError(state, "Inputs to the plant sizing object:"); - ShowContinueError(state, "Design Exit Water Temp [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2)); - ShowContinueError(state, "Loop Design Temperature Difference [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).DeltaT, 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Water Inlet Temp [C] = " + - General::RoundSigDigits(this->inletConds.WaterTemp, 2)); - ShowContinueError(state, "Calculated water outlet temperature at low UA [C](UA = " + General::RoundSigDigits(UA0, 2) + - " W/C) = " + General::RoundSigDigits(OutWaterTempAtUA0, 2)); - ShowContinueError(state, "Calculated water outlet temperature at high UA [C](UA = " + General::RoundSigDigits(UA1, 2) + - " W/C) = " + General::RoundSigDigits(OutWaterTempAtUA1, 2)); + ShowContinueError(state, + format("Design Exit Water Temp [C] = {:.2R}", + DataSizing::PlantSizData(PltSizCondNum).ExitTemp)); + ShowContinueError(state, + format("Loop Design Temperature Difference [C] = {:.2R}", + DataSizing::PlantSizData(PltSizCondNum).DeltaT)); + ShowContinueError( + state, format("Design Evaporative Fluid Cooler Water Inlet Temp [C] = {:.2R}", this->inletConds.WaterTemp)); + ShowContinueError( + state, format("Calculated water outlet temperature at low UA [C](UA = {:.2R} W/C) = {:.2R}", UA0, OutWaterTempAtUA0)); + ShowContinueError( + state, format("Calculated water outlet temperature at high UA [C](UA = {:.2R} W/C) = {:.2R}", UA1, OutWaterTempAtUA1)); ShowFatalError(state, "Autosizing of Evaporative Fluid Cooler UA failed for Evaporative Fluid Cooler = " + this->Name); } if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedEvapFluidCoolerUA = UA; @@ -1568,7 +1573,7 @@ namespace EvaporativeFluidCoolers { if (SolFla == -1) { ShowWarningError(state, "Iteration limit exceeded in calculating evaporative fluid cooler UA."); ShowContinueError(state, "Autosizing of fluid cooler UA failed for evaporative fluid cooler = " + this->Name); - ShowContinueError(state, "The final UA value = " + General::RoundSigDigits(UA, 2) + "W/C, and the simulation continues..."); + ShowContinueError(state, format("The final UA value = {:.2R}W/C, and the simulation continues...", UA)); } else if (SolFla == -2) { ShowSevereError(state, CalledFrom + ": The combination of design input values did not allow the calculation of a "); ShowContinueError(state, "reasonable UA value. Review and revise design input values as appropriate. "); @@ -1639,7 +1644,7 @@ namespace EvaporativeFluidCoolers { if (SolFla == -1) { ShowWarningError(state, "Iteration limit exceeded in calculating evaporative fluid cooler UA."); ShowContinueError(state, "Autosizing of fluid cooler UA failed for evaporative fluid cooler = " + this->Name); - ShowContinueError(state, "The final UA value = " + General::RoundSigDigits(UA, 2) + "W/C, and the simulation continues..."); + ShowContinueError(state, format("The final UA value = {:.2R}W/C, and the simulation continues...", UA)); } else if (SolFla == -2) { this->SimSimpleEvapFluidCooler(state, Par(2), Par(3), UA0, OutWaterTempAtUA0); this->SimSimpleEvapFluidCooler(state, Par(2), Par(3), UA1, OutWaterTempAtUA1); @@ -1657,25 +1662,27 @@ namespace EvaporativeFluidCoolers { "based on the autosized values shown below or to adjust design evaporative fluid cooler air inlet wet-bulb temperature."); ShowContinueError(state, "Plant:Sizing object inputs also influence these results (e.g. DeltaT and ExitTemp)."); ShowContinueError(state, "Inputs to the evaporative fluid cooler object:"); - ShowContinueError(state, "Design Evaporative Fluid Cooler Load [W] = " + General::RoundSigDigits(Par(1), 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Water Volume Flow Rate [m3/s] = " + - General::RoundSigDigits(this->DesignWaterFlowRate, 6)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Air Volume Flow Rate [m3/s] = " + General::RoundSigDigits(Par(3), 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Air Inlet Wet-bulb Temp [C] = " + - General::RoundSigDigits(this->inletConds.AirWetBulb, 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Water Inlet Temp [C] = " + - General::RoundSigDigits(this->inletConds.WaterTemp, 2)); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Load [W] = {:.2R}", Par(1))); + ShowContinueError(state, + format("Design Evaporative Fluid Cooler Water Volume Flow Rate [m3/s] = {:.6R}", this->DesignWaterFlowRate)); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Air Volume Flow Rate [m3/s] = {:.2R}", Par(3))); + ShowContinueError(state, + format("Design Evaporative Fluid Cooler Air Inlet Wet-bulb Temp [C] = {:.2R}", this->inletConds.AirWetBulb)); + ShowContinueError(state, + format("Design Evaporative Fluid Cooler Water Inlet Temp [C] = {:.2R}", this->inletConds.WaterTemp)); ShowContinueError(state, "Inputs to the plant sizing object:"); - ShowContinueError(state, "Design Exit Water Temp [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2)); - ShowContinueError(state, "Loop Design Temperature Difference [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).DeltaT, 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Water Inlet Temp [C] = " + - General::RoundSigDigits(this->inletConds.WaterTemp, 2)); - ShowContinueError(state, "Calculated water outlet temperature at low UA [C](UA = " + General::RoundSigDigits(UA0, 2) + - " W/C) = " + General::RoundSigDigits(OutWaterTempAtUA0, 2)); - ShowContinueError(state, "Calculated water outlet temperature at high UA [C](UA = " + General::RoundSigDigits(UA1, 2) + - " W/C) = " + General::RoundSigDigits(OutWaterTempAtUA1, 2)); + ShowContinueError(state, + format("Design Exit Water Temp [C] = {:.2R}", + DataSizing::PlantSizData(PltSizCondNum).ExitTemp)); + ShowContinueError(state, + format("Loop Design Temperature Difference [C] = {:.2R}", + DataSizing::PlantSizData(PltSizCondNum).DeltaT)); + ShowContinueError(state, + format("Design Evaporative Fluid Cooler Water Inlet Temp [C] = {:.2R}", this->inletConds.WaterTemp)); + ShowContinueError(state, + format("Calculated water outlet temperature at low UA [C](UA = {:.2R} W/C) = {:.2R}", UA0, OutWaterTempAtUA0)); + ShowContinueError( + state, format("Calculated water outlet temperature at high UA [C](UA = {:.2R} W/C) = {:.2R}", UA1, OutWaterTempAtUA1)); ShowFatalError(state, "Autosizing of Evaporative Fluid Cooler UA failed for Evaporative Fluid Cooler = " + this->Name); } this->HighSpeedEvapFluidCoolerUA = UA; @@ -1780,7 +1787,7 @@ namespace EvaporativeFluidCoolers { if (SolFla == -1) { ShowWarningError(state, "Iteration limit exceeded in calculating evaporative fluid cooler UA."); ShowContinueError(state, "Autosizing of fluid cooler UA failed for evaporative fluid cooler = " + this->Name); - ShowContinueError(state, "The final UA value = " + General::RoundSigDigits(UA, 2) + "W/C, and the simulation continues..."); + ShowContinueError(state, format("The final UA value = {:.2R}W/C, and the simulation continues...", UA)); } else if (SolFla == -2) { ShowSevereError(state, CalledFrom + ": The combination of design input values did not allow the calculation of a "); ShowContinueError(state, "reasonable low-speed UA value. Review and revise design input values as appropriate. "); @@ -1846,21 +1853,17 @@ namespace EvaporativeFluidCoolers { ShowContinueError(state, "temperatures calculated at high and low UA values. If the Design Exit Water Temperature is "); ShowContinueError(state, "out of this range, the solution will not converge and UA will not be calculated. "); ShowContinueError(state, "Inputs to the Evaporative Fluid Cooler model are:"); - ShowContinueError(state, "Design Evaporative Fluid Cooler Load = " + General::RoundSigDigits(Par(1), 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Water Volume Flow Rate = " + General::RoundSigDigits(Par(2), 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Air Volume Flow Rate = " + General::RoundSigDigits(Par(3), 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Air Inlet Wet-bulb Temp = " + - General::RoundSigDigits(this->inletConds.AirWetBulb, 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Water Inlet Temp = " + - General::RoundSigDigits(this->inletConds.WaterTemp, 2)); - ShowContinueError(state, "Design Exit Water Temp = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2)); - ShowContinueError(state, "Design Evaporative Fluid Cooler Water Inlet Temp [C] = " + - General::RoundSigDigits(this->inletConds.WaterTemp, 2)); - ShowContinueError(state, "Calculated water outlet temperature at low UA(" + General::RoundSigDigits(UA0, 2) + - ") = " + General::RoundSigDigits(OutWaterTempAtUA0, 2)); - ShowContinueError(state, "Calculated water outlet temperature at high UA(" + General::RoundSigDigits(UA1, 2) + - ") = " + General::RoundSigDigits(OutWaterTempAtUA1, 2)); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Load = {:.2R}", Par(1))); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Water Volume Flow Rate = {:.2R}", Par(2))); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Air Volume Flow Rate = {:.2R}", Par(3))); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Air Inlet Wet-bulb Temp = {:.2R}", this->inletConds.AirWetBulb)); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Water Inlet Temp = {:.2R}", this->inletConds.WaterTemp)); + ShowContinueError( + state, + format("Design Exit Water Temp = {:.2R}", DataSizing::PlantSizData(PltSizCondNum).ExitTemp)); + ShowContinueError(state, format("Design Evaporative Fluid Cooler Water Inlet Temp [C] = {:.2R}", this->inletConds.WaterTemp)); + ShowContinueError(state, format("Calculated water outlet temperature at low UA({:.2R}) = {:.2R}", UA0, OutWaterTempAtUA0)); + ShowContinueError(state, format("Calculated water outlet temperature at high UA({:.2R}) = {:.2R}", UA1, OutWaterTempAtUA1)); ShowFatalError(state, "Autosizing of Evaporative Fluid Cooler UA failed for Evaporative Fluid Cooler = " + this->Name); } this->LowSpeedEvapFluidCoolerUA = UA; @@ -2478,9 +2481,8 @@ namespace EvaporativeFluidCoolers { if (this->HighMassFlowErrorCount < 2) { ShowWarningError(state, this->EvapFluidCoolerType + " \"" + this->Name + "\""); ShowContinueError(state, " Condenser Loop Mass Flow Rate is much greater than the evaporative fluid coolers design mass flow rate."); - ShowContinueError(state, " Condenser Loop Mass Flow Rate = " + - General::TrimSigDigits(DataLoopNode::Node(this->WaterOutletNode).MassFlowRate, 6)); - ShowContinueError(state, " Evaporative Fluid Cooler Design Mass Flow Rate = " + General::TrimSigDigits(this->DesWaterMassFlowRate, 6)); + ShowContinueError(state, format(" Condenser Loop Mass Flow Rate = {:.6T}", DataLoopNode::Node(this->WaterOutletNode).MassFlowRate)); + ShowContinueError(state, format(" Evaporative Fluid Cooler Design Mass Flow Rate = {:.6T}", this->DesWaterMassFlowRate)); ShowContinueErrorTimeStamp(state, ""); } else { ShowRecurringWarningErrorAtEnd(state, @@ -2521,7 +2523,7 @@ namespace EvaporativeFluidCoolers { ShowWarningError(state, this->EvapFluidCoolerType + " \"" + this->Name + "\""); ShowContinueError(state, "Evaporative fluid cooler water mass flow rate near zero."); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Actual Mass flow = " + General::TrimSigDigits(this->WaterMassFlowRate, 2)); + ShowContinueError(state, format("Actual Mass flow = {:.2T}", this->WaterMassFlowRate)); } else { ShowRecurringWarningErrorAtEnd(state, this->EvapFluidCoolerType + " \"" + this->Name + "\" Evaporative fluid cooler water mass flow rate near zero error continues...", diff --git a/src/EnergyPlus/ExteriorEnergyUse.cc b/src/EnergyPlus/ExteriorEnergyUse.cc index 34a9b3470f2..43cd100936f 100644 --- a/src/EnergyPlus/ExteriorEnergyUse.cc +++ b/src/EnergyPlus/ExteriorEnergyUse.cc @@ -108,7 +108,7 @@ namespace ExteriorEnergyUse { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMaxValue; using ScheduleManager::GetScheduleMinValue; @@ -178,13 +178,13 @@ namespace ExteriorEnergyUse { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames(2) + " minimum, is < 0.0 for " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1)); - ShowContinueError(state, cAlphaArgs(2) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + "]. Values must be >= 0.0."); + ShowContinueError(state, format("{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", cAlphaArgs(2), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames(2) + " maximum, is < 0.0 for " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1)); - ShowContinueError(state, cAlphaArgs(2) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + "]. Values must be >= 0.0."); + ShowContinueError(state, format("{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", cAlphaArgs(2), SchMax)); ErrorsFound = true; } } @@ -335,13 +335,13 @@ namespace ExteriorEnergyUse { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames(3) + " minimum, is < 0.0 for " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1)); - ShowContinueError(state, cAlphaArgs(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + "]. Values must be >= 0.0."); + ShowContinueError(state, format("{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", cAlphaArgs(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames(3) + " maximum, is < 0.0 for " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1)); - ShowContinueError(state, cAlphaArgs(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + "]. Values must be >= 0.0."); + ShowContinueError(state, format("{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", cAlphaArgs(3), SchMax)); ErrorsFound = true; } } @@ -388,13 +388,13 @@ namespace ExteriorEnergyUse { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames(3) + " minimum, is < 0.0 for " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1)); - ShowContinueError(state, cAlphaArgs(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + "]. Values must be >= 0.0."); + ShowContinueError(state, format("{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", cAlphaArgs(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames(3) + " maximum, is < 0.0 for " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1)); - ShowContinueError(state, cAlphaArgs(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + "]. Values must be >= 0.0."); + ShowContinueError(state, format("{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", cAlphaArgs(3), SchMax)); ErrorsFound = true; } } diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index 5c544f4722d..bb8f03079a3 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -517,7 +517,7 @@ namespace ExternalInterface { // This subroutine is for initializations of the ExternalInterface // Using/Aliasing - using General::TrimSigDigits; + using RuntimeLanguageProcessor::FindEMSVariable; using RuntimeLanguageProcessor::isExternalInterfaceErlVariable; using ScheduleManager::GetDayScheduleIndex; @@ -555,7 +555,7 @@ namespace ExternalInterface { if (FileSystem::fileExists(socCfgFilNam)) { socketFD = establishclientsocket(socCfgFilNam.c_str()); if (socketFD < 0) { - ShowSevereError(state, "ExternalInterface: Could not open socket. File descriptor = " + TrimSigDigits(socketFD) + '.'); + ShowSevereError(state, format("ExternalInterface: Could not open socket. File descriptor = {}.", socketFD)); ErrorsFound = true; } } else { @@ -643,9 +643,9 @@ namespace ExternalInterface { if (nOutVal + nInpVar > maxVar) { ShowSevereError(state, "ExternalInterface: Too many variables to be exchanged."); - ShowContinueError(state, "Attempted to exchange " + TrimSigDigits(nOutVal) + " outputs"); - ShowContinueError(state, "plus " + TrimSigDigits(nOutVal) + " inputs."); - ShowContinueError(state, "Maximum allowed is sum is " + TrimSigDigits(maxVar) + '.'); + ShowContinueError(state, format("Attempted to exchange {} outputs", nOutVal)); + ShowContinueError(state, format("plus {} inputs.", nOutVal)); + ShowContinueError(state, format("Maximum allowed is sum is {}.", maxVar)); ShowContinueError(state, "To fix, increase maxVar in ExternalInterface.cc"); ErrorsFound = true; } @@ -668,8 +668,8 @@ namespace ExternalInterface { } StopExternalInterfaceIfError(state); - DisplayString(state, "Number of outputs in ExternalInterface = " + TrimSigDigits(nOutVal)); - DisplayString(state, "Number of inputs in ExternalInterface = " + TrimSigDigits(nInpVar)); + DisplayString(state, format("Number of outputs in ExternalInterface = {}", nOutVal)); + DisplayString(state, format("Number of inputs in ExternalInterface = {}", nInpVar)); InitExternalInterfacefirstCall = false; @@ -731,7 +731,7 @@ namespace ExternalInterface { // Using/Aliasing using EMSManager::ManageEMS; - using General::TrimSigDigits; + using RuntimeLanguageProcessor::ExternalInterfaceSetErlVariable; using RuntimeLanguageProcessor::FindEMSVariable; using RuntimeLanguageProcessor::isExternalInterfaceErlVariable; @@ -790,7 +790,7 @@ namespace ExternalInterface { if (FMU(i).Instance(j).fmistatus != fmiOK) { ShowSevereError(state, "ExternalInterface/GetSetVariablesAndDoStepFMUImport: Error when trying to get outputs"); ShowContinueError(state, "in instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\""); - ShowContinueError(state, "Error Code = \"" + TrimSigDigits(FMU(i).Instance(j).fmistatus) + "\""); + ShowContinueError(state, format("Error Code = \"{}\"", FMU(i).Instance(j).fmistatus)); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -821,7 +821,7 @@ namespace ExternalInterface { if (FMU(i).Instance(j).fmistatus != fmiOK) { ShowSevereError(state, "ExternalInterface/GetSetVariablesAndDoStepFMUImport: Error when trying to get outputs"); ShowContinueError(state, "in instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\""); - ShowContinueError(state, "Error Code = \"" + TrimSigDigits(FMU(i).Instance(j).fmistatus) + "\""); + ShowContinueError(state, format("Error Code = \"{}\"", FMU(i).Instance(j).fmistatus)); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -852,7 +852,7 @@ namespace ExternalInterface { if (FMU(i).Instance(j).fmistatus != fmiOK) { ShowSevereError(state, "ExternalInterface/GetSetVariablesAndDoStepFMUImport: Error when trying to get outputs"); ShowContinueError(state, "in instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\""); - ShowContinueError(state, "Error Code = \"" + TrimSigDigits(FMU(i).Instance(j).fmistatus) + "\""); + ShowContinueError(state, format("Error Code = \"{}\"", FMU(i).Instance(j).fmistatus)); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -916,7 +916,7 @@ namespace ExternalInterface { if (FMU(i).Instance(j).fmistatus != fmiOK) { ShowSevereError(state, "ExternalInterface/GetSetVariablesAndDoStepFMUImport: Error when trying to set inputs"); ShowContinueError(state, "in instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\""); - ShowContinueError(state, "Error Code = \"" + TrimSigDigits(FMU(i).Instance(j).fmistatus) + "\""); + ShowContinueError(state, format("Error Code = \"{}\"", FMU(i).Instance(j).fmistatus)); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -929,7 +929,7 @@ namespace ExternalInterface { ShowSevereError(state, "ExternalInterface/GetSetVariablesAndDoStepFMUImport: Error when trying to"); ShowContinueError(state, "do the coSimulation with instance \"" + FMU(i).Instance(j).Name + "\""); ShowContinueError(state, "of FMU \"" + FMU(i).Name + "\""); - ShowContinueError(state, "Error Code = \"" + TrimSigDigits(FMU(i).Instance(j).fmistatus) + "\""); + ShowContinueError(state, format("Error Code = \"{}\"", FMU(i).Instance(j).fmistatus)); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -957,7 +957,6 @@ namespace ExternalInterface { // This routine instantiates and initializes FMUs. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int i, j; // Loop counters @@ -991,7 +990,7 @@ namespace ExternalInterface { if (FMU(i).Instance(j).fmistatus != fmiOK) { ShowSevereError(state, "ExternalInterface/CalcExternalInterfaceFMUImport: Error when trying to initialize"); ShowContinueError(state, "instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\""); - ShowContinueError(state, "Error Code = \"" + TrimSigDigits(FMU(i).Instance(j).fmistatus) + "\""); + ShowContinueError(state, format("Error Code = \"{}\"", FMU(i).Instance(j).fmistatus)); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -1011,7 +1010,6 @@ namespace ExternalInterface { // This routine reinitializes FMUs. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int i, j; // Loop counters @@ -1025,7 +1023,7 @@ namespace ExternalInterface { if (FMU(i).Instance(j).fmistatus != fmiOK) { ShowSevereError(state, "ExternalInterface/CalcExternalInterfaceFMUImport: Error when trying to initialize"); ShowContinueError(state, "instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\""); - ShowContinueError(state, "Error Code = \"" + TrimSigDigits(FMU(i).Instance(j).fmistatus) + "\""); + ShowContinueError(state, format("Error Code = \"{}\"", FMU(i).Instance(j).fmistatus)); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -1087,7 +1085,7 @@ namespace ExternalInterface { using DataStringGlobals::CurrentWorkingFolder; using DataStringGlobals::pathChar; using DataSystemVariables::CheckForActualFileName; - using General::TrimSigDigits; + using RuntimeLanguageProcessor::FindEMSVariable; using RuntimeLanguageProcessor::isExternalInterfaceErlVariable; using ScheduleManager::GetDayScheduleIndex; @@ -1491,20 +1489,22 @@ namespace ExternalInterface { for (j = 1; j <= FMU(i).NumInstances; ++j) { // check whether the number of input variables in fmu is bigger than in the idf if (FMU(i).Instance(j).NumInputVariablesInFMU > FMU(i).Instance(j).NumInputVariablesInIDF) { - ShowWarningError(state, "InitExternalInterfaceFMUImport: The number of input variables defined in input file (" + - TrimSigDigits(FMU(i).Instance(j).NumInputVariablesInIDF) + ')'); + ShowWarningError(state, + format("InitExternalInterfaceFMUImport: The number of input variables defined in input file ({})", + FMU(i).Instance(j).NumInputVariablesInIDF)); ShowContinueError(state, "of instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\" is less than the number of input variables"); - ShowContinueError(state, "in the modelDescription file (" + TrimSigDigits(FMU(i).Instance(j).NumInputVariablesInFMU) + ")."); + ShowContinueError(state, format("in the modelDescription file ({}).", FMU(i).Instance(j).NumInputVariablesInFMU)); ShowContinueError(state, "Check the input file and the modelDescription file again."); } // check whether the number of input variables in fmu is less than in the idf if (FMU(i).Instance(j).NumInputVariablesInFMU < FMU(i).Instance(j).NumInputVariablesInIDF) { - ShowWarningError(state, "InitExternalInterfaceFMUImport: The number of input variables defined in input file (" + - TrimSigDigits(FMU(i).Instance(j).NumInputVariablesInIDF) + ')'); + ShowWarningError(state, + format("InitExternalInterfaceFMUImport: The number of input variables defined in input file ({})", + FMU(i).Instance(j).NumInputVariablesInIDF)); ShowContinueError(state, "of instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\" is bigger than the number of input variables"); - ShowContinueError(state, "in the modelDescription file (" + TrimSigDigits(FMU(i).Instance(j).NumInputVariablesInFMU) + ")."); + ShowContinueError(state, format("in the modelDescription file ({}).", FMU(i).Instance(j).NumInputVariablesInFMU)); ShowContinueError(state, "Check the input file and the modelDescription file again."); } } @@ -1821,27 +1821,33 @@ namespace ExternalInterface { FMU(i).Instance(j).NumOutputVariablesActuator; // check whether the number of output variables in fmu is bigger than in the idf if (FMU(i).Instance(j).NumOutputVariablesInFMU > FMU(i).Instance(j).NumOutputVariablesInIDF) { - ShowWarningError(state, "InitExternalInterfaceFMUImport: The number of output variables defined in input file (" + - TrimSigDigits(FMU(i).Instance(j).NumOutputVariablesInIDF) + ')'); + ShowWarningError(state, + format("InitExternalInterfaceFMUImport: The number of output variables defined in input file ({})", + FMU(i).Instance(j).NumOutputVariablesInIDF)); ShowContinueError(state, "of instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\" is less than the number of output variables"); - ShowContinueError(state, "in the modelDescription file (" + TrimSigDigits(FMU(i).Instance(j).NumOutputVariablesInFMU) + ")."); + ShowContinueError(state, format("in the modelDescription file ({}).", FMU(i).Instance(j).NumOutputVariablesInFMU)); ShowContinueError(state, "Check the input file and the modelDescription file again."); } // check whether the number of output variables in fmu is less than in the idf if (FMU(i).Instance(j).NumOutputVariablesInFMU < FMU(i).Instance(j).NumOutputVariablesInIDF) { - ShowWarningError(state, "InitExternalInterfaceFMUImport: The number of output variables defined in input file (" + - TrimSigDigits(FMU(i).Instance(j).NumOutputVariablesInIDF) + ')'); + ShowWarningError(state, + format("InitExternalInterfaceFMUImport: The number of output variables defined in input file ({})", + FMU(i).Instance(j).NumOutputVariablesInIDF)); ShowContinueError(state, "of instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\" is bigger than the number of output variables"); - ShowContinueError(state, "in the modelDescription file (" + TrimSigDigits(FMU(i).Instance(j).NumOutputVariablesInFMU) + ")."); + ShowContinueError(state, format("in the modelDescription file ({}).", FMU(i).Instance(j).NumOutputVariablesInFMU)); ShowContinueError(state, "Check the input file and the modelDescription file again."); } - DisplayString(state, "Number of inputs in instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\" = \"" + - TrimSigDigits(FMU(i).Instance(j).NumInputVariablesInIDF) + "\"."); - DisplayString(state, "Number of outputs in instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\" = \"" + - TrimSigDigits(FMU(i).Instance(j).NumOutputVariablesInIDF) + "\"."); + DisplayString(state, format("Number of inputs in instance \"{}\" of FMU \"{}\" = \"{}\".", + FMU(i).Instance(j).Name, + FMU(i).Name, + FMU(i).Instance(j).NumInputVariablesInIDF)); + DisplayString(state, format("Number of outputs in instance \"{}\" of FMU \"{}\" = \"{}\".", + FMU(i).Instance(j).Name, + FMU(i).Name, + FMU(i).Instance(j).NumOutputVariablesInIDF)); } } StopExternalInterfaceIfError(state); @@ -1983,7 +1989,7 @@ namespace ExternalInterface { using DataEnvironment::TotDesDays; using DataSystemVariables::UpdateDataDuringWarmupExternalInterface; using EMSManager::ManageEMS; - using General::TrimSigDigits; + using RuntimeLanguageProcessor::ExternalInterfaceSetErlVariable; using RuntimeLanguageProcessor::FindEMSVariable; using RuntimeLanguageProcessor::isExternalInterfaceErlVariable; @@ -2112,8 +2118,7 @@ namespace ExternalInterface { ShowSevereError(state, "ExternalInterface/CalcExternalInterfaceFMUImport: Error when trying to set an input value in instance \"" + FMU(i).Instance(j).Name + "\""); - ShowContinueError(state, "of FMU \"" + FMU(i).Name + "\"; Error Code = \"" + TrimSigDigits(FMU(i).Instance(j).fmistatus) + - "\""); + ShowContinueError(state, format("of FMU \"{}\"; Error Code = \"{}\"", FMU(i).Name, FMU(i).Instance(j).fmistatus)); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -2170,7 +2175,7 @@ namespace ExternalInterface { ShowSevereError(state, "ExternalInterface/CalcExternalInterfaceFMUImport: "); ShowContinueError(state, "Error when trying to set inputs in instance"); ShowContinueError(state, "\"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\""); - ShowContinueError(state, "Error Code = \"" + TrimSigDigits(FMU(i).Instance(j).fmistatus) + "\""); + ShowContinueError(state, format("Error Code = \"{}\"", FMU(i).Instance(j).fmistatus)); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -2281,7 +2286,7 @@ namespace ExternalInterface { // Using/Aliasing using EMSManager::ManageEMS; - using General::TrimSigDigits; + using RuntimeLanguageProcessor::ExternalInterfaceSetErlVariable; using ScheduleManager::ExternalInterfaceSetSchedule; // using DataPrecisionGlobals; @@ -2315,8 +2320,9 @@ namespace ExternalInterface { // Socket asked to terminate simulation, but simulation continues if (noMoreValues && showContinuationWithoutUpdate) { if (haveExternalInterfaceBCVTB) { - ShowWarningError(state, "ExternalInterface: Continue simulation without updated values from server at t =" + - TrimSigDigits(preSimTim / 3600.0, 2) + " hours"); + ShowWarningError( + state, + format("ExternalInterface: Continue simulation without updated values from server at t ={:.2T} hours", preSimTim / 3600.0)); } showContinuationWithoutUpdate = false; } @@ -2377,8 +2383,7 @@ namespace ExternalInterface { // Make sure we get the right number of double values, unless retVal != 0 if ((flaRea == 0) && (!ErrorsFound) && continueSimulation && (nDblRea != isize(varInd))) { - ShowSevereError(state, "ExternalInterface: Received \"" + TrimSigDigits(nDblRea) + "\" double values, expected \"" + - TrimSigDigits(size(varInd)) + "\"."); + ShowSevereError(state, format("ExternalInterface: Received \"{}\" double values, expected \"{}\".", nDblRea, size(varInd))); ErrorsFound = true; StopExternalInterfaceIfError(state); } @@ -2392,7 +2397,7 @@ namespace ExternalInterface { ExternalInterfaceSetErlVariable(varInd(i), dblValRea(i)); } else { ShowContinueError(state, "ExternalInterface: Error in finding the type of the input variable for EnergyPlus"); - ShowContinueError(state, "variable index: " + std::to_string(i) + ". Variable will not be updated."); + ShowContinueError(state, format("variable index: {}. Variable will not be updated.", i)); } } } diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 5c96180a1a6..6d35e115d15 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -66,7 +66,6 @@ #include #include #include -#include #include #include #include @@ -239,7 +238,6 @@ namespace FanCoilUnits { // Manages the simulation of a fan coil unit. Called from SimZone Equipment // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int FanCoilNum; // index of fan coil unit being simulated @@ -262,13 +260,17 @@ namespace FanCoilUnits { } else { FanCoilNum = CompIndex; if (FanCoilNum > NumFanCoils || FanCoilNum < 1) { - ShowFatalError(state, "SimFanCoil: Invalid CompIndex passed=" + TrimSigDigits(FanCoilNum) + - ", Number of Units=" + TrimSigDigits(NumFanCoils) + ", Entered Unit name=" + CompName); + ShowFatalError( + state, + format("SimFanCoil: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", FanCoilNum, NumFanCoils, CompName)); } if (CheckEquipName(FanCoilNum)) { if (CompName != FanCoil(FanCoilNum).Name) { - ShowFatalError(state, "SimFanCoil: Invalid CompIndex passed=" + TrimSigDigits(FanCoilNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + FanCoil(FanCoilNum).Name); + ShowFatalError(state, + format("SimFanCoil: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + FanCoilNum, + CompName, + FanCoil(FanCoilNum).Name)); } CheckEquipName(FanCoilNum) = false; } @@ -318,9 +320,8 @@ namespace FanCoilUnits { using BranchNodeConnections::TestCompSet; using Fans::GetFanDesignVolumeFlowRate; using Fans::GetFanType; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; - using namespace DataIPShortCuts; using WaterCoils::GetCoilWaterInletNode; auto &GetHXCoilWaterInletNode(HVACHXAssistedCoolingCoil::GetCoilWaterInletNode); auto &GetHeatingCoilCapacity(HeatingCoils::GetCoilCapacity); @@ -464,9 +465,8 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).LowSpeedRatio > FanCoil(FanCoilNum).MedSpeedRatio) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + FanCoil(FanCoilNum).Name + "\","); ShowContinueError(state, "... " + cNumericFields(2) + " is greater than the medium speed supply air flow ratio."); - ShowContinueError(state, "... Fan Coil Unit low speed supply air flow ratio = " + TrimSigDigits(FanCoil(FanCoilNum).LowSpeedRatio, 5) + ' '); - ShowContinueError(state, "... Fan Coit Unit medium speed supply air flow ratio = " + TrimSigDigits(FanCoil(FanCoilNum).MedSpeedRatio, 5) + - ' '); + ShowContinueError(state, format("... Fan Coil Unit low speed supply air flow ratio = {:.5T} ", FanCoil(FanCoilNum).LowSpeedRatio)); + ShowContinueError(state, format("... Fan Coit Unit medium speed supply air flow ratio = {:.5T} ", FanCoil(FanCoilNum).MedSpeedRatio)); ShowContinueError(state, "... Fan Coil Unit low speed supply air flow ratio and medium speed supply air flow ratio set to default values"); FanCoil(FanCoilNum).LowSpeedRatio = 1.0 / 3.0; FanCoil(FanCoilNum).MedSpeedRatio = 2.0 / 3.0; @@ -687,9 +687,9 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).FanAirVolFlow != AutoSize) { ShowWarningError(state, RoutineName + FanCoil(FanCoilNum).UnitType + ": " + FanCoil(FanCoilNum).Name); ShowContinueError(state, "... " + cNumericFields(1) + " is greater than the maximum fan flow rate."); - ShowContinueError(state, "... Fan Coil Unit flow = " + TrimSigDigits(FanCoil(FanCoilNum).MaxAirVolFlow, 5) + " m3/s."); + ShowContinueError(state, format("... Fan Coil Unit flow = {:.5T} m3/s.", FanCoil(FanCoilNum).MaxAirVolFlow)); ShowContinueError(state, "... Fan = " + cFanTypes(FanCoil(FanCoilNum).FanType_Num) + ": " + FanCoil(FanCoilNum).FanName); - ShowContinueError(state, "... Fan flow = " + TrimSigDigits(FanCoil(FanCoilNum).FanAirVolFlow, 5) + " m3/s."); + ShowContinueError(state, format("... Fan flow = {:.5T} m3/s.", FanCoil(FanCoilNum).FanAirVolFlow)); ShowContinueError(state, "... Fan Coil Unit flow rate reduced to match the fan flow rate and the simulation continues."); FanCoil(FanCoilNum).MaxAirVolFlow = FanCoil(FanCoilNum).FanAirVolFlow; } @@ -726,9 +726,9 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).MaxAirVolFlow > FanCoil(FanCoilNum).FanAirVolFlow && FanCoil(FanCoilNum).FanAirVolFlow != AutoSize) { ShowWarningError(state, RoutineName + FanCoil(FanCoilNum).UnitType + ": " + FanCoil(FanCoilNum).Name); ShowContinueError(state, "... " + cNumericFields(1) + " is greater than the maximum fan flow rate."); - ShowContinueError(state, "... Fan Coil Unit flow = " + TrimSigDigits(FanCoil(FanCoilNum).MaxAirVolFlow, 5) + " m3/s."); + ShowContinueError(state, format("... Fan Coil Unit flow = {:.5T} m3/s.", FanCoil(FanCoilNum).MaxAirVolFlow)); ShowContinueError(state, "... Fan = " + cFanTypes(FanCoil(FanCoilNum).FanType_Num) + ": " + FanCoil(FanCoilNum).FanName); - ShowContinueError(state, "... Fan flow = " + TrimSigDigits(FanCoil(FanCoilNum).FanAirVolFlow, 5) + " m3/s."); + ShowContinueError(state, format("... Fan flow = {:.5T} m3/s.", FanCoil(FanCoilNum).FanAirVolFlow)); ShowContinueError(state, "... Fan Coil Unit flow rate reduced to match the fan flow rate and the simulation continues."); FanCoil(FanCoilNum).MaxAirVolFlow = FanCoil(FanCoilNum).FanAirVolFlow; } @@ -754,8 +754,8 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).LowSpeedRatio > 0.5) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + FanCoil(FanCoilNum).Name + "\","); ShowContinueError(state, "... " + cNumericFields(2) + " is greater than the 50% of the supply air flow ratio."); - ShowContinueError(state, "... Fan Coil Unit low speed supply air flow ratio = " + TrimSigDigits(FanCoil(FanCoilNum).LowSpeedRatio, 5) + - ' '); + ShowContinueError(state, + format("... Fan Coil Unit low speed supply air flow ratio = {:.5T} ", FanCoil(FanCoilNum).LowSpeedRatio)); } else if (FanCoil(FanCoilNum).LowSpeedRatio == 0.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + FanCoil(FanCoilNum).Name + "\","); ShowContinueError(state, "... " + cNumericFields(2) + " is equal to 0."); @@ -910,8 +910,8 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).DesignMaxOutletTemp < FanCoil(FanCoilNum).DesignMinOutletTemp) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + FanCoil(FanCoilNum).Name + "\","); ShowContinueError(state, "... " + cNumericFields(11) + " is greater than " + cNumericFields(12) + "."); - ShowContinueError(state, "... " + cNumericFields(11) + " = " + TrimSigDigits(FanCoil(FanCoilNum).DesignMinOutletTemp, 2) + " [C]."); - ShowContinueError(state, "... " + cNumericFields(12) + " = " + TrimSigDigits(FanCoil(FanCoilNum).DesignMaxOutletTemp, 2) + " [C]."); + ShowContinueError(state, format("... {} = {:.2T} [C].", cNumericFields(11), FanCoil(FanCoilNum).DesignMinOutletTemp)); + ShowContinueError(state, format("... {} = {:.2T} [C].", cNumericFields(12), FanCoil(FanCoilNum).DesignMaxOutletTemp)); ErrorsFound = true; } } @@ -1394,8 +1394,7 @@ namespace FanCoilUnits { using Fans::GetFanDesignVolumeFlowRate; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; - using General::TrimSigDigits; + using HVACHXAssistedCoolingCoil::GetHXCoilType; using HVACHXAssistedCoolingCoil::GetHXDXCoilName; using PlantUtilities::MyPlantSizingIndex; @@ -1668,9 +1667,9 @@ namespace FanCoilUnits { if (MaxAirVolFlowDes > FanCoil(FanCoilNum).FanAirVolFlow) { ShowWarningError(state, RoutineName + FanCoil(FanCoilNum).UnitType + ": " + FanCoil(FanCoilNum).Name); ShowContinueError(state, "... Maximum supply air flow rate is greater than the maximum fan flow rate."); - ShowContinueError(state, "... Fan Coil Unit flow = " + TrimSigDigits(MaxAirVolFlowDes, 5) + " [m3/s]."); + ShowContinueError(state, format("... Fan Coil Unit flow = {:.5T} [m3/s].", MaxAirVolFlowDes)); ShowContinueError(state, "... Fan = " + cFanTypes(FanCoil(FanCoilNum).FanType_Num) + ": " + FanCoil(FanCoilNum).FanName); - ShowContinueError(state, "... Fan flow = " + TrimSigDigits(FanCoil(FanCoilNum).FanAirVolFlow, 5) + " [m3/s]."); + ShowContinueError(state, format("... Fan flow = {:.5T} [m3/s].", FanCoil(FanCoilNum).FanAirVolFlow)); ShowContinueError(state, "... Fan Coil Unit flow rate reduced to match the fan flow rate and the simulation continues."); MaxAirVolFlowDes = FanCoil(FanCoilNum).FanAirVolFlow; } @@ -1684,10 +1683,9 @@ namespace FanCoilUnits { if ((std::abs(MaxAirVolFlowDes - MaxAirVolFlowUser) / MaxAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeFanCoilUnit: Potential issue with equipment sizing for " + FanCoil(FanCoilNum).UnitType + ' ' + FanCoil(FanCoilNum).Name); - ShowContinueError(state, "User-Specified Supply Air Maximum Flow Rate of " + RoundSigDigits(MaxAirVolFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Supply Air Maximum Flow Rate of " + RoundSigDigits(MaxAirVolFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Supply Air Maximum Flow Rate of {:.5R} [m3/s]", MaxAirVolFlowUser)); + ShowContinueError(state, + format("differs from Design Size Supply Air Maximum Flow Rate of {:.5R} [m3/s]", MaxAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1708,9 +1706,9 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).MaxAirVolFlow > FanCoil(FanCoilNum).FanAirVolFlow) { ShowWarningError(state, RoutineName + FanCoil(FanCoilNum).UnitType + ": " + FanCoil(FanCoilNum).Name); ShowContinueError(state, "... Maximum supply air flow rate is greater than the maximum fan flow rate."); - ShowContinueError(state, "... Fan Coil Unit flow = " + TrimSigDigits(FanCoil(FanCoilNum).MaxAirVolFlow, 5) + " m3/s."); + ShowContinueError(state, format("... Fan Coil Unit flow = {:.5T} m3/s.", FanCoil(FanCoilNum).MaxAirVolFlow)); ShowContinueError(state, "... Fan = " + cFanTypes(FanCoil(FanCoilNum).FanType_Num) + ": " + FanCoil(FanCoilNum).FanName); - ShowContinueError(state, "... Fan flow = " + TrimSigDigits(FanCoil(FanCoilNum).FanAirVolFlow, 5) + " m3/s."); + ShowContinueError(state, format("... Fan flow = {:.5T} m3/s.", FanCoil(FanCoilNum).FanAirVolFlow)); ShowContinueError(state, "... Fan Coil Unit flow rate reduced to match the fan flow rate and the simulation continues."); FanCoil(FanCoilNum).MaxAirVolFlow = FanCoil(FanCoilNum).FanAirVolFlow; } @@ -1752,10 +1750,9 @@ namespace FanCoilUnits { if ((std::abs(OutAirVolFlowDes - OutAirVolFlowUser) / OutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeFanCoilUnit: Potential issue with equipment sizing for " + FanCoil(FanCoilNum).UnitType + ' ' + FanCoil(FanCoilNum).Name); - ShowContinueError(state, "User-Specified Maximum Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Outdoor Air Flow Rate of {:.5R} [m3/s]", OutAirVolFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Outdoor Air Flow Rate of {:.5R} [m3/s]", OutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1915,10 +1912,9 @@ namespace FanCoilUnits { if ((std::abs(MaxHotWaterVolFlowDes - MaxHotWaterVolFlowUser) / MaxHotWaterVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeFanCoilUnit: Potential issue with equipment sizing for " + FanCoil(FanCoilNum).UnitType + ' ' + FanCoil(FanCoilNum).Name); - ShowContinueError(state, "User-Specified Maximum Hot Water Flow of " + RoundSigDigits(MaxHotWaterVolFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Hot Water Flow of " + RoundSigDigits(MaxHotWaterVolFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Hot Water Flow of {:.5R} [m3/s]", MaxHotWaterVolFlowUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Hot Water Flow of {:.5R} [m3/s]", MaxHotWaterVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2086,10 +2082,9 @@ namespace FanCoilUnits { if ((std::abs(MaxColdWaterVolFlowDes - MaxColdWaterVolFlowUser) / MaxColdWaterVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeFanCoilUnit: Potential issue with equipment sizing for " + FanCoil(FanCoilNum).UnitType + ' ' + FanCoil(FanCoilNum).Name); - ShowContinueError(state, "User-Specified Maximum Cold Water Flow of " + RoundSigDigits(MaxColdWaterVolFlowUser, 5) + - "[m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Cold Water Flow of " + RoundSigDigits(MaxColdWaterVolFlowDes, 5) + - "[m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Cold Water Flow of {:.5R}[m3/s]", MaxColdWaterVolFlowUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Cold Water Flow of {:.5R}[m3/s]", MaxColdWaterVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2231,7 +2226,7 @@ namespace FanCoilUnits { using DataHeatBalFanSys::TempControlType; using DataZoneEquipment::CalcDesignSpecificationOutdoorAir; using General::SolveRoot; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -2436,11 +2431,13 @@ namespace FanCoilUnits { ShowContinueError(state, " Iteration limit exceeded in calculating water flow rate "); Node(FanCoil(FanCoilNum).CoolCoilFluidInletNode).MassFlowRate = CWFlow; Calc4PipeFanCoil(state, FanCoilNum, ControlledZoneNum, FirstHVACIteration, QUnitOut); - ShowContinueErrorTimeStamp(state, "Load Request = " + TrimSigDigits(QZnReq) + - ", Final Capacity = " + TrimSigDigits(QUnitOut)); - ShowContinueErrorTimeStamp(state, "Min water flow used during iterations = " + TrimSigDigits(MinWaterFlow) + - ", Max water flow used during iterations = " + TrimSigDigits(MaxWaterFlow)); - ShowContinueErrorTimeStamp(state, "Water flow rate on last iteration = " + TrimSigDigits(CWFlow)); + ShowContinueErrorTimeStamp(state, format("Load Request = {}, Final Capacity = {}", QZnReq, QUnitOut)); + ShowContinueErrorTimeStamp( + state, + format("Min water flow used during iterations = {}, Max water flow used during iterations = {}", + MinWaterFlow, + MaxWaterFlow)); + ShowContinueErrorTimeStamp(state, format("Water flow rate on last iteration = {}", CWFlow)); ShowContinueErrorTimeStamp(state, "..Water flow rate set to last iteration value "); } else { ShowRecurringWarningErrorAtEnd(state, "Cold water flow Iteration limit exceeded in fan coil unit " + @@ -2582,11 +2579,13 @@ namespace FanCoilUnits { ShowContinueError(state, " Iteration limit exceeded in calculating water flow rate "); Node(FanCoil(FanCoilNum).HeatCoilFluidInletNode).MassFlowRate = HWFlow; Calc4PipeFanCoil(state, FanCoilNum, ControlledZoneNum, FirstHVACIteration, QUnitOut); - ShowContinueErrorTimeStamp(state, "Load Request = " + TrimSigDigits(QZnReq) + - ", Final Capacity = " + TrimSigDigits(QUnitOut)); - ShowContinueErrorTimeStamp(state, "Min water flow used during iterations = " + TrimSigDigits(MinWaterFlow) + - ", Max water flow used during iterations = " + TrimSigDigits(MaxWaterFlow)); - ShowContinueErrorTimeStamp(state, "Water flow rate on last iteration = " + TrimSigDigits(HWFlow)); + ShowContinueErrorTimeStamp(state, format("Load Request = {}, Final Capacity = {}", QZnReq, QUnitOut)); + ShowContinueErrorTimeStamp( + state, + format("Min water flow used during iterations = {}, Max water flow used during iterations = {}", + MinWaterFlow, + MaxWaterFlow)); + ShowContinueErrorTimeStamp(state, format("Water flow rate on last iteration = {}", HWFlow)); ShowContinueErrorTimeStamp(state, "..Water flow rate set to last iteration value "); } else { ShowRecurringWarningErrorAtEnd(state, "Hot water flow Iteration limit exceeded in fan coil unit " + @@ -2815,11 +2814,12 @@ namespace FanCoilUnits { ShowContinueError(state, " Iteration limit exceeded in calculating FCU part-load ratio "); Node(FanCoil(FanCoilNum).CoolCoilFluidInletNode).MassFlowRate = PLR * FanCoil(FanCoilNum).MaxCoolCoilFluidFlow; Calc4PipeFanCoil(state, FanCoilNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, PLR); - ShowContinueErrorTimeStamp(state, "Load Request = " + TrimSigDigits(QZnReq) + - ", Final Capacity = " + TrimSigDigits(QUnitOut)); - ShowContinueErrorTimeStamp(state, "Min part-load used during iterations = " + TrimSigDigits(PLRMin) + - ", Max part-load used during iterations = " + TrimSigDigits(PLRMax)); - ShowContinueErrorTimeStamp(state, "Part-load ratio on last iteration = " + TrimSigDigits(PLR)); + ShowContinueErrorTimeStamp(state, format("Load Request = {}, Final Capacity = {}", QZnReq, QUnitOut)); + ShowContinueErrorTimeStamp( + state, + format( + "Min part-load used during iterations = {}, Max part-load used during iterations = {}", PLRMin, PLRMax)); + ShowContinueErrorTimeStamp(state, format("Part-load ratio on last iteration = {}", PLR)); ShowContinueErrorTimeStamp(state, "..Part-load ratio set to last iteration value "); } else { ShowRecurringWarningErrorAtEnd(state, "Part-load ratio cooling iteration limit exceeded in fan coil unit " + @@ -2831,7 +2831,7 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).LimitErrCountC < 2) { ShowWarningError(state, "Part-load ratio cooling control failed in fan coil unit " + FanCoil(FanCoilNum).Name); ShowContinueError(state, " Bad part-load ratio limits"); - ShowContinueErrorTimeStamp(state, "..Part-load ratio set to " + TrimSigDigits(PLRMin)); + ShowContinueErrorTimeStamp(state, format("..Part-load ratio set to {}", PLRMin)); } else { ShowRecurringWarningErrorAtEnd(state, "Part-load ratio cooling control failed in fan coil unit " + FanCoil(FanCoilNum).Name, @@ -2926,11 +2926,13 @@ namespace FanCoilUnits { Node(FanCoil(FanCoilNum).HeatCoilFluidInletNode).MassFlowRate = PLR * FanCoil(FanCoilNum).MaxHeatCoilFluidFlow; Calc4PipeFanCoil(state, FanCoilNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, PLR); - ShowContinueErrorTimeStamp(state, "Load Request = " + TrimSigDigits(QZnReq) + - ", Final Capacity = " + TrimSigDigits(QUnitOut)); - ShowContinueErrorTimeStamp(state, "Min part-load ratio used during iterations = " + TrimSigDigits(PLRMin) + - ", Max part-load used during iterations = " + TrimSigDigits(PLRMax)); - ShowContinueErrorTimeStamp(state, "Part-load ratio on last iteration = " + TrimSigDigits(PLR)); + ShowContinueErrorTimeStamp(state, format("Load Request = {}, Final Capacity = {}", QZnReq, QUnitOut)); + ShowContinueErrorTimeStamp( + state, + format("Min part-load ratio used during iterations = {}, Max part-load used during iterations = {}", + PLRMin, + PLRMax)); + ShowContinueErrorTimeStamp(state, format("Part-load ratio on last iteration = {}", PLR)); ShowContinueErrorTimeStamp(state, "..Part-load ratio set to last iteration value "); } else { ShowRecurringWarningErrorAtEnd(state, "Part-load ratio heating iteration limit exceeded in fan coil unit " + @@ -2942,7 +2944,7 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).LimitErrCountH < 2) { ShowWarningError(state, "Part-load ratio heating control failed in fan coil unit " + FanCoil(FanCoilNum).Name); ShowContinueError(state, " Bad hot part-load ratio limits"); - ShowContinueErrorTimeStamp(state, "..Part-load ratio set to " + TrimSigDigits(PLRMin)); + ShowContinueErrorTimeStamp(state, format("..Part-load ratio set to {}", PLRMin)); } else { ShowRecurringWarningErrorAtEnd(state, "Part-load ratio heating control failed in fan coil unit " + FanCoil(FanCoilNum).Name, @@ -3260,7 +3262,7 @@ namespace FanCoilUnits { ShowWarningMessage(state, "ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations while adjusting cycling fan sensible runtime to meet the zone load " "within the cooling convergence tolerance."); - ShowContinueErrorTimeStamp(state, "Iterations=" + TrimSigDigits(MaxIterCycl)); + ShowContinueErrorTimeStamp(state, format("Iterations={}", MaxIterCycl)); } ShowRecurringWarningErrorAtEnd(state, "ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -3311,9 +3313,9 @@ namespace FanCoilUnits { ShowWarningMessage(state, "ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations while adjusting cycling fan sensible runtime to meet the zone load " "within the heating convergence tolerance."); - ShowContinueError(state, "...Requested zone load = " + TrimSigDigits(QZnReq, 3) + " [W]"); - ShowContinueError(state, "...Fan coil capacity = " + TrimSigDigits(QUnitOut, 3) + " [W]"); - ShowContinueErrorTimeStamp(state, "Iterations=" + TrimSigDigits(MaxIterCycl)); + ShowContinueError(state, format("...Requested zone load = {:.3T} [W]", QZnReq)); + ShowContinueError(state, format("...Fan coil capacity = {:.3T} [W]", QUnitOut)); + ShowContinueErrorTimeStamp(state, format("Iterations={}", MaxIterCycl)); } ShowRecurringWarningErrorAtEnd(state, "ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -4245,7 +4247,7 @@ namespace FanCoilUnits { // Using/Aliasing using namespace DataZoneEnergyDemands; using DataHeatBalFanSys::TempControlType; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; // Locals @@ -4344,7 +4346,7 @@ namespace FanCoilUnits { ShowWarningMessage(state, "ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations while adjusting cycling fan sensible runtime to meet the zone load within " "the cooling convergence tolerance."); - ShowContinueErrorTimeStamp(state, "Iterations=" + TrimSigDigits(MaxIterCycl)); + ShowContinueErrorTimeStamp(state, format("Iterations={}", MaxIterCycl)); } ShowRecurringWarningErrorAtEnd(state, "ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -4475,7 +4477,7 @@ namespace FanCoilUnits { "ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations while adjusting cycling fan sensible runtime to meet the zone load within " "the heating convergence tolerance."); - ShowContinueErrorTimeStamp(state, "Iterations=" + TrimSigDigits(MaxIterCycl)); + ShowContinueErrorTimeStamp(state, format("Iterations={}", MaxIterCycl)); } ShowRecurringWarningErrorAtEnd(state, "ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -4503,10 +4505,9 @@ namespace FanCoilUnits { ShowWarningError(state, "Electric heating coil control failed in fan coil unit " + FanCoil(FanCoilNum).Name); ShowContinueError(state, " Iteration limit exceeded in calculating electric heating coil capacity modulation "); Calc4PipeFanCoil(state, FanCoilNum, ZoneNum, FirstHVACIteration, QUnitOut, _, eHeatCoilPLR); - ShowContinueErrorTimeStamp(state, "Load Request = " + TrimSigDigits(QZnReq) + - ", Final Capacity = " + TrimSigDigits(QUnitOut)); - ShowContinueErrorTimeStamp(state, "Electric heating coil part load ratio used during last iterations = " + - TrimSigDigits(eHeatCoilPLR)); + ShowContinueErrorTimeStamp(state, format("Load Request = {}, Final Capacity = {}", QZnReq, QUnitOut)); + ShowContinueErrorTimeStamp( + state, format("Electric heating coil part load ratio used during last iterations = {}", eHeatCoilPLR)); } else { ShowRecurringWarningErrorAtEnd(state, "Electric heating coil Iteration limit exceeded in fan coil unit " + FanCoil(FanCoilNum).Name, diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 6609b4708cc..f656ccd3ef6 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -188,7 +187,6 @@ namespace Fans { // This subroutine manages Fan component simulation. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int FanNum; // current fan number @@ -210,13 +208,19 @@ namespace Fans { } else { FanNum = CompIndex; if (FanNum > state.dataFans->NumFans || FanNum < 1) { - ShowFatalError(state, "SimulateFanComponents: Invalid CompIndex passed=" + TrimSigDigits(FanNum) + - ", Number of Fans=" + TrimSigDigits(state.dataFans->NumFans) + ", Fan name=" + CompName); + ShowFatalError(state, + format("SimulateFanComponents: Invalid CompIndex passed={}, Number of Fans={}, Fan name={}", + FanNum, + state.dataFans->NumFans, + CompName)); } if (CheckEquipName(FanNum)) { if (!CompName.empty() && CompName != Fan(FanNum).FanName) { - ShowFatalError(state, "SimulateFanComponents: Invalid CompIndex passed=" + TrimSigDigits(FanNum) + ", Fan name=" + CompName + - ", stored Fan Name for that index=" + Fan(FanNum).FanName); + ShowFatalError(state, + format("SimulateFanComponents: Invalid CompIndex passed={}, Fan name={}, stored Fan Name for that index={}", + FanNum, + CompName, + Fan(FanNum).FanName)); } CheckEquipName(FanNum) = false; } @@ -1186,7 +1190,6 @@ namespace Fans { using namespace OutputReportPredefined; using CurveManager::CurveValue; using CurveManager::GetCurveIndex; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1319,7 +1322,7 @@ namespace Fans { if (MotorSpeed > (Fan(FanNum).MotorMaxSpd + 1.e-5)) { ShowWarningError(state, "Drive ratio for " + Fan(FanNum).FanType + ": " + Fan(FanNum).FanName + " is too low at design conditions -- check motor speed and drive ratio inputs"); - ShowContinueError(state, "...Design fan speed [rev/min]: " + RoundSigDigits(Fan(FanNum).FanSpd, 2)); + ShowContinueError(state, format("...Design fan speed [rev/min]: {:.2R}", Fan(FanNum).FanSpd)); } Fan(FanNum).FanTrq = Fan(FanNum).FanShaftPower / FanSpdRadS; //[N-m] @@ -1335,7 +1338,7 @@ namespace Fans { if (Fan(FanNum).FanTrq > (Fan(FanNum).BeltMaxTorque + 1.e-5)) { ShowWarningError(state, "Belt for " + Fan(FanNum).FanType + ": " + Fan(FanNum).FanName + " is undersized at design conditions -- check belt inputs"); - ShowContinueError(state, "...Design belt output torque (without oversizing) [Nm]: " + RoundSigDigits(Fan(FanNum).FanTrq, 2)); + ShowContinueError(state, format("...Design belt output torque (without oversizing) [Nm]: {:.2R}", Fan(FanNum).FanTrq)); } // Calculate belt max efficiency using correlations and coefficients based on AMCA data @@ -1377,7 +1380,7 @@ namespace Fans { if (Fan(FanNum).BeltInputPower > (Fan(FanNum).MotorMaxOutPwr + 1.e-5)) { ShowWarningError(state, "Motor for " + Fan(FanNum).FanType + ": " + Fan(FanNum).FanName + " is undersized at design conditions -- check motor inputs"); - ShowContinueError(state, "...Design motor output power (without oversizing) [W]: " + RoundSigDigits(Fan(FanNum).BeltInputPower, 2)); + ShowContinueError(state, format("...Design motor output power (without oversizing) [W]: {:.2R}", Fan(FanNum).BeltInputPower)); } // Calculate motor max efficiency using correlations and coefficients based on MotorMaster+ data @@ -1418,7 +1421,7 @@ namespace Fans { if (Fan(FanNum).MotorInputPower > (Fan(FanNum).VFDMaxOutPwr + 1.e-5)) { ShowWarningError(state, "VFD for " + Fan(FanNum).FanType + ": " + Fan(FanNum).FanName + " is undersized at design conditions -- check VFD inputs"); - ShowContinueError(state, "...Design VFD output power (without oversizing) [W]: " + RoundSigDigits(Fan(FanNum).MotorInputPower, 2)); + ShowContinueError(state, format("...Design VFD output power (without oversizing) [W]: {:.2R}", Fan(FanNum).MotorInputPower)); } VFDOutPwrRatio = Fan(FanNum).MotorInputPower / Fan(FanNum).VFDMaxOutPwr; //[-] @@ -1902,7 +1905,6 @@ namespace Fans { // Using/Aliasing using CurveManager::CurveValue; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2015,8 +2017,7 @@ namespace Fans { if (Fan(FanNum).OneTimePowerRatioCheck && !state.dataGlobal->WarmupFlag) { ShowSevereError(state, cFanTypes(Fan(FanNum).FanType_Num) + " = " + Fan(FanNum).FanName + "\""); ShowContinueError(state, "Error in Fan Power Ratio curve. Curve output less than 0.0."); - ShowContinueError(state, "Curve output = " + TrimSigDigits(SpeedRaisedToPower, 5) + - ", fan speed ratio = " + TrimSigDigits(SpeedRatio, 5)); + ShowContinueError(state, format("Curve output = {:.5T}, fan speed ratio = {:.5T}", SpeedRaisedToPower, SpeedRatio)); ShowContinueError(state, "Check curve coefficients to ensure proper power ratio as a function of fan speed ratio."); ShowContinueError(state, "Resetting Fan Power Ratio curve output to 0.0 and the simulation continues."); ShowContinueErrorTimeStamp(state, "Occurrence info:"); @@ -2030,8 +2031,7 @@ namespace Fans { if (Fan(FanNum).OneTimeEffRatioCheck && !state.dataGlobal->WarmupFlag) { ShowSevereError(state, cFanTypes(Fan(FanNum).FanType_Num) + " = " + Fan(FanNum).FanName + "\""); ShowContinueError(state, "Error in Fan Efficiency Ratio curve. Curve output less than 0.01."); - ShowContinueError(state, "Curve output = " + TrimSigDigits(EffRatioAtSpeedRatio, 5) + - ", fan speed ratio = " + TrimSigDigits(SpeedRatio, 5)); + ShowContinueError(state, format("Curve output = {:.5T}, fan speed ratio = {:.5T}", EffRatioAtSpeedRatio, SpeedRatio)); ShowContinueError(state, "Check curve coefficients to ensure proper efficiency ratio as a function of fan speed ratio."); ShowContinueError(state, "Resetting Fan Efficiency Ratio curve output to 0.01 and the simulation continues."); ShowContinueErrorTimeStamp(state, "Occurrence info:"); @@ -2236,7 +2236,6 @@ namespace Fans { using DataEnvironment::CurMnDy; using DataEnvironment::EnvironmentName; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -3064,7 +3063,6 @@ namespace Fans { // na // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index a174a864cbf..8abecc3b72b 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -859,9 +859,11 @@ namespace FluidCoolers { // temperature is less than design inlet air dry bulb temperature if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Error when autosizing the UA value for fluid cooler = " + this->Name + '.'); - ShowContinueError(state, "Design Loop Exit Temperature (" + General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2) + - " C) must be greater than design entering air dry-bulb temperature (" + - General::RoundSigDigits(this->DesignEnteringAirTemp, 2) + " C) when autosizing the fluid cooler UA."); + ShowContinueError(state, + format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb temperature " + "({:.2R} C) when autosizing the fluid cooler UA.", + DataSizing::PlantSizData(PltSizCondNum).ExitTemp, + this->DesignEnteringAirTemp)); ShowContinueError(state, "It is recommended that the Design Loop Exit Temperature = design inlet air dry-bulb temp plus the Fluid Cooler " "design approach temperature (e.g., 4 C)."); ShowContinueError(state, "If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design Setpoint must be " @@ -907,10 +909,11 @@ namespace FluidCoolers { if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Error when autosizing the UA value for fluid cooler = " + this->Name + '.'); - ShowContinueError(state, "Design Loop Exit Temperature (" + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2) + - " C) must be greater than design entering air dry-bulb temperature (" + - General::RoundSigDigits(this->DesignEnteringAirTemp, 2) + " C) when autosizing the fluid cooler UA."); + ShowContinueError(state, + format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb " + "temperature ({:.2R} C) when autosizing the fluid cooler UA.", + DataSizing::PlantSizData(PltSizCondNum).ExitTemp, + this->DesignEnteringAirTemp)); ShowContinueError(state, "It is recommended that the Design Loop Exit Temperature = design inlet air dry-bulb temp plus the " "Fluid Cooler design approach temperature (e.g., 4 C)."); ShowContinueError(state, "If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design " @@ -980,10 +983,11 @@ namespace FluidCoolers { if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Error when autosizing the UA value for fluid cooler = " + this->Name + '.'); - ShowContinueError(state, "Design Loop Exit Temperature (" + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2) + - " C) must be greater than design entering air dry-bulb temperature (" + - General::RoundSigDigits(this->DesignEnteringAirTemp, 2) + " C) when autosizing the fluid cooler UA."); + ShowContinueError(state, + format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb " + "temperature ({:.2R} C) when autosizing the fluid cooler UA.", + DataSizing::PlantSizData(PltSizCondNum).ExitTemp, + this->DesignEnteringAirTemp)); ShowContinueError(state, "It is recommended that the Design Loop Exit Temperature = design inlet air dry-bulb temp plus the " "Fluid Cooler design approach temperature (e.g., 4 C)."); ShowContinueError(state, "If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design " @@ -1045,10 +1049,11 @@ namespace FluidCoolers { // temperature is less than design inlet air dry bulb temperature if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Error when autosizing the UA value for fluid cooler = " + this->Name + '.'); - ShowContinueError(state, "Design Loop Exit Temperature (" + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2) + - " C) must be greater than design entering air dry-bulb temperature (" + - General::RoundSigDigits(this->DesignEnteringAirTemp, 2) + " C) when autosizing the fluid cooler UA."); + ShowContinueError(state, + format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb " + "temperature ({:.2R} C) when autosizing the fluid cooler UA.", + DataSizing::PlantSizData(PltSizCondNum).ExitTemp, + this->DesignEnteringAirTemp)); ShowContinueError(state, "It is recommended that the Design Loop Exit Temperature = design inlet air dry-bulb temp plus the Fluid " "Cooler design approach temperature (e.g., 4 C)."); ShowContinueError(state, "If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design Setpoint " @@ -1082,7 +1087,7 @@ namespace FluidCoolers { if (SolFla == -1) { ShowWarningError(state, "Iteration limit exceeded in calculating fluid cooler UA."); ShowContinueError(state, "Autosizing of fluid cooler UA failed for fluid cooler = " + this->Name); - ShowContinueError(state, "The final UA value =" + General::RoundSigDigits(UA, 2) + " W/K, and the simulation continues..."); + ShowContinueError(state, format("The final UA value ={:.2R} W/K, and the simulation continues...", UA)); } else if (SolFla == -2) { CalcFluidCoolerOutlet(state, int(Par(2)), Par(3), Par(4), UA0, OutWaterTempAtUA0); CalcFluidCoolerOutlet(state, int(Par(2)), Par(3), Par(4), UA1, OutWaterTempAtUA1); @@ -1099,21 +1104,22 @@ namespace FluidCoolers { ShowContinueError(state, "on the autosized values shown below or to adjust design fluid cooler air inlet dry-bulb temperature."); ShowContinueError(state, "Plant:Sizing object inputs also influence these results (e.g. DeltaT and ExitTemp)."); ShowContinueError(state, "Inputs to the fluid cooler object:"); - ShowContinueError(state, "Design Fluid Cooler Load [W] = " + General::RoundSigDigits(Par(1), 2)); - ShowContinueError(state, "Design Fluid Cooler Water Volume Flow Rate [m3/s] = " + - General::RoundSigDigits(this->DesignWaterFlowRate, 6)); - ShowContinueError(state, "Design Fluid Cooler Air Volume Flow Rate [m3/s] = " + General::RoundSigDigits(Par(4), 2)); - ShowContinueError(state, "Design Fluid Cooler Air Inlet Dry-bulb Temp [C] = " + General::RoundSigDigits(this->AirTemp, 2)); + ShowContinueError(state, format("Design Fluid Cooler Load [W] = {:.2R}", Par(1))); + ShowContinueError(state, format("Design Fluid Cooler Water Volume Flow Rate [m3/s] = {:.6R}", this->DesignWaterFlowRate)); + ShowContinueError(state, format("Design Fluid Cooler Air Volume Flow Rate [m3/s] = {:.2R}", Par(4))); + ShowContinueError(state, format("Design Fluid Cooler Air Inlet Dry-bulb Temp [C] = {:.2R}", this->AirTemp)); ShowContinueError(state, "Inputs to the plant sizing object:"); - ShowContinueError(state, "Design Exit Water Temp [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2)); - ShowContinueError(state, "Loop Design Temperature Difference [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).DeltaT, 2)); - ShowContinueError(state, "Design Fluid Cooler Water Inlet Temp [C] = " + General::RoundSigDigits(this->WaterTemp, 2)); - ShowContinueError(state, "Calculated water outlet temp at low UA [C] (UA = " + General::RoundSigDigits(UA0, 2) + - " W/K) = " + General::RoundSigDigits(OutWaterTempAtUA0, 2)); - ShowContinueError(state, "Calculated water outlet temp at high UA [C](UA = " + General::RoundSigDigits(UA1, 2) + - " W/K) = " + General::RoundSigDigits(OutWaterTempAtUA1, 2)); + ShowContinueError( + state, + format("Design Exit Water Temp [C] = {:.2R}", DataSizing::PlantSizData(PltSizCondNum).ExitTemp)); + ShowContinueError( + state, + format("Loop Design Temperature Difference [C] = {:.2R}", DataSizing::PlantSizData(PltSizCondNum).DeltaT)); + ShowContinueError(state, format("Design Fluid Cooler Water Inlet Temp [C] = {:.2R}", this->WaterTemp)); + ShowContinueError(state, + format("Calculated water outlet temp at low UA [C] (UA = {:.2R} W/K) = {:.2R}", UA0, OutWaterTempAtUA0)); + ShowContinueError(state, + format("Calculated water outlet temp at high UA [C](UA = {:.2R} W/K) = {:.2R}", UA1, OutWaterTempAtUA1)); ShowFatalError(state, "Autosizing of Fluid Cooler UA failed for fluid cooler = " + this->Name); } tmpHighSpeedEvapFluidCoolerUA = UA; @@ -1191,7 +1197,7 @@ namespace FluidCoolers { if (PltSizCondNum > 0) { ShowContinueError(state, "Autosizing of fluid cooler UA failed for fluid cooler = " + this->Name); } - ShowContinueError(state, "The final UA value =" + General::RoundSigDigits(UA, 2) + " W/K, and the simulation continues..."); + ShowContinueError(state, format("The final UA value ={:.2R} W/K, and the simulation continues...", UA)); } else if (SolFla == -2) { CalcFluidCoolerOutlet(state, int(Par(2)), Par(3), Par(4), UA0, OutWaterTempAtUA0); CalcFluidCoolerOutlet(state, int(Par(2)), Par(3), Par(4), UA1, OutWaterTempAtUA1); @@ -1208,23 +1214,23 @@ namespace FluidCoolers { ShowContinueError(state, "on the autosized values shown below or to adjust design fluid cooler air inlet dry-bulb temperature."); ShowContinueError(state, "Plant:Sizing object inputs also influence these results (e.g. DeltaT and ExitTemp)."); ShowContinueError(state, "Inputs to the fluid cooler object:"); - ShowContinueError(state, "Design Fluid Cooler Load [W] = " + General::RoundSigDigits(Par(1), 2)); - ShowContinueError(state, "Design Fluid Cooler Water Volume Flow Rate [m3/s] = " + - General::RoundSigDigits(this->DesignWaterFlowRate, 6)); - ShowContinueError(state, "Design Fluid Cooler Air Volume Flow Rate [m3/s] = " + General::RoundSigDigits(Par(4), 2)); - ShowContinueError(state, "Design Fluid Cooler Air Inlet Dry-bulb Temp [C] = " + General::RoundSigDigits(this->AirTemp, 2)); + ShowContinueError(state, format("Design Fluid Cooler Load [W] = {:.2R}", Par(1))); + ShowContinueError(state, format("Design Fluid Cooler Water Volume Flow Rate [m3/s] = {:.6R}", this->DesignWaterFlowRate)); + ShowContinueError(state, format("Design Fluid Cooler Air Volume Flow Rate [m3/s] = {:.2R}", Par(4))); + ShowContinueError(state, format("Design Fluid Cooler Air Inlet Dry-bulb Temp [C] = {:.2R}", this->AirTemp)); if (PltSizCondNum > 0) { ShowContinueError(state, "Inputs to the plant sizing object:"); - ShowContinueError(state, "Design Exit Water Temp [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2)); - ShowContinueError(state, "Loop Design Temperature Difference [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).DeltaT, 2)); + ShowContinueError( + state, + format("Design Exit Water Temp [C] = {:.2R}", DataSizing::PlantSizData(PltSizCondNum).ExitTemp)); + ShowContinueError( + state, + format("Loop Design Temperature Difference [C] = {:.2R}", DataSizing::PlantSizData(PltSizCondNum).DeltaT)); }; - ShowContinueError(state, "Design Fluid Cooler Water Inlet Temp [C] = " + General::RoundSigDigits(this->WaterTemp, 2)); - ShowContinueError(state, "Calculated water outlet temp at low UA [C] (UA = " + General::RoundSigDigits(UA0, 2) + - " W/K) = " + General::RoundSigDigits(OutWaterTempAtUA0, 2)); - ShowContinueError(state, "Calculated water outlet temp at high UA [C] (UA = " + General::RoundSigDigits(UA1, 2) + - " W/K) = " + General::RoundSigDigits(OutWaterTempAtUA1, 2)); + ShowContinueError(state, format("Design Fluid Cooler Water Inlet Temp [C] = {:.2R}", this->WaterTemp)); + ShowContinueError(state, format("Calculated water outlet temp at low UA [C] (UA = {:.2R} W/K) = {:.2R}", UA0, OutWaterTempAtUA0)); + ShowContinueError(state, + format("Calculated water outlet temp at high UA [C] (UA = {:.2R} W/K) = {:.2R}", UA1, OutWaterTempAtUA1)); if (PltSizCondNum > 0) { ShowFatalError(state, "Autosizing of Fluid Cooler UA failed for fluid cooler = " + this->Name); } @@ -1341,8 +1347,7 @@ namespace FluidCoolers { if (SolFla == -1) { ShowWarningError(state, "Iteration limit exceeded in calculating fluid cooler UA."); ShowContinueError(state, "Autosizing of fluid cooler UA failed for fluid cooler = " + this->Name); - ShowContinueError(state, "The final UA value at low fan speed =" + General::RoundSigDigits(UA, 2) + - " W/C, and the simulation continues..."); + ShowContinueError(state, format("The final UA value at low fan speed ={:.2R} W/C, and the simulation continues...", UA)); } else if (SolFla == -2) { CalcFluidCoolerOutlet(state, int(Par(2)), Par(3), Par(4), UA0, OutWaterTempAtUA0); CalcFluidCoolerOutlet(state, int(Par(2)), Par(3), Par(4), UA1, OutWaterTempAtUA1); @@ -1359,21 +1364,20 @@ namespace FluidCoolers { ShowContinueError(state, "on the autosized values shown below or to adjust design fluid cooler air inlet dry-bulb temperature."); ShowContinueError(state, "Plant:Sizing object inputs also influence these results (e.g. DeltaT and ExitTemp)."); ShowContinueError(state, "Inputs to the fluid cooler object:"); - ShowContinueError(state, "Design Fluid Cooler Load [W] = " + General::RoundSigDigits(Par(1), 2)); - ShowContinueError(state, "Design Fluid Cooler Water Volume Flow Rate [m3/s] = " + - General::RoundSigDigits(this->DesignWaterFlowRate, 6)); - ShowContinueError(state, "Design Fluid Cooler Air Volume Flow Rate [m3/s] = " + General::RoundSigDigits(Par(4), 2)); - ShowContinueError(state, "Design Fluid Cooler Air Inlet Dry-bulb Temp [C] = " + General::RoundSigDigits(this->AirTemp, 2)); + ShowContinueError(state, format("Design Fluid Cooler Load [W] = {:.2R}", Par(1))); + ShowContinueError(state, format("Design Fluid Cooler Water Volume Flow Rate [m3/s] = {:.6R}", this->DesignWaterFlowRate)); + ShowContinueError(state, format("Design Fluid Cooler Air Volume Flow Rate [m3/s] = {:.2R}", Par(4))); + ShowContinueError(state, format("Design Fluid Cooler Air Inlet Dry-bulb Temp [C] = {:.2R}", this->AirTemp)); ShowContinueError(state, "Inputs to the plant sizing object:"); - ShowContinueError(state, "Design Exit Water Temp [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2)); - ShowContinueError(state, "Loop Design Temperature Difference [C] = " + - General::RoundSigDigits(DataSizing::PlantSizData(PltSizCondNum).DeltaT, 2)); - ShowContinueError(state, "Design Fluid Cooler Water Inlet Temp [C] = " + General::RoundSigDigits(this->WaterTemp, 2)); - ShowContinueError(state, "Calculated water outlet temp at low UA [C](UA = " + General::RoundSigDigits(UA0, 2) + - " W/C) = " + General::RoundSigDigits(OutWaterTempAtUA0, 2)); - ShowContinueError(state, "Calculated water outlet temp at high UA [C](UA = " + General::RoundSigDigits(UA1, 2) + - " W/C) = " + General::RoundSigDigits(OutWaterTempAtUA1, 2)); + ShowContinueError( + state, + format("Design Exit Water Temp [C] = {:.2R}", DataSizing::PlantSizData(PltSizCondNum).ExitTemp)); + ShowContinueError( + state, + format("Loop Design Temperature Difference [C] = {:.2R}", DataSizing::PlantSizData(PltSizCondNum).DeltaT)); + ShowContinueError(state, format("Design Fluid Cooler Water Inlet Temp [C] = {:.2R}", this->WaterTemp)); + ShowContinueError(state, format("Calculated water outlet temp at low UA [C](UA = {:.2R} W/C) = {:.2R}", UA0, OutWaterTempAtUA0)); + ShowContinueError(state, format("Calculated water outlet temp at high UA [C](UA = {:.2R} W/C) = {:.2R}", UA1, OutWaterTempAtUA1)); ShowFatalError(state, "Autosizing of Fluid Cooler UA failed for fluid cooler = " + this->Name); } if (DataPlant::PlantFirstSizesOkayToFinalize) this->LowSpeedFluidCoolerUA = UA; @@ -1778,8 +1782,8 @@ namespace FluidCoolers { if (this->HighMassFlowErrorCount < 2) { ShowWarningError(state, this->FluidCoolerType + " \"" + this->Name + "\""); ShowContinueError(state, " Condenser Loop Mass Flow Rate is much greater than the fluid coolers design mass flow rate."); - ShowContinueError(state, " Condenser Loop Mass Flow Rate = " + General::TrimSigDigits(DataLoopNode::Node(waterOutletNode).MassFlowRate, 6)); - ShowContinueError(state, " Fluid Cooler Design Mass Flow Rate = " + General::TrimSigDigits(this->DesWaterMassFlowRate, 6)); + ShowContinueError(state, format(" Condenser Loop Mass Flow Rate = {:.6T}", DataLoopNode::Node(waterOutletNode).MassFlowRate)); + ShowContinueError(state, format(" Fluid Cooler Design Mass Flow Rate = {:.6T}", this->DesWaterMassFlowRate)); ShowContinueErrorTimeStamp(state, ""); } else { ShowRecurringWarningErrorAtEnd(state, @@ -1820,7 +1824,7 @@ namespace FluidCoolers { ShowWarningError(state, this->FluidCoolerType + " \"" + this->Name + "\""); ShowContinueError(state, " Fluid cooler water mass flow rate near zero."); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Actual Mass flow = " + General::TrimSigDigits(this->WaterMassFlowRate, 2)); + ShowContinueError(state, format("Actual Mass flow = {:.2T}", this->WaterMassFlowRate)); } else { ShowRecurringWarningErrorAtEnd(state, this->FluidCoolerType + " \"" + this->Name + "\" Fluid cooler water mass flow rate near zero error continues...", diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index 3e24b904392..3171161f7ac 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -104,12 +104,6 @@ namespace FluidProperties { // supplying the same data for concentrations of 0.0 and 1.0 only. // Temperature data has to be supplied in ascending order only. - // REFERENCES: - - // USE STATEMENTS - // Using/Aliasing - using General::RoundSigDigits; - // Data // MODULE PARAMETER DEFINITIONS std::string const Refrig("REFRIGERANT"); @@ -737,9 +731,12 @@ namespace FluidProperties { if (FluidTemps(Loop).Temps(TempLoop) <= FluidTemps(Loop).Temps(TempLoop - 1)) { ShowSevereError(state, RoutineName + CurrentModuleObject + " name=" + FluidTemps(Loop).Name + ", lists must have data in ascending order"); - ShowContinueError(state, "First out of order occurrence at Temperature #(" + RoundSigDigits(TempLoop - 1) + ") {" + - RoundSigDigits(FluidTemps(Loop).Temps(TempLoop - 1), 3) + "} >= Temp(" + RoundSigDigits(TempLoop) + ") {" + - RoundSigDigits(FluidTemps(Loop).Temps(TempLoop), 3) + '}'); + ShowContinueError(state, + format("First out of order occurrence at Temperature #({}) {{{:.R3}}} >= Temp({}) {{{:.R3}}}", + TempLoop - 1, + FluidTemps(Loop).Temps(TempLoop - 1), + TempLoop, + FluidTemps(Loop).Temps(TempLoop))); ErrorsFound = true; break; } @@ -793,8 +790,11 @@ namespace FluidProperties { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); ShowContinueError(state, "Temperature Name=" + TempsName + ", Temperature array and fluid saturation pressure array must have the same number of points"); - ShowContinueError(state, "Temperature # points=" + RoundSigDigits(NumNumbers) + " whereas " + RefrigData(Loop).Name + - " # pressure points=" + RoundSigDigits(RefrigData(Loop).NumPsPoints)); + ShowContinueError(state, + format("Temperature # points={} whereas {} # pressure points={}", + NumNumbers, + RefrigData(Loop).Name, + RefrigData(Loop).NumPsPoints)); ErrorsFound = true; break; // the TempLoop DO Loop } @@ -866,8 +866,11 @@ namespace FluidProperties { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); ShowSevereError(state, "Temperature Name=" + TempsName + ", Temperature array and saturated fluid enthalpy array must have the same number of points"); - ShowContinueError(state, "Temperature # points=" + RoundSigDigits(NumNumbers) + " whereas " + RefrigData(Loop).Name + - " # points=" + RoundSigDigits(RefrigData(Loop).NumHPoints)); + ShowContinueError(state, + format("Temperature # points={} whereas {} # points={}", + NumNumbers, + RefrigData(Loop).Name, + RefrigData(Loop).NumHPoints)); ErrorsFound = true; break; // the TempLoop DO Loop } @@ -941,8 +944,11 @@ namespace FluidProperties { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); ShowContinueError(state, "Temperature Name=" + TempsName + ", Temperature array and saturated gas/fluid enthalpy array must have the same number of points"); - ShowContinueError(state, "Temperature # points=" + RoundSigDigits(NumNumbers) + " whereas " + RefrigData(Loop).Name + - " # points=" + RoundSigDigits(RefrigData(Loop).NumHPoints)); + ShowContinueError(state, + format("Temperature # points={} whereas {} # points={}", + NumNumbers, + RefrigData(Loop).Name, + RefrigData(Loop).NumHPoints)); ErrorsFound = true; break; // the TempLoop DO Loop } @@ -1012,8 +1018,11 @@ namespace FluidProperties { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); ShowSevereError(state, "Temperature Name=" + TempsName + ", Temperature array and saturated fluid Cp array must have the same number of points"); - ShowContinueError(state, "Temperature # points=" + RoundSigDigits(NumNumbers) + " whereas " + RefrigData(Loop).Name + - " # Cp points=" + RoundSigDigits(RefrigData(Loop).NumCpPoints)); + ShowContinueError(state, + format("Temperature # points={} whereas {} # Cp points={}", + NumNumbers, + RefrigData(Loop).Name, + RefrigData(Loop).NumCpPoints)); ErrorsFound = true; break; // the TempLoop DO Loop } @@ -1087,8 +1096,11 @@ namespace FluidProperties { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); ShowContinueError(state, "Temperature Name=" + TempsName + ", Temperature array and saturated gas/fluid Cp array must have the same number of points"); - ShowContinueError(state, "Temperature # points=" + RoundSigDigits(NumNumbers) + " whereas " + RefrigData(Loop).Name + - " # Cp points=" + RoundSigDigits(RefrigData(Loop).NumCpPoints)); + ShowContinueError(state, + format("Temperature # points={} whereas {} # Cp points={}", + NumNumbers, + RefrigData(Loop).Name, + RefrigData(Loop).NumCpPoints)); ErrorsFound = true; break; // the TempLoop DO Loop } @@ -1158,8 +1170,11 @@ namespace FluidProperties { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); ShowContinueError(state, "Temperature Name=" + TempsName + ", Temperature array and saturated fluid density array must have the same number of points"); - ShowContinueError(state, "Temperature # points=" + RoundSigDigits(NumNumbers) + " whereas " + RefrigData(Loop).Name + - " # Density points=" + RoundSigDigits(RefrigData(Loop).NumRhoPoints)); + ShowContinueError(state, + format("Temperature # points={} whereas {} # Density points={}", + NumNumbers, + RefrigData(Loop).Name, + RefrigData(Loop).NumRhoPoints)); ErrorsFound = true; break; // the TempLoop DO Loop } @@ -1233,8 +1248,11 @@ namespace FluidProperties { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); ShowContinueError(state, "Temperature Name=" + TempsName + ", Temperature array and saturated gas/fluid density array must have the same number of points"); - ShowContinueError(state, "Temperature # points=" + RoundSigDigits(NumNumbers) + " whereas " + RefrigData(Loop).Name + - " # density points=" + RoundSigDigits(RefrigData(Loop).NumRhoPoints)); + ShowContinueError(state, + format("Temperature # points={} whereas {} # density points={}", + NumNumbers, + RefrigData(Loop).Name, + RefrigData(Loop).NumRhoPoints)); ErrorsFound = true; break; // the TempLoop DO Loop } @@ -1346,7 +1364,7 @@ namespace FluidProperties { } if (iTemp > 1) { - ShowWarningError(state, RoutineName + CurrentModuleObject + " has " + RoundSigDigits(iTemp - 1) + " similar errors to the previous."); + ShowWarningError(state, format("{}{} has {} similar errors to the previous.", RoutineName, CurrentModuleObject, iTemp - 1)); } // ********** SUPERHEATED DATA SECTION ********** @@ -1436,8 +1454,7 @@ namespace FluidProperties { ++NumOfPressPts; if (Numbers(1) <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); - ShowContinueError(state, "Negative pressures not allowed in fluid property input data, Value =[" + RoundSigDigits(Numbers(1), 3) + - "]."); + ShowContinueError(state, format("Negative pressures not allowed in fluid property input data, Value =[{:.3R}].", Numbers(1))); ErrorsFound = true; } PressurePtr(NumOfPressPts).Pressure = Numbers(1); @@ -1480,9 +1497,12 @@ namespace FluidProperties { if (RefrigData(Loop).SHPress(InData) <= RefrigData(Loop).SHPress(InData - 1)) { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); ShowContinueError(state, "Pressures must be entered in ascending order for fluid property data"); - ShowContinueError(state, "First Occurrence at Pressure(" + RoundSigDigits(InData - 1) + ") {" + - RoundSigDigits(RefrigData(Loop).SHPress(InData - 1), 3) + "} >= Pressure(" + RoundSigDigits(InData) + - ") {" + RoundSigDigits(RefrigData(Loop).SHPress(InData), 3) + '}'); + ShowContinueError(state, + format("First Occurrence at Pressure({}) {{{:.3R}}} >= Pressure({}) {{{:.3R}}}", + InData - 1, + RefrigData(Loop).SHPress(InData - 1), + InData, + RefrigData(Loop).SHPress(InData))); ErrorsFound = true; break; } @@ -1523,8 +1543,7 @@ namespace FluidProperties { ++NumOfPressPts; if (Numbers(1) <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); - ShowContinueError(state, "Negative pressures not allowed in fluid property input data, Value =[" + RoundSigDigits(Numbers(1), 3) + - "]."); + ShowContinueError(state, format("Negative pressures not allowed in fluid property input data, Value =[{:.3R}].", Numbers(1))); ErrorsFound = true; } PressurePtr(NumOfPressPts).Pressure = Numbers(1); @@ -1604,7 +1623,7 @@ namespace FluidProperties { ShowWarningError(state, RoutineName + CurrentModuleObject + " Name=" + RefrigData(Loop).Name); ShowContinueError(state, cAlphaFieldNames(2) + "=\"" + Alphas(2) + "\" is not valid."); ShowContinueError(state, "Valid choices are \"" + Enthalpy + "\", \"" + Density + "\"."); - ShowContinueError(state, "Pressure value of this item=[" + RoundSigDigits(Numbers(1), 2) + "]."); + ShowContinueError(state, format("Pressure value of this item=[{:.2R}].", Numbers(1))); ShowContinueError(state, "This fluid property will not be processed nor available for the simulation."); } ++iTemp; @@ -1612,7 +1631,7 @@ namespace FluidProperties { } if (iTemp > 1) { - ShowWarningError(state, RoutineName + CurrentModuleObject + " has " + RoundSigDigits(iTemp - 1) + " similar errors to the previous."); + ShowWarningError(state, format("{}{} has {} similar errors to the previous.", RoutineName, CurrentModuleObject, iTemp - 1)); } if (NumOfPressPts == 0) { @@ -4891,14 +4910,14 @@ CurrentModuleObject, // First, find where the actual concentration falls between the concentration data. // Then, interpolate if necessary. if (Concentration < RawConcData(1)) { // Concentration too low - ShowWarningError(state, RoutineName + - "Glycol concentration out of range for data (too low), concentration = " + RoundSigDigits(Concentration, 3)); + ShowWarningError(state, + format("{}Glycol concentration out of range for data (too low), concentration = {:.3R}", RoutineName, Concentration)); ShowContinueError(state, "Check your data or the definition of your glycols in the GlycolConcentrations input"); ShowContinueError(state, "Property data set to data for lowest concentration entered"); InterpData = RawPropData(_, 1); } else if (Concentration > RawConcData(NumOfConcs)) { // Concentration too high - ShowWarningError(state, RoutineName + - "Glycol concentration out of range for data (too high), concentration = " + RoundSigDigits(Concentration, 3)); + ShowWarningError(state, + format("{}Glycol concentration out of range for data (too high), concentration = {:.3R}", RoutineName, Concentration)); ShowContinueError(state, "Check your data or the definition of your glycols in the GlycolConcentrations input"); ShowContinueError(state, "Property data set to data for highest concentration entered"); InterpData = RawPropData(_, NumOfConcs); @@ -4996,14 +5015,14 @@ CurrentModuleObject, // First, find where the actual concentration falls between the concentration data. // Then, interpolate if necessary. if (Concentration < RawConcData(1)) { // Concentration too low - ShowWarningError(state, RoutineName + - "Glycol concentration out of range for data (too low), concentration = " + RoundSigDigits(Concentration, 3)); + ShowWarningError(state, + format("{}Glycol concentration out of range for data (too low), concentration = {:.3R}", RoutineName, Concentration)); ShowContinueError(state, "Check your data or the definition of your glycols in the GlycolConcentrations input"); ShowContinueError(state, "Property data set to data for lowest concentration entered"); InterpData = RawPropData(1, _); } else if (Concentration > RawConcData(NumOfConcs)) { // Concentration too high - ShowWarningError(state, RoutineName + - "Glycol concentration out of range for data (too high), concentration = " + RoundSigDigits(Concentration, 3)); + ShowWarningError(state, + format("{}Glycol concentration out of range for data (too high), concentration = {:.3R}", RoutineName, Concentration)); ShowContinueError(state, "Check your data or the definition of your glycols in the GlycolConcentrations input"); ShowContinueError(state, "Property data set to data for highest concentration entered"); InterpData = RawPropData(NumOfConcs, _); @@ -5801,7 +5820,7 @@ CurrentModuleObject, print(state.files.debug, ",{:.3R}\n", RefrigData(RefrigNum).HshValues(Loop, RefrigData(RefrigNum).NumSuperTempPts)); } for (Loop = 1; Loop <= RefrigData(RefrigNum).NumSuperPressPts; ++Loop) { - print(state.files.debug, "Superheated Pressure:#{}={:.2R}\n", RoundSigDigits(Loop), RefrigData(RefrigNum).SHPress(Loop)); + print(state.files.debug, "Superheated Pressure:#{}={:.2R}\n", Loop, RefrigData(RefrigNum).SHPress(Loop)); print(state.files.debug, "Density Superheated Gas:"); for (Loop1 = 1; Loop1 <= RefrigData(RefrigNum).NumSuperTempPts - 1; ++Loop1) { print(state.files.debug, ",{:.3R}", RefrigData(RefrigNum).RhoshValues(Loop, Loop1)); @@ -6067,11 +6086,13 @@ CurrentModuleObject, if (RefrigErrorTracking(RefrigNum).SatTempErrCount <= RefrigerantErrorLimitTest) { ShowSevereMessage(state, RoutineName + "Saturation temperature is out of range for refrigerant [" + RefrigErrorTracking(RefrigNum).Name + "] supplied data: **"); - ShowContinueError(state, "...Called From:" + CalledFrom + ", supplied data range=[" + - RoundSigDigits(refrig.PsTemps(refrig.PsLowTempIndex), 2) + ',' + - RoundSigDigits(refrig.PsTemps(refrig.PsHighTempIndex), 2) + ']'); - ShowContinueError(state, "...Supplied Refrigerant Temperature=" + RoundSigDigits(Temperature, 2) + - " Returned saturated pressure value = " + RoundSigDigits(ReturnValue, 0)); + ShowContinueError(state, + format("...Called From:{}, supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + refrig.PsTemps(refrig.PsLowTempIndex), + refrig.PsTemps(refrig.PsHighTempIndex))); + ShowContinueError( + state, format("...Supplied Refrigerant Temperature={:.2R} Returned saturated pressure value = {:.0R}", Temperature, ReturnValue)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringSevereErrorAtEnd(state, RoutineName + "Saturation temperature is out of range for refrigerant [" + @@ -6189,11 +6210,13 @@ CurrentModuleObject, if (RefrigErrorTracking(RefrigNum).SatPressErrCount <= RefrigerantErrorLimitTest) { ShowSevereMessage(state, RoutineName + "Saturation pressure is out of range for refrigerant [" + RefrigErrorTracking(RefrigNum).Name + "] supplied data: **"); - ShowContinueError(state, "...Called From:" + CalledFrom + ", supplied data range=[" + - RoundSigDigits(refrig.PsValues(refrig.PsLowPresIndex), 0) + ',' + - RoundSigDigits(refrig.PsValues(refrig.PsHighPresIndex), 0) + ']'); - ShowContinueError(state, "...Supplied Refrigerant Pressure=" + RoundSigDigits(Pressure, 0) + - " Returned saturated temperature value =" + RoundSigDigits(ReturnValue, 2)); + ShowContinueError(state, + format("...Called From:{}, supplied data range=[{:.0R},{:.0R}]", + CalledFrom, + refrig.PsValues(refrig.PsLowPresIndex), + refrig.PsValues(refrig.PsHighPresIndex))); + ShowContinueError( + state, format("...Supplied Refrigerant Pressure={:.0R} Returned saturated temperature value ={:.2R}", Pressure, ReturnValue)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringSevereErrorAtEnd(state, RoutineName + "Saturation pressure is out of range for refrigerant [" + @@ -6270,7 +6293,7 @@ CurrentModuleObject, if ((Quality < 0.0) || (Quality > 1.0)) { ShowSevereError(state, RoutineName + ": Refrigerant \"" + Refrigerant + "\", invalid quality, called from " + CalledFrom); - ShowContinueError(state, "Saturated refrigerant quality must be between 0 and 1, entered value=[" + RoundSigDigits(Quality, 4) + "]."); + ShowContinueError(state, format("Saturated refrigerant quality must be between 0 and 1, entered value=[{:.4R}].", Quality)); ShowFatalError(state, "Program terminates due to preceding condition."); } @@ -6363,7 +6386,7 @@ CurrentModuleObject, if ((Quality < 0.0) || (Quality > 1.0)) { ShowSevereError(state, RoutineName + "Refrigerant \"" + Refrigerant + "\", invalid quality, called from " + CalledFrom); - ShowContinueError(state, "Saturated density quality must be between 0 and 1, entered value=[" + RoundSigDigits(Quality, 4) + "]."); + ShowContinueError(state, format("Saturated density quality must be between 0 and 1, entered value=[{:.4R}].", Quality)); ShowFatalError(state, "Program terminates due to preceding condition."); } @@ -6428,11 +6451,13 @@ CurrentModuleObject, if (RefrigErrorTracking(RefrigNum).SatTempDensityErrCount <= RefrigerantErrorLimitTest) { ShowSevereMessage(state, RoutineName + "Saturation temperature is out of range for refrigerant [" + RefrigErrorTracking(RefrigNum).Name + "] supplied data: **"); - ShowContinueError(state, "...Called From:" + CalledFrom + ", supplied data range=[" + - RoundSigDigits(refrig.RhoTemps(refrig.RhofLowTempIndex), 2) + ',' + - RoundSigDigits(refrig.RhoTemps(refrig.RhofHighTempIndex), 2) + ']'); - ShowContinueError(state, "...Supplied Refrigerant Temperature=" + RoundSigDigits(Temperature, 2) + - " Returned saturated density value =" + RoundSigDigits(ReturnValue, 2)); + ShowContinueError(state, + format("...Called From:{}, supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + refrig.RhoTemps(refrig.RhofLowTempIndex), + refrig.RhoTemps(refrig.RhofHighTempIndex))); + ShowContinueError( + state, format("...Supplied Refrigerant Temperature={:.2R} Returned saturated density value ={:.2R}", Temperature, ReturnValue)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringSevereErrorAtEnd(state, RoutineName + "Saturation temperature is out of range for refrigerant [" + @@ -6510,7 +6535,7 @@ CurrentModuleObject, if ((Quality < 0.0) || (Quality > 1.0)) { ShowSevereError(state, RoutineName + "Refrigerant \"" + Refrigerant + "\", invalid quality, called from " + CalledFrom); - ShowContinueError(state, "Saturated density quality must be between 0 and 1, entered value=[" + RoundSigDigits(Quality, 4) + "]."); + ShowContinueError(state, format("Saturated density quality must be between 0 and 1, entered value=[{:.4R}].", Quality)); ShowFatalError(state, "Program terminates due to preceding condition."); } @@ -6727,9 +6752,9 @@ CurrentModuleObject, ShowWarningMessage(state, RoutineName + "Refrigerant [" + RefrigErrorTracking(RefrigNum).Name + "] is saturated at the given conditions, saturated enthalpy at given temperature returned. **"); ShowContinueError(state, "...Called From:" + CalledFrom); - ShowContinueError(state, "Refrigerant temperature = " + RoundSigDigits(Temperature, 2)); - ShowContinueError(state, "Refrigerant pressure = " + RoundSigDigits(Pressure, 0)); - ShowContinueError(state, "Returned Enthalpy value = " + RoundSigDigits(ReturnValue, 3)); + ShowContinueError(state, format("Refrigerant temperature = {:.2R}", Temperature)); + ShowContinueError(state, format("Refrigerant pressure = {:.0R}", Pressure)); + ShowContinueError(state, format("Returned Enthalpy value = {:.3R}", ReturnValue)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, RoutineName + "Refrigerant [" + RefrigErrorTracking(RefrigNum).Name + @@ -7034,9 +7059,9 @@ CurrentModuleObject, ShowSevereMessage(state, RoutineName + "Refrigerant [" + RefrigErrorTracking(RefrigNum).Name + "] is saturated at the given enthalpy and temperature, saturated enthalpy at given temperature returned. **"); ShowContinueError(state, "...Called From:" + CalledFrom); - ShowContinueError(state, "Refrigerant temperature = " + RoundSigDigits(Temperature, 2)); - ShowContinueError(state, "Refrigerant Enthalpy = " + RoundSigDigits(Enthalpy, 3)); - ShowContinueError(state, "Returned Pressure value = " + RoundSigDigits(ReturnValue, 0)); + ShowContinueError(state, format("Refrigerant temperature = {:.2R}", Temperature)); + ShowContinueError(state, format("Refrigerant Enthalpy = {:.3R}", Enthalpy)); + ShowContinueError(state, format("Returned Pressure value = {:.0R}", ReturnValue)); ShowContinueErrorTimeStamp(state, ""); } if (CurSatErrCount > 0) { @@ -7472,9 +7497,9 @@ CurrentModuleObject, ShowWarningMessage(state, RoutineName + ": Refrigerant [" + RefrigErrorTracking(RefrigNum).Name + "] is saturated at the given conditions, saturated density at given temperature returned. **"); ShowContinueError(state, "...Called From:" + CalledFrom); - ShowContinueError(state, "Refrigerant temperature = " + RoundSigDigits(Temperature, 2)); - ShowContinueError(state, "Refrigerant pressure = " + RoundSigDigits(Pressure, 0)); - ShowContinueError(state, "Returned Density value = " + RoundSigDigits(saturated_density, 3)); + ShowContinueError(state, format("Refrigerant temperature = {:.2R}", Temperature)); + ShowContinueError(state, format("Refrigerant pressure = {:.0R}", Pressure)); + ShowContinueError(state, format("Returned Density value = {:.3R}", saturated_density)); ShowContinueErrorTimeStamp(state, ""); } if (SatErrCount > 0) { @@ -7629,8 +7654,12 @@ CurrentModuleObject, if (LowTempLimitErr <= GlycolErrorLimitTest) { ShowWarningMessage(state, RoutineName + "Temperature is out of range (too low) for fluid [" + glycol_data.Name + "] specific heat supplied values **"); - ShowContinueError(state, "..Called From:" + CalledFrom + ",Temperature=[" + RoundSigDigits(Temperature, 2) + "], supplied data range=[" + - RoundSigDigits(glycol_data.CpLowTempValue, 2) + ',' + RoundSigDigits(glycol_data.CpHighTempValue, 2) + ']'); + ShowContinueError(state, + format("..Called From:{},Temperature=[{:.2R}], supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + Temperature, + glycol_data.CpLowTempValue, + glycol_data.CpHighTempValue)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, RoutineName + "Temperature out of range (too low) for fluid [" + glycol_data.Name + @@ -7648,8 +7677,12 @@ CurrentModuleObject, HighTempLimitErr = ++GlycolErrorTracking(GlycolIndex).SpecHeatHighErrCount; if (HighTempLimitErr <= GlycolErrorLimitTest) { ShowWarningMessage(state, RoutineName + "Temperature is out of range (too high) for fluid [" + glycol_data.Name + "] specific heat **"); - ShowContinueError(state, "..Called From:" + CalledFrom + ",Temperature=[" + RoundSigDigits(Temperature, 2) + "], supplied data range=[" + - RoundSigDigits(glycol_data.CpLowTempValue, 2) + ',' + RoundSigDigits(glycol_data.CpHighTempValue, 2) + ']'); + ShowContinueError(state, + format("..Called From:{},Temperature=[{:.2R}], supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + Temperature, + glycol_data.CpLowTempValue, + glycol_data.CpHighTempValue)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, RoutineName + "Temperature out of range (too high) for fluid [" + glycol_data.Name + @@ -7809,9 +7842,12 @@ CurrentModuleObject, if ((LowErrorThisTime) && (LowTempLimitErr <= GlycolErrorLimitTest)) { ShowWarningMessage(state, RoutineName + "Temperature is out of range (too low) for fluid [" + GlycolData(GlycolIndex).Name + "] density **"); - ShowContinueError(state, "..Called From:" + CalledFrom + ",Temperature=[" + RoundSigDigits(Temperature, 2) + "], supplied data range=[" + - RoundSigDigits(GlycolData(GlycolIndex).RhoLowTempValue, 2) + ',' + - RoundSigDigits(GlycolData(GlycolIndex).RhoHighTempValue, 2) + ']'); + ShowContinueError(state, + format("..Called From:{},Temperature=[{:.2R}], supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + Temperature, + GlycolData(GlycolIndex).RhoLowTempValue, + GlycolData(GlycolIndex).RhoHighTempValue)); ShowContinueErrorTimeStamp(state, ""); } if (LowErrorThisTime) { @@ -7828,9 +7864,12 @@ CurrentModuleObject, if ((HighErrorThisTime) && (HighTempLimitErr <= GlycolErrorLimitTest)) { ShowWarningMessage(state, RoutineName + "Temperature is out of range (too high) for fluid [" + GlycolData(GlycolIndex).Name + "] density **"); - ShowContinueError(state, "..Called From:" + CalledFrom + ",Temperature=[" + RoundSigDigits(Temperature, 2) + "], supplied data range=[" + - RoundSigDigits(GlycolData(GlycolIndex).RhoLowTempValue, 2) + ',' + - RoundSigDigits(GlycolData(GlycolIndex).RhoHighTempValue, 2) + ']'); + ShowContinueError(state, + format("..Called From:{},Temperature=[{:.2R}], supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + Temperature, + GlycolData(GlycolIndex).RhoLowTempValue, + GlycolData(GlycolIndex).RhoHighTempValue)); ShowContinueErrorTimeStamp(state, ""); } if (HighErrorThisTime) { @@ -7974,9 +8013,12 @@ CurrentModuleObject, if ((LowErrorThisTime) && (LowTempLimitErr <= GlycolErrorLimitTest)) { ShowWarningMessage(state, RoutineName + "Temperature is out of range (too low) for fluid [" + GlycolData(GlycolIndex).Name + "] conductivity **"); - ShowContinueError(state, "..Called From:" + CalledFrom + ",Temperature=[" + RoundSigDigits(Temperature, 2) + "], supplied data range=[" + - RoundSigDigits(GlycolData(GlycolIndex).CondLowTempValue, 2) + ',' + - RoundSigDigits(GlycolData(GlycolIndex).CondHighTempValue, 2) + ']'); + ShowContinueError(state, + format("..Called From:{},Temperature=[{:.2R}], supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + Temperature, + GlycolData(GlycolIndex).CondLowTempValue, + GlycolData(GlycolIndex).CondHighTempValue)); ShowContinueErrorTimeStamp(state, ""); } if (LowErrorThisTime) { @@ -7993,9 +8035,12 @@ CurrentModuleObject, if ((HighErrorThisTime) && (HighTempLimitErr <= GlycolErrorLimitTest)) { ShowWarningMessage(state, RoutineName + "Temperature is out of range (too high) for fluid [" + GlycolData(GlycolIndex).Name + "] conductivity **"); - ShowContinueError(state, "..Called From:" + CalledFrom + ",Temperature=[" + RoundSigDigits(Temperature, 2) + "], supplied data range=[" + - RoundSigDigits(GlycolData(GlycolIndex).CondLowTempValue, 2) + ',' + - RoundSigDigits(GlycolData(GlycolIndex).CondHighTempValue, 2) + ']'); + ShowContinueError(state, + format("..Called From:{},Temperature=[{:.2R}], supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + Temperature, + GlycolData(GlycolIndex).CondLowTempValue, + GlycolData(GlycolIndex).CondHighTempValue)); ShowContinueErrorTimeStamp(state, ""); } if (HighErrorThisTime) { @@ -8139,9 +8184,12 @@ CurrentModuleObject, if ((LowErrorThisTime) && (LowTempLimitErr <= GlycolErrorLimitTest)) { ShowWarningMessage(state, RoutineName + "Temperature is out of range (too low) for fluid [" + GlycolData(GlycolIndex).Name + "] viscosity **"); - ShowContinueError(state, "..Called From:" + CalledFrom + ",Temperature=[" + RoundSigDigits(Temperature, 2) + "], supplied data range=[" + - RoundSigDigits(GlycolData(GlycolIndex).ViscLowTempValue, 2) + ',' + - RoundSigDigits(GlycolData(GlycolIndex).ViscHighTempValue, 2) + ']'); + ShowContinueError(state, + format("..Called From:{},Temperature=[{:.2R}], supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + Temperature, + GlycolData(GlycolIndex).ViscLowTempValue, + GlycolData(GlycolIndex).ViscHighTempValue)); ShowContinueErrorTimeStamp(state, ""); } if (LowErrorThisTime) { @@ -8158,9 +8206,12 @@ CurrentModuleObject, if ((HighErrorThisTime) && (HighTempLimitErr <= GlycolErrorLimitTest)) { ShowWarningMessage(state, RoutineName + "Temperature is out of range (too high) for fluid [" + GlycolData(GlycolIndex).Name + "] viscosity **"); - ShowContinueError(state, "..Called From:" + CalledFrom + ",Temperature=[" + RoundSigDigits(Temperature, 2) + "], supplied data range=[" + - RoundSigDigits(GlycolData(GlycolIndex).ViscLowTempValue, 2) + ',' + - RoundSigDigits(GlycolData(GlycolIndex).ViscHighTempValue, 2) + ']'); + ShowContinueError(state, + format("..Called From:{},Temperature=[{:.2R}], supplied data range=[{:.2R},{:.2R}]", + CalledFrom, + Temperature, + GlycolData(GlycolIndex).ViscLowTempValue, + GlycolData(GlycolIndex).ViscHighTempValue)); ShowContinueErrorTimeStamp(state, ""); } if (HighErrorThisTime) { @@ -8668,8 +8719,8 @@ CurrentModuleObject, if (TempRangeErrCount <= RefrigerantErrorLimitTest) { ShowWarningError(state, "GetInterpolatedSatProp: Saturation temperature for interpolation is out of range of data supplied: **"); ShowContinueErrorTimeStamp(state, " Called from:" + CalledFrom); - ShowContinueError(state, "Refrigerant temperature = " + RoundSigDigits(Temperature, 2)); - ShowContinueError(state, "Returned saturated property value = " + RoundSigDigits(ReturnValue, 3)); + ShowContinueError(state, format("Refrigerant temperature = {:.2R}", Temperature)); + ShowContinueError(state, format("Returned saturated property value = {:.3R}", ReturnValue)); } else { ShowRecurringWarningErrorAtEnd(state, "GetInterpolatedSatProp: Refrigerant temperature for interpolation out of range error", TempRangeErrIndex, @@ -8781,8 +8832,8 @@ CurrentModuleObject, } if (NumUnusedRefrig > 0 || NumUnusedGlycol > 0) { - if (NumUnusedRefrig > 0) ShowMessage(state, "There are " + RoundSigDigits(NumUnusedRefrig) + " unused refrigerants in input."); - if (NumUnusedGlycol > 0) ShowMessage(state, "There are " + RoundSigDigits(NumUnusedGlycol) + " unused glycols in input."); + if (NumUnusedRefrig > 0) ShowMessage(state, format("There are {} unused refrigerants in input.", NumUnusedRefrig)); + if (NumUnusedGlycol > 0) ShowMessage(state, format("There are {} unused glycols in input.", NumUnusedGlycol)); ShowMessage(state, "Use Output:Diagnostics,DisplayUnusedObjects; to see them."); } } diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index 74e2c129775..7bbb033e627 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -503,7 +503,7 @@ namespace FuelCellElectricGenerator { FuelCell(thisFuelCell).AirSup.NumConstituents = NumAirConstit; if (NumAirConstit > 5) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(4) + '=' + General::RoundSigDigits(NumArray(4), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(4), NumArray(4))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, "Fuel Cell model not set up for more than 5 air constituents"); ErrorsFound = true; @@ -539,7 +539,7 @@ namespace FuelCellElectricGenerator { if (std::abs(sum(FuelCell(thisFuelCell).AirSup.ConstitMolalFract) - 1.0) > 0.0001) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " molar fractions do not sum to 1.0"); - ShowContinueError(state, "..Sum was=" + General::RoundSigDigits(sum(FuelCell(thisFuelCell).AirSup.ConstitMolalFract), 1)); + ShowContinueError(state, format("..Sum was={:.1R}", sum(FuelCell(thisFuelCell).AirSup.ConstitMolalFract))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + " = " + AlphArray(1)); ErrorsFound = true; } @@ -1560,8 +1560,7 @@ namespace FuelCellElectricGenerator { DataGenerators::FuelSupply(this->FuelSupNum).CompPowerLossFactor * DataGenerators::FuelSupply(this->FuelSupNum).PfuelCompEl; if (DataGenerators::FuelSupply(this->FuelSupNum).QskinLoss < 0.0) { - ShowWarningError(state, "problem in FuelSupply.QskinLoss " + - General::RoundSigDigits(DataGenerators::FuelSupply(this->FuelSupNum).QskinLoss, 3)); + ShowWarningError(state, format("problem in FuelSupply.QskinLoss {:.3R}", DataGenerators::FuelSupply(this->FuelSupNum).QskinLoss)); DataGenerators::FuelSupply(this->FuelSupNum).QskinLoss = 0.0; } @@ -1678,7 +1677,7 @@ namespace FuelCellElectricGenerator { this->AirSup.QskinLoss = this->AirSup.BlowerHeatLossFactor * this->AirSup.PairCompEl; if (this->AirSup.QskinLoss < 0.0) { - ShowWarningError(state, "problem in AirSup.QskinLoss " + General::RoundSigDigits(this->AirSup.QskinLoss, 3)); + ShowWarningError(state, format("problem in AirSup.QskinLoss {:.3R}", this->AirSup.QskinLoss)); this->AirSup.QskinLoss = 0.0; } diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 70446dc61d3..3b30df9c65c 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -322,7 +322,7 @@ namespace Furnaces { using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; using namespace DataZoneEnergyDemands; using DataHeatBalFanSys::TempControlType; - using General::TrimSigDigits; + using IntegratedHeatPump::IntegratedHeatPumps; using WaterToAirHeatPumpSimple::SimWatertoAirHPSimple; @@ -364,13 +364,18 @@ namespace Furnaces { } else { FurnaceNum = CompIndex; if (FurnaceNum > NumFurnaces || FurnaceNum < 1) { - ShowFatalError(state, "SimFurnace: Invalid CompIndex passed=" + TrimSigDigits(FurnaceNum) + - ", Number of Units=" + TrimSigDigits(NumFurnaces) + ", Entered Unit name=" + FurnaceName); + ShowFatalError( + state, + format( + "SimFurnace: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", FurnaceNum, NumFurnaces, FurnaceName)); } if (CheckEquipName(FurnaceNum)) { if (FurnaceName != Furnace(FurnaceNum).Name) { - ShowFatalError(state, "SimFurnace: Invalid CompIndex passed=" + TrimSigDigits(FurnaceNum) + ", Unit name=" + FurnaceName + - ", stored Unit Name for that index=" + Furnace(FurnaceNum).Name); + ShowFatalError(state, + format("SimFurnace: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + FurnaceNum, + FurnaceName, + Furnace(FurnaceNum).Name)); } CheckEquipName(FurnaceNum) = false; } @@ -900,8 +905,7 @@ namespace Furnaces { using Fans::GetFanOutletNode; using Fans::GetFanType; using FluidProperties::GetSatDensityRefrig; - using General::RoundSigDigits; - using General::TrimSigDigits; + using OutAirNodeManager::CheckOutAirNodeNumber; using SteamCoils::GetTypeOfCoil; using namespace DataIPShortCuts; @@ -1549,8 +1553,12 @@ namespace Furnaces { if (Furnace(FurnaceNum).DesignFanVolFlowRate > FanVolFlowRate) { ShowWarningError(state, CurrentModuleObject + " = " + Alphas(1)); ShowContinueError(state, "... The " + cNumericFields(2) + " > Max Volume Flow Rate defined in the associated fan object, should be <=."); - ShowContinueError(state, "... Entered value = " + RoundSigDigits(Furnace(FurnaceNum).DesignFanVolFlowRate, 4) + "... Fan [" + FanType + - " = " + FanName + "] Max Value = " + RoundSigDigits(FanVolFlowRate, 4)); + ShowContinueError(state, + format("... Entered value = {:.4R}... Fan [{} = {}] Max Value = {:.4R}", + Furnace(FurnaceNum).DesignFanVolFlowRate, + FanType, + FanName, + FanVolFlowRate)); ShowContinueError(state, " The HVAC system flow rate is reset to the fan flow rate and the simulation continues."); Furnace(FurnaceNum).DesignFanVolFlowRate = FanVolFlowRate; } @@ -1559,7 +1567,7 @@ namespace Furnaces { if (Furnace(FurnaceNum).DesignFanVolFlowRate <= 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); ShowContinueError(state, "... The " + cNumericFields(2) + " <= 0.0, it must be > 0.0."); - ShowContinueError(state, "... Entered value = " + RoundSigDigits(Furnace(FurnaceNum).DesignFanVolFlowRate, 2)); + ShowContinueError(state, format("... Entered value = {:.2R}", Furnace(FurnaceNum).DesignFanVolFlowRate)); ErrorsFound = true; } } @@ -2684,21 +2692,21 @@ namespace Furnaces { Furnace(FurnaceNum).MaxCoolAirVolFlow = Numbers(2); if (Furnace(FurnaceNum).MaxCoolAirVolFlow <= 0 && Furnace(FurnaceNum).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "Illegal " + cNumericFields(2) + " = " + TrimSigDigits(Numbers(2), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(2), Numbers(2))); ErrorsFound = true; } Furnace(FurnaceNum).MaxHeatAirVolFlow = Numbers(3); if (Furnace(FurnaceNum).MaxHeatAirVolFlow <= 0 && Furnace(FurnaceNum).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "Illegal " + cNumericFields(3) + " = " + TrimSigDigits(Numbers(3), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(3), Numbers(3))); ErrorsFound = true; } Furnace(FurnaceNum).MaxNoCoolHeatAirVolFlow = Numbers(4); if (Furnace(FurnaceNum).MaxNoCoolHeatAirVolFlow < 0 && Furnace(FurnaceNum).MaxNoCoolHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "Illegal " + cNumericFields(4) + " = " + TrimSigDigits(Numbers(4), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(4), Numbers(4))); ErrorsFound = true; } @@ -2734,16 +2742,22 @@ namespace Furnaces { if (FanVolFlowRate != AutoSize) { if (FanVolFlowRate < Furnace(FurnaceNum).MaxCoolAirVolFlow && Furnace(FurnaceNum).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "... air flow rate = " + TrimSigDigits(FanVolFlowRate, 7) + " in fan object " + FanName + - " is less than the maximum HVAC system air flow rate in cooling mode."); + ShowContinueError( + state, + format("... air flow rate = {:.7T} in fan object {} is less than the maximum HVAC system air flow rate in cooling mode.", + FanVolFlowRate, + FanName)); ShowContinueError(state, " The " + cNumericFields(2) + " is reset to the fan flow rate and the simulation continues."); Furnace(FurnaceNum).MaxCoolAirVolFlow = FanVolFlowRate; Furnace(FurnaceNum).DesignFanVolFlowRate = FanVolFlowRate; } if (FanVolFlowRate < Furnace(FurnaceNum).MaxHeatAirVolFlow && Furnace(FurnaceNum).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "... air flow rate = " + TrimSigDigits(FanVolFlowRate, 7) + " in fan object " + FanName + - " is less than the maximum HVAC system air flow rate in heating mode."); + ShowContinueError( + state, + format("... air flow rate = {:.7T} in fan object {} is less than the maximum HVAC system air flow rate in heating mode.", + FanVolFlowRate, + FanName)); ShowContinueError(state, " The " + cNumericFields(3) + " is reset to the fan flow rate and the simulation continues."); Furnace(FurnaceNum).MaxHeatAirVolFlow = FanVolFlowRate; Furnace(FurnaceNum).DesignFanVolFlowRate = FanVolFlowRate; @@ -3557,21 +3571,21 @@ namespace Furnaces { Furnace(FurnaceNum).MaxCoolAirVolFlow = Numbers(1); if (Furnace(FurnaceNum).MaxCoolAirVolFlow <= 0 && Furnace(FurnaceNum).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "Illegal " + cNumericFields(1) + " = " + TrimSigDigits(Numbers(1), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(1), Numbers(1))); ErrorsFound = true; } Furnace(FurnaceNum).MaxHeatAirVolFlow = Numbers(2); if (Furnace(FurnaceNum).MaxHeatAirVolFlow <= 0 && Furnace(FurnaceNum).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "Illegal " + cNumericFields(2) + " = " + TrimSigDigits(Numbers(2), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(2), Numbers(2))); ErrorsFound = true; } Furnace(FurnaceNum).MaxNoCoolHeatAirVolFlow = Numbers(3); if (Furnace(FurnaceNum).MaxNoCoolHeatAirVolFlow < 0 && Furnace(FurnaceNum).MaxNoCoolHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "Illegal " + cNumericFields(3) + " = " + TrimSigDigits(Numbers(3), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(3), Numbers(3))); ErrorsFound = true; } @@ -3624,16 +3638,22 @@ namespace Furnaces { if (FanVolFlowRate != AutoSize) { if (FanVolFlowRate < Furnace(FurnaceNum).MaxCoolAirVolFlow && Furnace(FurnaceNum).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "... air flow rate = " + TrimSigDigits(FanVolFlowRate, 7) + " in fan object " + FanName + - " is less than the maximum HVAC system air flow rate in cooling mode."); + ShowContinueError( + state, + format("... air flow rate = {:.7T} in fan object {} is less than the maximum HVAC system air flow rate in cooling mode.", + FanVolFlowRate, + FanName)); ShowContinueError(state, " The " + cNumericFields(1) + " is reset to the fan flow rate and the simulation continues."); Furnace(FurnaceNum).MaxCoolAirVolFlow = FanVolFlowRate; Furnace(FurnaceNum).DesignFanVolFlowRate = FanVolFlowRate; } if (FanVolFlowRate < Furnace(FurnaceNum).MaxHeatAirVolFlow && Furnace(FurnaceNum).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "... air flow rate = " + TrimSigDigits(FanVolFlowRate, 7) + " in fan object " + FanName + - " is less than the maximum HVAC system air flow rate in heating mode."); + ShowContinueError( + state, + format("... air flow rate = {:.7T} in fan object {} is less than the maximum HVAC system air flow rate in heating mode.", + FanVolFlowRate, + FanName)); ShowContinueError(state, " The " + cNumericFields(2) + " is reset to the fan flow rate and the simulation continues."); Furnace(FurnaceNum).MaxHeatAirVolFlow = FanVolFlowRate; Furnace(FurnaceNum).DesignFanVolFlowRate = FanVolFlowRate; @@ -4407,15 +4427,19 @@ namespace Furnaces { if (Furnace(FurnaceNum).DesignFanVolFlowRate > FanVolFlowRate) { ShowContinueError(state, "...occurs in " + CurrentModuleObject + " = " + Alphas(1)); ShowContinueError(state, "... has a Cooling or Heating Air Flow Rate > Max Fan Volume Flow Rate, should be <=."); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(Furnace(FurnaceNum).DesignFanVolFlowRate, 2) + "... Fan [" + FanType + - ':' + FanName + "] Max Value=" + RoundSigDigits(FanVolFlowRate, 2)); + ShowContinueError(state, + format("... Entered value={:.2R}... Fan [{}:{}] Max Value={:.2R}", + Furnace(FurnaceNum).DesignFanVolFlowRate, + FanType, + FanName, + FanVolFlowRate)); } } if (FanVolFlowRate != AutoSize && Furnace(FurnaceNum).DesignFanVolFlowRate != AutoSize) { if (Furnace(FurnaceNum).DesignFanVolFlowRate <= 0.0) { ShowContinueError(state, "...occurs in " + CurrentModuleObject + " = " + Alphas(1)); ShowContinueError(state, "... has a Design Fan Flow Rate <= 0.0, it must be >0.0"); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(Furnace(FurnaceNum).DesignFanVolFlowRate, 2)); + ShowContinueError(state, format("... Entered value={:.2R}", Furnace(FurnaceNum).DesignFanVolFlowRate)); ErrorsFound = true; } } @@ -4800,8 +4824,7 @@ namespace Furnaces { using DataZoneEnergyDemands::ZoneSysMoistureDemand; using Fans::GetFanDesignVolumeFlowRate; using Fans::GetFanSpeedRatioCurveIndex; - using General::RoundSigDigits; - using General::TrimSigDigits; + using PlantUtilities::ScanPlantLoopsForObject; using SteamCoils::SimulateSteamCoilComponents; auto &GetCoilMaxSteamFlowRate(SteamCoils::GetCoilMaxSteamFlowRate); @@ -4948,13 +4971,16 @@ namespace Furnaces { if (Furnace(FurnaceNum).DesignFanVolFlowRate > FanVolFlowRate) { ShowWarningError(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + '=' + Furnace(FurnaceNum).Name + " has a Design Fan Volume Flow Rate > Max Fan Volume Flow Rate, should be <="); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(Furnace(FurnaceNum).DesignFanVolFlowRate, 2) + "... Fan [" + - cFanTypes(Furnace(FurnaceNum).FanType_Num) + "] Max Value=" + RoundSigDigits(FanVolFlowRate, 2)); + ShowContinueError(state, + format("... Entered value={:.2R}... Fan [{}] Max Value={:.2R}", + Furnace(FurnaceNum).DesignFanVolFlowRate, + cFanTypes(Furnace(FurnaceNum).FanType_Num), + FanVolFlowRate)); } if (Furnace(FurnaceNum).DesignFanVolFlowRate <= 0.0) { ShowSevereError(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + '=' + Furnace(FurnaceNum).Name + " has a Design Fan Volume Flow Rate <= 0.0, it must be >0.0"); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(Furnace(FurnaceNum).DesignFanVolFlowRate, 2)); + ShowContinueError(state, format("... Entered value={:.2R}", Furnace(FurnaceNum).DesignFanVolFlowRate)); } MySecondOneTimeFlag(FurnaceNum) = false; @@ -5227,10 +5253,10 @@ namespace Furnaces { ShowContinueError(state, "...For fan type and name = " + FanType + " \"" + FanName + "\""); ShowContinueError(state, "...Fan power ratio function of speed ratio curve has no impact if fan volumetric flow rate is the same as " "the unitary system volumetric flow rate."); - ShowContinueError(state, "...Fan volumetric flow rate = " + RoundSigDigits(Furnace(FurnaceNum).ActualFanVolFlowRate, 5) + - " m3/s."); - ShowContinueError(state, "...Unitary system volumetric flow rate = " + RoundSigDigits(Furnace(FurnaceNum).MaxHeatAirVolFlow, 5) + - " m3/s."); + ShowContinueError(state, + format("...Fan volumetric flow rate = {:.5R} m3/s.", Furnace(FurnaceNum).ActualFanVolFlowRate)); + ShowContinueError(state, + format("...Unitary system volumetric flow rate = {:.5R} m3/s.", Furnace(FurnaceNum).MaxHeatAirVolFlow)); } } MyFanFlag(FurnaceNum) = false; @@ -5523,9 +5549,12 @@ namespace Furnaces { if (Furnace(FurnaceNum).FanVolFlow != AutoSize) { // Check fan versus system supply air flow rates if (Furnace(FurnaceNum).FanVolFlow + 1e-10 < Furnace(FurnaceNum).CoolVolumeFlowRate(NumOfSpeedCooling)) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(Furnace(FurnaceNum).FanVolFlow, 7) + - " in fan object is less than the MSHP system air flow rate when cooling is required (" + - TrimSigDigits(Furnace(FurnaceNum).CoolVolumeFlowRate(NumOfSpeedCooling), 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object is less than the MSHP system air flow rate when cooling " + "is required ({:.7T}).", + CurrentModuleObject, + Furnace(FurnaceNum).FanVolFlow, + Furnace(FurnaceNum).CoolVolumeFlowRate(NumOfSpeedCooling))); ShowContinueError(state, " The MSHP system flow rate when cooling is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + Furnace(FurnaceNum).Name); @@ -5540,9 +5569,10 @@ namespace Furnaces { // Check flow rates in other speeds and ensure flow rates are not above the max flow rate for (int i = NumOfSpeedCooling - 1; i >= 1; --i) { if (Furnace(FurnaceNum).CoolVolumeFlowRate(i) > Furnace(FurnaceNum).CoolVolumeFlowRate(i + 1)) { - ShowContinueError(state, " The MSHP system flow rate when cooling is required is reset to the flow rate at higher speed and " - "the simulation continues at Speed" + - TrimSigDigits(i) + '.'); + ShowContinueError(state, + format(" The MSHP system flow rate when cooling is required is reset to the flow rate at higher " + "speed and the simulation continues at Speed{}.", + i)); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + Furnace(FurnaceNum).Name); Furnace(FurnaceNum).CoolVolumeFlowRate(i) = Furnace(FurnaceNum).CoolVolumeFlowRate(i + 1); } @@ -5550,9 +5580,12 @@ namespace Furnaces { } if (NumOfSpeedHeating > 0) { if (Furnace(FurnaceNum).FanVolFlow + 1e-10 < Furnace(FurnaceNum).HeatVolumeFlowRate(NumOfSpeedHeating)) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(Furnace(FurnaceNum).FanVolFlow, 7) + - " in fan object is less than the MSHP system air flow rate when heating is required (" + - TrimSigDigits(Furnace(FurnaceNum).HeatVolumeFlowRate(NumOfSpeedHeating), 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object is less than the MSHP system air flow rate when " + "heating is required ({:.7T}).", + CurrentModuleObject, + Furnace(FurnaceNum).FanVolFlow, + Furnace(FurnaceNum).HeatVolumeFlowRate(NumOfSpeedHeating))); ShowContinueError(state, " The MSHP system flow rate when heating is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + Furnace(FurnaceNum).Name); @@ -5567,9 +5600,10 @@ namespace Furnaces { for (int i = NumOfSpeedHeating - 1; i >= 1; --i) { if (Furnace(FurnaceNum).HeatVolumeFlowRate(i) > Furnace(FurnaceNum).HeatVolumeFlowRate(i + 1)) { - ShowContinueError(state, " The MSHP system flow rate when heating is required is reset to the flow rate at higher speed " - "and the simulation continues at Speed" + - TrimSigDigits(i) + '.'); + ShowContinueError(state, + format(" The MSHP system flow rate when heating is required is reset to the flow rate at " + "higher speed and the simulation continues at Speed{}.", + i)); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " system = " + Furnace(FurnaceNum).Name); Furnace(FurnaceNum).HeatVolumeFlowRate(i) = Furnace(FurnaceNum).HeatVolumeFlowRate(i + 1); } @@ -5577,9 +5611,12 @@ namespace Furnaces { } } if (Furnace(FurnaceNum).FanVolFlow < Furnace(FurnaceNum).IdleVolumeAirRate && Furnace(FurnaceNum).IdleVolumeAirRate != 0.0) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(Furnace(FurnaceNum).FanVolFlow, 7) + - " in fan object is less than the MSHP system air flow rate when no heating or cooling is needed (" + - TrimSigDigits(Furnace(FurnaceNum).IdleVolumeAirRate, 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object is less than the MSHP system air flow rate when no " + "heating or cooling is needed ({:.7T}).", + CurrentModuleObject, + Furnace(FurnaceNum).FanVolFlow, + Furnace(FurnaceNum).IdleVolumeAirRate)); ShowContinueError(state, " The MSHP system flow rate when no heating or cooling is needed is reset to the fan flow rate and the " "simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + Furnace(FurnaceNum).Name); @@ -5901,7 +5938,6 @@ namespace Furnaces { // na // Using/Aliasing - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -6059,7 +6095,7 @@ namespace Furnaces { // Using/Aliasing using namespace DataSizing; using EMSManager::ManageEMS; - using General::TrimSigDigits; + using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; using IntegratedHeatPump::IntegratedHeatPumps; using IntegratedHeatPump::SizeIHP; @@ -6441,7 +6477,6 @@ namespace Furnaces { using HeatingCoils::SimulateHeatingCoilComponents; using namespace ScheduleManager; using DataHeatBalFanSys::MAT; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -6633,9 +6668,11 @@ namespace Furnaces { if (Iter > MaxIter) { if (Furnace(FurnaceNum).HeatingMaxIterIndex2 == 0) { - ShowWarningMessage(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + - "\" -- Exceeded max heating iterations (" + TrimSigDigits(MaxIter) + - ") while adjusting furnace runtime."); + ShowWarningMessage(state, + format("{} \"{}\" -- Exceeded max heating iterations ({}) while adjusting furnace runtime.", + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num), + Furnace(FurnaceNum).Name, + MaxIter)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -6743,7 +6780,7 @@ namespace Furnaces { using DXCoils::DXCoil; using DXCoils::DXCoilPartLoadRatio; using General::SolveRoot; - using General::TrimSigDigits; + using TempSolveRoot::SolveRoot; // Locals @@ -7034,10 +7071,12 @@ namespace Furnaces { ShowWarningMessage(state, "Heating coil control failed to converge for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " Iteration limit exceeded in calculating DX heating coil sensible part-load ratio."); - ShowContinueErrorTimeStamp(state, - "Sensible load to be met by DX heating coil = " + TrimSigDigits(SystemSensibleLoad, 2) + - " (watts), sensible output of DX heating coil = " + TrimSigDigits(TempHeatOutput, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, + format("Sensible load to be met by DX heating coil = {:.2T} (watts), sensible output of DX heating " + "coil = {:.2T} (watts), and the simulation continues.", + SystemSensibleLoad, + TempHeatOutput)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7052,8 +7091,10 @@ namespace Furnaces { ShowWarningMessage(state, "Heating coil control failed for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " DX sensible heating part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met by DX heating coil = " + - TrimSigDigits(SystemSensibleLoad, 2) + " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, + format("Sensible load to be met by DX heating coil = {:.2T} (watts), and the simulation continues.", + SystemSensibleLoad)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7304,9 +7345,10 @@ namespace Furnaces { cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " Iteration limit exceeded in calculating heating coil sensible part-load ratio."); ShowContinueErrorTimeStamp(state, - "Sensible load to be met by heating coil = " + TrimSigDigits(SystemSensibleLoad, 2) + - " (watts), sensible output of heating coil = " + TrimSigDigits(TempHeatOutput, 2) + - " (watts), and the simulation continues."); + format("Sensible load to be met by heating coil = {:.2T} (watts), sensible output " + "of heating coil = {:.2T} (watts), and the simulation continues.", + SystemSensibleLoad, + TempHeatOutput)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7321,8 +7363,10 @@ namespace Furnaces { ShowWarningMessage(state, "Heating coil control failed for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " Sensible heating part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met by heating coil = " + TrimSigDigits(SystemSensibleLoad, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, + format("Sensible load to be met by heating coil = {:.2T} (watts), and the simulation continues.", + SystemSensibleLoad)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7524,9 +7568,10 @@ namespace Furnaces { ShowContinueError(state, " Iteration limit exceeded in calculating DX cooling coil sensible part-load ratio."); ShowContinueErrorTimeStamp(state, - "Sensible load to be met by DX coil = " + TrimSigDigits(CoolCoilLoad, 2) + - " (watts), sensible output of DX coil = " + TrimSigDigits(TempCoolOutput, 2) + - " (watts), and the simulation continues."); + format("Sensible load to be met by DX coil = {:.2T} (watts), sensible " + "output of DX coil = {:.2T} (watts), and the simulation continues.", + CoolCoilLoad, + TempCoolOutput)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7543,7 +7588,7 @@ namespace Furnaces { ShowWarningMessage(state, "Cooling coil control failed for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " Cooling sensible part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, " Cooling sensible load = " + TrimSigDigits(CoolCoilLoad, 2)); + ShowContinueErrorTimeStamp(state, format(" Cooling sensible load = {:.2T}", CoolCoilLoad)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7803,13 +7848,15 @@ namespace Furnaces { cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " Iteration limit exceeded in calculating cooling coil latent part-load ratio."); - ShowContinueError(state, - " Latent load convergence error (percent) = " + - TrimSigDigits(100.0 * std::abs((SystemMoistureLoad - TempLatentOutput) / SystemMoistureLoad), 2)); + ShowContinueError( + state, + format(" Latent load convergence error (percent) = {:.2T}", + 100.0 * std::abs((SystemMoistureLoad - TempLatentOutput) / SystemMoistureLoad))); ShowContinueErrorTimeStamp(state, - "Moisture load to be met by DX coil = " + TrimSigDigits(SystemMoistureLoad, 2) + - " (watts), Latent output of DX coil = " + TrimSigDigits(TempLatentOutput, 2) + - " (watts), and the simulation continues."); + format("Moisture load to be met by DX coil = {:.2T} (watts), Latent " + "output of DX coil = {:.2T} (watts), and the simulation continues.", + SystemMoistureLoad, + TempLatentOutput)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7824,10 +7871,12 @@ namespace Furnaces { if (Furnace(FurnaceNum).LatentRegulaFalsiFailedIndex2 == 0) { ShowWarningMessage(state, "Cooling coil control failed for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); - ShowContinueError(state, " Latent part-load ratio determined to be outside the range of " + - TrimSigDigits(TempMinPLR, 3) + " to " + TrimSigDigits(TempMaxPLR, 3) + '.'); - ShowContinueErrorTimeStamp(state, "A PLR of " + TrimSigDigits(TempMinPLR, 3) + - " will be used and the simulation continues."); + ShowContinueError(state, + format(" Latent part-load ratio determined to be outside the range of {:.3T} to {:.3T}.", + TempMinPLR, + TempMaxPLR)); + ShowContinueErrorTimeStamp(state, + format("A PLR of {:.3T} will be used and the simulation continues.", TempMinPLR)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -8058,7 +8107,7 @@ namespace Furnaces { // Using/Aliasing using DataHeatBalFanSys::MAT; using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using TempSolveRoot::SolveRoot; @@ -8275,9 +8324,11 @@ namespace Furnaces { ShowWarningMessage(state, "Cooling coil control failed to converge for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " Iteration limit exceeded in calculating DX cooling coil sensible part-load ratio."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met by DX coil = " + TrimSigDigits(TotalZoneSensLoad, 2) + - " (watts), sensible output of DX coil = " + TrimSigDigits(ZoneSensLoadMet, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp(state, + format("Sensible load to be met by DX coil = {:.2T} (watts), sensible output of DX coil = " + "{:.2T} (watts), and the simulation continues.", + TotalZoneSensLoad, + ZoneSensLoadMet)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + "\" - Iteration limit exceeded in calculating sensible cooling part-load ratio error " @@ -8307,11 +8358,12 @@ namespace Furnaces { ShowWarningMessage(state, "Cooling coil control failed for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " Cooling sensible part-load ratio determined to be outside the range of 0-1."); - ShowContinueError(state, " An estimated part-load ratio = " + TrimSigDigits(CoolPartLoadRatio, 2) + - " will be used and the simulation continues."); - ShowContinueError(state, " The estimated part-load ratio provides a cooling sensible capacity = " + - TrimSigDigits(ZoneSensLoadMet, 2)); - ShowContinueErrorTimeStamp(state, " Cooling sensible load required = " + TrimSigDigits(TotalZoneSensLoad, 2)); + ShowContinueError( + state, + format(" An estimated part-load ratio = {:.2T} will be used and the simulation continues.", CoolPartLoadRatio)); + ShowContinueError( + state, format(" The estimated part-load ratio provides a cooling sensible capacity = {:.2T}", ZoneSensLoadMet)); + ShowContinueErrorTimeStamp(state, format(" Cooling sensible load required = {:.2T}", TotalZoneSensLoad)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -8465,9 +8517,11 @@ namespace Furnaces { ShowWarningMessage(state, "Heating coil control failed to converge for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " Iteration limit exceeded in calculating DX heating coil sensible part-load ratio."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met by DX coil = " + TrimSigDigits(TotalZoneSensLoad, 2) + - " (watts), sensible output of DX coil = " + TrimSigDigits(ZoneSensLoadMet, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp(state, + format("Sensible load to be met by DX coil = {:.2T} (watts), sensible output of DX coil = " + "{:.2T} (watts), and the simulation continues.", + TotalZoneSensLoad, + ZoneSensLoadMet)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -8496,11 +8550,12 @@ namespace Furnaces { ShowWarningError(state, "Heating coil control failed for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + ':' + Furnace(FurnaceNum).Name); ShowContinueError(state, " Heating sensible part-load ratio determined to be outside the range of 0-1."); - ShowContinueError(state, " An estimated part-load ratio = " + TrimSigDigits(HeatPartLoadRatio, 2) + - " will be used and the simulation continues."); - ShowContinueError(state, " The estimated part-load ratio provides a heating sensible capacity = " + - TrimSigDigits(ZoneSensLoadMet, 2)); - ShowContinueErrorTimeStamp(state, " Heating sensible load required = " + TrimSigDigits(TotalZoneSensLoad, 2)); + ShowContinueError( + state, + format(" An estimated part-load ratio = {:.2T} will be used and the simulation continues.", HeatPartLoadRatio)); + ShowContinueError( + state, format(" The estimated part-load ratio provides a heating sensible capacity = {:.2T}", ZoneSensLoadMet)); + ShowContinueErrorTimeStamp(state, format(" Heating sensible load required = {:.2T}", TotalZoneSensLoad)); } ShowRecurringWarningErrorAtEnd(state, cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + "\" - Heating sensible part-load ratio out of range error continues.", @@ -9672,7 +9727,7 @@ namespace Furnaces { // Using/Aliasing using DataHVACGlobals::SmallLoad; - using General::RoundSigDigits; + using General::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; @@ -9765,21 +9820,23 @@ namespace Furnaces { ShowWarningMessage(state, "CalcNonDXHeatingCoils: Hot water coil control failed for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + "=\"" + Furnace(FurnaceNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(SolveMaxIter) + - "] exceeded in calculating hot water mass flow rate"); + ShowContinueError(state, + format(" Iteration limit [{}] exceeded in calculating hot water mass flow rate", SolveMaxIter)); } - ShowRecurringWarningErrorAtEnd(state, "CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + - cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + "=\"" + Furnace(FurnaceNum).Name, - Furnace(FurnaceNum).HotWaterCoilMaxIterIndex); + ShowRecurringWarningErrorAtEnd(state, + format("CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [{}]) for {}=\"{}", + SolveMaxIter, + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num), + Furnace(FurnaceNum).Name), + Furnace(FurnaceNum).HotWaterCoilMaxIterIndex); } else if (SolFlag == -2) { if (Furnace(FurnaceNum).HotWaterCoilMaxIterIndex2 == 0) { ShowWarningMessage(state, "CalcNonDXHeatingCoils: Hot water coil control failed (maximum flow limits) for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + "=\"" + Furnace(FurnaceNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad hot water maximum flow rate limits"); - ShowContinueError(state, "...Given minimum water flow rate=" + RoundSigDigits(MinWaterFlow, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum water flow rate=" + RoundSigDigits(MaxHotWaterFlow, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum water flow rate={:.3R} kg/s", MinWaterFlow)); + ShowContinueError(state, format("...Given maximum water flow rate={:.3R} kg/s", MaxHotWaterFlow)); } ShowRecurringWarningErrorAtEnd(state, "CalcNonDXHeatingCoils: Hot water coil control failed (flow limits) for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + "=\"" + Furnace(FurnaceNum).Name + @@ -10261,9 +10318,8 @@ namespace Furnaces { // Use RegulaFalsi technique to iterate on part-load ratio until convergence is achieved. // Using/Aliasing - using General::RoundSigDigits; using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using IntegratedHeatPump::GetCurWorkMode; using IntegratedHeatPump::GetMaxSpeedNumIHP; @@ -10436,7 +10492,7 @@ namespace Furnaces { ++ErrCountCyc; ShowWarningError(state, "Iteration limit exceeded calculating VS WSHP unit cycling ratio, for unit=" + Furnace(FurnaceNum).Name); - ShowContinueErrorTimeStamp(state, "Cycling ratio returned=" + RoundSigDigits(PartLoadFrac, 2)); + ShowContinueErrorTimeStamp(state, format("Cycling ratio returned={:.2R}", PartLoadFrac)); } else { ++ErrCountCyc; ShowRecurringWarningErrorAtEnd(state, @@ -10505,8 +10561,7 @@ namespace Furnaces { ++ErrCountVar; ShowWarningError(state, "Iteration limit exceeded calculating VS WSHP unit speed ratio, for unit=" + Furnace(FurnaceNum).Name); - ShowContinueErrorTimeStamp(state, "Speed ratio returned=[" + RoundSigDigits(SpeedRatio, 2) + - "], Speed number =" + RoundSigDigits(SpeedNum)); + ShowContinueErrorTimeStamp(state, format("Speed ratio returned=[{:.2R}], Speed number ={}", SpeedRatio, SpeedNum)); } else { ++ErrCountVar; ShowRecurringWarningErrorAtEnd(state, @@ -10578,8 +10633,7 @@ namespace Furnaces { if (ErrCountVar == 0) { ++ErrCountVar; ShowWarningError(state, "Iteration limit exceeded calculating VS WSHP unit speed ratio, for unit=" + Furnace(FurnaceNum).Name); - ShowContinueErrorTimeStamp(state, "Speed ratio returned=[" + RoundSigDigits(SpeedRatio, 2) + - "], Speed number =" + RoundSigDigits(SpeedNum)); + ShowContinueErrorTimeStamp(state, format("Speed ratio returned=[{:.2R}], Speed number ={}", SpeedRatio, SpeedNum)); } else { ++ErrCountVar; ShowRecurringWarningErrorAtEnd(state, Furnace(FurnaceNum).Name + @@ -11773,7 +11827,6 @@ namespace Furnaces { // Using/Aliasing using DataZoneEnergyDemands::CurDeadBandOrSetback; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: diff --git a/src/EnergyPlus/General.cc b/src/EnergyPlus/General.cc index 8f0e8d5209f..37bfe7d1c9a 100644 --- a/src/EnergyPlus/General.cc +++ b/src/EnergyPlus/General.cc @@ -1587,30 +1587,6 @@ namespace General { return POLY2F; } - std::string TrimSigDigits(Real64 const RealValue, int const SigDigits) - { - return format("{:.{}T}", RealValue, SigDigits); - } - - std::string TrimSigDigits(int const IntegerValue, - [[maybe_unused]] Optional_int_const SigDigits // ignored - ) - { - return format("{}", IntegerValue); - } - - std::string RoundSigDigits(Real64 const RealValue, int const SigDigits) - { - return format("{:.{}R}", RealValue, SigDigits); - } - - std::string RoundSigDigits(int const IntegerValue, - [[maybe_unused]] Optional_int_const SigDigits // ignored - ) - { - return format("{}", IntegerValue); - } - std::string RemoveTrailingZeros(std::string const &InputString) { @@ -3589,10 +3565,13 @@ namespace General { ShowWarningError(state, calledFrom + CurrentObject + " Combination of ZoneList and Object Name generate a name too long."); ShowContinueError(state, "Object Name=\"" + ItemName + "\"."); ShowContinueError(state, "ZoneList/Zone Name=\"" + ZoneName + "\"."); - ShowContinueError(state, "Item length=[" + RoundSigDigits(int(ItemLength)) + "] > Maximum Length=[" + RoundSigDigits(DataGlobalConstants::MaxNameLength()) + - "]. You may need to shorten the names."); - ShowContinueError(state, "Shortening the Object Name by [" + RoundSigDigits(int(MaxZoneNameLength + 1 + ItemNameLength - DataGlobalConstants::MaxNameLength())) + - "] characters will assure uniqueness for this ZoneList."); + ShowContinueError(state, + format("Item length=[{}] > Maximum Length=[{}]. You may need to shorten the names.", + ItemLength, + DataGlobalConstants::MaxNameLength())); + ShowContinueError(state, + format("Shortening the Object Name by [{}] characters will assure uniqueness for this ZoneList.", + MaxZoneNameLength + 1 + ItemNameLength - DataGlobalConstants::MaxNameLength())); ShowContinueError(state, "name that will be used (may be needed in reporting)=\"" + ResultName + "\"."); TooLong = true; } @@ -3601,8 +3580,8 @@ namespace General { if (FoundItem != 0) { ShowSevereError(state, calledFrom + CurrentObject + "=\"" + ItemName + "\", Duplicate Generated name encountered."); - ShowContinueError(state, "name=\"" + ResultName + "\" has already been generated or entered as " + CurrentObject + " item=[" + - RoundSigDigits(FoundItem) + "]."); + ShowContinueError(state, + format("name=\"{}\" has already been generated or entered as {} item=[{}].", ResultName, CurrentObject, FoundItem)); if (TooLong) ShowContinueError(state, "Duplicate name likely caused by the previous \"too long\" warning."); ResultName = "xxxxxxx"; errFlag = true; diff --git a/src/EnergyPlus/General.hh b/src/EnergyPlus/General.hh index e74cfd3dd58..feac07ba70b 100644 --- a/src/EnergyPlus/General.hh +++ b/src/EnergyPlus/General.hh @@ -216,18 +216,6 @@ namespace General { int &N // number of terms in polynomial ); - std::string TrimSigDigits(Real64 const RealValue, int const SigDigits); - - std::string TrimSigDigits(int const IntegerValue, - Optional_int_const SigDigits = _ // ignored - ); - - std::string RoundSigDigits(Real64 const RealValue, int const SigDigits); - - std::string RoundSigDigits(int const IntegerValue, - Optional_int_const SigDigits = _ // ignored - ); - std::string RemoveTrailingZeros(std::string const &InputString); std::string &strip_trailing_zeros(std::string &InputString); diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 8106aa9272c..0ef0f139532 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -160,8 +160,7 @@ void ControlCompOutput(EnergyPlusData &state, std::string const &CompName, using namespace DataLoopNode; using BaseboardRadiator::SimHWConvective; using FanCoilUnits::Calc4PipeFanCoil; - using General::RoundSigDigits; - using General::TrimSigDigits; + using HWBaseboardRadiator::CalcHWBaseboard; using OutdoorAirUnit::CalcOAUnitCoilComps; using PlantUtilities::SetActuatedBranchFlowRate; @@ -310,8 +309,7 @@ void ControlCompOutput(EnergyPlusData &state, std::string const &CompName, // Check to make sure that the Minimum Flow rate is less than the max. if (MinFlow > MaxFlow) { ShowSevereError(state, "ControlCompOutput:" + CompType + ':' + CompName + ", Min Control Flow is > Max Control Flow"); - ShowContinueError(state, "Acuated Node=" + NodeID(ActuatedNode) + " MinFlow=[" + TrimSigDigits(MinFlow, 3) + - "], Max Flow=" + TrimSigDigits(MaxFlow, 3)); + ShowContinueError(state, format("Acuated Node={} MinFlow=[{:.3T}], Max Flow={:.3T}", NodeID(ActuatedNode), MinFlow, MaxFlow)); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Program terminates due to preceding condition."); } @@ -494,7 +492,7 @@ void ControlCompOutput(EnergyPlusData &state, std::string const &CompName, } else if (Action == iReverseAction) { Denom = -max(std::abs(QZnReq), 100.0); } else { - ShowFatalError(state, "ControlCompOutput: Illegal Action argument =[" + TrimSigDigits(Action) + ']'); + ShowFatalError(state, format("ControlCompOutput: Illegal Action argument =[{}]", Action)); } } @@ -592,7 +590,7 @@ void ControlCompOutput(EnergyPlusData &state, std::string const &CompName, break; default: - ShowFatalError(state, "ControlCompOutput: Illegal Component Number argument =[" + TrimSigDigits(SimCompNum) + ']'); + ShowFatalError(state, format("ControlCompOutput: Illegal Component Number argument =[{}]", SimCompNum)); break; } @@ -627,12 +625,12 @@ void ControlCompOutput(EnergyPlusData &state, std::string const &CompName, if ((Iter > MaxIter) && (!state.dataGlobal->WarmupFlag)) { // if ( CompErrIndex == 0 ) { ShowWarningMessage(state, "ControlCompOutput: Maximum iterations exceeded for " + CompType + " = " + CompName); - ShowContinueError(state, "... Load met = " + TrimSigDigits(LoadMet, 5) + " W."); - ShowContinueError(state, "... Load requested = " + TrimSigDigits(QZnReq, 5) + " W."); - ShowContinueError(state, "... Error = " + TrimSigDigits(std::abs((LoadMet - QZnReq) * 100.0 / Denom), 8) + " %."); - ShowContinueError(state, "... Tolerance = " + TrimSigDigits(ControlOffset * 100.0, 8) + " %."); + ShowContinueError(state, format("... Load met = {:.5T} W.", LoadMet)); + ShowContinueError(state, format("... Load requested = {:.5T} W.", QZnReq)); + ShowContinueError(state, format("... Error = {:.8T} %.", std::abs((LoadMet - QZnReq) * 100.0 / Denom))); + ShowContinueError(state, format("... Tolerance = {:.8T} %.", ControlOffset * 100.0)); ShowContinueError(state, "... Error = (Load met - Load requested) / MAXIMUM(Load requested, 100)"); - ShowContinueError(state, "... Actuated Node Mass Flow Rate =" + RoundSigDigits(Node(ActuatedNode).MassFlowRate, 9) + " kg/s"); + ShowContinueError(state, format("... Actuated Node Mass Flow Rate ={:.9R} kg/s", Node(ActuatedNode).MassFlowRate)); ShowContinueErrorTimeStamp(state, ""); ShowRecurringWarningErrorAtEnd(state, "ControlCompOutput: Maximum iterations error for " + CompType + " = " + CompName, CompErrIndex, diff --git a/src/EnergyPlus/GeneratorFuelSupply.cc b/src/EnergyPlus/GeneratorFuelSupply.cc index af6d5f0a789..b2bc51ab493 100644 --- a/src/EnergyPlus/GeneratorFuelSupply.cc +++ b/src/EnergyPlus/GeneratorFuelSupply.cc @@ -140,7 +140,7 @@ namespace GeneratorFuelSupply { using DataLoopNode::NodeConnectionType_Sensor; using DataLoopNode::NodeType_Air; using DataLoopNode::ObjectIsNotParent; - using General::RoundSigDigits; + using NodeInputManager::GetOnlySingleNode; using ScheduleManager::GetScheduleIndex; @@ -243,7 +243,7 @@ namespace GeneratorFuelSupply { // check for molar fractions summing to 1.0. if (std::abs(sum(FuelSupply(FuelSupNum).ConstitMolalFract) - 1.0) > 0.0001) { ShowSevereError(state, cCurrentModuleObject + " molar fractions do not sum to 1.0"); - ShowContinueError(state, "Sum was=" + RoundSigDigits(sum(FuelSupply(FuelSupNum).ConstitMolalFract), 5)); + ShowContinueError(state, format("Sum was={:.5R}", sum(FuelSupply(FuelSupNum).ConstitMolalFract))); ShowContinueError(state, "Entered in " + cCurrentModuleObject + " = " + AlphArray(1)); ErrorsFound = true; } diff --git a/src/EnergyPlus/GroundHeatExchangers.cc b/src/EnergyPlus/GroundHeatExchangers.cc index 38137356d29..aad91d69568 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -118,7 +118,7 @@ namespace GroundHeatExchangers { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using namespace DataLoopNode; - using General::TrimSigDigits; + using namespace GroundTemperatureManager; // MODULE PARAMETER DEFINITIONS @@ -258,8 +258,7 @@ namespace GroundHeatExchangers { for (int yBH = 1; yBH <= arrayObjectPtr->numBHinYDirection; ++yBH) { bhCounter += 1; std::shared_ptr thisBH(new GLHEVertSingleStruct); - thisBH->name = - thisRF->name + " BH " + std::to_string(bhCounter) + " loc: (" + std::to_string(xLoc) + ", " + std::to_string(yLoc) + ")"; + thisBH->name = format("{} BH {} loc: ({}, {})", thisRF->name, bhCounter, xLoc, yLoc); thisBH->props = GetVertProps(arrayObjectPtr->props->name); thisBH->xLoc = xLoc; thisBH->yLoc = yLoc; @@ -283,11 +282,11 @@ namespace GroundHeatExchangers { { // Make new response factor object and store it for later use std::shared_ptr thisRF(new GLHEResponseFactorsStruct); - thisRF->name = "Response Factor Object Auto Generated No: " + std::to_string(numAutoGeneratedResponseFactors + 1); + thisRF->name = format("Response Factor Object Auto Generated No: {}", numAutoGeneratedResponseFactors + 1); // Make new props object which has the mean values of the other props objects referenced by the individual BH objects std::shared_ptr thisProps(new GLHEVertPropsStruct); - thisProps->name = "Response Factor Auto Generated Mean Props No: " + std::to_string(numAutoGeneratedResponseFactors + 1); + thisProps->name = format("Response Factor Auto Generated Mean Props No: {}", numAutoGeneratedResponseFactors + 1); int numBH = singleBHsForRFVect.size(); for (auto &thisBH : singleBoreholesVector) { thisProps->bhDiameter += thisBH->props->bhDiameter; @@ -1015,7 +1014,7 @@ namespace GroundHeatExchangers { int i = 0; for (auto &thisBH : myRespFactors->myBorholes) { ++i; - auto &d_bh = d["BH Data"]["BH " + std::to_string(i)]; + auto &d_bh = d["BH Data"][format("BH {}", i)]; d_bh["X-Location"] = thisBH->xLoc; d_bh["Y-Location"] = thisBH->yLoc; } @@ -1134,12 +1133,12 @@ namespace GroundHeatExchangers { int i = 0; for (auto &existing_data : json_in) { ++i; - std::string case_name = "GHLE " + std::to_string(i); + std::string case_name = format("GHLE {}", i); json_out[case_name] = existing_data; } // add current data - std::string case_name = "GHLE " + std::to_string(i + 1); + std::string case_name = format("GHLE {}", i + 1); json_out[case_name] = myCacheData; if (state.files.outputControl.glhe) { @@ -1731,7 +1730,6 @@ namespace GroundHeatExchangers { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -2020,7 +2018,7 @@ namespace GroundHeatExchangers { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; + using PlantUtilities::SafeCopyPlantNode; // SUBROUTINE ARGUMENT DEFINITIONS @@ -2045,8 +2043,7 @@ namespace GroundHeatExchangers { ShowContinueError(state, "For GroundHeatExchanger: " + name + "GLHE delta Temp > 100C."); ShowContinueError(state, "This can be encountered in cases where the GLHE mass flow rate is either significantly"); ShowContinueError(state, " lower than the design value, or cases where the mass flow rate rapidly changes."); - ShowContinueError(state, "GLHE Current Flow Rate=" + TrimSigDigits(massFlowRate, 3) + - "; GLHE Design Flow Rate=" + TrimSigDigits(designMassFlow, 3)); + ShowContinueError(state, format("GLHE Current Flow Rate={:.3T}; GLHE Design Flow Rate={:.3T}", massFlowRate, designMassFlow)); ++this->numErrorCalls; } } @@ -2145,8 +2142,7 @@ namespace GroundHeatExchangers { // Using/Aliasing using BranchNodeConnections::TestCompSet; using DataEnvironment::MaxNumberSimYears; - using General::RoundSigDigits; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -2741,7 +2737,7 @@ namespace GroundHeatExchangers { // Need to add a response factor object for the slinky model std::shared_ptr thisRF(new GLHEResponseFactorsStruct); - thisRF->name = "Response Factor Object Auto Generated No: " + std::to_string(numAutoGeneratedResponseFactors + 1); + thisRF->name = "Response Factor Object Auto Generated No: " + fmt::to_string(numAutoGeneratedResponseFactors + 1); thisGLHE.myRespFactors = thisRF; responseFactorsVector.push_back(thisRF); @@ -2761,8 +2757,8 @@ namespace GroundHeatExchangers { if (thisGLHE.trenchDepth - thisGLHE.coilDiameter < 0.0) { // Error: part of the coil is above ground ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + thisGLHE.name + "\", invalid value in field."); - ShowContinueError(state, "..." + DataIPShortCuts::cNumericFieldNames(13) + "=[" + RoundSigDigits(thisGLHE.trenchDepth, 3) + "]."); - ShowContinueError(state, "..." + DataIPShortCuts::cNumericFieldNames(10) + "=[" + RoundSigDigits(thisGLHE.coilDepth, 3) + "]."); + ShowContinueError(state, format("...{}=[{:.3R}].", DataIPShortCuts::cNumericFieldNames(13), thisGLHE.trenchDepth)); + ShowContinueError(state, format("...{}=[{:.3R}].", DataIPShortCuts::cNumericFieldNames(10), thisGLHE.coilDepth)); ShowContinueError(state, "...Average coil depth will be <=0."); errorsFound = true; @@ -2784,8 +2780,8 @@ namespace GroundHeatExchangers { if (thisGLHE.pipe.thickness >= thisGLHE.pipe.outDia / 2.0) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + thisGLHE.name + "\", invalid value in field."); - ShowContinueError(state, "..." + DataIPShortCuts::cNumericFieldNames(12) + "=[" + RoundSigDigits(thisGLHE.pipe.thickness, 3) + "]."); - ShowContinueError(state, "..." + DataIPShortCuts::cNumericFieldNames(10) + "=[" + RoundSigDigits(thisGLHE.pipe.outDia, 3) + "]."); + ShowContinueError(state, format("...{}=[{:.3R}].", DataIPShortCuts::cNumericFieldNames(12), thisGLHE.pipe.thickness)); + ShowContinueError(state, format("...{}=[{:.3R}].", DataIPShortCuts::cNumericFieldNames(10), thisGLHE.pipe.outDia)); ShowContinueError(state, "...Radius will be <=0."); errorsFound = true; } diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index e81fe787ea0..4b7ea45cf24 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -306,7 +306,6 @@ namespace HVACControllers { using namespace DataSystemVariables; using DataPlant::FlowLocked; using DataPlant::PlantLoop; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -340,13 +339,20 @@ namespace HVACControllers { } else { ControlNum = ControllerIndex; if (ControlNum > NumControllers || ControlNum < 1) { - ShowFatalError(state, "ManageControllers: Invalid ControllerIndex passed=" + TrimSigDigits(ControlNum) + - ", Number of controllers=" + TrimSigDigits(NumControllers) + ", Controller name=" + ControllerName); + ShowFatalError(state, + format("ManageControllers: Invalid ControllerIndex passed={}, Number of controllers={}, Controller name={}", + ControlNum, + NumControllers, + ControllerName)); } if (CheckEquipName(ControlNum)) { if (ControllerName != ControllerProps(ControlNum).ControllerName) { - ShowFatalError(state, "ManageControllers: Invalid ControllerIndex passed=" + TrimSigDigits(ControlNum) + ", Controller name=" + - ControllerName + ", stored Controller Name for that index=" + ControllerProps(ControlNum).ControllerName); + ShowFatalError( + state, + format("ManageControllers: Invalid ControllerIndex passed={}, Controller name={}, stored Controller Name for that index={}", + ControlNum, + ControllerName, + ControllerProps(ControlNum).ControllerName)); } CheckEquipName(ControlNum) = false; } @@ -464,7 +470,7 @@ namespace HVACControllers { } } else { - ShowFatalError(state, "ManageControllers: Invalid Operation passed=" + TrimSigDigits(Operation) + ", Controller name=" + ControllerName); + ShowFatalError(state, format("ManageControllers: Invalid Operation passed={}, Controller name={}", Operation, ControllerName)); } } @@ -1455,7 +1461,7 @@ namespace HVACControllers { // na // Using/Aliasing - using General::TrimSigDigits; + using RootFinder::CheckRootFinderCandidate; using RootFinder::InitializeRootFinder; @@ -1544,16 +1550,16 @@ namespace HVACControllers { ShowSevereError(state, "CalcSimpleController: Root finder failed at " + CreateHVACStepFullString(state)); ShowContinueError(state, " Controller name=\"" + ControllerName + "\""); ShowContinueError(state, " Minimum bound must remain invariant during successive iterations."); - ShowContinueError(state, " Minimum root finder point=" + TrimSigDigits(RootFinders(ControlNum).MinPoint.X, NumSigDigits)); - ShowContinueError(state, " Minimum avail actuated=" + TrimSigDigits(ControllerProps(ControlNum).MinAvailActuated, NumSigDigits)); + ShowContinueError(state, format(" Minimum root finder point={:.{}T}", RootFinders(ControlNum).MinPoint.X, NumSigDigits)); + ShowContinueError(state, format(" Minimum avail actuated={:.{}T}", ControllerProps(ControlNum).MinAvailActuated, NumSigDigits)); ShowFatalError(state, "Preceding error causes program termination."); } if (RootFinders(ControlNum).MaxPoint.X != ControllerProps(ControlNum).MaxAvailActuated) { ShowSevereError(state, "CalcSimpleController: Root finder failed at " + CreateHVACStepFullString(state)); ShowContinueError(state, " Controller name=\"" + ControllerName + "\""); ShowContinueError(state, " Maximum bound must remain invariant during successive iterations."); - ShowContinueError(state, " Maximum root finder point=" + TrimSigDigits(RootFinders(ControlNum).MaxPoint.X, NumSigDigits)); - ShowContinueError(state, " Maximum avail actuated=" + TrimSigDigits(ControllerProps(ControlNum).MaxAvailActuated, NumSigDigits)); + ShowContinueError(state, format(" Maximum root finder point={:.{}T}", RootFinders(ControlNum).MaxPoint.X, NumSigDigits)); + ShowContinueError(state, format(" Maximum avail actuated={:.{}T}", ControllerProps(ControlNum).MaxAvailActuated, NumSigDigits)); ShowFatalError(state, "Preceding error causes program termination."); } @@ -1588,7 +1594,7 @@ namespace HVACControllers { // REFERENCES: // Using/Aliasing - using General::TrimSigDigits; + using RootFinder::CheckRootFinderCandidate; using RootFinder::IterateRootFinder; @@ -1697,10 +1703,12 @@ namespace HVACControllers { } else if (SELECT_CASE_var == iStatusErrorRange) { ShowSevereError(state, "FindRootSimpleController: Root finder failed at " + CreateHVACStepFullString(state)); ShowContinueError(state, " Controller name=\"" + ControllerName + "\""); - ShowContinueError(state, " Root candidate x=" + TrimSigDigits(ControllerProps(ControlNum).ActuatedValue, NumSigDigits) + - " does not lie within the min/max bounds."); - ShowContinueError(state, " Min bound is x=" + TrimSigDigits(RootFinders(ControlNum).MinPoint.X, NumSigDigits)); - ShowContinueError(state, " Max bound is x=" + TrimSigDigits(RootFinders(ControlNum).MaxPoint.X, NumSigDigits)); + ShowContinueError(state, + format(" Root candidate x={:.{}T} does not lie within the min/max bounds.", + ControllerProps(ControlNum).ActuatedValue, + NumSigDigits)); + ShowContinueError(state, format(" Min bound is x={:.{}T}", RootFinders(ControlNum).MinPoint.X, NumSigDigits)); + ShowContinueError(state, format(" Max bound is x={:.{}T}", RootFinders(ControlNum).MaxPoint.X, NumSigDigits)); ShowFatalError(state, "Preceding error causes program termination."); // Abnormal case: should never happen @@ -1708,13 +1716,15 @@ namespace HVACControllers { ShowSevereError(state, "FindRootSimpleController: Root finder failed at " + CreateHVACStepFullString(state)); ShowContinueError(state, " Controller name=" + ControllerProps(ControlNum).ControllerName); ShowContinueError(state, " Controller action=" + ActionTypes(ControllerProps(ControlNum).Action)); - ShowContinueError(state, " Root candidate x=" + TrimSigDigits(ControllerProps(ControlNum).ActuatedValue, NumSigDigits) + - " does not lie within the lower/upper brackets."); + ShowContinueError(state, + format(" Root candidate x={:.{}T} does not lie within the lower/upper brackets.", + ControllerProps(ControlNum).ActuatedValue, + NumSigDigits)); if (RootFinders(ControlNum).LowerPoint.DefinedFlag) { - ShowContinueError(state, " Lower bracket is x=" + TrimSigDigits(RootFinders(ControlNum).LowerPoint.X, NumSigDigits)); + ShowContinueError(state, format(" Lower bracket is x={:.{}T}", RootFinders(ControlNum).LowerPoint.X, NumSigDigits)); } if (RootFinders(ControlNum).UpperPoint.DefinedFlag) { - ShowContinueError(state, " Upper bracket is x=" + TrimSigDigits(RootFinders(ControlNum).UpperPoint.X, NumSigDigits)); + ShowContinueError(state, format(" Upper bracket is x={:.{}T}", RootFinders(ControlNum).UpperPoint.X, NumSigDigits)); } ShowFatalError(state, "Preceding error causes program termination."); @@ -1764,36 +1774,36 @@ namespace HVACControllers { ShowContinueError(state, " Actuator will be set to maximum action"); ShowContinueError(state, "Controller control type=" + ControlVariableTypes(ControllerProps(ControlNum).ControlVar)); if (ControllerProps(ControlNum).ControlVar == iTemperature) { - ShowContinueError(state, "Controller temperature setpoint = " + TrimSigDigits(ControllerProps(ControlNum).SetPointValue, 2) + - " [C]"); - ShowContinueError(state, "Controller sensed temperature = " + TrimSigDigits(ControllerProps(ControlNum).SensedValue, 2) + " [C]"); + ShowContinueError(state, format("Controller temperature setpoint = {:.2T} [C]", ControllerProps(ControlNum).SetPointValue)); + ShowContinueError(state, format("Controller sensed temperature = {:.2T} [C]", ControllerProps(ControlNum).SensedValue)); } else if (ControllerProps(ControlNum).ControlVar == iHumidityRatio) { - ShowContinueError(state, "Controller humidity ratio setpoint = " + TrimSigDigits(ControllerProps(ControlNum).SetPointValue, 2) + - " [kgWater/kgDryAir]"); - ShowContinueError(state, "Controller sensed humidity ratio = " + TrimSigDigits(ControllerProps(ControlNum).SensedValue, 2) + - " [kgWater/kgDryAir]"); + ShowContinueError( + state, + format("Controller humidity ratio setpoint = {:.2T} [kgWater/kgDryAir]", ControllerProps(ControlNum).SetPointValue)); + ShowContinueError( + state, format("Controller sensed humidity ratio = {:.2T} [kgWater/kgDryAir]", ControllerProps(ControlNum).SensedValue)); } else if (ControllerProps(ControlNum).ControlVar == iTemperatureAndHumidityRatio) { - ShowContinueError(state, "Controller temperature setpoint = " + TrimSigDigits(ControllerProps(ControlNum).SetPointValue, 2) + - " [C]"); - ShowContinueError(state, "Controller sensed temperature = " + TrimSigDigits(ControllerProps(ControlNum).SensedValue, 2) + " [C]"); - ShowContinueError(state, "Controller humidity ratio setpoint = " + - TrimSigDigits(Node(ControllerProps(ControlNum).SensedNode).HumRatMax, 2) + " [kgWater/kgDryAir]"); - ShowContinueError(state, "Controller sensed humidity ratio = " + - TrimSigDigits(Node(ControllerProps(ControlNum).SensedNode).HumRat, 2) + " [kgWater/kgDryAir]"); + ShowContinueError(state, format("Controller temperature setpoint = {:.2T} [C]", ControllerProps(ControlNum).SetPointValue)); + ShowContinueError(state, format("Controller sensed temperature = {:.2T} [C]", ControllerProps(ControlNum).SensedValue)); + ShowContinueError(state, + format("Controller humidity ratio setpoint = {:.2T} [kgWater/kgDryAir]", + Node(ControllerProps(ControlNum).SensedNode).HumRatMax)); + ShowContinueError(state, + format("Controller sensed humidity ratio = {:.2T} [kgWater/kgDryAir]", + Node(ControllerProps(ControlNum).SensedNode).HumRat)); } else if (ControllerProps(ControlNum).ControlVar == iFlow) { - ShowContinueError(state, "Controller mass flow rate setpoint = " + TrimSigDigits(ControllerProps(ControlNum).SetPointValue, 2) + - " [kg/s]"); - ShowContinueError(state, "Controller sensed mass flow rate = " + TrimSigDigits(ControllerProps(ControlNum).SensedValue, 2) + - " [kg/s]"); + ShowContinueError(state, + format("Controller mass flow rate setpoint = {:.2T} [kg/s]", ControllerProps(ControlNum).SetPointValue)); + ShowContinueError(state, format("Controller sensed mass flow rate = {:.2T} [kg/s]", ControllerProps(ControlNum).SensedValue)); } else { // bad control variable input checked in input routine } if (ControllerProps(ControlNum).ActuatorVar == iFlow) { - ShowContinueError(state, "Controller actuator mass flow rate set to " + - TrimSigDigits(ControllerProps(ControlNum).MaxAvailActuated, 2) + " [kg/s]"); + ShowContinueError( + state, format("Controller actuator mass flow rate set to {:.2T} [kg/s]", ControllerProps(ControlNum).MaxAvailActuated)); if (ControllerProps(ControlNum).ControlVar == iTemperature) { - ShowContinueError(state, "Controller actuator temperature = " + - TrimSigDigits(Node(ControllerProps(ControlNum).ActuatedNode).Temp, 2) + " [C]"); + ShowContinueError( + state, format("Controller actuator temperature = {:.2T} [C]", Node(ControllerProps(ControlNum).ActuatedNode).Temp)); ShowContinueError(state, " Note: Chilled water coils should be reverse action and the entering chilled"); ShowContinueError(state, " water temperature (controller actuator temperature) should be below the setpoint temperature"); ShowContinueError(state, " Note: Hot water coils should be normal action and the entering hot"); @@ -1818,7 +1828,7 @@ namespace HVACControllers { // Should never happen ShowSevereError(state, "FindRootSimpleController: Root finder failed at " + CreateHVACStepFullString(state)); ShowContinueError(state, " Controller name=" + ControllerName); - ShowContinueError(state, " Unrecognized root finder status flag=" + TrimSigDigits(RootFinders(ControlNum).StatusFlag)); + ShowContinueError(state, format(" Unrecognized root finder status flag={}", RootFinders(ControlNum).StatusFlag)); ShowFatalError(state, "Preceding error causes program termination."); } } @@ -1847,7 +1857,7 @@ namespace HVACControllers { // REFERENCES: // Using/Aliasing - using General::TrimSigDigits; + using RootFinder::CheckRootFinderConvergence; // Locals @@ -2541,7 +2551,6 @@ namespace HVACControllers { // Using/Aliasing using namespace DataAirSystems; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2684,23 +2693,6 @@ namespace HVACControllers { // METHODOLOGY EMPLOYED: // Needs description, as appropriate. - // REFERENCES: - // na - - // Using/Aliasing - using General::TrimSigDigits; - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // na - - // SUBROUTINE PARAMETER DEFINITIONS: - - // INTERFACE BLOCK SPECIFICATIONS - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ControllerNum; @@ -2847,7 +2839,6 @@ namespace HVACControllers { using DataEnvironment::CurMnDy; using DataHVACGlobals::FirstTimeStepSysFlag; using General::LogicalToInteger; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2904,7 +2895,6 @@ namespace HVACControllers { // na // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -3019,7 +3009,7 @@ namespace HVACControllers { // Using/Aliasing using DataEnvironment::CurEnvirNum; using General::LogicalToInteger; - using General::TrimSigDigits; + using RootFinder::WriteRootFinderTrace; // Locals @@ -3156,8 +3146,10 @@ namespace HVACControllers { } else { // Should never happen - ShowFatalError(state, "TraceIndividualController: Invalid Operation passed=" + TrimSigDigits(Operation) + - ", Controller name=" + ControllerProps(ControlNum).ControllerName); + ShowFatalError(state, + format("TraceIndividualController: Invalid Operation passed={}, Controller name={}", + Operation, + ControllerProps(ControlNum).ControllerName)); } } diff --git a/src/EnergyPlus/HVACCooledBeam.cc b/src/EnergyPlus/HVACCooledBeam.cc index b4a92aad20c..b68bd2f03a6 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -168,9 +167,6 @@ namespace HVACCooledBeam { // Manages the simulation of a cooled beam unit. // Called from SimZoneAirLoopEquipment in module ZoneAirLoopEquipmentManager. - // Using/Aliasing - using General::TrimSigDigits; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CBNum; // index of cooled beam unit being simulated @@ -190,13 +186,17 @@ namespace HVACCooledBeam { } else { CBNum = CompIndex; if (CBNum > NumCB || CBNum < 1) { - ShowFatalError(state, "SimCoolBeam: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + - ", Number of Cool Beam Units=" + TrimSigDigits(NumCB) + ", System name=" + CompName); + ShowFatalError( + state, + format("SimCoolBeam: Invalid CompIndex passed={}, Number of Cool Beam Units={}, System name={}", CompIndex, NumCB, CompName)); } if (CheckEquipName(CBNum)) { if (CompName != CoolBeam(CBNum).Name) { - ShowFatalError(state, "SimCoolBeam: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + ", Cool Beam Unit name=" + CompName + - ", stored Cool Beam Unit for that index=" + CoolBeam(CBNum).Name); + ShowFatalError(state, + format("SimCoolBeam: Invalid CompIndex passed={}, Cool Beam Unit name={}, stored Cool Beam Unit for that index={}", + CompIndex, + CompName, + CoolBeam(CBNum).Name)); } CheckEquipName(CBNum) = false; } @@ -931,7 +931,6 @@ namespace HVACCooledBeam { // Using/Aliasing using namespace DataZoneEnergyDemands; - using General::SolveRoot; using PlantUtilities::SetComponentFlowRate; // Locals diff --git a/src/EnergyPlus/HVACDXHeatPumpSystem.cc b/src/EnergyPlus/HVACDXHeatPumpSystem.cc index b40180836f8..9a8627d81b7 100644 --- a/src/EnergyPlus/HVACDXHeatPumpSystem.cc +++ b/src/EnergyPlus/HVACDXHeatPumpSystem.cc @@ -163,7 +163,7 @@ namespace HVACDXHeatPumpSystem { // Using/Aliasing using DXCoils::SimDXCoil; - using General::TrimSigDigits; + using VariableSpeedCoils::SimVariableSpeedCoils; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -197,13 +197,19 @@ namespace HVACDXHeatPumpSystem { } else { DXSystemNum = CompIndex; if (DXSystemNum > NumDXHeatPumpSystems || DXSystemNum < 1) { - ShowFatalError(state, "SimDXHeatPumpSystem: Invalid CompIndex passed=" + TrimSigDigits(DXSystemNum) + - ", Number of DX Units=" + TrimSigDigits(NumDXHeatPumpSystems) + ", DX Unit name=" + DXHeatPumpSystemName); + ShowFatalError(state, + format("SimDXHeatPumpSystem: Invalid CompIndex passed={}, Number of DX Units={}, DX Unit name={}", + DXSystemNum, + NumDXHeatPumpSystems, + DXHeatPumpSystemName)); } if (CheckEquipName(DXSystemNum)) { if (DXHeatPumpSystemName != DXHeatPumpSystem(DXSystemNum).Name) { - ShowFatalError(state, "SimDXHeatPumpSystem: Invalid CompIndex passed=" + TrimSigDigits(DXSystemNum) + ", DX Unit name=" + - DXHeatPumpSystemName + ", stored DX Unit Name for that index=" + DXHeatPumpSystem(DXSystemNum).Name); + ShowFatalError(state, + format("SimDXHeatPumpSystem: Invalid CompIndex passed={}, DX Unit name={}, stored DX Unit Name for that index={}", + DXSystemNum, + DXHeatPumpSystemName, + DXHeatPumpSystem(DXSystemNum).Name)); } CheckEquipName(DXSystemNum) = false; } @@ -589,7 +595,7 @@ namespace HVACDXHeatPumpSystem { using DXCoils::DXCoilOutletTemp; using DXCoils::SimDXCoil; using FaultsManager::FaultsCoilSATSensor; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; using Psychrometrics::PsyHFnTdbW; @@ -734,8 +740,8 @@ namespace HVACDXHeatPumpSystem { ShowWarningError(state, DXHeatPumpSystem(DXSystemNum).DXHeatPumpSystemType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + DXHeatPumpSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -757,7 +763,7 @@ namespace HVACDXHeatPumpSystem { " - DX unit sensible part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXHeatPumpSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -940,8 +946,8 @@ namespace HVACDXHeatPumpSystem { DXHeatPumpSystem(DXSystemNum).DXHeatPumpSystemType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + DXHeatPumpSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -963,7 +969,7 @@ namespace HVACDXHeatPumpSystem { " - DX unit sensible part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXHeatPumpSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -1007,8 +1013,8 @@ namespace HVACDXHeatPumpSystem { DXHeatPumpSystem(DXSystemNum).DXHeatPumpSystemType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + DXHeatPumpSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -1030,7 +1036,7 @@ namespace HVACDXHeatPumpSystem { " - DX unit sensible part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXHeatPumpSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { diff --git a/src/EnergyPlus/HVACDXSystem.cc b/src/EnergyPlus/HVACDXSystem.cc index 835873a022c..a54ab597a5f 100644 --- a/src/EnergyPlus/HVACDXSystem.cc +++ b/src/EnergyPlus/HVACDXSystem.cc @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include //coil report @@ -204,7 +203,7 @@ namespace HVACDXSystem { using DXCoils::SimDXCoil; using DXCoils::SimDXCoilMultiMode; using DXCoils::SimDXCoilMultiSpeed; - using General::TrimSigDigits; + using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; using PackagedThermalStorageCoil::SimTESCoil; using VariableSpeedCoils::SimVariableSpeedCoils; @@ -241,13 +240,20 @@ namespace HVACDXSystem { } else { DXSystemNum = CompIndex; if (DXSystemNum > NumDXSystem || DXSystemNum < 1) { - ShowFatalError(state, "SimulateDXCoolingSystem: Invalid CompIndex passed=" + TrimSigDigits(DXSystemNum) + - ", Number of DX Units=" + TrimSigDigits(NumDXSystem) + ", DX Unit name=" + DXCoolingSystemName); + ShowFatalError(state, + format("SimulateDXCoolingSystem: Invalid CompIndex passed={}, Number of DX Units={}, DX Unit name={}", + DXSystemNum, + NumDXSystem, + DXCoolingSystemName)); } if (CheckEquipName(DXSystemNum)) { if (DXCoolingSystemName != DXCoolingSystem(DXSystemNum).Name) { - ShowFatalError(state, "SimulateDXCoolingSystem: Invalid CompIndex passed=" + TrimSigDigits(DXSystemNum) + ", DX Unit name=" + - DXCoolingSystemName + ", stored DX Unit Name for that index=" + DXCoolingSystem(DXSystemNum).Name); + ShowFatalError( + state, + format("SimulateDXCoolingSystem: Invalid CompIndex passed={}, DX Unit name={}, stored DX Unit Name for that index={}", + DXSystemNum, + DXCoolingSystemName, + DXCoolingSystem(DXSystemNum).Name)); } CheckEquipName(DXSystemNum) = false; } @@ -384,7 +390,6 @@ namespace HVACDXSystem { using NodeInputManager::GetOnlySingleNode; using PackagedThermalStorageCoil::GetTESCoilIndex; using VariableSpeedCoils::GetCoilIndexVariableSpeed; - using namespace DataIPShortCuts; using DXCoils::GetDXCoilIndex; using DXCoils::SetCoilSystemCoolingData; using DXCoils::SetDXCoilTypeData; @@ -1024,7 +1029,7 @@ namespace HVACDXSystem { using DXCoils::SimDXCoilMultiMode; using DXCoils::SimDXCoilMultiSpeed; using FaultsManager::FaultsCoilSATSensor; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; using HVACHXAssistedCoolingCoil::HXAssistedCoilOutletHumRat; @@ -1198,8 +1203,8 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1221,7 +1226,7 @@ namespace HVACDXSystem { " - DX unit sensible part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1280,8 +1285,8 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit latent part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1307,7 +1312,7 @@ namespace HVACDXSystem { " - DX unit latent part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1456,8 +1461,8 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1478,7 +1483,7 @@ namespace HVACDXSystem { " - DX unit sensible part-load ratio calculation unexpectedly failed: part-load " "ratio limits exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1501,7 +1506,7 @@ namespace HVACDXSystem { " - DX unit sensible part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1584,8 +1589,8 @@ namespace HVACDXSystem { ShowWarningError(state, DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit latent part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated latent part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated latent part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated latent part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated latent part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated latent part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1606,7 +1611,7 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - DX unit latent part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1701,9 +1706,9 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit latent part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated latent part-load ratio = " + - RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated latent part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, + format("Estimated latent part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated latent part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated latent part-load ratio will be used and the simulation " "continues. Occurrence info:"); } @@ -1725,7 +1730,7 @@ namespace HVACDXSystem { " - DX unit latent part-load ratio calculation failed unexpectedly: part-load ratio " "limits exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1747,7 +1752,7 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - DX unit latent part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -1789,7 +1794,7 @@ namespace HVACDXSystem { ShowWarningError(state, DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit sensible speed ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Calculated speed ratio = " + RoundSigDigits(SpeedRatio, 3)); + ShowContinueError(state, format("Calculated speed ratio = {:.3R}", SpeedRatio)); ShowContinueErrorTimeStamp(state, "The calculated speed ratio will be used and the simulation continues. Occurrence info:"); } @@ -1822,7 +1827,7 @@ namespace HVACDXSystem { ShowWarningError(state, DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit sensible cycling ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Calculated cycling ratio = " + RoundSigDigits(CycRatio, 3)); + ShowContinueError(state, format("Calculated cycling ratio = {:.3R}", CycRatio)); ShowContinueErrorTimeStamp(state, "The calculated cycling ratio will be used and the simulation continues. Occurrence info:"); } @@ -1880,7 +1885,7 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit latent speed ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Calculated speed ratio = " + RoundSigDigits(SpeedRatio, 3)); + ShowContinueError(state, format("Calculated speed ratio = {:.3R}", SpeedRatio)); ShowContinueErrorTimeStamp(state, "The calculated speed ratio will be used and the simulation continues. Occurrence info:"); } @@ -1913,7 +1918,7 @@ namespace HVACDXSystem { ShowWarningError(state, DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit latent cycling ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Calculated cycling ratio = " + RoundSigDigits(CycRatio, 3)); + ShowContinueError(state, format("Calculated cycling ratio = {:.3R}", CycRatio)); ShowContinueErrorTimeStamp(state, "The calculated cycling ratio will be used and the simulation continues. Occurrence info:"); } @@ -1984,8 +1989,8 @@ namespace HVACDXSystem { ShowWarningError(state, DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2071,8 +2076,8 @@ namespace HVACDXSystem { } else { TempMinPLR = PartLoadFrac + 0.001; } - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(TempMinPLR, 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", TempMinPLR)); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2109,8 +2114,8 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit multimode latent part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2172,8 +2177,8 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit coolreheat latent part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2300,9 +2305,9 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + - RoundSigDigits((TempSpeedOut / TempSpeedReqst), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, + format("Estimated part-load ratio = {:.3R}", (TempSpeedOut / TempSpeedReqst))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2323,7 +2328,7 @@ namespace HVACDXSystem { " - DX unit sensible part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2408,8 +2413,8 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(SpeedRatio, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", SpeedRatio)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2430,7 +2435,7 @@ namespace HVACDXSystem { " - DX unit sensible part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2533,8 +2538,8 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit latent part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2555,7 +2560,7 @@ namespace HVACDXSystem { " - DX unit latent part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2589,8 +2594,8 @@ namespace HVACDXSystem { DXCoolingSystem(DXSystemNum).DXCoolingSystemType + " - Iteration limit exceeded calculating DX unit latent part-load ratio for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2611,7 +2616,7 @@ namespace HVACDXSystem { " - DX unit latent part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + DXCoolingSystem(DXSystemNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } diff --git a/src/EnergyPlus/HVACDuct.cc b/src/EnergyPlus/HVACDuct.cc index bdf4da7dcc8..1a501c64945 100644 --- a/src/EnergyPlus/HVACDuct.cc +++ b/src/EnergyPlus/HVACDuct.cc @@ -49,14 +49,11 @@ #include #include #include -#include #include #include -#include #include #include #include -#include #include namespace EnergyPlus { @@ -90,7 +87,6 @@ namespace HVACDuct { // USE STATEMENTS: // // Using/Aliasing - using namespace DataHVACGlobals; using namespace DataLoopNode; // @@ -139,7 +135,6 @@ namespace HVACDuct { // Manage the simulation of a duct component // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int DuctNum; // index of duct being simulated @@ -159,13 +154,17 @@ namespace HVACDuct { } else { DuctNum = CompIndex; if (DuctNum > NumDucts || DuctNum < 1) { - ShowFatalError(state, "SimDuct: Invalid CompIndex passed=" + TrimSigDigits(DuctNum) + ", Number of Components=" + TrimSigDigits(NumDucts) + - ", Entered Component name=" + CompName); + ShowFatalError( + state, + format("SimDuct: Invalid CompIndex passed={}, Number of Components={}, Entered Component name={}", DuctNum, NumDucts, CompName)); } if (CheckEquipName(DuctNum)) { if (CompName != Duct(DuctNum).Name) { - ShowFatalError(state, "SimDuct: Invalid CompIndex passed=" + TrimSigDigits(DuctNum) + ", Component name=" + CompName + - ", stored Component Name for that index=" + Duct(DuctNum).Name); + ShowFatalError(state, + format("SimDuct: Invalid CompIndex passed={}, Component name={}, stored Component Name for that index={}", + DuctNum, + CompName, + Duct(DuctNum).Name)); } CheckEquipName(DuctNum) = false; } diff --git a/src/EnergyPlus/HVACFan.cc b/src/EnergyPlus/HVACFan.cc index e780e053364..a2f98c2ec32 100644 --- a/src/EnergyPlus/HVACFan.cc +++ b/src/EnergyPlus/HVACFan.cc @@ -62,7 +62,6 @@ #include #include // used for fault model routine CalFaultyFanAirFlowReduction #include -#include #include #include #include @@ -625,7 +624,8 @@ namespace HVACFan { SetupOutputVariable(state, "Fan Runtime Fraction", OutputProcessor::Unit::None, m_fanRunTimeFractionAtSpeed[0], "System", "Average", name); } else if (speedControl == SpeedControlMethod::Discrete && m_numSpeeds > 1) { for (auto speedLoop = 0; speedLoop < m_numSpeeds; ++speedLoop) { - SetupOutputVariable(state, "Fan Runtime Fraction Speed " + General::TrimSigDigits(speedLoop + 1) + "", + SetupOutputVariable(state, + "Fan Runtime Fraction Speed " + fmt::to_string(speedLoop + 1), OutputProcessor::Unit::None, m_fanRunTimeFractionAtSpeed[speedLoop], "System", diff --git a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc index d2407836e55..946edb7d8ad 100644 --- a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc +++ b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -65,7 +64,6 @@ #include #include #include -#include #include #include #include @@ -185,9 +183,6 @@ namespace HVACHXAssistedCoolingCoil { // This subroutine manages the simulation of the // cooling coil/heat exchanger combination. - // Using/Aliasing - using General::TrimSigDigits; - // Locals // SUBROUTINE ARGUMENT DEFINITIONS: // (not used for Coil:Water:DetailedFlatCooling) @@ -217,14 +212,19 @@ namespace HVACHXAssistedCoolingCoil { } else { HXAssistedCoilNum = CompIndex; if (HXAssistedCoilNum > TotalNumHXAssistedCoils || HXAssistedCoilNum < 1) { - ShowFatalError(state, "SimHXAssistedCoolingCoil: Invalid CompIndex passed=" + TrimSigDigits(HXAssistedCoilNum) + - ", Number of HX Assisted Cooling Coils=" + TrimSigDigits(TotalNumHXAssistedCoils) + - ", Coil name=" + HXAssistedCoilName); + ShowFatalError(state, + format("SimHXAssistedCoolingCoil: Invalid CompIndex passed={}, Number of HX Assisted Cooling Coils={}, Coil name={}", + HXAssistedCoilNum, + TotalNumHXAssistedCoils, + HXAssistedCoilName)); } if (CheckEquipName(HXAssistedCoilNum)) { if (!HXAssistedCoilName.empty() && HXAssistedCoilName != HXAssistedCoil(HXAssistedCoilNum).Name) { - ShowFatalError(state, "SimHXAssistedCoolingCoil: Invalid CompIndex passed=" + TrimSigDigits(HXAssistedCoilNum) + ", Coil name=" + - HXAssistedCoilName + ", stored Coil Name for that index=" + HXAssistedCoil(HXAssistedCoilNum).Name); + ShowFatalError(state, + format("SimHXAssistedCoolingCoil: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + HXAssistedCoilNum, + HXAssistedCoilName, + HXAssistedCoil(HXAssistedCoilNum).Name)); } CheckEquipName(HXAssistedCoilNum) = false; } @@ -880,9 +880,7 @@ namespace HVACHXAssistedCoolingCoil { // Using/Aliasing using DXCoils::SimDXCoil; - using General::TrimSigDigits; using HeatRecovery::SimHeatRecovery; - using Psychrometrics::PsyHFnTdbW; using WaterCoils::SimulateWaterCoilComponents; // Locals @@ -1002,8 +1000,11 @@ namespace HVACHXAssistedCoolingCoil { if (Iter > MaxIter) { if (HXAssistedCoil(HXAssistedCoilNum).MaxIterCounter < 1) { ++HXAssistedCoil(HXAssistedCoilNum).MaxIterCounter; - ShowWarningError(state, HXAssistedCoil(HXAssistedCoilNum).HXAssistedCoilType + " \"" + HXAssistedCoil(HXAssistedCoilNum).Name + - "\" -- Exceeded max iterations (" + TrimSigDigits(MaxIter) + ") while calculating operating conditions."); + ShowWarningError(state, + format("{} \"{}\" -- Exceeded max iterations ({}) while calculating operating conditions.", + HXAssistedCoil(HXAssistedCoilNum).HXAssistedCoilType, + HXAssistedCoil(HXAssistedCoilNum).Name, + MaxIter)); ShowContinueErrorTimeStamp(state, ""); } else { ShowRecurringWarningErrorAtEnd(state, HXAssistedCoil(HXAssistedCoilNum).HXAssistedCoilType + " \"" + HXAssistedCoil(HXAssistedCoilNum).Name + @@ -1072,9 +1073,6 @@ namespace HVACHXAssistedCoolingCoil { // This routine provides a method for outside routines to check if // the hx assisted cooling coil is scheduled to be on. - // Using/Aliasing - using General::TrimSigDigits; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int HXAssistedCoilNum; @@ -1101,12 +1099,19 @@ namespace HVACHXAssistedCoolingCoil { } else { HXAssistedCoilNum = CompIndex; if (HXAssistedCoilNum > TotalNumHXAssistedCoils || HXAssistedCoilNum < 1) { - ShowFatalError(state, "CheckHXAssistedCoolingCoilSchedule: Invalid CompIndex passed=" + TrimSigDigits(HXAssistedCoilNum) + - ", Number of Heating Coils=" + TrimSigDigits(TotalNumHXAssistedCoils) + ", Coil name=" + CompName); + ShowFatalError(state, + format("CheckHXAssistedCoolingCoilSchedule: Invalid CompIndex passed={}, Number of Heating Coils={}, Coil name={}", + HXAssistedCoilNum, + TotalNumHXAssistedCoils, + CompName)); } if (CompName != HXAssistedCoil(HXAssistedCoilNum).Name) { - ShowFatalError(state, "CheckHXAssistedCoolingCoilSchedule: Invalid CompIndex passed=" + TrimSigDigits(HXAssistedCoilNum) + - ", Coil name=" + CompName + ", stored Coil Name for that index=" + HXAssistedCoil(HXAssistedCoilNum).Name); + ShowFatalError( + state, + format("CheckHXAssistedCoolingCoilSchedule: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + HXAssistedCoilNum, + CompName, + HXAssistedCoil(HXAssistedCoilNum).Name)); } Value = 1.0; // not scheduled? diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index 62ef17d94fd..73933aa1786 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -685,7 +685,7 @@ namespace HVACManager { using DataPlant::TotNumLoops; using EMSManager::ManageEMS; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + using NonZoneEquipmentManager::ManageNonZoneEquipment; using PlantCondLoopOperation::SetupPlantEMSActuators; using PlantManager::GetPlantInput; @@ -974,8 +974,12 @@ namespace HVACManager { ++ErrCount; if (ErrCount < 15) { ErrEnvironmentName = EnvironmentName; - ShowWarningError(state, "SimHVAC: Maximum iterations (" + fmt::to_string(MaxIter) + ") exceeded for all HVAC loops, at " + EnvironmentName + ", " + - CurMnDy + ' ' + CreateSysTimeIntervalString(state)); + ShowWarningError(state, + format("SimHVAC: Maximum iterations ({}) exceeded for all HVAC loops, at {}, {} {}", + MaxIter, + EnvironmentName, + CurMnDy, + CreateSysTimeIntervalString(state))); if (SimAirLoopsFlag) { ShowContinueError(state, "The solution for one or more of the Air Loop HVAC systems did not appear to converge"); } @@ -1005,14 +1009,13 @@ namespace HVACManager { ShowContinueError(state, "Check values should be zero. Most Recent values listed first."); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += RoundSigDigits(AirLoopConvergence(AirSysNum).HVACFlowDemandToSupplyTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACFlowDemandToSupplyTolValue(StackDepth)); } ShowContinueError(state, "Demand-to-Supply interface mass flow rate check value iteration history trace: " + HistoryTrace); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACFlowSupplyDeck1ToDemandTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACFlowSupplyDeck1ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 1 mass flow rate check value iteration history trace: " + HistoryTrace); @@ -1020,8 +1023,7 @@ namespace HVACManager { if (state.dataAirLoop->AirToZoneNodeInfo(AirSysNum).NumSupplyNodes >= 2) { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACFlowSupplyDeck2ToDemandTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACFlowSupplyDeck2ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 2 mass flow rate check value iteration history trace: " + HistoryTrace); @@ -1035,12 +1037,12 @@ namespace HVACManager { ShowContinueError(state, "Check values should be zero. Most Recent values listed first."); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += RoundSigDigits(AirLoopConvergence(AirSysNum).HVACHumDemandToSupplyTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACHumDemandToSupplyTolValue(StackDepth)); } ShowContinueError(state, "Demand-to-Supply interface humidity ratio check value iteration history trace: " + HistoryTrace); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += RoundSigDigits(AirLoopConvergence(AirSysNum).HVACHumSupplyDeck1ToDemandTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACHumSupplyDeck1ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 1 humidity ratio check value iteration history trace: " + HistoryTrace); @@ -1048,8 +1050,7 @@ namespace HVACManager { if (state.dataAirLoop->AirToZoneNodeInfo(AirSysNum).NumSupplyNodes >= 2) { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACHumSupplyDeck2ToDemandTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACHumSupplyDeck2ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 2 humidity ratio check value iteration history trace: " + HistoryTrace); @@ -1062,21 +1063,19 @@ namespace HVACManager { ShowContinueError(state, "Check values should be zero. Most Recent values listed first."); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += RoundSigDigits(AirLoopConvergence(AirSysNum).HVACTempDemandToSupplyTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACTempDemandToSupplyTolValue(StackDepth)); } ShowContinueError(state, "Demand-to-Supply interface temperature check value iteration history trace: " + HistoryTrace); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACTempSupplyDeck1ToDemandTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACTempSupplyDeck1ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 1 temperature check value iteration history trace: " + HistoryTrace); if (state.dataAirLoop->AirToZoneNodeInfo(AirSysNum).NumSupplyNodes >= 2) { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACTempSupplyDeck1ToDemandTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACTempSupplyDeck1ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 2 temperature check value iteration history trace: " + HistoryTrace); @@ -1088,13 +1087,12 @@ namespace HVACManager { ShowContinueError(state, "Check values should be zero. Most Recent values listed first."); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += RoundSigDigits(AirLoopConvergence(AirSysNum).HVACEnergyDemandToSupplyTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACEnergyDemandToSupplyTolValue(StackDepth)); } ShowContinueError(state, "Demand-to-Supply interface energy check value iteration history trace: " + HistoryTrace); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACEnergySupplyDeck1ToDemandTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", AirLoopConvergence(AirSysNum).HVACEnergySupplyDeck1ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 1 energy check value iteration history trace: " + HistoryTrace); @@ -1102,7 +1100,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACEnergySupplyDeck2ToDemandTolValue(StackDepth), 6) + ','; + format("{:.6R},", AirLoopConvergence(AirSysNum).HVACEnergySupplyDeck2ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 2 energy check value iteration history trace: " + HistoryTrace); } @@ -1129,9 +1127,11 @@ namespace HVACManager { ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).HumidityRatio(StackDepth)) < HVACHumRatOscillationToler) { FoundOscillationByDuplicate = true; - ShowContinueError(state, "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + - " shows oscillating humidity ratio across iterations with a repeated value of " + - RoundSigDigits(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).HumidityRatio(1), 6)); + ShowContinueError( + state, + format("Node named {} shows oscillating humidity ratio across iterations with a repeated value of {:.6R}", + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum), + ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).HumidityRatio(1))); break; } } @@ -1153,9 +1153,10 @@ namespace HVACManager { } if (MonotonicDecreaseFound) { ShowContinueError(state, - "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + - " shows monotonically decreasing humidity ratio with a trend rate across iterations of " + - RoundSigDigits(SlopeHumRat, 6) + " [ kg-water/kg-dryair/iteration]"); + format("Node named {} shows monotonically decreasing humidity ratio with a trend " + "rate across iterations of {:.6R} [ kg-water/kg-dryair/iteration]", + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum), + SlopeHumRat)); } } else { // check for monotic incrase MonotonicIncreaseFound = true; @@ -1168,9 +1169,10 @@ namespace HVACManager { } if (MonotonicIncreaseFound) { ShowContinueError(state, - "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + - " shows monotonically increasing humidity ratio with a trend rate across iterations of " + - RoundSigDigits(SlopeHumRat, 6) + " [ kg-water/kg-dryair/iteration]"); + format("Node named {} shows monotonically increasing humidity ratio with a trend " + "rate across iterations of {:.6R} [ kg-water/kg-dryair/iteration]", + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum), + SlopeHumRat)); } } } // significant slope in iterates @@ -1180,8 +1182,7 @@ namespace HVACManager { if (MonotonicDecreaseFound || MonotonicIncreaseFound || FoundOscillationByDuplicate) { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += - RoundSigDigits(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).HumidityRatio(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).HumidityRatio(StackDepth)); } ShowContinueError(state, "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + @@ -1203,9 +1204,11 @@ namespace HVACManager { ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).MassFlowRate(StackDepth)) < HVACFlowRateOscillationToler) { FoundOscillationByDuplicate = true; - ShowContinueError(state, "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + - " shows oscillating mass flow rate across iterations with a repeated value of " + - RoundSigDigits(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).MassFlowRate(1), 6)); + ShowContinueError( + state, + format("Node named {} shows oscillating mass flow rate across iterations with a repeated value of {:.6R}", + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum), + ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).MassFlowRate(1))); break; } } @@ -1226,9 +1229,10 @@ namespace HVACManager { } if (MonotonicDecreaseFound) { ShowContinueError(state, - "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + - " shows monotonically decreasing mass flow rate with a trend rate across iterations of " + - RoundSigDigits(SlopeMdot, 6) + " [kg/s/iteration]"); + format("Node named {} shows monotonically decreasing mass flow rate with a trend " + "rate across iterations of {:.6R} [kg/s/iteration]", + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum), + SlopeMdot)); } } else { // check for monotic incrase MonotonicIncreaseFound = true; @@ -1241,9 +1245,10 @@ namespace HVACManager { } if (MonotonicIncreaseFound) { ShowContinueError(state, - "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + - " shows monotonically increasing mass flow rate with a trend rate across iterations of " + - RoundSigDigits(SlopeMdot, 6) + " [kg/s/iteration]"); + format("Node named {} shows monotonically increasing mass flow rate with a trend " + "rate across iterations of {:.6R} [kg/s/iteration]", + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum), + SlopeMdot)); } } } // significant slope in iterates @@ -1253,8 +1258,7 @@ namespace HVACManager { if (MonotonicDecreaseFound || MonotonicIncreaseFound || FoundOscillationByDuplicate) { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += - RoundSigDigits(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).MassFlowRate(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).MassFlowRate(StackDepth)); } ShowContinueError(state, "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + " mass flow rate [kg/s] iteration history trace (most recent first): " + HistoryTrace); @@ -1275,9 +1279,11 @@ namespace HVACManager { ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).Temperature(StackDepth)) < HVACTemperatureOscillationToler) { FoundOscillationByDuplicate = true; - ShowContinueError(state, "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + - " shows oscillating temperatures across iterations with a repeated value of " + - RoundSigDigits(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).Temperature(1), 6)); + ShowContinueError( + state, + format("Node named {} shows oscillating temperatures across iterations with a repeated value of {:.6R}", + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum), + ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).Temperature(1))); break; } } @@ -1298,9 +1304,10 @@ namespace HVACManager { } if (MonotonicDecreaseFound) { ShowContinueError(state, - "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + - " shows monotonically decreasing temperature with a trend rate across iterations of " + - RoundSigDigits(SlopeTemps, 4) + " [C/iteration]"); + format("Node named {} shows monotonically decreasing temperature with a trend rate " + "across iterations of {:.4R} [C/iteration]", + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum), + SlopeTemps)); } } else { // check for monotic incrase MonotonicIncreaseFound = true; @@ -1313,9 +1320,10 @@ namespace HVACManager { } if (MonotonicIncreaseFound) { ShowContinueError(state, - "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + - " shows monotonically increasing temperatures with a trend rate across iterations of " + - RoundSigDigits(SlopeTemps, 4) + " [C/iteration]"); + format("Node named {} shows monotonically increasing temperatures with a trend " + "rate across iterations of {:.4R} [C/iteration]", + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum), + SlopeTemps)); } } } // significant slope in iterates @@ -1325,8 +1333,7 @@ namespace HVACManager { if (MonotonicDecreaseFound || MonotonicIncreaseFound || FoundOscillationByDuplicate) { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += - RoundSigDigits(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).Temperature(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).Temperature(StackDepth)); } ShowContinueError(state, "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + " temperature [C] iteration history trace (most recent first): " + HistoryTrace); @@ -1343,12 +1350,12 @@ namespace HVACManager { ShowContinueError(state, "Check values should be zero. Most Recent values listed first."); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += RoundSigDigits(PlantConvergence(LoopNum).PlantFlowDemandToSupplyTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", PlantConvergence(LoopNum).PlantFlowDemandToSupplyTolValue(StackDepth)); } ShowContinueError(state, "Demand-to-Supply interface mass flow rate check value iteration history trace: " + HistoryTrace); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += RoundSigDigits(PlantConvergence(LoopNum).PlantFlowSupplyToDemandTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", PlantConvergence(LoopNum).PlantFlowSupplyToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-Demand interface mass flow rate check value iteration history trace: " + HistoryTrace); @@ -1368,10 +1375,11 @@ namespace HVACManager { PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)) < PlantFlowRateOscillationToler) { FoundOscillationByDuplicate = true; - ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + - " shows oscillating flow rates across iterations with a repeated value of " + - RoundSigDigits(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(1), 7)); + ShowContinueError( + state, + format("Node named {} shows oscillating flow rates across iterations with a repeated value of {:.7R}", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(1))); break; } } @@ -1394,9 +1402,10 @@ namespace HVACManager { } if (MonotonicDecreaseFound) { ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + - " shows monotonically decreasing mass flow rate with a trend rate across iterations of " + - RoundSigDigits(SlopeMdot, 7) + " [kg/s/iteration]"); + format("Node named {} shows monotonically decreasing mass flow rate with a trend " + "rate across iterations of {:.7R} [kg/s/iteration]", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + SlopeMdot)); } } else { // check for monotonic incrase MonotonicIncreaseFound = true; @@ -1409,9 +1418,10 @@ namespace HVACManager { } if (MonotonicIncreaseFound) { ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + - " shows monotonically increasing mass flow rate with a trend rate across iterations of " + - RoundSigDigits(SlopeMdot, 7) + " [kg/s/iteration]"); + format("Node named {} shows monotonically increasing mass flow rate with a trend " + "rate across iterations of {:.7R} [kg/s/iteration]", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + SlopeMdot)); } } } // significant slope found @@ -1421,8 +1431,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { HistoryTrace += - RoundSigDigits(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth), 7) + - ','; + format("{:.7R},", PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)); } ShowContinueError(state, "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + " mass flow rate [kg/s] iteration history trace (most recent first): " + HistoryTrace); @@ -1443,10 +1452,11 @@ namespace HVACManager { PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)) < PlantFlowRateOscillationToler) { FoundOscillationByDuplicate = true; - ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + - " shows oscillating flow rates across iterations with a repeated value of " + - RoundSigDigits(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(1), 7)); + ShowContinueError( + state, + format("Node named {} shows oscillating flow rates across iterations with a repeated value of {:.7R}", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(1))); break; } } @@ -1470,9 +1480,10 @@ namespace HVACManager { } if (MonotonicDecreaseFound) { ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + - " shows monotonically decreasing mass flow rate with a trend rate across iterations of " + - RoundSigDigits(SlopeMdot, 7) + " [kg/s/iteration]"); + format("Node named {} shows monotonically decreasing mass flow rate with a trend " + "rate across iterations of {:.7R} [kg/s/iteration]", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + SlopeMdot)); } } else { // check for monotonic incrase MonotonicIncreaseFound = true; @@ -1485,9 +1496,10 @@ namespace HVACManager { } if (MonotonicIncreaseFound) { ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + - " shows monotonically increasing mass flow rate with a trend rate across iterations of " + - RoundSigDigits(SlopeMdot, 7) + " [kg/s/iteration]"); + format("Node named {} shows monotonically increasing mass flow rate with a trend " + "rate across iterations of {:.7R} [kg/s/iteration]", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + SlopeMdot)); } } } // significant slope found @@ -1497,8 +1509,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { HistoryTrace += - RoundSigDigits(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth), 7) + - ','; + format("{:.7R},", PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)); } ShowContinueError(state, "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + " mass flow rate [kg/s] iteration history trace (most recent first): " + HistoryTrace); @@ -1514,12 +1525,12 @@ namespace HVACManager { ShowContinueError(state, "Check values should be zero. Most Recent values listed first."); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += RoundSigDigits(PlantConvergence(LoopNum).PlantTempDemandToSupplyTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", PlantConvergence(LoopNum).PlantTempDemandToSupplyTolValue(StackDepth)); } ShowContinueError(state, "Demand-to-Supply interface temperature check value iteration history trace: " + HistoryTrace); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { - HistoryTrace += RoundSigDigits(PlantConvergence(LoopNum).PlantTempSupplyToDemandTolValue(StackDepth), 6) + ','; + HistoryTrace += format("{:.6R},", PlantConvergence(LoopNum).PlantTempSupplyToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-Demand interface temperature check value iteration history trace: " + HistoryTrace); @@ -1539,10 +1550,12 @@ namespace HVACManager { PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)) < PlantTemperatureOscillationToler) { FoundOscillationByDuplicate = true; - ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + - " shows oscillating temperatures across iterations with a repeated value of " + - RoundSigDigits(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(1), 5)); + ShowContinueError( + state, + format( + "Node named {} shows oscillating temperatures across iterations with a repeated value of {:.5R}", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(1))); break; } } @@ -1565,9 +1578,10 @@ namespace HVACManager { } if (MonotonicDecreaseFound) { ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + - " shows monotonically decreasing temperatures with a trend rate across iterations of " + - RoundSigDigits(SlopeTemps, 5) + " [C/iteration]"); + format("Node named {} shows monotonically decreasing temperatures with a trend " + "rate across iterations of {:.5R} [C/iteration]", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + SlopeTemps)); } } else { // check for monotic incrase MonotonicIncreaseFound = true; @@ -1580,9 +1594,10 @@ namespace HVACManager { } if (MonotonicIncreaseFound) { ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + - " shows monotonically increasing temperatures with a trend rate across iterations of " + - RoundSigDigits(SlopeTemps, 5) + " [C/iteration]"); + format("Node named {} shows monotonically increasing temperatures with a trend " + "rate across iterations of {:.5R} [C/iteration]", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + SlopeTemps)); } } } // significant slope found @@ -1592,8 +1607,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { HistoryTrace += - RoundSigDigits(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth), 5) + - ','; + format("{:.5R},", PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)); } ShowContinueError(state, "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + " temperature [C] iteration history trace (most recent first): " + HistoryTrace); @@ -1614,10 +1628,12 @@ namespace HVACManager { PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)) < PlantTemperatureOscillationToler) { FoundOscillationByDuplicate = true; - ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + - " shows oscillating temperatures across iterations with a repeated value of " + - RoundSigDigits(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(1), 5)); + ShowContinueError( + state, + format( + "Node named {} shows oscillating temperatures across iterations with a repeated value of {:.5R}", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(1))); break; } } @@ -1640,9 +1656,10 @@ namespace HVACManager { } if (MonotonicDecreaseFound) { ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + - " shows monotonically decreasing temperatures with a trend rate across iterations of " + - RoundSigDigits(SlopeTemps, 5) + " [C/iteration]"); + format("Node named {} shows monotonically decreasing temperatures with a trend " + "rate across iterations of {:.5R} [C/iteration]", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + SlopeTemps)); } } else { // check for monotic incrase MonotonicIncreaseFound = true; @@ -1655,9 +1672,10 @@ namespace HVACManager { } if (MonotonicIncreaseFound) { ShowContinueError(state, - "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + - " shows monotonically increasing temperatures with a trend rate across iterations of " + - RoundSigDigits(SlopeTemps, 5) + " [C/iteration]"); + format("Node named {} shows monotonically increasing temperatures with a trend " + "rate across iterations of {:.5R} [C/iteration]", + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + SlopeTemps)); } } } // significant slope found @@ -1667,8 +1685,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { HistoryTrace += - RoundSigDigits(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth), 5) + - ','; + format("{:.5R},", PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)); } ShowContinueError(state, "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + " temperature [C] iteration history trace (most recent first): " + HistoryTrace); @@ -3092,11 +3109,12 @@ namespace HVACManager { ShowSevereError(state, "CheckAirLoopFlowBalance: AirLoopHVAC " + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name + " is unbalanced. Supply is > return plus outdoor air."); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Flows [m3/s at standard density]: Supply=" + - General::RoundSigDigits(thisAirLoopFlow.SupFlow / DataEnvironment::StdRhoAir, 6) + - " Return=" + General::RoundSigDigits(thisAirLoopFlow.SysRetFlow / DataEnvironment::StdRhoAir, 6) + - " Outdoor Air=" + General::RoundSigDigits(thisAirLoopFlow.OAFlow / DataEnvironment::StdRhoAir, 6)); - ShowContinueError(state, " Imbalance=" + General::RoundSigDigits(unbalancedExhaustDelta / DataEnvironment::StdRhoAir, 6)); + ShowContinueError(state, + format(" Flows [m3/s at standard density]: Supply={:.6R} Return={:.6R} Outdoor Air={:.6R}", + thisAirLoopFlow.SupFlow / DataEnvironment::StdRhoAir, + thisAirLoopFlow.SysRetFlow / DataEnvironment::StdRhoAir, + thisAirLoopFlow.OAFlow / DataEnvironment::StdRhoAir)); + ShowContinueError(state, format(" Imbalance={:.6R}", unbalancedExhaustDelta / DataEnvironment::StdRhoAir)); ShowContinueError(state, " This error will only be reported once per system."); thisAirLoopFlow.FlowError = true; } diff --git a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc index 45399ef03b0..194a4b07491 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -257,7 +257,6 @@ namespace HVACMultiSpeedHeatPump { // Manages the simulation of multispeed heat pump. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int MSHeatPumpNum; // index of fan coil unit being simulated @@ -281,13 +280,19 @@ namespace HVACMultiSpeedHeatPump { } else { MSHeatPumpNum = CompIndex; if (MSHeatPumpNum > NumMSHeatPumps || MSHeatPumpNum < 1) { - ShowFatalError(state, "SimMSHeatPump: Invalid CompIndex passed=" + TrimSigDigits(MSHeatPumpNum) + - ", Number of MultiSpeed Heat Pumps=" + TrimSigDigits(NumMSHeatPumps) + ", Heat Pump name=" + CompName); + ShowFatalError(state, + format("SimMSHeatPump: Invalid CompIndex passed={}, Number of MultiSpeed Heat Pumps={}, Heat Pump name={}", + MSHeatPumpNum, + NumMSHeatPumps, + CompName)); } if (CheckEquipName(MSHeatPumpNum)) { if (CompName != MSHeatPump(MSHeatPumpNum).Name) { - ShowFatalError(state, "SimMSHeatPump: Invalid CompIndex passed=" + TrimSigDigits(MSHeatPumpNum) + ", Heat Pump name=" + CompName + - MSHeatPump(MSHeatPumpNum).Name); + ShowFatalError(state, + format("SimMSHeatPump: Invalid CompIndex passed={}, Heat Pump name={}{}", + MSHeatPumpNum, + CompName, + MSHeatPump(MSHeatPumpNum).Name)); } CheckEquipName(MSHeatPumpNum) = false; } @@ -567,7 +572,7 @@ namespace HVACMultiSpeedHeatPump { using Fans::GetFanType; using Fans::GetFanVolFlow; using FluidProperties::FindGlycol; - using General::RoundSigDigits; + using NodeInputManager::GetOnlySingleNode; using BranchNodeConnections::SetUpCompSets; using DXCoils::GetDXCoilIndex; @@ -1341,7 +1346,7 @@ namespace HVACMultiSpeedHeatPump { MSHeatPump(MSHPNum).SuppMaxOATemp = Numbers(3); if (MSHeatPump(MSHPNum).SuppMaxOATemp > 21.0) { ShowSevereError(state, CurrentModuleObject + ", \"" + MSHeatPump(MSHPNum).Name + "\", " + cNumericFields(3) + " is greater than 21.0"); - ShowContinueError(state, "The input value is " + RoundSigDigits(Numbers(3), 2)); + ShowContinueError(state, format("The input value is {:.2R}", Numbers(3))); ErrorsFound = true; } @@ -1422,14 +1427,14 @@ namespace HVACMultiSpeedHeatPump { if (MSHeatPump(MSHPNum).NumOfSpeedHeating < 2 || MSHeatPump(MSHPNum).NumOfSpeedHeating > 4) { if (MSHeatPump(MSHPNum).HeatCoilType == MultiSpeedHeatingCoil) { ShowSevereError(state, CurrentModuleObject + ", The maximum " + cNumericFields(9) + " is 4, and the minimum number is 2"); - ShowContinueError(state, "The input value is " + RoundSigDigits(Numbers(9), 0)); + ShowContinueError(state, format("The input value is {:.0R}", Numbers(9))); ErrorsFound = true; } } MSHeatPump(MSHPNum).NumOfSpeedCooling = Numbers(10); if (MSHeatPump(MSHPNum).NumOfSpeedCooling < 2 || MSHeatPump(MSHPNum).NumOfSpeedCooling > 4) { ShowSevereError(state, CurrentModuleObject + ", The maximum " + cNumericFields(10) + " is 4, and the minimum number is 2"); - ShowContinueError(state, "The input value is " + RoundSigDigits(Numbers(10), 0)); + ShowContinueError(state, format("The input value is {:.0R}", Numbers(10))); ErrorsFound = true; } @@ -1803,8 +1808,7 @@ namespace HVACMultiSpeedHeatPump { using Fans::GetFanVolFlow; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; - using General::RoundSigDigits; - using General::TrimSigDigits; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; @@ -2264,10 +2268,13 @@ namespace HVACMultiSpeedHeatPump { if (MSHeatPump(MSHeatPumpNum).FanVolFlow != AutoSize) { // Check fan versus system supply air flow rates if (MSHeatPump(MSHeatPumpNum).FanVolFlow < MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(NumOfSpeedCooling)) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(MSHeatPump(MSHeatPumpNum).FanVolFlow, 7) + - " in fan object " + MSHeatPump(MSHeatPumpNum).FanName + - " is less than the MSHP system air flow rate when cooling is required (" + - TrimSigDigits(MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(NumOfSpeedCooling), 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the MSHP system air flow rate when cooling is " + "required ({:.7T}).", + CurrentModuleObject, + MSHeatPump(MSHeatPumpNum).FanVolFlow, + MSHeatPump(MSHeatPumpNum).FanName, + MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(NumOfSpeedCooling))); ShowContinueError(state, " The MSHP system flow rate when cooling is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + MSHeatPump(MSHeatPumpNum).Name); @@ -2275,28 +2282,33 @@ namespace HVACMultiSpeedHeatPump { // Check flow rates in other speeds and ensure flow rates are not above the max flow rate for (i = NumOfSpeedCooling - 1; i >= 1; --i) { if (MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(i) > MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(i + 1)) { - ShowContinueError(state, " The MSHP system flow rate when cooling is required is reset to the flow rate at higher speed and the " - "simulation continues at Speed" + - TrimSigDigits(i) + '.'); + ShowContinueError(state, + format(" The MSHP system flow rate when cooling is required is reset to the flow rate at higher speed " + "and the simulation continues at Speed{}.", + i)); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + MSHeatPump(MSHeatPumpNum).Name); MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(i) = MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(i + 1); } } } if (MSHeatPump(MSHeatPumpNum).FanVolFlow < MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(NumOfSpeedHeating)) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(MSHeatPump(MSHeatPumpNum).FanVolFlow, 7) + - " in fan object " + MSHeatPump(MSHeatPumpNum).FanName + - " is less than the MSHP system air flow rate when heating is required (" + - TrimSigDigits(MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(NumOfSpeedHeating), 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the MSHP system air flow rate when heating is " + "required ({:.7T}).", + CurrentModuleObject, + MSHeatPump(MSHeatPumpNum).FanVolFlow, + MSHeatPump(MSHeatPumpNum).FanName, + MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(NumOfSpeedHeating))); ShowContinueError(state, " The MSHP system flow rate when heating is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + MSHeatPump(MSHeatPumpNum).Name); MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(NumOfSpeedHeating) = MSHeatPump(MSHeatPumpNum).FanVolFlow; for (i = NumOfSpeedHeating - 1; i >= 1; --i) { if (MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(i) > MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(i + 1)) { - ShowContinueError(state, " The MSHP system flow rate when heating is required is reset to the flow rate at higher speed and the " - "simulation continues at Speed" + - TrimSigDigits(i) + '.'); + ShowContinueError(state, + format(" The MSHP system flow rate when heating is required is reset to the flow rate at higher speed " + "and the simulation continues at Speed{}.", + i)); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " system = " + MSHeatPump(MSHeatPumpNum).Name); MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(i) = MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(i + 1); } @@ -2304,10 +2316,13 @@ namespace HVACMultiSpeedHeatPump { } if (MSHeatPump(MSHeatPumpNum).FanVolFlow < MSHeatPump(MSHeatPumpNum).IdleVolumeAirRate && MSHeatPump(MSHeatPumpNum).IdleVolumeAirRate != 0.0) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(MSHeatPump(MSHeatPumpNum).FanVolFlow, 7) + - " in fan object " + MSHeatPump(MSHeatPumpNum).FanName + - " is less than the MSHP system air flow rate when no heating or cooling is needed (" + - TrimSigDigits(MSHeatPump(MSHeatPumpNum).IdleVolumeAirRate, 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the MSHP system air flow rate when no heating " + "or cooling is needed ({:.7T}).", + CurrentModuleObject, + MSHeatPump(MSHeatPumpNum).FanVolFlow, + MSHeatPump(MSHeatPumpNum).FanName, + MSHeatPump(MSHeatPumpNum).IdleVolumeAirRate)); ShowContinueError(state, " The MSHP system flow rate when no heating or cooling is needed is reset to the fan flow rate and the " "simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + MSHeatPump(MSHeatPumpNum).Name); @@ -2503,7 +2518,8 @@ namespace HVACMultiSpeedHeatPump { ShowWarningError(state, MSHeatPump(MSHeatPumpNum).Name + " is ready to perform cooling, but its DX cooling coil = " + MSHeatPump(MSHeatPumpNum).DXCoolCoilName + " is not available at Available Schedule = " + GetScheduleName(state, CoilAvailSchPtr) + '.'); - ShowContinueErrorTimeStamp(state, "Availability schedule returned=" + RoundSigDigits(GetCurrentScheduleValue(state, CoilAvailSchPtr), 1)); + ShowContinueErrorTimeStamp(state, + format("Availability schedule returned={:.1R}", GetCurrentScheduleValue(state, CoilAvailSchPtr))); } else { ++MSHeatPump(MSHeatPumpNum).CoolCountAvail; ShowRecurringWarningErrorAtEnd(state, MSHeatPump(MSHeatPumpNum).Name + ": Cooling coil is still not available ...", @@ -2528,7 +2544,8 @@ namespace HVACMultiSpeedHeatPump { ShowWarningError(state, MSHeatPump(MSHeatPumpNum).Name + " is ready to perform heating, but its DX heating coil = " + MSHeatPump(MSHeatPumpNum).DXCoolCoilName + " is not available at Available Schedule = " + GetScheduleName(state, CoilAvailSchPtr) + '.'); - ShowContinueErrorTimeStamp(state, "Availability schedule returned=" + RoundSigDigits(GetCurrentScheduleValue(state, CoilAvailSchPtr), 1)); + ShowContinueErrorTimeStamp(state, + format("Availability schedule returned={:.1R}", GetCurrentScheduleValue(state, CoilAvailSchPtr))); } else { ++MSHeatPump(MSHeatPumpNum).HeatCountAvail; ShowRecurringWarningErrorAtEnd(state, MSHeatPump(MSHeatPumpNum).Name + ": Heating coil is still not available ...", @@ -2697,7 +2714,7 @@ namespace HVACMultiSpeedHeatPump { // Using/Aliasing using namespace DataSizing; using DataZoneEquipment::ZoneEquipConfig; - using General::TrimSigDigits; + using PlantUtilities::RegisterPlantCompDesignFlow; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -2753,9 +2770,10 @@ namespace HVACMultiSpeedHeatPump { MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(i) = MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(i + 1); } } - BaseSizer::reportSizerOutput(state, CurrentModuleObject, + BaseSizer::reportSizerOutput(state, + CurrentModuleObject, MSHeatPump(MSHeatPumpNum).Name, - "Speed " + TrimSigDigits(i) + " Supply Air Flow Rate During Cooling Operation [m3/s]", + format("Speed {} Supply Air Flow Rate During Cooling Operation [m3/s]", i), MSHeatPump(MSHeatPumpNum).CoolVolumeFlowRate(i)); } } @@ -2789,9 +2807,10 @@ namespace HVACMultiSpeedHeatPump { MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(i) = MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(i + 1); } } - BaseSizer::reportSizerOutput(state, CurrentModuleObject, + BaseSizer::reportSizerOutput(state, + CurrentModuleObject, MSHeatPump(MSHeatPumpNum).Name, - "Speed" + TrimSigDigits(i) + "Supply Air Flow Rate During Heating Operation [m3/s]", + format("Speed{}Supply Air Flow Rate During Heating Operation [m3/s]", i), MSHeatPump(MSHeatPumpNum).HeatVolumeFlowRate(i)); } } @@ -2888,13 +2907,8 @@ namespace HVACMultiSpeedHeatPump { // METHODOLOGY EMPLOYED: // Use RegulaFalsi technique to iterate on part-load ratio until convergence is achieved. - // REFERENCES: - // na - - // Using/Aliasing - using General::RoundSigDigits; using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using Psychrometrics::PsyCpAirFnW; using TempSolveRoot::SolveRoot; @@ -3187,7 +3201,7 @@ namespace HVACMultiSpeedHeatPump { ++ErrCountCyc; // TODO: Why is the error count shared among all heat pump units? ShowWarningError(state, "Iteration limit exceeded calculating DX unit cycling ratio, for unit=" + MSHeatPump(MSHeatPumpNum).Name); - ShowContinueErrorTimeStamp(state, "Cycling ratio returned=" + RoundSigDigits(PartLoadFrac, 2)); + ShowContinueErrorTimeStamp(state, format("Cycling ratio returned={:.2R}", PartLoadFrac)); } else { ++ErrCountCyc; ShowRecurringWarningErrorAtEnd(state, @@ -3251,8 +3265,7 @@ namespace HVACMultiSpeedHeatPump { ++ErrCountVar; ShowWarningError(state, "Iteration limit exceeded calculating DX unit speed ratio, for unit=" + MSHeatPump(MSHeatPumpNum).Name); - ShowContinueErrorTimeStamp(state, "Speed ratio returned=[" + RoundSigDigits(SpeedRatio, 2) + - "], Speed number =" + RoundSigDigits(SpeedNum)); + ShowContinueErrorTimeStamp(state, format("Speed ratio returned=[{:.2R}], Speed number ={}", SpeedRatio, SpeedNum)); } else { ++ErrCountVar; ShowRecurringWarningErrorAtEnd(state, @@ -3297,7 +3310,7 @@ namespace HVACMultiSpeedHeatPump { ++ErrCountCyc; ShowWarningError(state, "Iteration limit exceeded calculating DX unit cycling ratio, for unit=" + MSHeatPump(MSHeatPumpNum).Name); - ShowContinueErrorTimeStamp(state, "Cycling ratio returned=" + RoundSigDigits(PartLoadFrac, 2)); + ShowContinueErrorTimeStamp(state, format("Cycling ratio returned={:.2R}", PartLoadFrac)); } else { ++ErrCountCyc; ShowRecurringWarningErrorAtEnd(state, @@ -3354,8 +3367,8 @@ namespace HVACMultiSpeedHeatPump { ++ErrCountVar; ShowWarningError(state, "Iteration limit exceeded calculating DX unit speed ratio, for unit=" + MSHeatPump(MSHeatPumpNum).Name); - ShowContinueErrorTimeStamp(state, "Speed ratio returned=[" + RoundSigDigits(SpeedRatio, 2) + - "], Speed number =" + RoundSigDigits(SpeedNum)); + ShowContinueErrorTimeStamp( + state, format("Speed ratio returned=[{:.2R}], Speed number ={}", SpeedRatio, SpeedNum)); } else { ++ErrCountVar; ShowRecurringWarningErrorAtEnd(state, @@ -4349,7 +4362,7 @@ namespace HVACMultiSpeedHeatPump { // Using/Aliasing using DataHVACGlobals::SmallLoad; - using General::RoundSigDigits; + using General::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; @@ -4461,21 +4474,23 @@ namespace HVACMultiSpeedHeatPump { ShowWarningMessage(state, "CalcNonDXHeatingCoils: Hot water coil control failed for " + CurrentModuleObject + "=\"" + MSHeatPump(MSHeatPumpNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(SolveMaxIter) + - "] exceeded in calculating hot water mass flow rate"); + ShowContinueError( + state, format(" Iteration limit [{}] exceeded in calculating hot water mass flow rate", SolveMaxIter)); } - ShowRecurringWarningErrorAtEnd(state, "CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + CurrentModuleObject + "=\"" + - MSHeatPump(MSHeatPumpNum).Name, - MSHeatPump(MSHeatPumpNum).HotWaterCoilMaxIterIndex); + ShowRecurringWarningErrorAtEnd(state, + format("CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [{}]) for {}=\"{}", + SolveMaxIter, + CurrentModuleObject, + MSHeatPump(MSHeatPumpNum).Name), + MSHeatPump(MSHeatPumpNum).HotWaterCoilMaxIterIndex); } else if (SolFlag == -2) { if (MSHeatPump(MSHeatPumpNum).HotWaterCoilMaxIterIndex2 == 0) { ShowWarningMessage(state, "CalcNonDXHeatingCoils: Hot water coil control failed (maximum flow limits) for " + CurrentModuleObject + "=\"" + MSHeatPump(MSHeatPumpNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad hot water maximum flow rate limits"); - ShowContinueError(state, "...Given minimum water flow rate=" + RoundSigDigits(MinWaterFlow, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum water flow rate=" + RoundSigDigits(MaxHotWaterFlow, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum water flow rate={:.3R} kg/s", MinWaterFlow)); + ShowContinueError(state, format("...Given maximum water flow rate={:.3R} kg/s", MaxHotWaterFlow)); } ShowRecurringWarningErrorAtEnd(state, "CalcNonDXHeatingCoils: Hot water coil control failed (flow limits) for " + CurrentModuleObject + "=\"" + MSHeatPump(MSHeatPumpNum).Name + "\"", diff --git a/src/EnergyPlus/HVACSingleDuctInduc.cc b/src/EnergyPlus/HVACSingleDuctInduc.cc index 6535deb0ca2..ff9d235b53e 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.cc +++ b/src/EnergyPlus/HVACSingleDuctInduc.cc @@ -56,11 +56,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include @@ -69,7 +67,6 @@ #include #include #include -#include #include #include #include @@ -185,7 +182,6 @@ namespace HVACSingleDuctInduc { // Using/Aliasing using DataSizing::TermUnitIU; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int IUNum; // index of terminal unit being simulated @@ -206,13 +202,18 @@ namespace HVACSingleDuctInduc { } else { IUNum = CompIndex; if (IUNum > NumIndUnits || IUNum < 1) { - ShowFatalError(state, "SimIndUnit: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + - ", Number of Induction Units=" + TrimSigDigits(NumIndUnits) + ", System name=" + CompName); + ShowFatalError( + state, + format( + "SimIndUnit: Invalid CompIndex passed={}, Number of Induction Units={}, System name={}", CompIndex, NumIndUnits, CompName)); } if (CheckEquipName(IUNum)) { if (CompName != IndUnit(IUNum).Name) { - ShowFatalError(state, "SimIndUnit: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + ", Induction Unit name=" + CompName + - ", stored Induction Unit for that index=" + IndUnit(IUNum).Name); + ShowFatalError(state, + format("SimIndUnit: Invalid CompIndex passed={}, Induction Unit name={}, stored Induction Unit for that index={}", + CompIndex, + CompName, + IndUnit(IUNum).Name)); } CheckEquipName(IUNum) = false; } @@ -275,7 +276,6 @@ namespace HVACSingleDuctInduc { using DataDefineEquip::AirDistUnit; using DataDefineEquip::NumAirDistUnits; using WaterCoils::GetCoilWaterInletNode; - using namespace DataIPShortCuts; using DataPlant::TypeOf_CoilWaterCooling; using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; using DataPlant::TypeOf_CoilWaterSimpleHeating; @@ -764,7 +764,7 @@ namespace HVACSingleDuctInduc { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; using WaterCoils::GetCoilWaterInletNode; using WaterCoils::GetCoilWaterOutletNode; @@ -847,10 +847,9 @@ namespace HVACSingleDuctInduc { if ((std::abs(MaxTotAirVolFlowDes - MaxTotAirVolFlowUser) / MaxTotAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuctInduction: Potential issue with equipment sizing for " + IndUnit(IUNum).UnitType + " = \"" + IndUnit(IUNum).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Total Air Flow Rate of " + RoundSigDigits(MaxTotAirVolFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Total Air Flow Rate of " + - RoundSigDigits(MaxTotAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Total Air Flow Rate of {:.5R} [m3/s]", MaxTotAirVolFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Total Air Flow Rate of {:.5R} [m3/s]", MaxTotAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -947,10 +946,11 @@ namespace HVACSingleDuctInduc { if ((std::abs(MaxVolHotWaterFlowDes - MaxVolHotWaterFlowUser) / MaxVolHotWaterFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuctInduction: Potential issue with equipment sizing for " + IndUnit(IUNum).UnitType + " = \"" + IndUnit(IUNum).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Hot Water Flow Rate of " + RoundSigDigits(MaxVolHotWaterFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Hot Water Flow Rate of " + - RoundSigDigits(MaxVolHotWaterFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Hot Water Flow Rate of {:.5R} [m3/s]", MaxVolHotWaterFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Maximum Hot Water Flow Rate of {:.5R} [m3/s]", MaxVolHotWaterFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1039,10 +1039,11 @@ namespace HVACSingleDuctInduc { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuctInduction: Potential issue with equipment sizing for " + IndUnit(IUNum).UnitType + " = \"" + IndUnit(IUNum).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Cold Water Flow Rate of " + RoundSigDigits(MaxVolColdWaterFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Cold Water Flow Rate of " + - RoundSigDigits(MaxVolColdWaterFlowDes, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Maximum Cold Water Flow Rate of {:.5R} [m3/s]", MaxVolColdWaterFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Maximum Cold Water Flow Rate of {:.5R} [m3/s]", MaxVolColdWaterFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1108,7 +1109,7 @@ namespace HVACSingleDuctInduc { // Using/Aliasing using namespace DataZoneEnergyDemands; using DataPlant::PlantLoop; - using General::RoundSigDigits; + using General::SolveRoot; using PlantUtilities::SetComponentFlowRate; using TempSolveRoot::SolveRoot; @@ -1250,21 +1251,22 @@ namespace HVACSingleDuctInduc { ShowWarningMessage(state, "SimFourPipeIndUnit: Hot water coil control failed for " + IndUnit(IUNum).UnitType + "=\"" + IndUnit(IUNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(SolveMaxIter) + - "] exceeded in calculating hot water mass flow rate"); + ShowContinueError(state, format(" Iteration limit [{}] exceeded in calculating hot water mass flow rate", SolveMaxIter)); } - ShowRecurringWarningErrorAtEnd(state, "SimFourPipeIndUnit: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + IndUnit(IUNum).UnitType + "=\"" + - IndUnit(IUNum).Name + "\"", - IndUnit(IUNum).HWCoilFailNum1); + ShowRecurringWarningErrorAtEnd(state, + format("SimFourPipeIndUnit: Hot water coil control failed (iteration limit [{}]) for {}=\"{}\"", + SolveMaxIter, + IndUnit(IUNum).UnitType, + IndUnit(IUNum).Name), + IndUnit(IUNum).HWCoilFailNum1); } else if (SolFlag == -2) { if (IndUnit(IUNum).HWCoilFailNum2 == 0) { ShowWarningMessage(state, "SimFourPipeIndUnit: Hot water coil control failed (maximum flow limits) for " + IndUnit(IUNum).UnitType + "=\"" + IndUnit(IUNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad hot water maximum flow rate limits"); - ShowContinueError(state, "...Given minimum water flow rate=" + RoundSigDigits(MinHotWaterFlow, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum water flow rate=" + RoundSigDigits(MaxHotWaterFlow, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum water flow rate={:.3R} kg/s", MinHotWaterFlow)); + ShowContinueError(state, format("...Given maximum water flow rate={:.3R} kg/s", MaxHotWaterFlow)); } ShowRecurringWarningErrorAtEnd(state, "SimFourPipeIndUnit: Hot water coil control failed (flow limits) for " + IndUnit(IUNum).UnitType + "=\"" + IndUnit(IUNum).Name + "\"", @@ -1299,12 +1301,13 @@ namespace HVACSingleDuctInduc { ShowWarningMessage(state, "SimFourPipeIndUnit: Cold water coil control failed for " + IndUnit(IUNum).UnitType + "=\"" + IndUnit(IUNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(SolveMaxIter) + - "] exceeded in calculating cold water mass flow rate"); + ShowContinueError(state, + format(" Iteration limit [{}] exceeded in calculating cold water mass flow rate", SolveMaxIter)); } - ShowRecurringWarningErrorAtEnd(state, "SimFourPipeIndUnit: Cold water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + IndUnit(IUNum).UnitType + "=\"" + - IndUnit(IUNum).Name, + ShowRecurringWarningErrorAtEnd(state, format("SimFourPipeIndUnit: Cold water coil control failed (iteration limit [{}]) for {}=\"{}", + SolveMaxIter, + IndUnit(IUNum).UnitType, + IndUnit(IUNum).Name), IndUnit(IUNum).CWCoilFailNum1); } else if (SolFlag == -2) { if (IndUnit(IUNum).CWCoilFailNum2 == 0) { @@ -1312,8 +1315,8 @@ namespace HVACSingleDuctInduc { IndUnit(IUNum).UnitType + "=\"" + IndUnit(IUNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad cold water maximum flow rate limits"); - ShowContinueError(state, "...Given minimum water flow rate=" + RoundSigDigits(MinColdWaterFlow, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum water flow rate=" + RoundSigDigits(MaxColdWaterFlow, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum water flow rate={:.3R} kg/s", MinColdWaterFlow)); + ShowContinueError(state, format("...Given maximum water flow rate={:.3R} kg/s", MaxColdWaterFlow)); } ShowRecurringWarningErrorAtEnd(state, "SimFourPipeIndUnit: Cold water coil control failed (flow limits) for " + IndUnit(IUNum).UnitType + "=\"" + IndUnit(IUNum).Name + "\"", diff --git a/src/EnergyPlus/HVACSizingSimulationManager.cc b/src/EnergyPlus/HVACSizingSimulationManager.cc index d13b5c5495d..221ad153056 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -220,7 +219,7 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) using DataSystemVariables::ReportDuringHVACSizingSimulation; using EMSManager::ManageEMS; using ExteriorEnergyUse::ManageExteriorEnergyUse; - using General::TrimSigDigits; + using PlantPipingSystemsManager::SimulateGroundDomains; using namespace WeatherManager; @@ -315,10 +314,10 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) if (state.dataGlobal->WarmupFlag) { ++NumOfWarmupDays; - cWarmupDay = TrimSigDigits(NumOfWarmupDays); + cWarmupDay = fmt::to_string(NumOfWarmupDays); DisplayString(state, "Warming up {" + cWarmupDay + '}'); } else if (state.dataGlobal->DayOfSim == 1) { - DisplayString(state, "Starting HVAC Sizing Simulation at " + CurMnDy + " for " + EnvironmentName); + DisplayString(state, fmt::format("Starting HVAC Sizing Simulation at {} for {}", CurMnDy, EnvironmentName)); static constexpr auto Format_700("Environment:WarmupDays,{:3}\n"); print(state.files.eio, Format_700, NumOfWarmupDays); } else if (DisplayPerfSimulationFlag) { diff --git a/src/EnergyPlus/HVACStandAloneERV.cc b/src/EnergyPlus/HVACStandAloneERV.cc index 8be8f285d1b..0ac3b927328 100644 --- a/src/EnergyPlus/HVACStandAloneERV.cc +++ b/src/EnergyPlus/HVACStandAloneERV.cc @@ -189,7 +189,6 @@ namespace HVACStandAloneERV { // Manages the simulation of a Stand Alone ERV unit. Called from SimZoneEquipment // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -215,13 +214,19 @@ namespace HVACStandAloneERV { } else { StandAloneERVNum = CompIndex; if (StandAloneERVNum > NumStandAloneERVs || StandAloneERVNum < 1) { - ShowFatalError(state, "SimStandAloneERV: Invalid CompIndex passed=" + TrimSigDigits(StandAloneERVNum) + - ", Number of Units=" + TrimSigDigits(NumStandAloneERVs) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimStandAloneERV: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + StandAloneERVNum, + NumStandAloneERVs, + CompName)); } if (CheckEquipName(StandAloneERVNum)) { if (CompName != StandAloneERV(StandAloneERVNum).Name) { - ShowFatalError(state, "SimStandAloneERV: Invalid CompIndex passed=" + TrimSigDigits(StandAloneERVNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + StandAloneERV(StandAloneERVNum).Name); + ShowFatalError(state, + format("SimStandAloneERV: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + StandAloneERVNum, + CompName, + StandAloneERV(StandAloneERVNum).Name)); } CheckEquipName(StandAloneERVNum) = false; } @@ -262,7 +267,7 @@ namespace HVACStandAloneERV { using Fans::GetFanIndex; using Fans::GetFanOutletNode; using Fans::GetFanType; - using General::RoundSigDigits; + using MixedAir::OAController; using NodeInputManager::GetOnlySingleNode; auto &GetGenericSupplyAirFlowRate(HeatRecovery::GetSupplyAirFlowRate); @@ -668,9 +673,12 @@ namespace HVACStandAloneERV { if (StandAloneERV(StandAloneERVNum).SupplyAirVolFlow > StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate) { ShowWarningError(state, CurrentModuleObject + " = " + StandAloneERV(StandAloneERVNum).Name + " has a " + cNumericFields(1) + " > Max Volume Flow Rate defined in the associated fan object, should be <="); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(StandAloneERV(StandAloneERVNum).SupplyAirVolFlow, 2) + "... Fan [" + - cFanTypes(SAFanTypeNum) + " \"" + StandAloneERV(StandAloneERVNum).SupplyAirFanName + - "\"] Max Value = " + RoundSigDigits(StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate, 2)); + ShowContinueError(state, + format("... Entered value={:.2R}... Fan [{} \"{}\"] Max Value = {:.2R}", + StandAloneERV(StandAloneERVNum).SupplyAirVolFlow, + cFanTypes(SAFanTypeNum), + StandAloneERV(StandAloneERVNum).SupplyAirFanName, + StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate)); ShowContinueError(state, " The ERV " + cNumericFields(1) + " is reset to the supply air fan flow rate and the simulation continues."); StandAloneERV(StandAloneERVNum).SupplyAirVolFlow = StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate; } @@ -679,7 +687,7 @@ namespace HVACStandAloneERV { if (StandAloneERV(StandAloneERVNum).SupplyAirVolFlow <= 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + StandAloneERV(StandAloneERVNum).Name + " has a " + cNumericFields(1) + " <= 0.0, it must be >0.0"); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(StandAloneERV(StandAloneERVNum).SupplyAirVolFlow, 2)); + ShowContinueError(state, format("... Entered value={:.2R}", StandAloneERV(StandAloneERVNum).SupplyAirVolFlow)); ErrorsFound = true; } } else { @@ -702,9 +710,12 @@ namespace HVACStandAloneERV { if (StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow > StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate) { ShowWarningError(state, CurrentModuleObject + " = " + StandAloneERV(StandAloneERVNum).Name + " has an " + cNumericFields(2) + " > Max Volume Flow Rate defined in the associated fan object, should be <="); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow, 2) + "... Fan [" + - cFanTypes(EAFanTypeNum) + ':' + StandAloneERV(StandAloneERVNum).ExhaustAirFanName + - "] Max Value = " + RoundSigDigits(StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate, 2)); + ShowContinueError(state, + format("... Entered value={:.2R}... Fan [{}:{}] Max Value = {:.2R}", + StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow, + cFanTypes(EAFanTypeNum), + StandAloneERV(StandAloneERVNum).ExhaustAirFanName, + StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate)); ShowContinueError(state, " The ERV " + cNumericFields(2) + " is reset to the exhaust air fan flow rate and the simulation continues."); StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow = StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate; } @@ -713,7 +724,7 @@ namespace HVACStandAloneERV { if (StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow <= 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + StandAloneERV(StandAloneERVNum).Name + " has an " + cNumericFields(2) + " <= 0.0, it must be >0.0"); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow, 2)); + ShowContinueError(state, format("... Entered value={:.2R}", StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow)); ErrorsFound = true; } } else { @@ -1039,15 +1050,15 @@ namespace HVACStandAloneERV { StandAloneERV(WhichERV).DesignSAFanVolFlowRate != AutoSize) { if (StandAloneERV(WhichERV).SupplyAirVolFlow * HighRHOARatio > StandAloneERV(WhichERV).DesignSAFanVolFlowRate) { ShowWarningError(state, CurrentModuleObject + " \"" + Alphas(1) + "\""); - ShowContinueError(state, "... A " + cNumericFields(5) + " was entered as " + RoundSigDigits(HighRHOARatio, 4)); + ShowContinueError(state, format("... A {} was entered as {:.4R}", cNumericFields(5), HighRHOARatio)); ShowContinueError(state, "... This flow ratio results in a Supply Air Volume Flow Rate through the ERV which is greater than the " "Max Volume specified in the supply air fan object."); ShowContinueError(state, "... Associated fan object = " + cFanTypes(SAFanTypeNum) + " \"" + StandAloneERV(WhichERV).SupplyAirFanName + "\""); - ShowContinueError(state, "... Modified value = " + - RoundSigDigits(StandAloneERV(WhichERV).SupplyAirVolFlow * HighRHOARatio, 2)); - ShowContinueError(state, " ... Supply Fan Max Volume Flow Rate = " + - RoundSigDigits(StandAloneERV(WhichERV).DesignSAFanVolFlowRate, 2)); + ShowContinueError( + state, format("... Modified value = {:.2R}", StandAloneERV(WhichERV).SupplyAirVolFlow * HighRHOARatio)); + ShowContinueError(state, + format(" ... Supply Fan Max Volume Flow Rate = {:.2R}", StandAloneERV(WhichERV).DesignSAFanVolFlowRate)); ShowContinueError(state, "... The ERV supply air fan will limit the air flow through the ERV and the simulation continues."); } } @@ -1057,15 +1068,16 @@ namespace HVACStandAloneERV { StandAloneERV(WhichERV).DesignEAFanVolFlowRate != AutoSize) { if (StandAloneERV(WhichERV).ExhaustAirVolFlow * HighRHOARatio > StandAloneERV(WhichERV).DesignEAFanVolFlowRate) { ShowWarningError(state, "ZoneHVAC:EnergyRecoveryVentilator:Controller \"" + Alphas(1) + "\""); - ShowContinueError(state, "... A " + cNumericFields(5) + " was entered as " + RoundSigDigits(HighRHOARatio, 4)); + ShowContinueError(state, format("... A {} was entered as {:.4R}", cNumericFields(5), HighRHOARatio)); ShowContinueError(state, "... This flow ratio results in an Exhaust Air Volume Flow Rate through the ERV which is greater than the " "Max Volume specified in the exhaust air fan object."); ShowContinueError(state, "... Associated fan object = " + cFanTypes(EAFanTypeNum) + " \"" + StandAloneERV(WhichERV).ExhaustAirFanName + "\""); - ShowContinueError(state, "... Modified value = " + - RoundSigDigits(StandAloneERV(WhichERV).ExhaustAirVolFlow * HighRHOARatio, 2)); - ShowContinueError(state, " ... Exhaust Fan Max Volume Flow Rate = " + - RoundSigDigits(StandAloneERV(WhichERV).DesignEAFanVolFlowRate, 2)); + ShowContinueError( + state, + format("... Modified value = {:.2R}", StandAloneERV(WhichERV).ExhaustAirVolFlow * HighRHOARatio)); + ShowContinueError(state, + format(" ... Exhaust Fan Max Volume Flow Rate = {:.2R}", StandAloneERV(WhichERV).DesignEAFanVolFlowRate)); ShowContinueError(state, "... The ERV exhaust air fan will limit the air flow through the ERV and the simulation continues."); } } @@ -1398,7 +1410,7 @@ namespace HVACStandAloneERV { using DataZoneEquipment::ZoneEquipConfig; using Fans::SetFanData; using Fans::SimulateFanComponents; - using General::RoundSigDigits; + using HeatRecovery::SetHeatExchangerData; using MixedAir::OAController; using ScheduleManager::GetScheduleMaxValue; @@ -1557,9 +1569,8 @@ namespace HVACStandAloneERV { ShowMessage(state, "SizeStandAloneERV: Potential issue with equipment sizing for ZoneHVAC:EnergyRecoveryVentilator " + cFanTypes(StandAloneERV(StandAloneERVNum).SupplyAirFanType_Num) + ' ' + StandAloneERV(StandAloneERVNum).SupplyAirFanName); - ShowContinueError(state, "User-Specified Supply Fan Maximum Flow Rate of " + RoundSigDigits(DesignSAFanVolFlowRateUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from the ERV Supply Air Flow Rate of " + RoundSigDigits(DesignSAFanVolFlowRateDes, 5) + " [m3/s]"); + ShowContinueError(state, format("User-Specified Supply Fan Maximum Flow Rate of {:.5R} [m3/s]", DesignSAFanVolFlowRateUser)); + ShowContinueError(state, format("differs from the ERV Supply Air Flow Rate of {:.5R} [m3/s]", DesignSAFanVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1613,7 +1624,7 @@ namespace HVACStandAloneERV { using DataHeatBalance::ZoneAirMassFlow; using DataZoneEquipment::ZoneEquipConfig; using Fans::SimulateFanComponents; - using General::RoundSigDigits; + using HeatRecovery::SimHeatRecovery; using MixedAir::OAController; @@ -1777,8 +1788,8 @@ namespace HVACStandAloneERV { if (TotalExhaustMassFlow > TotalSupplyMassFlow && !ZoneAirMassFlow.EnforceZoneMassBalance) { ShowWarningError(state, "For " + StandAloneERV(StandAloneERVNum).UnitType + " \"" + StandAloneERV(StandAloneERVNum).Name + "\" there is unbalanced exhaust air flow."); - ShowContinueError(state, "... The exhaust air mass flow rate = " + RoundSigDigits(Node(ExhaustInletNode).MassFlowRate, 6)); - ShowContinueError(state, "... The supply air mass flow rate = " + RoundSigDigits(Node(SupInletNode).MassFlowRate, 6)); + ShowContinueError(state, format("... The exhaust air mass flow rate = {:.6R}", Node(ExhaustInletNode).MassFlowRate)); + ShowContinueError(state, format("... The supply air mass flow rate = {:.6R}", Node(SupInletNode).MassFlowRate)); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "... Unless there is balancing infiltration / ventilation air flow, this will result in"); ShowContinueError(state, "... load due to induced outside air being neglected in the simulation."); diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index a58d4d5a4ed..0df08170899 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -235,13 +235,18 @@ namespace HVACUnitaryBypassVAV { } else { CBVAVNum = CompIndex; if (CBVAVNum > NumCBVAV || CBVAVNum < 1) { - ShowFatalError(state, "SimUnitaryBypassVAV: Invalid CompIndex passed=" + General::TrimSigDigits(CBVAVNum) + - ", Number of Units=" + General::TrimSigDigits(NumCBVAV) + ", Entered Unit name=" + CompName); + ShowFatalError( + state, + format( + "SimUnitaryBypassVAV: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", CBVAVNum, NumCBVAV, CompName)); } if (CheckEquipName(CBVAVNum)) { if (CompName != CBVAV(CBVAVNum).Name) { - ShowFatalError(state, "SimUnitaryBypassVAV: Invalid CompIndex passed=" + General::TrimSigDigits(CBVAVNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + CBVAV(CBVAVNum).Name); + ShowFatalError(state, + format("SimUnitaryBypassVAV: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + CBVAVNum, + CompName, + CBVAV(CBVAVNum).Name)); } CheckEquipName(CBVAVNum) = false; } @@ -454,7 +459,7 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).MaxCoolAirVolFlow = Numbers(1); if (CBVAV(CBVAVNum).MaxCoolAirVolFlow <= 0.0 && CBVAV(CBVAVNum).MaxCoolAirVolFlow != DataSizing::AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(1) + " = " + General::TrimSigDigits(Numbers(1), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(1), Numbers(1))); ShowContinueError(state, cNumericFields(1) + " must be greater than zero."); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + CBVAV(CBVAVNum).Name); ErrorsFound = true; @@ -462,7 +467,7 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).MaxHeatAirVolFlow = Numbers(2); if (CBVAV(CBVAVNum).MaxHeatAirVolFlow <= 0.0 && CBVAV(CBVAVNum).MaxHeatAirVolFlow != DataSizing::AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(2) + " = " + General::TrimSigDigits(Numbers(2), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(2), Numbers(2))); ShowContinueError(state, cNumericFields(2) + " must be greater than zero."); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + CBVAV(CBVAVNum).Name); ErrorsFound = true; @@ -470,7 +475,7 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow = Numbers(3); if (CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow < 0.0 && CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow != DataSizing::AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(3) + " = " + General::TrimSigDigits(Numbers(3), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(3), Numbers(3))); ShowContinueError(state, cNumericFields(3) + " must be greater than or equal to zero."); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + CBVAV(CBVAVNum).Name); ErrorsFound = true; @@ -478,7 +483,7 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).CoolOutAirVolFlow = Numbers(4); if (CBVAV(CBVAVNum).CoolOutAirVolFlow < 0.0 && CBVAV(CBVAVNum).CoolOutAirVolFlow != DataSizing::AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(4) + " = " + General::TrimSigDigits(Numbers(4), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(4), Numbers(4))); ShowContinueError(state, cNumericFields(4) + " must be greater than or equal to zero."); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + CBVAV(CBVAVNum).Name); ErrorsFound = true; @@ -486,7 +491,7 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).HeatOutAirVolFlow = Numbers(5); if (CBVAV(CBVAVNum).HeatOutAirVolFlow < 0.0 && CBVAV(CBVAVNum).HeatOutAirVolFlow != DataSizing::AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(5) + " = " + General::TrimSigDigits(Numbers(5), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(5), Numbers(5))); ShowContinueError(state, cNumericFields(5) + " must be greater than or equal to zero."); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + CBVAV(CBVAVNum).Name); ErrorsFound = true; @@ -494,7 +499,7 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).NoCoolHeatOutAirVolFlow = Numbers(6); if (CBVAV(CBVAVNum).NoCoolHeatOutAirVolFlow < 0.0 && CBVAV(CBVAVNum).NoCoolHeatOutAirVolFlow != DataSizing::AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(6) + " = " + General::TrimSigDigits(Numbers(6), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(6), Numbers(6))); ShowContinueError(state, cNumericFields(6) + " must be greater than or equal to zero."); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + CBVAV(CBVAVNum).Name); ErrorsFound = true; @@ -697,15 +702,25 @@ namespace HVACUnitaryBypassVAV { if (CBVAV(CBVAVNum).FanVolFlow != DataSizing::AutoSize) { if (CBVAV(CBVAVNum).FanVolFlow < CBVAV(CBVAVNum).MaxCoolAirVolFlow && CBVAV(CBVAVNum).MaxCoolAirVolFlow != DataSizing::AutoSize) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(CBVAV(CBVAVNum).FanVolFlow, 7) + " in " + - cAlphaFields(11) + " = " + CBVAV(CBVAVNum).FanName + " is less than the " + cNumericFields(1)); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in {} = {} is less than the ", + CurrentModuleObject, + CBVAV(CBVAVNum).FanVolFlow, + cAlphaFields(11), + CBVAV(CBVAVNum).FanName) + + cNumericFields(1)); ShowContinueError(state, ' ' + cNumericFields(1) + " is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + CBVAV(CBVAVNum).Name); CBVAV(CBVAVNum).MaxCoolAirVolFlow = CBVAV(CBVAVNum).FanVolFlow; } if (CBVAV(CBVAVNum).FanVolFlow < CBVAV(CBVAVNum).MaxHeatAirVolFlow && CBVAV(CBVAVNum).MaxHeatAirVolFlow != DataSizing::AutoSize) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(CBVAV(CBVAVNum).FanVolFlow, 7) + " in " + - cAlphaFields(11) + " = " + CBVAV(CBVAVNum).FanName + " is less than the " + cNumericFields(2)); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in {} = {} is less than the ", + CurrentModuleObject, + CBVAV(CBVAVNum).FanVolFlow, + cAlphaFields(11), + CBVAV(CBVAVNum).FanName) + + cNumericFields(2)); ShowContinueError(state, ' ' + cNumericFields(2) + " is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + CBVAV(CBVAVNum).Name); CBVAV(CBVAVNum).MaxHeatAirVolFlow = CBVAV(CBVAVNum).FanVolFlow; @@ -908,8 +923,13 @@ namespace HVACUnitaryBypassVAV { if (CBVAV(CBVAVNum).FanVolFlow != DataSizing::AutoSize) { if (CBVAV(CBVAVNum).FanVolFlow < CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow && CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow != DataSizing::AutoSize && CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow != 0.0) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(CBVAV(CBVAVNum).FanVolFlow, 7) + " in " + - cAlphaFields(11) + " = " + CBVAV(CBVAVNum).FanName + " is less than " + cNumericFields(3)); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in {} = {} is less than ", + CurrentModuleObject, + CBVAV(CBVAVNum).FanVolFlow, + cAlphaFields(11), + CBVAV(CBVAVNum).FanName) + + cNumericFields(3)); ShowContinueError(state, ' ' + cNumericFields(3) + " is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + CBVAV(CBVAVNum).Name); CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow = CBVAV(CBVAVNum).FanVolFlow; @@ -1646,30 +1666,39 @@ namespace HVACUnitaryBypassVAV { if (!state.dataGlobal->DoingSizing && CBVAV(CBVAVNum).FanVolFlow != DataSizing::AutoSize) { // Check fan versus system supply air flow rates if (CBVAV(CBVAVNum).FanVolFlow < CBVAV(CBVAVNum).MaxCoolAirVolFlow) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(CBVAV(CBVAVNum).FanVolFlow, 7) + - " in fan object " + CBVAV(CBVAVNum).FanName + - " is less than the maximum CBVAV system air flow rate when cooling is required (" + - General::TrimSigDigits(CBVAV(CBVAVNum).MaxCoolAirVolFlow, 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the maximum CBVAV system air flow rate when " + "cooling is required ({:.7T}).", + CurrentModuleObject, + CBVAV(CBVAVNum).FanVolFlow, + CBVAV(CBVAVNum).FanName, + CBVAV(CBVAVNum).MaxCoolAirVolFlow)); ShowContinueError(state, " The CBVAV system flow rate when cooling is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in Changeover-bypass VAV system = " + CBVAV(CBVAVNum).Name); CBVAV(CBVAVNum).MaxCoolAirVolFlow = CBVAV(CBVAVNum).FanVolFlow; } if (CBVAV(CBVAVNum).FanVolFlow < CBVAV(CBVAVNum).MaxHeatAirVolFlow) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(CBVAV(CBVAVNum).FanVolFlow, 7) + - " in fan object " + CBVAV(CBVAVNum).FanName + - " is less than the maximum CBVAV system air flow rate when heating is required (" + - General::TrimSigDigits(CBVAV(CBVAVNum).MaxHeatAirVolFlow, 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the maximum CBVAV system air flow rate when " + "heating is required ({:.7T}).", + CurrentModuleObject, + CBVAV(CBVAVNum).FanVolFlow, + CBVAV(CBVAVNum).FanName, + CBVAV(CBVAVNum).MaxHeatAirVolFlow)); ShowContinueError(state, " The CBVAV system flow rate when heating is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in Changeover-bypass VAV system = " + CBVAV(CBVAVNum).Name); CBVAV(CBVAVNum).MaxHeatAirVolFlow = CBVAV(CBVAVNum).FanVolFlow; } if (CBVAV(CBVAVNum).FanVolFlow < CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow && CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow != 0.0) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(CBVAV(CBVAVNum).FanVolFlow, 7) + - " in fan object " + CBVAV(CBVAVNum).FanName + - " is less than the maximum CBVAV system air flow rate when no heating or cooling is needed (" + - General::TrimSigDigits(CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow, 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the maximum CBVAV system air flow rate when " + "no heating or cooling is needed ({:.7T}).", + CurrentModuleObject, + CBVAV(CBVAVNum).FanVolFlow, + CBVAV(CBVAVNum).FanName, + CBVAV(CBVAVNum).MaxNoCoolHeatAirVolFlow)); ShowContinueError(state, " The CBVAV system flow rate when no heating or cooling is needed is reset to the fan flow rate and the " "simulation continues."); ShowContinueError(state, " Occurs in Changeover-bypass VAV system = " + CBVAV(CBVAVNum).Name); @@ -1677,30 +1706,39 @@ namespace HVACUnitaryBypassVAV { } // Check fan versus outdoor air flow rates if (CBVAV(CBVAVNum).FanVolFlow < CBVAV(CBVAVNum).CoolOutAirVolFlow) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(CBVAV(CBVAVNum).FanVolFlow, 7) + - " in fan object " + CBVAV(CBVAVNum).FanName + - " is less than the maximum CBVAV outdoor air flow rate when cooling is required (" + - General::TrimSigDigits(CBVAV(CBVAVNum).CoolOutAirVolFlow, 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the maximum CBVAV outdoor air flow rate when " + "cooling is required ({:.7T}).", + CurrentModuleObject, + CBVAV(CBVAVNum).FanVolFlow, + CBVAV(CBVAVNum).FanName, + CBVAV(CBVAVNum).CoolOutAirVolFlow)); ShowContinueError(state, " The CBVAV outdoor flow rate when cooling is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in Changeover-bypass VAV system = " + CBVAV(CBVAVNum).Name); CBVAV(CBVAVNum).CoolOutAirVolFlow = CBVAV(CBVAVNum).FanVolFlow; } if (CBVAV(CBVAVNum).FanVolFlow < CBVAV(CBVAVNum).HeatOutAirVolFlow) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(CBVAV(CBVAVNum).FanVolFlow, 7) + - " in fan object " + CBVAV(CBVAVNum).FanName + - " is less than the maximum CBVAV outdoor air flow rate when heating is required (" + - General::TrimSigDigits(CBVAV(CBVAVNum).HeatOutAirVolFlow, 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the maximum CBVAV outdoor air flow rate when " + "heating is required ({:.7T}).", + CurrentModuleObject, + CBVAV(CBVAVNum).FanVolFlow, + CBVAV(CBVAVNum).FanName, + CBVAV(CBVAVNum).HeatOutAirVolFlow)); ShowContinueError(state, " The CBVAV outdoor flow rate when heating is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in Changeover-bypass VAV system = " + CBVAV(CBVAVNum).Name); CBVAV(CBVAVNum).HeatOutAirVolFlow = CBVAV(CBVAVNum).FanVolFlow; } if (CBVAV(CBVAVNum).FanVolFlow < CBVAV(CBVAVNum).NoCoolHeatOutAirVolFlow) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(CBVAV(CBVAVNum).FanVolFlow, 7) + - " in fan object " + CBVAV(CBVAVNum).FanName + - " is less than the maximum CBVAV outdoor air flow rate when no heating or cooling is needed (" + - General::TrimSigDigits(CBVAV(CBVAVNum).NoCoolHeatOutAirVolFlow, 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the maximum CBVAV outdoor air flow rate when " + "no heating or cooling is needed ({:.7T}).", + CurrentModuleObject, + CBVAV(CBVAVNum).FanVolFlow, + CBVAV(CBVAVNum).FanName, + CBVAV(CBVAVNum).NoCoolHeatOutAirVolFlow)); ShowContinueError(state, " The CBVAV outdoor flow rate when no heating or cooling is needed is reset to the fan flow rate and the " "simulation continues."); ShowContinueError(state, " Occurs in Changeover-bypass VAV system = " + CBVAV(CBVAVNum).Name); @@ -2303,7 +2341,7 @@ namespace HVACUnitaryBypassVAV { ++CBVAV(CBVAVNum).HXDXIterationExceeded; ShowWarningError(state, "Iteration limit exceeded calculating HX assisted DX unit part-load ratio, for unit = " + CBVAV(CBVAVNum).DXCoolCoilName); - ShowContinueError(state, "Calculated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -2324,8 +2362,10 @@ namespace HVACUnitaryBypassVAV { ShowSevereError(state, "HX assisted DX unit part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + CBVAV(CBVAVNum).DXCoolCoilName); - ShowContinueErrorTimeStamp(state, "An estimated part-load ratio of " + General::RoundSigDigits(PartLoadFrac, 3) + - "will be used and the simulation continues. Occurrence info:"); + ShowContinueErrorTimeStamp( + state, + format("An estimated part-load ratio of {:.3R}will be used and the simulation continues. Occurrence info:", + PartLoadFrac)); } else { ShowRecurringWarningErrorAtEnd(state, CBVAV(CBVAVNum).Name + ", Part-load ratio calculation failed for HX assisted DX unit error continues.", @@ -2373,7 +2413,7 @@ namespace HVACUnitaryBypassVAV { ++CBVAV(CBVAVNum).DXIterationExceeded; ShowWarningError(state, "Iteration limit exceeded calculating DX unit part-load ratio, for unit = " + CBVAV(CBVAVNum).DXCoolCoilName); - ShowContinueError(state, "Calculated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -2393,8 +2433,10 @@ namespace HVACUnitaryBypassVAV { ++CBVAV(CBVAVNum).DXIterationFailed; ShowSevereError(state, "DX unit part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + CBVAV(CBVAVNum).DXCoolCoilName); - ShowContinueErrorTimeStamp(state, "An estimated part-load ratio of " + General::RoundSigDigits(PartLoadFrac, 3) + - "will be used and the simulation continues. Occurrence info:"); + ShowContinueErrorTimeStamp( + state, + format("An estimated part-load ratio of {:.3R}will be used and the simulation continues. Occurrence info:", + PartLoadFrac)); } else { ShowRecurringWarningErrorAtEnd(state, CBVAV(CBVAVNum).Name + ", Part-load ratio calculation failed for DX unit error continues.", @@ -2591,7 +2633,7 @@ namespace HVACUnitaryBypassVAV { ShowWarningError(state, CBVAV(CBVAVNum).DXCoolCoilType + " - Iteration limit exceeded calculating VS DX coil speed ratio for coil named " + CBVAV(CBVAVNum).DXCoolCoilName + ", in Unitary system named" + CBVAV(CBVAVNum).Name); - ShowContinueError(state, "Calculated speed ratio = " + General::RoundSigDigits(SpeedRatio, 4)); + ShowContinueError(state, format("Calculated speed ratio = {:.4R}", SpeedRatio)); ShowContinueErrorTimeStamp(state, "The calculated speed ratio will be used and the simulation continues. Occurrence info:"); } @@ -2610,8 +2652,7 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).DXCoolCoilType + " - DX unit speed ratio calculation failed: solver limits exceeded, for coil named " + CBVAV(CBVAVNum).DXCoolCoilName + ", in Unitary system named" + CBVAV(CBVAVNum).Name); - ShowContinueError(state, "Estimated speed ratio = " + - General::RoundSigDigits(TempSpeedReqst / TempSpeedOut, 3)); + ShowContinueError(state, format("Estimated speed ratio = {:.3R}", TempSpeedReqst / TempSpeedOut)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -2639,9 +2680,9 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).DXCoolCoilType + " - Iteration limit exceeded calculating VS DX unit low speed cycling ratio, for coil named " + CBVAV(CBVAVNum).DXCoolCoilName + ", in Unitary system named" + CBVAV(CBVAVNum).Name); - ShowContinueError(state, "Estimated cycling ratio = " + - General::RoundSigDigits((TempSpeedReqst / TempSpeedOut), 3)); - ShowContinueError(state, "Calculated cycling ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, + format("Estimated cycling ratio = {:.3R}", (TempSpeedReqst / TempSpeedOut))); + ShowContinueError(state, format("Calculated cycling ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated cycling ratio will be used and the simulation continues. Occurrence info:"); } @@ -2661,8 +2702,8 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).DXCoolCoilType + " - DX unit low speed cycling ratio calculation failed: limits exceeded, for unit = " + CBVAV(CBVAVNum).Name); - ShowContinueError(state, "Estimated low speed cycling ratio = " + - General::RoundSigDigits(TempSpeedReqst / TempSpeedOut, 3)); + ShowContinueError( + state, format("Estimated low speed cycling ratio = {:.3R}", TempSpeedReqst / TempSpeedOut)); ShowContinueErrorTimeStamp(state, "The estimated low speed cycling ratio will be used and the simulation " "continues. Occurrence info:"); } @@ -2732,7 +2773,7 @@ namespace HVACUnitaryBypassVAV { ++CBVAV(CBVAVNum).MMDXIterationExceeded; ShowWarningError(state, "Iteration limit exceeded calculating DX unit part-load ratio, for unit=" + CBVAV(CBVAVNum).Name); - ShowContinueErrorTimeStamp(state, "Part-load ratio returned = " + General::RoundSigDigits(PartLoadFrac, 2)); + ShowContinueErrorTimeStamp(state, format("Part-load ratio returned = {:.2R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -2752,7 +2793,7 @@ namespace HVACUnitaryBypassVAV { ++CBVAV(CBVAVNum).MMDXIterationFailed; ShowSevereError(state, "DX unit part-load ratio calculation failed: part-load ratio limits exceeded, for unit=" + CBVAV(CBVAVNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -2802,7 +2843,7 @@ namespace HVACUnitaryBypassVAV { ++CBVAV(CBVAVNum).DMDXIterationExceeded; ShowWarningError(state, "Iteration limit exceeded calculating DX unit dehumidifying part-load ratio, for unit = " + CBVAV(CBVAVNum).Name); - ShowContinueErrorTimeStamp(state, "Part-load ratio returned=" + General::RoundSigDigits(PartLoadFrac, 2)); + ShowContinueErrorTimeStamp(state, format("Part-load ratio returned={:.2R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -2825,7 +2866,7 @@ namespace HVACUnitaryBypassVAV { ShowSevereError(state, "DX unit dehumidifying part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + CBVAV(CBVAVNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -2887,7 +2928,7 @@ namespace HVACUnitaryBypassVAV { ++CBVAV(CBVAVNum).CRDXIterationExceeded; ShowWarningError(state, "Iteration limit exceeded calculating DX unit cool reheat part-load ratio, for unit = " + CBVAV(CBVAVNum).Name); - ShowContinueErrorTimeStamp(state, "Part-load ratio returned = " + General::RoundSigDigits(PartLoadFrac, 2)); + ShowContinueErrorTimeStamp(state, format("Part-load ratio returned = {:.2R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -2910,7 +2951,7 @@ namespace HVACUnitaryBypassVAV { ShowSevereError(state, "DX unit cool reheat part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + CBVAV(CBVAVNum).Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { @@ -3087,14 +3128,15 @@ namespace HVACUnitaryBypassVAV { if (SolFla == -1 && !state.dataGlobal->WarmupFlag) { ShowWarningError(state, "Iteration limit exceeded calculating DX unit part-load ratio, for unit = " + CBVAV(CBVAVNum).HeatCoilName); - ShowContinueError(state, "Calculated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else if (SolFla == -2 && !state.dataGlobal->WarmupFlag) { ShowSevereError(state, "DX unit part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + CBVAV(CBVAVNum).HeatCoilName); - ShowContinueErrorTimeStamp(state, "A part-load ratio of " + General::RoundSigDigits(PartLoadFrac, 3) + - "will be used and the simulation continues. Occurrence info:"); + ShowContinueErrorTimeStamp( + state, + format("A part-load ratio of {:.3R}will be used and the simulation continues. Occurrence info:", PartLoadFrac)); ShowContinueError(state, "Please send this information to the EnergyPlus support group."); } } @@ -3303,7 +3345,7 @@ namespace HVACUnitaryBypassVAV { ShowWarningError(state, CBVAV(CBVAVNum).HeatCoilType + " - Iteration limit exceeded calculating VS DX coil speed ratio for coil named " + CBVAV(CBVAVNum).HeatCoilName + ", in Unitary system named" + CBVAV(CBVAVNum).Name); - ShowContinueError(state, "Calculated speed ratio = " + General::RoundSigDigits(SpeedRatio, 4)); + ShowContinueError(state, format("Calculated speed ratio = {:.4R}", SpeedRatio)); ShowContinueErrorTimeStamp(state, "The calculated speed ratio will be used and the simulation continues. Occurrence info:"); } @@ -3362,8 +3404,8 @@ namespace HVACUnitaryBypassVAV { CBVAV(CBVAVNum).HeatCoilType + " - Iteration limit exceeded calculating VS DX unit low speed cycling ratio, for coil named " + CBVAV(CBVAVNum).HeatCoilName + ", in Unitary system named" + CBVAV(CBVAVNum).Name); - ShowContinueError(state, "Estimated cycling ratio = " + General::RoundSigDigits((DesOutTemp / TempSpeedOut), 3)); - ShowContinueError(state, "Calculated cycling ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated cycling ratio = {:.3R}", (DesOutTemp / TempSpeedOut))); + ShowContinueError(state, format("Calculated cycling ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated cycling ratio will be used and the simulation continues. Occurrence info:"); } @@ -3383,8 +3425,8 @@ namespace HVACUnitaryBypassVAV { " - DX unit low speed cycling ratio calculation failed: limits exceeded, for unit = " + CBVAV(CBVAVNum).Name); ShowContinueError(state, - "Estimated low speed cycling ratio = " + - General::RoundSigDigits((DesOutTemp - TempNoOutput) / (TempSpeedOutSpeed1 - TempNoOutput), 3)); + format("Estimated low speed cycling ratio = {:.3R}", + (DesOutTemp - TempNoOutput) / (TempSpeedOutSpeed1 - TempNoOutput))); ShowContinueErrorTimeStamp(state, "The estimated low speed cycling ratio will be used and the simulation continues. Occurrence info:"); } @@ -4063,21 +4105,23 @@ namespace HVACUnitaryBypassVAV { ShowWarningMessage(state, "CalcNonDXHeatingCoils: Hot water coil control failed for " + CBVAV(CBVAVNum).UnitType + "=\"" + CBVAV(CBVAVNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + General::RoundSigDigits(SolveMaxIter) + - "] exceeded in calculating hot water mass flow rate"); + ShowContinueError(state, + format(" Iteration limit [{}] exceeded in calculating hot water mass flow rate", SolveMaxIter)); } - ShowRecurringWarningErrorAtEnd(state, "CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [" + - General::RoundSigDigits(SolveMaxIter) + "]) for " + CBVAV(CBVAVNum).UnitType + "=\"" + - CBVAV(CBVAVNum).Name, - CBVAV(CBVAVNum).HotWaterCoilMaxIterIndex); + ShowRecurringWarningErrorAtEnd(state, + format("CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [{}]) for {}=\"{}", + SolveMaxIter, + CBVAV(CBVAVNum).UnitType, + CBVAV(CBVAVNum).Name), + CBVAV(CBVAVNum).HotWaterCoilMaxIterIndex); } else if (SolFlag == -2) { if (CBVAV(CBVAVNum).HotWaterCoilMaxIterIndex2 == 0) { ShowWarningMessage(state, "CalcNonDXHeatingCoils: Hot water coil control failed (maximum flow limits) for " + CBVAV(CBVAVNum).UnitType + "=\"" + CBVAV(CBVAVNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad hot water maximum flow rate limits"); - ShowContinueError(state, "...Given minimum water flow rate=" + General::RoundSigDigits(MinWaterFlow, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum water flow rate=" + General::RoundSigDigits(MaxHotWaterFlow, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum water flow rate={:.3R} kg/s", MinWaterFlow)); + ShowContinueError(state, format("...Given maximum water flow rate={:.3R} kg/s", MaxHotWaterFlow)); } ShowRecurringWarningErrorAtEnd(state, "CalcNonDXHeatingCoils: Hot water coil control failed (flow limits) for " + CBVAV(CBVAVNum).UnitType + "=\"" + CBVAV(CBVAVNum).Name + "\"", diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 4486bc1819d..a6f8e682aed 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -66,7 +66,6 @@ #include #include #include -#include #include #include #include @@ -258,7 +257,6 @@ namespace HVACVariableRefrigerantFlow { using DXCoils::DXCoilTotalCooling; using DXCoils::DXCoilTotalHeating; - using General::TrimSigDigits; int VRFTUNum; // current VRF system terminal unit index int VRFCondenser; // index to VRF AC system object - AirConditioner:VariableRefrigerantFlow @@ -293,13 +291,19 @@ namespace HVACVariableRefrigerantFlow { } else { VRFTUNum = CompIndex; if (VRFTUNum > NumVRFTU || VRFTUNum < 1) { - ShowFatalError(state, "SimulateVRF: Invalid CompIndex passed=" + TrimSigDigits(VRFTUNum) + - ", Number of VRF Terminal Units = " + TrimSigDigits(NumVRFTU) + ", VRF Terminal Unit name = " + CompName); + ShowFatalError(state, + format("SimulateVRF: Invalid CompIndex passed={}, Number of VRF Terminal Units = {}, VRF Terminal Unit name = {}", + VRFTUNum, + NumVRFTU, + CompName)); } if (CheckEquipName(VRFTUNum)) { if (!CompName.empty() && CompName != VRFTU(VRFTUNum).Name) { - ShowFatalError(state, "SimulateVRF: Invalid CompIndex passed=" + TrimSigDigits(VRFTUNum) + ", VRF Terminal Unit name=" + CompName + - ", stored VRF TU Name for that index=" + VRFTU(VRFTUNum).Name); + ShowFatalError(state, + format("SimulateVRF: Invalid CompIndex passed={}, VRF Terminal Unit name={}, stored VRF TU Name for that index={}", + VRFTUNum, + CompName, + VRFTU(VRFTUNum).Name)); } CheckEquipName(VRFTUNum) = false; } @@ -431,7 +435,8 @@ namespace HVACVariableRefrigerantFlow { [[maybe_unused]] bool RunFlag) { if (calledFromLocation.loopNum == this->SourceLoopNum) { // condenser loop - PlantUtilities::UpdateChillerComponentCondenserSide(state, this->SourceLoopNum, + PlantUtilities::UpdateChillerComponentCondenserSide(state, + this->SourceLoopNum, this->SourceLoopSideNum, TypeOf_HeatPumpVRF, this->CondenserNodeNum, @@ -469,7 +474,7 @@ namespace HVACVariableRefrigerantFlow { using DXCoils::DXCoilHeatInletAirDBTemp; using DXCoils::DXCoilHeatInletAirWBTemp; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using Psychrometrics::RhoH2O; @@ -715,10 +720,14 @@ namespace HVACVariableRefrigerantFlow { if (!state.dataGlobal->WarmupFlag && NumTUInCoolingMode > 0) { if (VRF(VRFCond).CoolCapFTErrorIndex == 0) { ShowSevereMessage(state, cVRFTypes(VRF_HeatPump) + " \"" + VRF(VRFCond).Name + "\":"); - ShowContinueError(state, " Cooling Capacity Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(TotCoolCapTempModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an outdoor air temperature of " + TrimSigDigits(CondInletTemp, 1) + - " C and an average indoor air wet-bulb temperature of " + TrimSigDigits(InletAirWetBulbC, 1) + " C."); + ShowContinueError( + state, + format(" Cooling Capacity Modifier curve (function of temperature) output is negative ({:.3T}).", TotCoolCapTempModFac)); + ShowContinueError(state, + format(" Negative value occurs using an outdoor air temperature of {:.1T} C and an average indoor air " + "wet-bulb temperature of {:.1T} C.", + CondInletTemp, + InletAirWetBulbC)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -736,10 +745,14 @@ namespace HVACVariableRefrigerantFlow { if (!state.dataGlobal->WarmupFlag && NumTUInCoolingMode > 0) { if (VRF(VRFCond).EIRFTempCoolErrorIndex == 0) { ShowSevereMessage(state, cVRFTypes(VRF_HeatPump) + " \"" + VRF(VRFCond).Name + "\":"); - ShowContinueError(state, " Cooling Energy Input Ratio Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(TotCoolEIRTempModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an outdoor air temperature of " + TrimSigDigits(CondInletTemp, 1) + - " C and an average indoor air wet-bulb temperature of " + TrimSigDigits(InletAirWetBulbC, 1) + " C."); + ShowContinueError(state, + format(" Cooling Energy Input Ratio Modifier curve (function of temperature) output is negative ({:.3T}).", + TotCoolEIRTempModFac)); + ShowContinueError(state, + format(" Negative value occurs using an outdoor air temperature of {:.1T} C and an average indoor air " + "wet-bulb temperature of {:.1T} C.", + CondInletTemp, + InletAirWetBulbC)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -766,10 +779,14 @@ namespace HVACVariableRefrigerantFlow { if (!state.dataGlobal->WarmupFlag && NumTUInCoolingMode > 0) { if (VRF(VRFCond).CoolCapFTErrorIndex == 0) { ShowSevereMessage(state, cVRFTypes(VRF_HeatPump) + " \"" + VRF(VRFCond).Name + "\":"); - ShowContinueError(state, " Cooling Capacity Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(TotCoolCapTempModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an outdoor air temperature of " + TrimSigDigits(CondInletTemp, 1) + - " C and an average indoor air wet-bulb temperature of " + TrimSigDigits(InletAirWetBulbC, 1) + " C."); + ShowContinueError( + state, + format(" Cooling Capacity Modifier curve (function of temperature) output is negative ({:.3T}).", TotCoolCapTempModFac)); + ShowContinueError(state, + format(" Negative value occurs using an outdoor air temperature of {:.1T} C and an average indoor air " + "wet-bulb temperature of {:.1T} C.", + CondInletTemp, + InletAirWetBulbC)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -786,10 +803,14 @@ namespace HVACVariableRefrigerantFlow { if (!state.dataGlobal->WarmupFlag && NumTUInCoolingMode > 0) { if (VRF(VRFCond).EIRFTempCoolErrorIndex == 0) { ShowSevereMessage(state, cVRFTypes(VRF_HeatPump) + " \"" + VRF(VRFCond).Name + "\":"); - ShowContinueError(state, " Cooling Energy Input Ratio Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(TotCoolEIRTempModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an outdoor air temperature of " + TrimSigDigits(CondInletTemp, 1) + - " C and an average indoor air wet-bulb temperature of " + TrimSigDigits(InletAirWetBulbC, 1) + " C."); + ShowContinueError(state, + format(" Cooling Energy Input Ratio Modifier curve (function of temperature) output is negative ({:.3T}).", + TotCoolEIRTempModFac)); + ShowContinueError(state, + format(" Negative value occurs using an outdoor air temperature of {:.1T} C and an average indoor air " + "wet-bulb temperature of {:.1T} C.", + CondInletTemp, + InletAirWetBulbC)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -863,16 +884,23 @@ namespace HVACVariableRefrigerantFlow { if (!state.dataGlobal->WarmupFlag && NumTUInHeatingMode > 0) { if (VRF(VRFCond).HeatCapFTErrorIndex == 0) { ShowSevereMessage(state, cVRFTypes(VRF_HeatPump) + " \"" + VRF(VRFCond).Name + "\":"); - ShowContinueError(state, " Heating Capacity Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(TotHeatCapTempModFac, 3) + ")."); + ShowContinueError( + state, + format(" Heating Capacity Modifier curve (function of temperature) output is negative ({:.3T}).", TotHeatCapTempModFac)); + auto const SELECT_CASE_var(VRF(VRFCond).HeatingPerformanceOATType); if (SELECT_CASE_var == DataHVACGlobals::DryBulbIndicator) { - ShowContinueError(state, " Negative value occurs using an outdoor air temperature of " + TrimSigDigits(CondInletTemp, 1) + - " C and an average indoor air dry-bulb temperature of " + TrimSigDigits(InletAirDryBulbC, 1) + " C."); + ShowContinueError(state, + format(" Negative value occurs using an outdoor air temperature of {:.1T} C and an average indoor air " + "dry-bulb temperature of {:.1T} C.", + CondInletTemp, + InletAirDryBulbC)); } else if (SELECT_CASE_var == DataHVACGlobals::WetBulbIndicator) { - ShowContinueError(state, " Negative value occurs using an outdoor air wet-bulb temperature of " + - TrimSigDigits(OutdoorWetBulb, 1) + " C and an average indoor air wet-bulb temperature of " + - TrimSigDigits(InletAirWetBulbC, 1) + " C."); + ShowContinueError(state, + format(" Negative value occurs using an outdoor air wet-bulb temperature of {:.1T} C and an average " + "indoor air wet-bulb temperature of {:.1T} C.", + OutdoorWetBulb, + InletAirWetBulbC)); } else { // should never get here } @@ -892,18 +920,24 @@ namespace HVACVariableRefrigerantFlow { if (!state.dataGlobal->WarmupFlag && NumTUInHeatingMode > 0) { if (VRF(VRFCond).EIRFTempHeatErrorIndex == 0) { ShowSevereMessage(state, cVRFTypes(VRF_HeatPump) + " \"" + VRF(VRFCond).Name + "\":"); - ShowContinueError(state, " Heating Energy Input Ratio Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(TotHeatEIRTempModFac, 3) + ")."); + ShowContinueError(state, + format(" Heating Energy Input Ratio Modifier curve (function of temperature) output is negative ({:.3T}).", + TotHeatEIRTempModFac)); { auto const SELECT_CASE_var(VRF(VRFCond).HeatingPerformanceOATType); if (SELECT_CASE_var == DataHVACGlobals::DryBulbIndicator) { - ShowContinueError(state, " Negative value occurs using an outdoor air dry-bulb temperature of " + - TrimSigDigits(CondInletTemp, 1) + " C and an average indoor air dry-bulb temperature of " + - TrimSigDigits(InletAirDryBulbC, 1) + " C."); + ShowContinueError(state, + format(" Negative value occurs using an outdoor air dry-bulb temperature of {:.1T} C and an " + "average indoor air dry-bulb temperature of {:.1T} C.", + CondInletTemp, + InletAirDryBulbC)); } else if (SELECT_CASE_var == DataHVACGlobals::WetBulbIndicator) { - ShowContinueError(state, " Negative value occurs using an outdoor air wet-bulb temperature of " + - TrimSigDigits(OutdoorWetBulb, 1) + " C and an average indoor air wet-bulb temperature of " + - TrimSigDigits(InletAirWetBulbC, 1) + " C."); + + ShowContinueError(state, + format(" Negative value occurs using an outdoor air wet-bulb temperature of {:.1T} C and an " + "average indoor air wet-bulb temperature of {:.1T} C.", + OutdoorWetBulb, + InletAirWetBulbC)); } else { } } @@ -957,11 +991,15 @@ namespace HVACVariableRefrigerantFlow { if (!state.dataGlobal->WarmupFlag) { if (VRF(VRFCond).DefrostHeatErrorIndex == 0) { ShowSevereMessage(state, cVRFTypes(VRF_HeatPump) + " \"" + VRF(VRFCond).Name + "\":"); - ShowContinueError(state, " Defrost Energy Input Ratio Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(DefrostEIRTempModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an outdoor air dry-bulb temperature of " + - TrimSigDigits(OutdoorDryBulb, 1) + " C and an average indoor air wet-bulb temperature of " + - TrimSigDigits(InletAirWetBulbC, 1) + " C."); + ShowContinueError( + state, + format(" Defrost Energy Input Ratio Modifier curve (function of temperature) output is negative ({:.3T}).", + DefrostEIRTempModFac)); + ShowContinueError(state, + format(" Negative value occurs using an outdoor air dry-bulb temperature of {:.1T} C and an " + "average indoor air wet-bulb temperature of {:.1T} C.", + OutdoorDryBulb, + InletAirWetBulbC)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + VRF(VRFCond).Name + @@ -1429,7 +1467,7 @@ namespace HVACVariableRefrigerantFlow { using Fans::GetFanInletNode; using Fans::GetFanOutletNode; using Fans::GetFanType; - using General::TrimSigDigits; + using MixedAir::GetOAMixerNodeNumbers; using NodeInputManager::GetOnlySingleNode; using ScheduleManager::CheckScheduleValueMinMax; @@ -1674,7 +1712,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).CoolCapFT = GetCurveIndex(state, cAlphaArgs(3)); if (VRF(VRFNum).CoolCapFT > 0) { // Verify Curve Object, only legal type is biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).CoolCapFT, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).CoolCapFT, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1682,7 +1721,7 @@ namespace HVACVariableRefrigerantFlow { cAlphaFieldNames(3)); // Field Name if (!ErrorsFound) { - checkCurveIsNormalizedToOne( state, + checkCurveIsNormalizedToOne(state, RoutineName + cCurrentModuleObject, VRF(VRFNum).Name, VRF(VRFNum).CoolCapFT, @@ -1696,7 +1735,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).CoolBoundaryCurvePtr = GetCurveIndex(state, cAlphaArgs(4)); if (VRF(VRFNum).CoolBoundaryCurvePtr > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).CoolBoundaryCurvePtr, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).CoolBoundaryCurvePtr, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1707,7 +1747,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).CoolCapFTHi = GetCurveIndex(state, cAlphaArgs(5)); if (VRF(VRFNum).CoolCapFTHi > 0) { // Verify Curve Object, only legal type is biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).CoolCapFTHi, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).CoolCapFTHi, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1718,7 +1759,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).CoolEIRFT = GetCurveIndex(state, cAlphaArgs(6)); if (VRF(VRFNum).CoolEIRFT > 0) { // Verify Curve Object, only legal type is biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).CoolEIRFT, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).CoolEIRFT, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1729,7 +1771,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).EIRCoolBoundaryCurvePtr = GetCurveIndex(state, cAlphaArgs(7)); if (VRF(VRFNum).EIRCoolBoundaryCurvePtr > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).EIRCoolBoundaryCurvePtr, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).EIRCoolBoundaryCurvePtr, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1740,7 +1783,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).CoolEIRFTHi = GetCurveIndex(state, cAlphaArgs(8)); if (VRF(VRFNum).CoolEIRFTHi > 0) { // Verify Curve Object, only legal type is biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).CoolEIRFTHi, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).CoolEIRFTHi, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1751,7 +1795,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).CoolEIRFPLR1 = GetCurveIndex(state, cAlphaArgs(9)); if (VRF(VRFNum).CoolEIRFPLR1 > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).CoolEIRFPLR1, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).CoolEIRFPLR1, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1762,7 +1807,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).CoolEIRFPLR2 = GetCurveIndex(state, cAlphaArgs(10)); if (VRF(VRFNum).CoolEIRFPLR2 > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).CoolEIRFPLR2, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).CoolEIRFPLR2, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1773,7 +1819,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).CoolCombRatioPTR = GetCurveIndex(state, cAlphaArgs(11)); if (VRF(VRFNum).CoolCombRatioPTR > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).CoolCombRatioPTR, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).CoolCombRatioPTR, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1784,7 +1831,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).CoolPLFFPLR = GetCurveIndex(state, cAlphaArgs(12)); if (VRF(VRFNum).CoolPLFFPLR > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).CoolPLFFPLR, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).CoolPLFFPLR, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1810,8 +1858,8 @@ namespace HVACVariableRefrigerantFlow { if (MinCurveVal < 0.7) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFieldNames(12) + "=\"" + cAlphaArgs(12) + "\" has out of range values."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + " is " + - TrimSigDigits(MinCurveVal, 3)); + ShowContinueError(state, + format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, VRF(VRFNum).CoolPLFFPLR, ErrorsFound, 0.7, _); } @@ -1819,8 +1867,8 @@ namespace HVACVariableRefrigerantFlow { if (MaxCurveVal > 1.0) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFieldNames(12) + " = " + cAlphaArgs(12) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + " is " + - TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError(state, + format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, VRF(VRFNum).CoolPLFFPLR, ErrorsFound, _, 1.0); } @@ -1837,15 +1885,19 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).MaxOATHeating = rNumericArgs(9); if (VRF(VRFNum).MinOATHeating >= VRF(VRFNum).MaxOATHeating) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(8) + " (" + TrimSigDigits(VRF(VRFNum).MinOATHeating, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).MaxOATHeating, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(8), + VRF(VRFNum).MinOATHeating, + VRF(VRFNum).MaxOATHeating)); ErrorsFound = true; } VRF(VRFNum).HeatCapFT = GetCurveIndex(state, cAlphaArgs(13)); if (VRF(VRFNum).HeatCapFT > 0) { // Verify Curve Object, only legal type is biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HeatCapFT, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HeatCapFT, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1854,7 +1906,7 @@ namespace HVACVariableRefrigerantFlow { if (!ErrorsFound) { if (UtilityRoutines::SameString(cAlphaArgs(19), "WETBULBTEMPERATURE")) { - checkCurveIsNormalizedToOne( state, + checkCurveIsNormalizedToOne(state, RoutineName + cCurrentModuleObject, VRF(VRFNum).Name, VRF(VRFNum).HeatCapFT, @@ -1863,7 +1915,7 @@ namespace HVACVariableRefrigerantFlow { RatedInletAirTempHeat, RatedOutdoorWetBulbTempHeat); } else if (UtilityRoutines::SameString(cAlphaArgs(19), "DRYBULBTEMPERATURE")) { - checkCurveIsNormalizedToOne( state, + checkCurveIsNormalizedToOne(state, RoutineName + cCurrentModuleObject, VRF(VRFNum).Name, VRF(VRFNum).HeatCapFT, @@ -1878,7 +1930,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HeatBoundaryCurvePtr = GetCurveIndex(state, cAlphaArgs(14)); if (VRF(VRFNum).HeatBoundaryCurvePtr > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HeatBoundaryCurvePtr, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HeatBoundaryCurvePtr, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1889,7 +1942,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HeatCapFTHi = GetCurveIndex(state, cAlphaArgs(15)); if (VRF(VRFNum).HeatCapFTHi > 0) { // Verify Curve Object, only legal type is biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HeatCapFTHi, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HeatCapFTHi, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1900,7 +1954,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HeatEIRFT = GetCurveIndex(state, cAlphaArgs(16)); if (VRF(VRFNum).HeatEIRFT > 0) { // Verify Curve Object, only legal type is biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HeatEIRFT, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HeatEIRFT, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1911,7 +1966,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).EIRHeatBoundaryCurvePtr = GetCurveIndex(state, cAlphaArgs(17)); if (VRF(VRFNum).EIRHeatBoundaryCurvePtr > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).EIRHeatBoundaryCurvePtr, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).EIRHeatBoundaryCurvePtr, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1922,7 +1978,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HeatEIRFTHi = GetCurveIndex(state, cAlphaArgs(18)); if (VRF(VRFNum).HeatEIRFTHi > 0) { // Verify Curve Object, only legal type is biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HeatEIRFTHi, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HeatEIRFTHi, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1944,7 +2001,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HeatEIRFPLR1 = GetCurveIndex(state, cAlphaArgs(20)); if (VRF(VRFNum).HeatEIRFPLR1 > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HeatEIRFPLR1, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HeatEIRFPLR1, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1955,7 +2013,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HeatEIRFPLR2 = GetCurveIndex(state, cAlphaArgs(21)); if (VRF(VRFNum).HeatEIRFPLR2 > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HeatEIRFPLR2, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HeatEIRFPLR2, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1966,7 +2025,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HeatCombRatioPTR = GetCurveIndex(state, cAlphaArgs(22)); if (VRF(VRFNum).HeatCombRatioPTR > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HeatCombRatioPTR, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HeatCombRatioPTR, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -1976,7 +2036,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HeatPLFFPLR = GetCurveIndex(state, cAlphaArgs(23)); if (VRF(VRFNum).HeatPLFFPLR > 0) { // Verify Curve Object, only legal type is linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HeatPLFFPLR, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HeatPLFFPLR, // Curve index {1}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2002,8 +2063,8 @@ namespace HVACVariableRefrigerantFlow { if (MinCurveVal < 0.7) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFieldNames(23) + "=\"" + cAlphaArgs(23) + "\" has out of range values."); - ShowContinueError(state, "...Curve minimum must be >= 0.7, curve min at PLR = " + TrimSigDigits(MinCurvePLR, 2) + " is " + - TrimSigDigits(MinCurveVal, 3)); + ShowContinueError(state, + format("...Curve minimum must be >= 0.7, curve min at PLR = {:.2T} is {:.3T}", MinCurvePLR, MinCurveVal)); ShowContinueError(state, "...Setting curve minimum to 0.7 and simulation continues."); SetCurveOutputMinMaxValues(state, VRF(VRFNum).HeatPLFFPLR, ErrorsFound, 0.7, _); } @@ -2011,8 +2072,8 @@ namespace HVACVariableRefrigerantFlow { if (MaxCurveVal > 1.0) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFieldNames(23) + " = " + cAlphaArgs(23) + " has out of range value."); - ShowContinueError(state, "...Curve maximum must be <= 1.0, curve max at PLR = " + TrimSigDigits(MaxCurvePLR, 2) + " is " + - TrimSigDigits(MaxCurveVal, 3)); + ShowContinueError(state, + format("...Curve maximum must be <= 1.0, curve max at PLR = {:.2T} is {:.3T}", MaxCurvePLR, MaxCurveVal)); ShowContinueError(state, "...Setting curve maximum to 1.0 and simulation continues."); SetCurveOutputMinMaxValues(state, VRF(VRFNum).HeatPLFFPLR, ErrorsFound, _, 1.0); } @@ -2024,37 +2085,43 @@ namespace HVACVariableRefrigerantFlow { Real64 maxEIRfLowPLRXInput = 0.0; if (VRF(VRFNum).CoolEIRFPLR1 > 0) { - CurveManager::GetCurveMinMaxValues(state,VRF(VRFNum).CoolEIRFPLR1, minEIRfLowPLRXInput, maxEIRfLowPLRXInput); + CurveManager::GetCurveMinMaxValues(state, VRF(VRFNum).CoolEIRFPLR1, minEIRfLowPLRXInput, maxEIRfLowPLRXInput); if (minEIRfLowPLRXInput > VRF(VRFNum).MinPLR) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFieldNames(9) + " = " + cAlphaArgs(9) + " has out of range value."); - ShowContinueError(state, "...Curve minimum value of X = " + TrimSigDigits(minEIRfLowPLRXInput, 3) + - " must be <= Minimum Heat Pump Part-Load Ratio = " + TrimSigDigits(VRF(VRFNum).MinPLR, 3) + "."); + ShowContinueError(state, + format("...Curve minimum value of X = {:.3T} must be <= Minimum Heat Pump Part-Load Ratio = {:.3T}.", + minEIRfLowPLRXInput, + VRF(VRFNum).MinPLR)); ErrorsFound = true; } if (maxEIRfLowPLRXInput < 1.0) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", suspicious"); ShowContinueError(state, "..." + cAlphaFieldNames(9) + " = " + cAlphaArgs(9) + " has unexpected value."); - ShowContinueError(state, "...Curve maximum value of X = " + TrimSigDigits(maxEIRfLowPLRXInput, 3) + - " should be 1 and will result in lower energy use than expected."); + ShowContinueError(state, + format("...Curve maximum value of X = {:.3T} should be 1 and will result in lower energy use than expected.", + maxEIRfLowPLRXInput)); } minEIRfLowPLRXInput = 0.0; maxEIRfLowPLRXInput = 0.0; } if (VRF(VRFNum).HeatEIRFPLR1 > 0) { - CurveManager::GetCurveMinMaxValues(state,VRF(VRFNum).HeatEIRFPLR1, minEIRfLowPLRXInput, maxEIRfLowPLRXInput); + CurveManager::GetCurveMinMaxValues(state, VRF(VRFNum).HeatEIRFPLR1, minEIRfLowPLRXInput, maxEIRfLowPLRXInput); if (minEIRfLowPLRXInput > VRF(VRFNum).MinPLR) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", invalid"); ShowContinueError(state, "..." + cAlphaFieldNames(20) + " = " + cAlphaArgs(20) + " has out of range value."); - ShowContinueError(state, "...Curve minimum value of X = " + TrimSigDigits(minEIRfLowPLRXInput, 3) + - " must be <= Minimum Heat Pump Part-Load Ratio = " + TrimSigDigits(VRF(VRFNum).MinPLR, 3) + "."); + ShowContinueError(state, + format("...Curve minimum value of X = {:.3T} must be <= Minimum Heat Pump Part-Load Ratio = {:.3T}.", + minEIRfLowPLRXInput, + VRF(VRFNum).MinPLR)); ErrorsFound = true; } if (maxEIRfLowPLRXInput < 1.0) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", suspicious"); ShowContinueError(state, "..." + cAlphaFieldNames(20) + " = " + cAlphaArgs(20) + " has unexpected value."); - ShowContinueError(state, "...Curve maximum value of X = " + TrimSigDigits(maxEIRfLowPLRXInput, 3) + - " should be 1 and will result in lower energy use than expected."); + ShowContinueError(state, + format("...Curve maximum value of X = {:.3T} should be 1 and will result in lower energy use than expected.", + maxEIRfLowPLRXInput)); } } @@ -2118,7 +2185,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).PCFLengthCoolPtr = GetCurveIndex(state, cAlphaArgs(29)); if (VRF(VRFNum).PCFLengthCoolPtr > 0) { // Verify Curve Object, only legal type is linear, quadratic, cubic, or biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).PCFLengthCoolPtr, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).PCFLengthCoolPtr, // Curve index {1, 2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2131,7 +2199,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).PCFLengthHeatPtr = GetCurveIndex(state, cAlphaArgs(30)); if (VRF(VRFNum).PCFLengthHeatPtr > 0) { // Verify Curve Object, only legal type is linear, quadratic, cubic, or biquadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).PCFLengthHeatPtr, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).PCFLengthHeatPtr, // Curve index {1, 2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2174,7 +2243,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).DefrostEIRPtr = GetCurveIndex(state, cAlphaArgs(33)); if (VRF(VRFNum).DefrostEIRPtr > 0) { // Verify Curve Object, expected type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).DefrostEIRPtr, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).DefrostEIRPtr, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2233,7 +2303,8 @@ namespace HVACVariableRefrigerantFlow { { auto const SELECT_CASE_var(VRF(VRFNum).CondenserType); if ((SELECT_CASE_var == DataHVACGlobals::AirCooled) || (SELECT_CASE_var == DataHVACGlobals::EvapCooled)) { - VRF(VRFNum).CondenserNodeNum = GetOnlySingleNode(state, cAlphaArgs(35), + VRF(VRFNum).CondenserNodeNum = GetOnlySingleNode(state, + cAlphaArgs(35), ErrorsFound, cCurrentModuleObject, VRF(VRFNum).Name, @@ -2248,7 +2319,8 @@ namespace HVACVariableRefrigerantFlow { ErrorsFound = true; } } else if (SELECT_CASE_var == DataHVACGlobals::WaterCooled) { - VRF(VRFNum).CondenserNodeNum = GetOnlySingleNode(state, cAlphaArgs(35), + VRF(VRFNum).CondenserNodeNum = GetOnlySingleNode(state, + cAlphaArgs(35), ErrorsFound, cCurrentModuleObject, VRF(VRFNum).Name, @@ -2262,7 +2334,8 @@ namespace HVACVariableRefrigerantFlow { } if (!lAlphaFieldBlanks(36) && VRF(VRFNum).CondenserType == DataHVACGlobals::WaterCooled) { - VRF(VRFNum).CondenserOutletNodeNum = GetOnlySingleNode(state, cAlphaArgs(36), + VRF(VRFNum).CondenserOutletNodeNum = GetOnlySingleNode(state, + cAlphaArgs(36), ErrorsFound, cCurrentModuleObject, VRF(VRFNum).Name, @@ -2297,7 +2370,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).EvapWaterSupplyMode = WaterSupplyFromMains; } else { VRF(VRFNum).EvapWaterSupplyMode = WaterSupplyFromTank; - SetupTankDemandComponent(state, VRF(VRFNum).Name, + SetupTankDemandComponent(state, + VRF(VRFNum).Name, cCurrentModuleObject, VRF(VRFNum).EvapWaterSupplyName, ErrorsFound, @@ -2336,7 +2410,8 @@ namespace HVACVariableRefrigerantFlow { if (!lAlphaFieldBlanks(39)) { // A39; \field Fuel type, Validate fuel type input bool FuelTypeError(false); - UtilityRoutines::ValidateFuelTypeWithAssignResourceTypeNum(cAlphaArgs(39), VRF(VRFNum).FuelType, VRF(VRFNum).FuelTypeNum, FuelTypeError); + UtilityRoutines::ValidateFuelTypeWithAssignResourceTypeNum( + cAlphaArgs(39), VRF(VRFNum).FuelType, VRF(VRFNum).FuelTypeNum, FuelTypeError); if (FuelTypeError) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\", " + cAlphaFieldNames(39) + " not found = " + cAlphaArgs(39)); @@ -2355,13 +2430,13 @@ namespace HVACVariableRefrigerantFlow { if (VRF(VRFNum).MinOATHeatRecovery < VRF(VRFNum).MinOATCooling || VRF(VRFNum).MinOATHeatRecovery < VRF(VRFNum).MinOATHeating) { ShowWarningError(state, cCurrentModuleObject + " = \"" + VRF(VRFNum).Name + "\", " + cNumericFieldNames(29) + " is less than the minimum temperature in heat pump mode."); - ShowContinueError(state, "..." + cNumericFieldNames(29) + " = " + TrimSigDigits(VRF(VRFNum).MinOATHeatRecovery, 2) + " C"); - ShowContinueError(state, "...Minimum Outdoor Temperature in Cooling Mode = " + TrimSigDigits(VRF(VRFNum).MinOATCooling, 2) + " C"); - ShowContinueError(state, "...Minimum Outdoor Temperature in Heating Mode = " + TrimSigDigits(VRF(VRFNum).MinOATHeating, 2) + " C"); + ShowContinueError(state, format("...{} = {:.2T} C", cNumericFieldNames(29), VRF(VRFNum).MinOATHeatRecovery)); + ShowContinueError(state, format("...Minimum Outdoor Temperature in Cooling Mode = {:.2T} C", VRF(VRFNum).MinOATCooling)); + ShowContinueError(state, format("...Minimum Outdoor Temperature in Heating Mode = {:.2T} C", VRF(VRFNum).MinOATHeating)); ShowContinueError(state, "...Minimum Outdoor Temperature in Heat Recovery Mode reset to greater of cooling or heating minimum " "temperature and simulation continues."); VRF(VRFNum).MinOATHeatRecovery = max(VRF(VRFNum).MinOATCooling, VRF(VRFNum).MinOATHeating); - ShowContinueError(state, "... adjusted " + cNumericFieldNames(29) + " = " + TrimSigDigits(VRF(VRFNum).MinOATHeatRecovery, 2) + " C"); + ShowContinueError(state, format("... adjusted {} = {:.2T} C", cNumericFieldNames(29), VRF(VRFNum).MinOATHeatRecovery)); } } if (lNumericFieldBlanks(30)) { @@ -2371,20 +2446,21 @@ namespace HVACVariableRefrigerantFlow { if (VRF(VRFNum).MaxOATHeatRecovery > VRF(VRFNum).MaxOATCooling || VRF(VRFNum).MaxOATHeatRecovery > VRF(VRFNum).MaxOATHeating) { ShowWarningError(state, cCurrentModuleObject + " = \"" + VRF(VRFNum).Name + "\", " + cNumericFieldNames(30) + " is greater than the maximum temperature in heat pump mode."); - ShowContinueError(state, "..." + cNumericFieldNames(30) + " = " + TrimSigDigits(VRF(VRFNum).MaxOATHeatRecovery, 2) + " C"); - ShowContinueError(state, "...Maximum Outdoor Temperature in Cooling Mode = " + TrimSigDigits(VRF(VRFNum).MaxOATCooling, 2) + " C"); - ShowContinueError(state, "...Maximum Outdoor Temperature in Heating Mode = " + TrimSigDigits(VRF(VRFNum).MaxOATHeating, 2) + " C"); + ShowContinueError(state, format("...{} = {:.2T} C", cNumericFieldNames(30), VRF(VRFNum).MaxOATHeatRecovery)); + ShowContinueError(state, format("...Maximum Outdoor Temperature in Cooling Mode = {:.2T} C", VRF(VRFNum).MaxOATCooling)); + ShowContinueError(state, format("...Maximum Outdoor Temperature in Heating Mode = {:.2T} C", VRF(VRFNum).MaxOATHeating)); ShowContinueError(state, "...Maximum Outdoor Temperature in Heat Recovery Mode reset to lesser of cooling or heating minimum " "temperature and simulation continues."); VRF(VRFNum).MaxOATHeatRecovery = min(VRF(VRFNum).MaxOATCooling, VRF(VRFNum).MaxOATHeating); - ShowContinueError(state, "... adjusted " + cNumericFieldNames(30) + " = " + TrimSigDigits(VRF(VRFNum).MaxOATHeatRecovery, 2) + " C"); + ShowContinueError(state, format("... adjusted {} = {:.2T} C", cNumericFieldNames(30), VRF(VRFNum).MaxOATHeatRecovery)); } } VRF(VRFNum).HRCAPFTCool = GetCurveIndex(state, cAlphaArgs(40)); if (VRF(VRFNum).HRCAPFTCool > 0) { // Verify Curve Object, only legal type is bi-quadratic or linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HRCAPFTCool, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HRCAPFTCool, // Curve index {1, 2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2398,7 +2474,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HREIRFTCool = GetCurveIndex(state, cAlphaArgs(41)); if (VRF(VRFNum).HREIRFTCool > 0) { // Verify Curve Object, only legal type is bi-quadratic or linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HREIRFTCool, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HREIRFTCool, // Curve index {1, 2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2415,7 +2492,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HRCAPFTHeat = GetCurveIndex(state, cAlphaArgs(42)); if (VRF(VRFNum).HRCAPFTHeat > 0) { // Verify Curve Object, only legal type is bi-quadratic or linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HRCAPFTHeat, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HRCAPFTHeat, // Curve index {1, 2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2432,7 +2510,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).HREIRFTHeat = GetCurveIndex(state, cAlphaArgs(43)); if (VRF(VRFNum).HREIRFTHeat > 0) { // Verify Curve Object, only legal type is bi-quadratic or linear, quadratic, or cubic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).HREIRFTHeat, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).HREIRFTHeat, // Curve index {1, 2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2516,14 +2595,20 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).MaxOATHeating = rNumericArgs(6); if (VRF(VRFNum).MinOATCooling >= VRF(VRFNum).MaxOATCooling) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(3) + " (" + TrimSigDigits(VRF(VRFNum).MinOATCooling, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).MaxOATCooling, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(3), + VRF(VRFNum).MinOATCooling, + VRF(VRFNum).MaxOATCooling)); ErrorsFound = true; } if (VRF(VRFNum).MinOATHeating >= VRF(VRFNum).MaxOATHeating) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(5) + " (" + TrimSigDigits(VRF(VRFNum).MinOATHeating, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).MaxOATHeating, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(5), + VRF(VRFNum).MinOATHeating, + VRF(VRFNum).MaxOATHeating)); ErrorsFound = true; } @@ -2550,14 +2635,20 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).IUCondTempHigh = rNumericArgs(14); if (VRF(VRFNum).IUEvapTempLow >= VRF(VRFNum).IUEvapTempHigh) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(11) + " (" + TrimSigDigits(VRF(VRFNum).IUEvapTempLow, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).IUEvapTempHigh, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(11), + VRF(VRFNum).IUEvapTempLow, + VRF(VRFNum).IUEvapTempHigh)); ErrorsFound = true; } if (VRF(VRFNum).IUCondTempLow >= VRF(VRFNum).IUCondTempHigh) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(13) + " (" + TrimSigDigits(VRF(VRFNum).IUCondTempLow, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).IUCondTempHigh, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(13), + VRF(VRFNum).IUCondTempLow, + VRF(VRFNum).IUCondTempHigh)); ErrorsFound = true; } @@ -2680,7 +2771,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).DefrostEIRPtr = GetCurveIndex(state, cAlphaArgs(10)); if (VRF(VRFNum).DefrostEIRPtr > 0) { // Verify Curve Object, expected type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).DefrostEIRPtr, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).DefrostEIRPtr, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2750,7 +2842,7 @@ namespace HVACVariableRefrigerantFlow { // Evaporating Capacity Curve if (!lAlphaFieldBlanks(Count2Index + 2 * NumCompSpd)) { int indexOUEvapCapCurve = GetCurveIndex(state, cAlphaArgs(Count2Index + 2 * NumCompSpd)); // convert curve name to index number - if (indexOUEvapCapCurve == 0) { // Verify curve name and type + if (indexOUEvapCapCurve == 0) { // Verify curve name and type if (lAlphaFieldBlanks(Count2Index + 2 * NumCompSpd)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", missing"); ShowContinueError(state, "...required " + cAlphaFieldNames(Count2Index + 2 * NumCompSpd) + " is blank."); @@ -2761,7 +2853,8 @@ namespace HVACVariableRefrigerantFlow { } ErrorsFound = true; } else { - ErrorsFound |= CurveManager::CheckCurveDims(state, indexOUEvapCapCurve, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + indexOUEvapCapCurve, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2776,8 +2869,9 @@ namespace HVACVariableRefrigerantFlow { // Compressor Power Curve if (!lAlphaFieldBlanks(Count2Index + 2 * NumCompSpd + 1)) { - int indexOUCompPwrCurve = GetCurveIndex(state, cAlphaArgs(Count2Index + 2 * NumCompSpd + 1)); // convert curve name to index number - if (indexOUCompPwrCurve == 0) { // Verify curve name and type + int indexOUCompPwrCurve = + GetCurveIndex(state, cAlphaArgs(Count2Index + 2 * NumCompSpd + 1)); // convert curve name to index number + if (indexOUCompPwrCurve == 0) { // Verify curve name and type if (lAlphaFieldBlanks(Count2Index + 2 * NumCompSpd + 1)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", missing"); ShowContinueError(state, "...required " + cAlphaFieldNames(Count2Index + 2 * NumCompSpd + 1) + " is blank."); @@ -2788,7 +2882,8 @@ namespace HVACVariableRefrigerantFlow { } ErrorsFound = true; } else { - ErrorsFound |= CurveManager::CheckCurveDims(state, indexOUCompPwrCurve, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + indexOUCompPwrCurve, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -2881,43 +2976,52 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).MaxOATHeatRecovery = rNumericArgs(8); if (VRF(VRFNum).MinOATCooling >= VRF(VRFNum).MaxOATCooling) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(3) + " (" + TrimSigDigits(VRF(VRFNum).MinOATCooling, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).MaxOATCooling, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(3), + VRF(VRFNum).MinOATCooling, + VRF(VRFNum).MaxOATCooling)); ErrorsFound = true; } if (VRF(VRFNum).MinOATHeating >= VRF(VRFNum).MaxOATHeating) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(5) + " (" + TrimSigDigits(VRF(VRFNum).MinOATHeating, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).MaxOATHeating, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(5), + VRF(VRFNum).MinOATHeating, + VRF(VRFNum).MaxOATHeating)); ErrorsFound = true; } if (VRF(VRFNum).MinOATHeatRecovery >= VRF(VRFNum).MaxOATHeatRecovery) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(7) + " (" + TrimSigDigits(VRF(VRFNum).MinOATHeating, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).MaxOATHeating, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(7), + VRF(VRFNum).MinOATHeating, + VRF(VRFNum).MaxOATHeating)); ErrorsFound = true; } if (VRF(VRFNum).MinOATHeatRecovery < VRF(VRFNum).MinOATCooling && VRF(VRFNum).MinOATHeatRecovery < VRF(VRFNum).MinOATHeating) { ShowWarningError(state, cCurrentModuleObject + " = \"" + VRF(VRFNum).Name + "\", " + cNumericFieldNames(7) + " is less than the minimum temperature in heat pump mode."); - ShowContinueError(state, "..." + cNumericFieldNames(7) + " = " + TrimSigDigits(VRF(VRFNum).MinOATHeatRecovery, 2) + " C"); - ShowContinueError(state, "...Minimum Outdoor Temperature in Cooling Mode = " + TrimSigDigits(VRF(VRFNum).MinOATCooling, 2) + " C"); - ShowContinueError(state, "...Minimum Outdoor Temperature in Heating Mode = " + TrimSigDigits(VRF(VRFNum).MinOATHeating, 2) + " C"); + ShowContinueError(state, format("...{} = {:.2T} C", cNumericFieldNames(7), VRF(VRFNum).MinOATHeatRecovery)); + ShowContinueError(state, format("...Minimum Outdoor Temperature in Cooling Mode = {:.2T} C", VRF(VRFNum).MinOATCooling)); + ShowContinueError(state, format("...Minimum Outdoor Temperature in Heating Mode = {:.2T} C", VRF(VRFNum).MinOATHeating)); ShowContinueError(state, "...Minimum Outdoor Temperature in Heat Recovery Mode reset to lesser of cooling or heating minimum temperature " "and simulation continues."); VRF(VRFNum).MinOATHeatRecovery = min(VRF(VRFNum).MinOATCooling, VRF(VRFNum).MinOATHeating); - ShowContinueError(state, "... adjusted " + cNumericFieldNames(7) + " = " + TrimSigDigits(VRF(VRFNum).MinOATHeatRecovery, 2) + " C"); + ShowContinueError(state, format("... adjusted {} = {:.2T} C", cNumericFieldNames(7), VRF(VRFNum).MinOATHeatRecovery)); } if (VRF(VRFNum).MaxOATHeatRecovery > VRF(VRFNum).MaxOATCooling && VRF(VRFNum).MaxOATHeatRecovery > VRF(VRFNum).MaxOATHeating) { ShowWarningError(state, cCurrentModuleObject + " = \"" + VRF(VRFNum).Name + "\", " + cNumericFieldNames(8) + " is greater than the maximum temperature in heat pump mode."); - ShowContinueError(state, "..." + cNumericFieldNames(8) + " = " + TrimSigDigits(VRF(VRFNum).MaxOATHeatRecovery, 2) + " C"); - ShowContinueError(state, "...Maximum Outdoor Temperature in Cooling Mode = " + TrimSigDigits(VRF(VRFNum).MaxOATCooling, 2) + " C"); - ShowContinueError(state, "...Maximum Outdoor Temperature in Heating Mode = " + TrimSigDigits(VRF(VRFNum).MaxOATHeating, 2) + " C"); + ShowContinueError(state, format("...{} = {:.2T} C", cNumericFieldNames(8), VRF(VRFNum).MaxOATHeatRecovery)); + ShowContinueError(state, format("...Maximum Outdoor Temperature in Cooling Mode = {:.2T} C", VRF(VRFNum).MaxOATCooling)); + ShowContinueError(state, format("...Maximum Outdoor Temperature in Heating Mode = {:.2T} C", VRF(VRFNum).MaxOATHeating)); ShowContinueError(state, "...Maximum Outdoor Temperature in Heat Recovery Mode reset to greater of cooling or heating maximum temperature " "and simulation continues."); VRF(VRFNum).MaxOATHeatRecovery = max(VRF(VRFNum).MaxOATCooling, VRF(VRFNum).MaxOATHeating); - ShowContinueError(state, "... adjusted " + cNumericFieldNames(8) + " = " + TrimSigDigits(VRF(VRFNum).MaxOATHeatRecovery, 2) + " C"); + ShowContinueError(state, format("... adjusted {} = {:.2T} C", cNumericFieldNames(8), VRF(VRFNum).MaxOATHeatRecovery)); } // IU Control Type @@ -2940,14 +3044,20 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).IUCondTempHigh = rNumericArgs(14); if (VRF(VRFNum).IUEvapTempLow >= VRF(VRFNum).IUEvapTempHigh) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(11) + " (" + TrimSigDigits(VRF(VRFNum).IUEvapTempLow, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).IUEvapTempHigh, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(11), + VRF(VRFNum).IUEvapTempLow, + VRF(VRFNum).IUEvapTempHigh)); ErrorsFound = true; } if (VRF(VRFNum).IUCondTempLow >= VRF(VRFNum).IUCondTempHigh) { ShowSevereError(state, cCurrentModuleObject + ", \"" + VRF(VRFNum).Name + "\""); - ShowContinueError(state, "... " + cNumericFieldNames(13) + " (" + TrimSigDigits(VRF(VRFNum).IUCondTempLow, 3) + - ") must be less than maximum (" + TrimSigDigits(VRF(VRFNum).IUCondTempHigh, 3) + ")."); + ShowContinueError(state, + format("... {} ({:.3T}) must be less than maximum ({:.3T}).", + cNumericFieldNames(13), + VRF(VRFNum).IUCondTempLow, + VRF(VRFNum).IUCondTempHigh)); ErrorsFound = true; } @@ -3086,7 +3196,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).DefrostEIRPtr = GetCurveIndex(state, cAlphaArgs(10)); if (VRF(VRFNum).DefrostEIRPtr > 0) { // Verify Curve Object, expected type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims(state, VRF(VRFNum).DefrostEIRPtr, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + VRF(VRFNum).DefrostEIRPtr, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -3146,7 +3257,7 @@ namespace HVACVariableRefrigerantFlow { // Evaporating Capacity Curve if (!lAlphaFieldBlanks(Count2Index + 2 * NumCompSpd)) { int indexOUEvapCapCurve = GetCurveIndex(state, cAlphaArgs(Count2Index + 2 * NumCompSpd)); // convert curve name to index number - if (indexOUEvapCapCurve == 0) { // Verify curve name and type + if (indexOUEvapCapCurve == 0) { // Verify curve name and type if (lAlphaFieldBlanks(Count2Index + 2 * NumCompSpd)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", missing"); ShowContinueError(state, "...required " + cAlphaFieldNames(Count2Index + 2 * NumCompSpd) + " is blank."); @@ -3157,7 +3268,8 @@ namespace HVACVariableRefrigerantFlow { } ErrorsFound = true; } else { - ErrorsFound |= CurveManager::CheckCurveDims(state, indexOUEvapCapCurve, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + indexOUEvapCapCurve, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -3172,8 +3284,9 @@ namespace HVACVariableRefrigerantFlow { // Compressor Power Curve if (!lAlphaFieldBlanks(Count2Index + 2 * NumCompSpd + 1)) { - int indexOUCompPwrCurve = GetCurveIndex(state, cAlphaArgs(Count2Index + 2 * NumCompSpd + 1)); // convert curve name to index number - if (indexOUCompPwrCurve == 0) { // Verify curve name and type + int indexOUCompPwrCurve = + GetCurveIndex(state, cAlphaArgs(Count2Index + 2 * NumCompSpd + 1)); // convert curve name to index number + if (indexOUCompPwrCurve == 0) { // Verify curve name and type if (lAlphaFieldBlanks(Count2Index + 2 * NumCompSpd + 1)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + VRF(VRFNum).Name + "\", missing"); ShowContinueError(state, "...required " + cAlphaFieldNames(Count2Index + 2 * NumCompSpd + 1) + " is blank."); @@ -3184,7 +3297,8 @@ namespace HVACVariableRefrigerantFlow { } ErrorsFound = true; } else { - ErrorsFound |= CurveManager::CheckCurveDims(state, indexOUCompPwrCurve, // Curve index + ErrorsFound |= CurveManager::CheckCurveDims(state, + indexOUCompPwrCurve, // Curve index {2}, // Valid dimensions RoutineName, // Routine name cCurrentModuleObject, // Object Type @@ -3264,7 +3378,8 @@ namespace HVACVariableRefrigerantFlow { } } - VRFTU(VRFTUNum).VRFTUInletNodeNum = GetOnlySingleNode(state, cAlphaArgs(3), + VRFTU(VRFTUNum).VRFTUInletNodeNum = GetOnlySingleNode(state, + cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, VRFTU(VRFTUNum).Name, @@ -3273,7 +3388,8 @@ namespace HVACVariableRefrigerantFlow { 1, ObjectIsParent); - VRFTU(VRFTUNum).VRFTUOutletNodeNum = GetOnlySingleNode(state, cAlphaArgs(4), + VRFTU(VRFTUNum).VRFTUOutletNodeNum = GetOnlySingleNode(state, + cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, VRFTU(VRFTUNum).Name, @@ -4082,9 +4198,11 @@ namespace HVACVariableRefrigerantFlow { // Check VRF DX heating coil heating capacity as a fuction of temperature performance curve. Only report here for // biquadratic curve type. if (VRFTU(VRFTUNum).VRFSysNum > 0 && VRFTU(VRFTUNum).HeatCoilIndex > 0 && - state.dataCurveManager->PerfCurve(GetDXCoilCapFTCurveIndex(state, VRFTU(VRFTUNum).HeatCoilIndex, ErrorsFound)).NumDims == 2) { + state.dataCurveManager->PerfCurve(GetDXCoilCapFTCurveIndex(state, VRFTU(VRFTUNum).HeatCoilIndex, ErrorsFound)) + .NumDims == 2) { if (VRF(VRFTU(VRFTUNum).VRFSysNum).HeatingPerformanceOATType == DataHVACGlobals::WetBulbIndicator) { - checkCurveIsNormalizedToOne(state, + checkCurveIsNormalizedToOne( + state, "GetDXCoils: " + DataHVACGlobals::cAllCoilTypes(VRFTU(VRFTUNum).DXHeatCoilType_Num), DXCoils::GetDXCoilName(state, VRFTU(VRFTUNum).HeatCoilIndex, @@ -4093,7 +4211,8 @@ namespace HVACVariableRefrigerantFlow { ObjexxFCL::Optional_bool_const()), GetDXCoilCapFTCurveIndex(state, VRFTU(VRFTUNum).HeatCoilIndex, ErrorsFound), "Heating Capacity Ratio Modifier Function of Temperature Curve Name", - CurveManager::GetCurveName(state, GetDXCoilCapFTCurveIndex(state, VRFTU(VRFTUNum).HeatCoilIndex, ErrorsFound)), + CurveManager::GetCurveName(state, + GetDXCoilCapFTCurveIndex(state, VRFTU(VRFTUNum).HeatCoilIndex, ErrorsFound)), RatedInletAirTempHeat, RatedOutdoorWetBulbTempHeat); } else if (VRF(VRFTU(VRFTUNum).VRFSysNum).HeatingPerformanceOATType == DataHVACGlobals::DryBulbIndicator) { @@ -4288,17 +4407,20 @@ namespace HVACVariableRefrigerantFlow { ErrorsFound = true; } // Get the supplemental heating coil steam max volume flow rate - VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = SteamCoils::GetCoilMaxSteamFlowRate(state, VRFTU(VRFTUNum).SuppHeatCoilIndex, errFlag); + VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = + SteamCoils::GetCoilMaxSteamFlowRate(state, VRFTU(VRFTUNum).SuppHeatCoilIndex, errFlag); if (VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow > 0.0) { int SteamIndex = 0; // fluid type index of 0 is passed if steam Real64 TempSteamIn = 100.0; - Real64 SteamDensity = FluidProperties::GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, SteamIndex, RoutineName); + Real64 SteamDensity = + FluidProperties::GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, SteamIndex, RoutineName); VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = SteamCoils::GetCoilMaxSteamFlowRate(state, VRFTU(VRFTUNum).SuppHeatCoilIndex, errFlag) * SteamDensity; } // Get the supplemental heating coil air inlet node errFlag = false; - SuppHeatCoilAirInletNode = SteamCoils::GetCoilAirInletNode(state, VRFTU(VRFTUNum).SuppHeatCoilIndex, SuppHeatingCoilName, errFlag); + SuppHeatCoilAirInletNode = + SteamCoils::GetCoilAirInletNode(state, VRFTU(VRFTUNum).SuppHeatCoilIndex, SuppHeatingCoilName, errFlag); VRFTU(VRFTUNum).SuppHeatCoilAirInletNode = SuppHeatCoilAirInletNode; if (errFlag) { ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + VRFTU(VRFTUNum).Name); @@ -4306,7 +4428,8 @@ namespace HVACVariableRefrigerantFlow { } // Get the supplemental heating coil air outlet node errFlag = false; - SuppHeatCoilAirOutletNode = SteamCoils::GetCoilAirOutletNode(state, VRFTU(VRFTUNum).SuppHeatCoilIndex, SuppHeatingCoilName, errFlag); + SuppHeatCoilAirOutletNode = + SteamCoils::GetCoilAirOutletNode(state, VRFTU(VRFTUNum).SuppHeatCoilIndex, SuppHeatingCoilName, errFlag); VRFTU(VRFTUNum).SuppHeatCoilAirOutletNode = SuppHeatCoilAirOutletNode; if (errFlag) { ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + VRFTU(VRFTUNum).Name); @@ -4566,8 +4689,11 @@ namespace HVACVariableRefrigerantFlow { // warn when number of ZoneTerminalUnitList different from number of AirConditioner:VariableRefrigerantFlow if (NumVRFTULists != NumVRFCond) { - ShowSevereError(state, "The number of AirConditioner:VariableRefrigerantFlow objects (" + TrimSigDigits(NumVRFCond) + - ") does not match the number of ZoneTerminalUnitList objects (" + TrimSigDigits(NumVRFTULists) + ")."); + ShowSevereError(state, + format("The number of AirConditioner:VariableRefrigerantFlow objects ({}) does not match the number of " + "ZoneTerminalUnitList objects ({}).", + NumVRFCond, + NumVRFTULists)); for (NumCond = 1; NumCond <= NumVRFCond; ++NumCond) { if (VRF(NumCond).ZoneTUListPtr > 0) { ShowContinueError(state, "...AirConditioner:VariableRefrigerantFlow = " + VRF(NumCond).Name + @@ -4587,13 +4713,15 @@ namespace HVACVariableRefrigerantFlow { // Set up output variables for (VRFNum = 1; VRFNum <= NumVRFTU; ++VRFNum) { if (VRFTU(VRFNum).CoolingCoilPresent) { - SetupOutputVariable(state, "Zone VRF Air Terminal Cooling Electricity Rate", + SetupOutputVariable(state, + "Zone VRF Air Terminal Cooling Electricity Rate", OutputProcessor::Unit::W, VRFTU(VRFNum).ParasiticCoolElecPower, "System", "Average", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Cooling Electricity Energy", + SetupOutputVariable(state, + "Zone VRF Air Terminal Cooling Electricity Energy", OutputProcessor::Unit::J, VRFTU(VRFNum).ParasiticElecCoolConsumption, "System", @@ -4604,37 +4732,43 @@ namespace HVACVariableRefrigerantFlow { "COOLING", _, "System"); - SetupOutputVariable(state, "Zone VRF Air Terminal Total Cooling Rate", + SetupOutputVariable(state, + "Zone VRF Air Terminal Total Cooling Rate", OutputProcessor::Unit::W, VRFTU(VRFNum).TotalCoolingRate, "System", "Average", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Sensible Cooling Rate", + SetupOutputVariable(state, + "Zone VRF Air Terminal Sensible Cooling Rate", OutputProcessor::Unit::W, VRFTU(VRFNum).SensibleCoolingRate, "System", "Average", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Latent Cooling Rate", + SetupOutputVariable(state, + "Zone VRF Air Terminal Latent Cooling Rate", OutputProcessor::Unit::W, VRFTU(VRFNum).LatentCoolingRate, "System", "Average", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Total Cooling Energy", + SetupOutputVariable(state, + "Zone VRF Air Terminal Total Cooling Energy", OutputProcessor::Unit::J, VRFTU(VRFNum).TotalCoolingEnergy, "System", "Sum", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Sensible Cooling Energy", + SetupOutputVariable(state, + "Zone VRF Air Terminal Sensible Cooling Energy", OutputProcessor::Unit::J, VRFTU(VRFNum).SensibleCoolingEnergy, "System", "Sum", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Latent Cooling Energy", + SetupOutputVariable(state, + "Zone VRF Air Terminal Latent Cooling Energy", OutputProcessor::Unit::J, VRFTU(VRFNum).LatentCoolingEnergy, "System", @@ -4642,13 +4776,15 @@ namespace HVACVariableRefrigerantFlow { VRFTU(VRFNum).Name); } if (VRFTU(VRFNum).HeatingCoilPresent) { - SetupOutputVariable(state, "Zone VRF Air Terminal Heating Electricity Rate", + SetupOutputVariable(state, + "Zone VRF Air Terminal Heating Electricity Rate", OutputProcessor::Unit::W, VRFTU(VRFNum).ParasiticHeatElecPower, "System", "Average", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Heating Electricity Energy", + SetupOutputVariable(state, + "Zone VRF Air Terminal Heating Electricity Energy", OutputProcessor::Unit::J, VRFTU(VRFNum).ParasiticElecHeatConsumption, "System", @@ -4659,44 +4795,51 @@ namespace HVACVariableRefrigerantFlow { "HEATING", _, "System"); - SetupOutputVariable(state, "Zone VRF Air Terminal Total Heating Rate", + SetupOutputVariable(state, + "Zone VRF Air Terminal Total Heating Rate", OutputProcessor::Unit::W, VRFTU(VRFNum).TotalHeatingRate, "System", "Average", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Sensible Heating Rate", + SetupOutputVariable(state, + "Zone VRF Air Terminal Sensible Heating Rate", OutputProcessor::Unit::W, VRFTU(VRFNum).SensibleHeatingRate, "System", "Average", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Latent Heating Rate", + SetupOutputVariable(state, + "Zone VRF Air Terminal Latent Heating Rate", OutputProcessor::Unit::W, VRFTU(VRFNum).LatentHeatingRate, "System", "Average", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Total Heating Energy", + SetupOutputVariable(state, + "Zone VRF Air Terminal Total Heating Energy", OutputProcessor::Unit::J, VRFTU(VRFNum).TotalHeatingEnergy, "System", "Sum", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Sensible Heating Energy", + SetupOutputVariable(state, + "Zone VRF Air Terminal Sensible Heating Energy", OutputProcessor::Unit::J, VRFTU(VRFNum).SensibleHeatingEnergy, "System", "Sum", VRFTU(VRFNum).Name); - SetupOutputVariable(state, "Zone VRF Air Terminal Latent Heating Energy", + SetupOutputVariable(state, + "Zone VRF Air Terminal Latent Heating Energy", OutputProcessor::Unit::J, VRFTU(VRFNum).LatentHeatingEnergy, "System", "Sum", VRFTU(VRFNum).Name); } - SetupOutputVariable(state, "Zone VRF Air Terminal Fan Availability Status", + SetupOutputVariable(state, + "Zone VRF Air Terminal Fan Availability Status", OutputProcessor::Unit::None, VRFTU(VRFNum).AvailStatus, "System", @@ -4713,25 +4856,29 @@ namespace HVACVariableRefrigerantFlow { } for (NumCond = 1; NumCond <= NumVRFCond; ++NumCond) { - SetupOutputVariable(state, "VRF Heat Pump Total Cooling Rate", + SetupOutputVariable(state, + "VRF Heat Pump Total Cooling Rate", OutputProcessor::Unit::W, VRF(NumCond).TotalCoolingCapacity, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Total Heating Rate", + SetupOutputVariable(state, + "VRF Heat Pump Total Heating Rate", OutputProcessor::Unit::W, VRF(NumCond).TotalHeatingCapacity, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Cooling " + VRF(NumCond).FuelType + " Rate", + SetupOutputVariable(state, + "VRF Heat Pump Cooling " + VRF(NumCond).FuelType + " Rate", OutputProcessor::Unit::W, VRF(NumCond).ElecCoolingPower, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Cooling " + VRF(NumCond).FuelType + " Energy", + SetupOutputVariable(state, + "VRF Heat Pump Cooling " + VRF(NumCond).FuelType + " Energy", OutputProcessor::Unit::J, VRF(NumCond).CoolElecConsumption, "System", @@ -4742,13 +4889,15 @@ namespace HVACVariableRefrigerantFlow { "COOLING", _, "System"); - SetupOutputVariable(state, "VRF Heat Pump Heating " + VRF(NumCond).FuelType + " Rate", + SetupOutputVariable(state, + "VRF Heat Pump Heating " + VRF(NumCond).FuelType + " Rate", OutputProcessor::Unit::W, VRF(NumCond).ElecHeatingPower, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Heating " + VRF(NumCond).FuelType + " Energy", + SetupOutputVariable(state, + "VRF Heat Pump Heating " + VRF(NumCond).FuelType + " Energy", OutputProcessor::Unit::J, VRF(NumCond).HeatElecConsumption, "System", @@ -4761,86 +4910,110 @@ namespace HVACVariableRefrigerantFlow { "System"); SetupOutputVariable(state, - "VRF Heat Pump Cooling COP", OutputProcessor::Unit::None, VRF(NumCond).OperatingCoolingCOP, "System", "Average", VRF(NumCond).Name); + "VRF Heat Pump Cooling COP", + OutputProcessor::Unit::None, + VRF(NumCond).OperatingCoolingCOP, + "System", + "Average", + VRF(NumCond).Name); SetupOutputVariable(state, - "VRF Heat Pump Heating COP", OutputProcessor::Unit::None, VRF(NumCond).OperatingHeatingCOP, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump COP", OutputProcessor::Unit::None, VRF(NumCond).OperatingCOP, "System", "Average", VRF(NumCond).Name); + "VRF Heat Pump Heating COP", + OutputProcessor::Unit::None, + VRF(NumCond).OperatingHeatingCOP, + "System", + "Average", + VRF(NumCond).Name); + SetupOutputVariable( + state, "VRF Heat Pump COP", OutputProcessor::Unit::None, VRF(NumCond).OperatingCOP, "System", "Average", VRF(NumCond).Name); if (VRF(NumCond).VRFAlgorithmTypeNum == AlgorithmTypeFluidTCtrl) { // For VRF_FluidTCtrl Model - SetupOutputVariable(state, "VRF Heat Pump Compressor Electricity Rate", + SetupOutputVariable(state, + "VRF Heat Pump Compressor Electricity Rate", OutputProcessor::Unit::W, VRF(NumCond).Ncomp, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Outdoor Unit Fan Power", + SetupOutputVariable(state, + "VRF Heat Pump Outdoor Unit Fan Power", OutputProcessor::Unit::W, VRF(NumCond).OUFanPower, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Compressor Rotating Speed", + SetupOutputVariable(state, + "VRF Heat Pump Compressor Rotating Speed", OutputProcessor::Unit::rev_min, VRF(NumCond).CompActSpeed, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Indoor Unit Evaporating Temperature", + SetupOutputVariable(state, + "VRF Heat Pump Indoor Unit Evaporating Temperature", OutputProcessor::Unit::C, VRF(NumCond).IUEvaporatingTemp, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Outdoor Unit Condensing Temperature", + SetupOutputVariable(state, + "VRF Heat Pump Outdoor Unit Condensing Temperature", OutputProcessor::Unit::C, VRF(NumCond).CondensingTemp, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Indoor Unit Condensing Temperature", + SetupOutputVariable(state, + "VRF Heat Pump Indoor Unit Condensing Temperature", OutputProcessor::Unit::C, VRF(NumCond).IUCondensingTemp, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Outdoor Unit Evaporating Temperature", + SetupOutputVariable(state, + "VRF Heat Pump Outdoor Unit Evaporating Temperature", OutputProcessor::Unit::C, VRF(NumCond).EvaporatingTemp, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Cooling Capacity at Max Compressor Speed", + SetupOutputVariable(state, + "VRF Heat Pump Cooling Capacity at Max Compressor Speed", OutputProcessor::Unit::W, VRF(NumCond).CoolingCapacity, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Heating Capacity at Max Compressor Speed", + SetupOutputVariable(state, + "VRF Heat Pump Heating Capacity at Max Compressor Speed", OutputProcessor::Unit::W, VRF(NumCond).HeatingCapacity, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Indoor Unit Piping Correction for Cooling", + SetupOutputVariable(state, + "VRF Heat Pump Indoor Unit Piping Correction for Cooling", OutputProcessor::Unit::None, VRF(NumCond).PipingCorrectionCooling, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Indoor Unit Piping Correction for Heating", + SetupOutputVariable(state, + "VRF Heat Pump Indoor Unit Piping Correction for Heating", OutputProcessor::Unit::None, VRF(NumCond).PipingCorrectionHeating, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Outdoor Unit Evaporator Heat Extract Rate", + SetupOutputVariable(state, + "VRF Heat Pump Outdoor Unit Evaporator Heat Extract Rate", OutputProcessor::Unit::W, VRF(NumCond).OUEvapHeatRate, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Outdoor Unit Condenser Heat Release Rate", + SetupOutputVariable(state, + "VRF Heat Pump Outdoor Unit Condenser Heat Release Rate", OutputProcessor::Unit::W, VRF(NumCond).OUCondHeatRate, "System", @@ -4849,13 +5022,15 @@ namespace HVACVariableRefrigerantFlow { } else { // For VRF_SysCurve Model - SetupOutputVariable(state, "VRF Heat Pump Maximum Capacity Cooling Rate", + SetupOutputVariable(state, + "VRF Heat Pump Maximum Capacity Cooling Rate", OutputProcessor::Unit::W, MaxCoolingCapacity(NumCond), "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Maximum Capacity Heating Rate", + SetupOutputVariable(state, + "VRF Heat Pump Maximum Capacity Heating Rate", OutputProcessor::Unit::W, MaxHeatingCapacity(NumCond), "System", @@ -4865,13 +5040,15 @@ namespace HVACVariableRefrigerantFlow { if (VRF(NumCond).DefrostStrategy == Resistive || (VRF(NumCond).DefrostStrategy == ReverseCycle && VRF(NumCond).FuelTypeNum == DataGlobalConstants::ResourceType::Electricity)) { - SetupOutputVariable(state, "VRF Heat Pump Defrost Electricity Rate", + SetupOutputVariable(state, + "VRF Heat Pump Defrost Electricity Rate", OutputProcessor::Unit::W, VRF(NumCond).DefrostPower, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Defrost Electricity Energy", + SetupOutputVariable(state, + "VRF Heat Pump Defrost Electricity Energy", OutputProcessor::Unit::J, VRF(NumCond).DefrostConsumption, "System", @@ -4883,13 +5060,15 @@ namespace HVACVariableRefrigerantFlow { _, "System"); } else { // defrost energy applied to fuel type - SetupOutputVariable(state, "VRF Heat Pump Defrost " + VRF(NumCond).FuelType + " Rate", + SetupOutputVariable(state, + "VRF Heat Pump Defrost " + VRF(NumCond).FuelType + " Rate", OutputProcessor::Unit::W, VRF(NumCond).DefrostPower, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Defrost " + VRF(NumCond).FuelType + " Energy", + SetupOutputVariable(state, + "VRF Heat Pump Defrost " + VRF(NumCond).FuelType + " Energy", OutputProcessor::Unit::J, VRF(NumCond).DefrostConsumption, "System", @@ -4902,29 +5081,47 @@ namespace HVACVariableRefrigerantFlow { "System"); } + SetupOutputVariable( + state, "VRF Heat Pump Part Load Ratio", OutputProcessor::Unit::None, VRF(NumCond).VRFCondPLR, "System", "Average", VRF(NumCond).Name); SetupOutputVariable(state, - "VRF Heat Pump Part Load Ratio", OutputProcessor::Unit::None, VRF(NumCond).VRFCondPLR, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, - "VRF Heat Pump Runtime Fraction", OutputProcessor::Unit::None, VRF(NumCond).VRFCondRTF, "System", "Average", VRF(NumCond).Name); + "VRF Heat Pump Runtime Fraction", + OutputProcessor::Unit::None, + VRF(NumCond).VRFCondRTF, + "System", + "Average", + VRF(NumCond).Name); SetupOutputVariable(state, - "VRF Heat Pump Cycling Ratio", OutputProcessor::Unit::None, VRF(NumCond).VRFCondCyclingRatio, "System", "Average", VRF(NumCond).Name); + "VRF Heat Pump Cycling Ratio", + OutputProcessor::Unit::None, + VRF(NumCond).VRFCondCyclingRatio, + "System", + "Average", + VRF(NumCond).Name); SetupOutputVariable(state, - "VRF Heat Pump Operating Mode", OutputProcessor::Unit::None, VRF(NumCond).OperatingMode, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Condenser Inlet Temperature", + "VRF Heat Pump Operating Mode", + OutputProcessor::Unit::None, + VRF(NumCond).OperatingMode, + "System", + "Average", + VRF(NumCond).Name); + SetupOutputVariable(state, + "VRF Heat Pump Condenser Inlet Temperature", OutputProcessor::Unit::C, VRF(NumCond).CondenserInletTemp, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Crankcase Heater Electricity Rate", + SetupOutputVariable(state, + "VRF Heat Pump Crankcase Heater Electricity Rate", OutputProcessor::Unit::W, VRF(NumCond).CrankCaseHeaterPower, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Crankcase Heater Electricity Energy", + SetupOutputVariable(state, + "VRF Heat Pump Crankcase Heater Electricity Energy", OutputProcessor::Unit::J, VRF(NumCond).CrankCaseHeaterElecConsumption, "System", @@ -4935,34 +5132,44 @@ namespace HVACVariableRefrigerantFlow { "COOLING", _, "System"); - SetupOutputVariable(state, "VRF Heat Pump Terminal Unit Cooling Load Rate", + SetupOutputVariable(state, + "VRF Heat Pump Terminal Unit Cooling Load Rate", OutputProcessor::Unit::W, VRF(NumCond).TUCoolingLoad, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Terminal Unit Heating Load Rate", + SetupOutputVariable(state, + "VRF Heat Pump Terminal Unit Heating Load Rate", OutputProcessor::Unit::W, VRF(NumCond).TUHeatingLoad, "System", "Average", VRF(NumCond).Name); if (VRF(NumCond).HeatRecoveryUsed) { - SetupOutputVariable(state, "VRF Heat Pump Heat Recovery Status Change Multiplier", + SetupOutputVariable(state, + "VRF Heat Pump Heat Recovery Status Change Multiplier", OutputProcessor::Unit::None, VRF(NumCond).SUMultiplier, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Simultaneous Cooling and Heating Efficiency", + SetupOutputVariable(state, + "VRF Heat Pump Simultaneous Cooling and Heating Efficiency", OutputProcessor::Unit::Btu_h_W, VRF(NumCond).SCHE, "System", "Average", VRF(NumCond).Name); SetupOutputVariable(state, - "VRF Heat Pump Heat Recovery Rate", OutputProcessor::Unit::W, VRF(NumCond).VRFHeatRec, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Heat Recovery Energy", + "VRF Heat Pump Heat Recovery Rate", + OutputProcessor::Unit::W, + VRF(NumCond).VRFHeatRec, + "System", + "Average", + VRF(NumCond).Name); + SetupOutputVariable(state, + "VRF Heat Pump Heat Recovery Energy", OutputProcessor::Unit::J, VRF(NumCond).VRFHeatEnergyRec, "System", @@ -4976,7 +5183,8 @@ namespace HVACVariableRefrigerantFlow { } if (VRF(NumCond).CondenserType == DataHVACGlobals::EvapCooled) { - SetupOutputVariable(state, "VRF Heat Pump Evaporative Condenser Water Use Volume", + SetupOutputVariable(state, + "VRF Heat Pump Evaporative Condenser Water Use Volume", OutputProcessor::Unit::m3, VRF(NumCond).EvapWaterConsumpRate, "System", @@ -4987,13 +5195,15 @@ namespace HVACVariableRefrigerantFlow { "Cooling", _, "System"); - SetupOutputVariable(state, "VRF Heat Pump Evaporative Condenser Pump Electricity Rate", + SetupOutputVariable(state, + "VRF Heat Pump Evaporative Condenser Pump Electricity Rate", OutputProcessor::Unit::W, VRF(NumCond).EvapCondPumpElecPower, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Evaporative Condenser Pump Electricity Energy", + SetupOutputVariable(state, + "VRF Heat Pump Evaporative Condenser Pump Electricity Energy", OutputProcessor::Unit::J, VRF(NumCond).EvapCondPumpElecConsumption, "System", @@ -5006,13 +5216,15 @@ namespace HVACVariableRefrigerantFlow { "System"); if (VRF(NumCond).BasinHeaterPowerFTempDiff > 0.0) { - SetupOutputVariable(state, "VRF Heat Pump Basin Heater Electricity Rate", + SetupOutputVariable(state, + "VRF Heat Pump Basin Heater Electricity Rate", OutputProcessor::Unit::W, VRF(NumCond).BasinHeaterPower, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Basin Heater Electricity Energy", + SetupOutputVariable(state, + "VRF Heat Pump Basin Heater Electricity Energy", OutputProcessor::Unit::J, VRF(NumCond).BasinHeaterConsumption, "System", @@ -5026,25 +5238,29 @@ namespace HVACVariableRefrigerantFlow { } } else if (VRF(NumCond).CondenserType == DataHVACGlobals::WaterCooled) { - SetupOutputVariable(state, "VRF Heat Pump Condenser Outlet Temperature", + SetupOutputVariable(state, + "VRF Heat Pump Condenser Outlet Temperature", OutputProcessor::Unit::C, VRF(NumCond).CondenserSideOutletTemp, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Condenser Mass Flow Rate", + SetupOutputVariable(state, + "VRF Heat Pump Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, VRF(NumCond).WaterCondenserMassFlow, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Condenser Heat Transfer Rate", + SetupOutputVariable(state, + "VRF Heat Pump Condenser Heat Transfer Rate", OutputProcessor::Unit::W, VRF(NumCond).QCondenser, "System", "Average", VRF(NumCond).Name); - SetupOutputVariable(state, "VRF Heat Pump Condenser Heat Transfer Energy", + SetupOutputVariable(state, + "VRF Heat Pump Condenser Heat Transfer Energy", OutputProcessor::Unit::J, VRF(NumCond).QCondEnergy, "System", @@ -5090,8 +5306,7 @@ namespace HVACVariableRefrigerantFlow { using DataZoneEquipment::ZoneEquipList; using Fans::GetFanVolFlow; using FluidProperties::GetDensityGlycol; - using General::RoundSigDigits; - using General::TrimSigDigits; + using MixedAir::SimOAMixer; using PlantUtilities::InitComponentNodes; using ScheduleManager::GetCurrentScheduleValue; @@ -5216,7 +5431,8 @@ namespace HVACVariableRefrigerantFlow { _, _); - WaterCoils::SetCoilDesFlow(state, DataHVACGlobals::cAllCoilTypes(VRFTU(VRFTUNum).SuppHeatCoilType_Num), + WaterCoils::SetCoilDesFlow(state, + DataHVACGlobals::cAllCoilTypes(VRFTU(VRFTUNum).SuppHeatCoilType_Num), VRFTU(VRFTUNum).SuppHeatCoilName, VRFTU(VRFTUNum).MaxHeatAirVolFlow, errFlag); @@ -5414,7 +5630,8 @@ namespace HVACVariableRefrigerantFlow { for (int OACompNum = 1; OACompNum <= state.dataAirLoop->OutsideAirSys(OASysNum).NumComponents; ++OACompNum) { if (!UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentName(OACompNum), VRFTU(TUIndex).Name) || - !UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentType(OACompNum), cCurrentModuleObject)) + !UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentType(OACompNum), + cCurrentModuleObject)) continue; VRFTU(TUIndex).airLoopNum = 0; // need air loop number here? VRFTU(TUIndex).isInOASys = true; @@ -5486,7 +5703,8 @@ namespace HVACVariableRefrigerantFlow { for (int ZoneInSysIndex = 1; ZoneInSysIndex <= NumAirLoopZones; ++ZoneInSysIndex) { // zone inlet nodes for cooling if (state.dataAirLoop->AirToZoneNodeInfo(VRFTU(TUIndex).airLoopNum).NumZonesCooled > 0) { - if (state.dataAirLoop->AirToZoneNodeInfo(VRFTU(TUIndex).airLoopNum).TermUnitCoolInletNodes(ZoneInSysIndex) == -999) { + if (state.dataAirLoop->AirToZoneNodeInfo(VRFTU(TUIndex).airLoopNum).TermUnitCoolInletNodes(ZoneInSysIndex) == + -999) { // the data structure for the zones inlet nodes has not been filled initLoadBasedControlFlowFracFlagReady = false; } else { @@ -5500,7 +5718,8 @@ namespace HVACVariableRefrigerantFlow { } // zone inlet nodes for heating if (state.dataAirLoop->AirToZoneNodeInfo(VRFTU(TUIndex).airLoopNum).NumZonesHeated > 0) { - if (state.dataAirLoop->AirToZoneNodeInfo(VRFTU(TUIndex).airLoopNum).TermUnitHeatInletNodes(ZoneInSysIndex) == -999) { + if (state.dataAirLoop->AirToZoneNodeInfo(VRFTU(TUIndex).airLoopNum).TermUnitHeatInletNodes(ZoneInSysIndex) == + -999) { // the data structure for the zones inlet nodes has not been filled initLoadBasedControlFlowFracFlagReady = false; } else { @@ -5956,9 +6175,11 @@ namespace HVACVariableRefrigerantFlow { MyEnvrnFlag(VRFTUNum) = false; if (VRF(VRFCond).CondenserType == DataHVACGlobals::WaterCooled) { - rho = GetDensityGlycol( - state, PlantLoop(VRF(VRFCond).SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp(), - PlantLoop(VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); + rho = GetDensityGlycol(state, + PlantLoop(VRF(VRFCond).SourceLoopNum).FluidName, + DataGlobalConstants::CWInitConvTemp(), + PlantLoop(VRF(VRFCond).SourceLoopNum).FluidIndex, + RoutineName); VRF(VRFCond).WaterCondenserDesignMassFlow = VRF(VRFCond).WaterCondVolFlowRate * rho; InitComponentNodes(0.0, @@ -6005,7 +6226,8 @@ namespace HVACVariableRefrigerantFlow { if (CoilMaxVolFlowRate != DataSizing::AutoSize) { int SteamIndex = 0; // fluid type index of 0 is passed if steam Real64 TempSteamIn = 100.0; - Real64 SteamDensity = FluidProperties::GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, SteamIndex, RoutineName); + Real64 SteamDensity = + FluidProperties::GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, SteamIndex, RoutineName); VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = CoilMaxVolFlowRate * SteamDensity; } } @@ -6127,10 +6349,11 @@ namespace HVACVariableRefrigerantFlow { ShowWarningError(state, "InitVRF: VRF Terminal Unit = [" + DataHVACGlobals::cVRFTUTypes(VRFTU(VRFTUNum).VRFTUType_Num) + ", \"" + VRFTU(VRFTUNum).Name + "\"]"); ShowContinueError(state, "... has Supply Air Flow Rate During Cooling Operation > Max Fan Volume Flow Rate, should be <="); - ShowContinueError(state, "... Supply Air Flow Rate During Cooling Operation = " + - RoundSigDigits(VRFTU(VRFTUNum).MaxCoolAirVolFlow, 4) + " m3/s"); - ShowContinueError(state, "... Max Fan Volume Flow Rate = " + - RoundSigDigits(VRFTU(VRFTUNum).ActualFanVolFlowRate, 4) + " m3/s"); + ShowContinueError( + state, format("... Supply Air Flow Rate During Cooling Operation = {:.4R} m3/s", VRFTU(VRFTUNum).MaxCoolAirVolFlow)); + ShowContinueError( + state, + format("... Max Fan Volume Flow Rate = {:.4R} m3/s", VRFTU(VRFTUNum).ActualFanVolFlowRate)); ShowContinueError(state, "...the supply air flow rate during cooling operation will be reduced to match and the simulation continues."); VRFTU(VRFTUNum).MaxCoolAirVolFlow = VRFTU(VRFTUNum).ActualFanVolFlowRate; @@ -6140,10 +6363,12 @@ namespace HVACVariableRefrigerantFlow { ShowWarningError(state, "InitVRF: VRF Terminal Unit = [" + DataHVACGlobals::cVRFTUTypes(VRFTU(VRFTUNum).VRFTUType_Num) + ", \"" + VRFTU(VRFTUNum).Name + "\"]"); ShowContinueError(state, "... has Supply Air Flow Rate When No Cooling is Needed > Max Fan Volume Flow Rate, should be <="); - ShowContinueError(state, "... Supply Air Flow Rate When No Cooling is Needed = " + - RoundSigDigits(VRFTU(VRFTUNum).MaxNoCoolAirVolFlow, 4) + " m3/s"); - ShowContinueError(state, "... Max Fan Volume Flow Rate = " + - RoundSigDigits(VRFTU(VRFTUNum).ActualFanVolFlowRate, 4) + " m3/s"); + ShowContinueError( + state, + format("... Supply Air Flow Rate When No Cooling is Needed = {:.4R} m3/s", VRFTU(VRFTUNum).MaxNoCoolAirVolFlow)); + ShowContinueError( + state, + format("... Max Fan Volume Flow Rate = {:.4R} m3/s", VRFTU(VRFTUNum).ActualFanVolFlowRate)); ShowContinueError(state, "...the supply air flow rate when no cooling is needed will be reduced to match and the simulation continues."); VRFTU(VRFTUNum).MaxNoCoolAirVolFlow = VRFTU(VRFTUNum).ActualFanVolFlowRate; @@ -6154,10 +6379,10 @@ namespace HVACVariableRefrigerantFlow { VRFTU(VRFTUNum).Name + "\"]"); ShowContinueError(state, "...The Outdoor Air Flow Rate During Cooling Operation exceeds the Supply Air Flow Rate During Cooling Operation."); - ShowContinueError(state, "...Outdoor Air Flow Rate During Cooling Operation = " + - RoundSigDigits(VRFTU(VRFTUNum).CoolOutAirVolFlow, 4) + " m3/s"); - ShowContinueError(state, "... Supply Air Flow Rate During Cooling Operation = " + - RoundSigDigits(VRFTU(VRFTUNum).MaxCoolAirVolFlow, 4) + " m3/s"); + ShowContinueError( + state, format("...Outdoor Air Flow Rate During Cooling Operation = {:.4R} m3/s", VRFTU(VRFTUNum).CoolOutAirVolFlow)); + ShowContinueError( + state, format("... Supply Air Flow Rate During Cooling Operation = {:.4R} m3/s", VRFTU(VRFTUNum).MaxCoolAirVolFlow)); ShowContinueError(state, "...the outdoor air flow rate will be reduced to match and the simulation continues."); VRFTU(VRFTUNum).CoolOutAirVolFlow = VRFTU(VRFTUNum).MaxCoolAirVolFlow; } @@ -6166,10 +6391,11 @@ namespace HVACVariableRefrigerantFlow { ShowWarningError(state, "InitVRF: VRF Terminal Unit = [" + DataHVACGlobals::cVRFTUTypes(VRFTU(VRFTUNum).VRFTUType_Num) + ", \"" + VRFTU(VRFTUNum).Name + "\"]"); ShowContinueError(state, "... has Supply Air Flow Rate During Heating Operation > Max Fan Volume Flow Rate, should be <="); - ShowContinueError(state, "... Supply Air Flow Rate During Heating Operation = " + - RoundSigDigits(VRFTU(VRFTUNum).MaxHeatAirVolFlow, 4) + " m3/s"); - ShowContinueError(state, "... Max Fan Volume Flow Rate = " + - RoundSigDigits(VRFTU(VRFTUNum).ActualFanVolFlowRate, 4) + " m3/s"); + ShowContinueError( + state, format("... Supply Air Flow Rate During Heating Operation = {:.4R} m3/s", VRFTU(VRFTUNum).MaxHeatAirVolFlow)); + ShowContinueError( + state, + format("... Max Fan Volume Flow Rate = {:.4R} m3/s", VRFTU(VRFTUNum).ActualFanVolFlowRate)); ShowContinueError(state, "...the supply air flow rate during cooling operation will be reduced to match and the simulation continues."); VRFTU(VRFTUNum).MaxHeatAirVolFlow = VRFTU(VRFTUNum).ActualFanVolFlowRate; @@ -6179,10 +6405,12 @@ namespace HVACVariableRefrigerantFlow { ShowWarningError(state, "InitVRF: VRF Terminal Unit = [" + DataHVACGlobals::cVRFTUTypes(VRFTU(VRFTUNum).VRFTUType_Num) + ", \"" + VRFTU(VRFTUNum).Name + "\"]"); ShowContinueError(state, "... has Supply Air Flow Rate When No Heating is Needed > Max Fan Volume Flow Rate, should be <="); - ShowContinueError(state, "... Supply Air Flow Rate When No Heating is Needed = " + - RoundSigDigits(VRFTU(VRFTUNum).MaxNoHeatAirVolFlow, 4) + " m3/s"); - ShowContinueError(state, "... Max Fan Volume Flow Rate = " + - RoundSigDigits(VRFTU(VRFTUNum).ActualFanVolFlowRate, 4) + " m3/s"); + ShowContinueError( + state, + format("... Supply Air Flow Rate When No Heating is Needed = {:.4R} m3/s", VRFTU(VRFTUNum).MaxNoHeatAirVolFlow)); + ShowContinueError( + state, + format("... Max Fan Volume Flow Rate = {:.4R} m3/s", VRFTU(VRFTUNum).ActualFanVolFlowRate)); ShowContinueError(state, "...the supply air flow rate when no cooling is needed will be reduced to match and the simulation continues."); VRFTU(VRFTUNum).MaxNoHeatAirVolFlow = VRFTU(VRFTUNum).ActualFanVolFlowRate; @@ -6193,10 +6421,10 @@ namespace HVACVariableRefrigerantFlow { VRFTU(VRFTUNum).Name + "\"]"); ShowContinueError(state, "...The Outdoor Air Flow Rate During Heating Operation exceeds the Supply Air Flow Rate During Heating Operation."); - ShowContinueError(state, "...Outdoor Air Flow Rate During Heating Operation = " + - RoundSigDigits(VRFTU(VRFTUNum).HeatOutAirVolFlow, 4) + " m3/s"); - ShowContinueError(state, "... Supply Air Flow Rate During Heating Operation = " + - RoundSigDigits(VRFTU(VRFTUNum).MaxHeatAirVolFlow, 4) + " m3/s"); + ShowContinueError( + state, format("...Outdoor Air Flow Rate During Heating Operation = {:.4R} m3/s", VRFTU(VRFTUNum).HeatOutAirVolFlow)); + ShowContinueError( + state, format("... Supply Air Flow Rate During Heating Operation = {:.4R} m3/s", VRFTU(VRFTUNum).MaxHeatAirVolFlow)); ShowContinueError(state, "...the outdoor air flow rate will be reduced to match and the simulation continues."); VRFTU(VRFTUNum).HeatOutAirVolFlow = VRFTU(VRFTUNum).MaxHeatAirVolFlow; } @@ -6206,10 +6434,12 @@ namespace HVACVariableRefrigerantFlow { VRFTU(VRFTUNum).Name + "\"]"); ShowContinueError(state, "... has a Outdoor Air Flow Rate When No Cooling or Heating is Needed > Max Fan Volume Flow Rate, should be <="); - ShowContinueError(state, "... Outdoor Air Flow Rate When No Cooling or Heating is Needed = " + - RoundSigDigits(VRFTU(VRFTUNum).NoCoolHeatOutAirVolFlow, 4) + " m3/s"); - ShowContinueError(state, "... Max Fan Volume Flow Rate = " + - RoundSigDigits(VRFTU(VRFTUNum).ActualFanVolFlowRate, 4) + " m3/s"); + ShowContinueError(state, + format("... Outdoor Air Flow Rate When No Cooling or Heating is Needed = {:.4R} m3/s", + VRFTU(VRFTUNum).NoCoolHeatOutAirVolFlow)); + ShowContinueError(state, + format("... Max Fan Volume Flow Rate = {:.4R} m3/s", + VRFTU(VRFTUNum).ActualFanVolFlowRate)); ShowContinueError(state, "...the outdoor air flow rate when no cooling or heating is needed will be reduced to match and the " "simulation continues."); VRFTU(VRFTUNum).NoCoolHeatOutAirVolFlow = VRFTU(VRFTUNum).ActualFanVolFlowRate; @@ -6311,16 +6541,16 @@ namespace HVACVariableRefrigerantFlow { ShowContinueError(state, "...InitVRF: VRF Heat Pump Min/Max Operating Temperature in Cooling Mode Limits have been " "exceeded and VRF system is disabled."); if (VRF(VRFCond).CondenserType == DataHVACGlobals::WaterCooled) { - ShowContinueError(state, "... Outdoor Unit Inlet Water Temperature = " + - TrimSigDigits(OutsideDryBulbTemp, 3)); + ShowContinueError(state, + format("... Outdoor Unit Inlet Water Temperature = {:.3T}", OutsideDryBulbTemp)); } else { - ShowContinueError(state, "... Outdoor Unit Inlet Air Temperature = " + - TrimSigDigits(OutsideDryBulbTemp, 3)); + ShowContinueError( + state, format("... Outdoor Unit Inlet Air Temperature = {:.3T}", OutsideDryBulbTemp)); } - ShowContinueError(state, "... Cooling Minimum Outdoor Unit Inlet Temperature = " + - TrimSigDigits(VRF(VRFCond).MinOATCooling, 3)); - ShowContinueError(state, "... Cooling Maximum Outdoor Unit Inlet Temperature = " + - TrimSigDigits(VRF(VRFCond).MaxOATCooling, 3)); + ShowContinueError( + state, format("... Cooling Minimum Outdoor Unit Inlet Temperature = {:.3T}", VRF(VRFCond).MinOATCooling)); + ShowContinueError( + state, format("... Cooling Maximum Outdoor Unit Inlet Temperature = {:.3T}", VRF(VRFCond).MaxOATCooling)); ShowContinueErrorTimeStamp(state, "... Check VRF Heat Pump Min/Max Outdoor Temperature in Cooling Mode limits."); } ShowRecurringWarningErrorAtEnd(state, @@ -6338,15 +6568,16 @@ namespace HVACVariableRefrigerantFlow { ShowContinueError(state, "...InitVRF: VRF Heat Pump Min/Max Operating Temperature in Cooling Mode Limits have been exceeded " "and VRF system is disabled."); if (VRF(VRFCond).CondenserType == DataHVACGlobals::WaterCooled) { - ShowContinueError(state, "... Outdoor Unit Inlet Water Temperature = " + TrimSigDigits(OutsideDryBulbTemp, 3)); + ShowContinueError(state, + format("... Outdoor Unit Inlet Water Temperature = {:.3T}", OutsideDryBulbTemp)); } else { - ShowContinueError(state, "... Outdoor Unit Inlet Air Temperature = " + - TrimSigDigits(OutsideDryBulbTemp, 3)); + ShowContinueError(state, + format("... Outdoor Unit Inlet Air Temperature = {:.3T}", OutsideDryBulbTemp)); } - ShowContinueError(state, "... Cooling Minimum Outdoor Unit Inlet Temperature = " + - TrimSigDigits(VRF(VRFCond).MinOATCooling, 3)); - ShowContinueError(state, "... Cooling Maximum Outdoor Unit Inlet Temperature = " + - TrimSigDigits(VRF(VRFCond).MaxOATCooling, 3)); + ShowContinueError(state, + format("... Cooling Minimum Outdoor Unit Inlet Temperature = {:.3T}", VRF(VRFCond).MinOATCooling)); + ShowContinueError(state, + format("... Cooling Maximum Outdoor Unit Inlet Temperature = {:.3T}", VRF(VRFCond).MaxOATCooling)); ShowContinueErrorTimeStamp(state, "... Check VRF Heat Pump Min/Max Outdoor Temperature in Cooling Mode limits."); } ShowRecurringWarningErrorAtEnd(state, cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + " \"" + VRF(VRFCond).Name + @@ -6383,16 +6614,16 @@ namespace HVACVariableRefrigerantFlow { ShowContinueError(state, "...InitVRF: VRF Heat Pump Min/Max Operating Temperature in Heating Mode Limits have been " "exceeded and VRF system is disabled."); if (VRF(VRFCond).CondenserType == DataHVACGlobals::WaterCooled) { - ShowContinueError(state, "... Outdoor Unit Inlet Water Temperature = " + - TrimSigDigits(OutsideDryBulbTemp, 3)); + ShowContinueError(state, + format("... Outdoor Unit Inlet Water Temperature = {:.3T}", OutsideDryBulbTemp)); } else { - ShowContinueError(state, "... Outdoor Unit Inlet Air Temperature = " + - TrimSigDigits(OutsideDryBulbTemp, 3)); + ShowContinueError(state, + format("... Outdoor Unit Inlet Air Temperature = {:.3T}", OutsideDryBulbTemp)); } - ShowContinueError(state, "... Heating Minimum Outdoor Unit Inlet Temperature = " + - TrimSigDigits(VRF(VRFCond).MinOATHeating, 3)); - ShowContinueError(state, "... Heating Maximum Outdoor Unit Inlet Temperature = " + - TrimSigDigits(VRF(VRFCond).MaxOATHeating, 3)); + ShowContinueError( + state, format("... Heating Minimum Outdoor Unit Inlet Temperature = {:.3T}", VRF(VRFCond).MinOATHeating)); + ShowContinueError( + state, format("... Heating Maximum Outdoor Unit Inlet Temperature = {:.3T}", VRF(VRFCond).MaxOATHeating)); ShowContinueErrorTimeStamp(state, "... Check VRF Heat Pump Min/Max Outdoor Temperature in Heating Mode limits."); } ShowRecurringWarningErrorAtEnd(state, @@ -6410,14 +6641,16 @@ namespace HVACVariableRefrigerantFlow { ShowContinueError(state, "...InitVRF: VRF Heat Pump Min/Max Operating Temperature in Heating Mode Limits have been exceeded " "and VRF system is disabled."); if (VRF(VRFCond).CondenserType == DataHVACGlobals::WaterCooled) { - ShowContinueError(state, "... Outdoor Unit Inlet Water Temperature = " + TrimSigDigits(OutsideDryBulbTemp, 3)); + ShowContinueError(state, + format("... Outdoor Unit Inlet Water Temperature = {:.3T}", OutsideDryBulbTemp)); } else { - ShowContinueError(state, "... Outdoor Unit Inlet Air Temperature = " + TrimSigDigits(OutsideDryBulbTemp, 3)); + ShowContinueError(state, + format("... Outdoor Unit Inlet Air Temperature = {:.3T}", OutsideDryBulbTemp)); } - ShowContinueError(state, "... Heating Minimum Outdoor Unit Inlet Temperature = " + - TrimSigDigits(VRF(VRFCond).MinOATHeating, 3)); - ShowContinueError(state, "... Heating Maximum Outdoor Unit Inlet Temperature = " + - TrimSigDigits(VRF(VRFCond).MaxOATHeating, 3)); + ShowContinueError(state, + format("... Heating Minimum Outdoor Unit Inlet Temperature = {:.3T}", VRF(VRFCond).MinOATHeating)); + ShowContinueError(state, + format("... Heating Maximum Outdoor Unit Inlet Temperature = {:.3T}", VRF(VRFCond).MaxOATHeating)); ShowContinueErrorTimeStamp(state, "... Check VRF Heat Pump Min/Max Outdoor Temperature in Heating Mode limits."); } ShowRecurringWarningErrorAtEnd(state, cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + " \"" + VRF(VRFCond).Name + @@ -6764,11 +6997,11 @@ namespace HVACVariableRefrigerantFlow { ShowWarningMessage(state, cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + " \"" + VRF(VRFCond).Name + "\"."); ShowContinueError(state, "...InitVRF: VRF Heat Pump Min/Max Outdoor Temperature in Heat Recovery Mode Limits have been exceeded and " "VRF heat recovery is disabled."); - ShowContinueError(state, "... Outdoor Dry-Bulb Temperature = " + TrimSigDigits(OutsideDryBulbTemp, 3)); - ShowContinueError(state, "... Heat Recovery Minimum Outdoor Dry-Bulb Temperature = " + - TrimSigDigits(VRF(VRFCond).MinOATHeatRecovery, 3)); - ShowContinueError(state, "... Heat Recovery Maximum Outdoor Dry-Bulb Temperature = " + - TrimSigDigits(VRF(VRFCond).MaxOATHeatRecovery, 3)); + ShowContinueError(state, format("... Outdoor Dry-Bulb Temperature = {:.3T}", OutsideDryBulbTemp)); + ShowContinueError(state, + format("... Heat Recovery Minimum Outdoor Dry-Bulb Temperature = {:.3T}", VRF(VRFCond).MinOATHeatRecovery)); + ShowContinueError(state, + format("... Heat Recovery Maximum Outdoor Dry-Bulb Temperature = {:.3T}", VRF(VRFCond).MaxOATHeatRecovery)); ShowContinueErrorTimeStamp(state, "... Check VRF Heat Pump Min/Max Outdoor Temperature in Heat Recovery Mode limits."); ShowContinueError(state, "...the system will operate in heat pump mode when applicable."); } @@ -6820,7 +7053,7 @@ namespace HVACVariableRefrigerantFlow { } else { if (VRF(VRFCond).HPOperatingModeErrorIndex == 0) { ShowWarningMessage(state, cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + " \"" + VRF(VRFCond).Name + "\"."); - ShowContinueError(state, "...InitVRF: Illegal HP operating mode = " + TrimSigDigits(VRF(VRFCond).EMSValueForHPOperatingMode, 0)); + ShowContinueError(state, format("...InitVRF: Illegal HP operating mode = {:.0T}", VRF(VRFCond).EMSValueForHPOperatingMode)); ShowContinueError(state, "...InitVRF: VRF HP operating mode will not be controlled by EMS."); } ShowRecurringWarningErrorAtEnd(state, cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + " \"" + VRF(VRFCond).Name + @@ -6998,7 +7231,7 @@ namespace HVACVariableRefrigerantFlow { using DataHVACGlobals::CoolingCapacitySizing; using DataHVACGlobals::HeatingAirflowSizing; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; + using PlantUtilities::RegisterPlantCompDesignFlow; static std::string const RoutineName("SizeVRF: "); // include trailing blank space @@ -7497,10 +7730,12 @@ namespace HVACVariableRefrigerantFlow { if ((std::abs(CoolOutAirVolFlowDes - CoolOutAirVolFlowUser) / CoolOutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + DataHVACGlobals::cVRFTUTypes(VRFTU(VRFTUNum).VRFTUType_Num) + ' ' + VRFTU(VRFTUNum).Name); - ShowContinueError(state, "User-Specified Outdoor Air Flow Rate During Cooling Operation of " + - RoundSigDigits(CoolOutAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Outdoor Air Flow Rate During Cooling Operation of " + - RoundSigDigits(CoolOutAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Outdoor Air Flow Rate During Cooling Operation of {:.5R} [m3/s]", CoolOutAirVolFlowUser)); + ShowContinueError(state, + format("differs from Design Size Outdoor Air Flow Rate During Cooling Operation of {:.5R} [m3/s]", + CoolOutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7560,10 +7795,12 @@ namespace HVACVariableRefrigerantFlow { if ((std::abs(HeatOutAirVolFlowDes - HeatOutAirVolFlowUser) / HeatOutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + DataHVACGlobals::cVRFTUTypes(VRFTU(VRFTUNum).VRFTUType_Num) + ' ' + VRFTU(VRFTUNum).Name); - ShowContinueError(state, "User-Specified Outdoor Air Flow Rate During Heating Operation of " + - RoundSigDigits(HeatOutAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Outdoor Air Flow Rate During Heating Operation of " + - RoundSigDigits(HeatOutAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Outdoor Air Flow Rate During Heating Operation of {:.5R} [m3/s]", HeatOutAirVolFlowUser)); + ShowContinueError(state, + format("differs from Design Size Outdoor Air Flow Rate During Heating Operation of {:.5R} [m3/s]", + HeatOutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7631,10 +7868,13 @@ namespace HVACVariableRefrigerantFlow { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + DataHVACGlobals::cVRFTUTypes(VRFTU(VRFTUNum).VRFTUType_Num) + ' ' + VRFTU(VRFTUNum).Name); - ShowContinueError(state, "User-Specified Outdoor Air Flow Rate When No Cooling or Heating is Needed of " + - RoundSigDigits(NoCoolHeatOutAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Outdoor Air Flow Rate When No Cooling or Heating is Needed of " + - RoundSigDigits(NoCoolHeatOutAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Outdoor Air Flow Rate When No Cooling or Heating is Needed of {:.5R} [m3/s]", + NoCoolHeatOutAirVolFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Outdoor Air Flow Rate When No Cooling or Heating is Needed of {:.5R} [m3/s]", + NoCoolHeatOutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7669,8 +7909,8 @@ namespace HVACVariableRefrigerantFlow { if (VRFTU(VRFTUNum).SuppHeatCoilType_Num == DataHVACGlobals::Coil_HeatingWater) { bool ErrorsFound = false; - WaterCoils::SetCoilDesFlow(state, - VRFTU(VRFTUNum).SuppHeatCoilType, VRFTU(VRFTUNum).SuppHeatCoilName, VRFTU(VRFTUNum).MaxHeatAirVolFlow, ErrorsFound); + WaterCoils::SetCoilDesFlow( + state, VRFTU(VRFTUNum).SuppHeatCoilType, VRFTU(VRFTUNum).SuppHeatCoilName, VRFTU(VRFTUNum).MaxHeatAirVolFlow, ErrorsFound); } if (VRFTU(VRFTUNum).SuppHeatingCoilPresent) { @@ -7785,10 +8025,10 @@ namespace HVACVariableRefrigerantFlow { if ((std::abs(CoolingCapacityDes - CoolingCapacityUser) / CoolingCapacityUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + ' ' + VRFTU(VRFCond).Name); - ShowContinueError(state, "User-Specified Rated Total Cooling Capacity (gross) of " + RoundSigDigits(CoolingCapacityUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Rated Total Cooling Capacity (gross) of " + - RoundSigDigits(CoolingCapacityDes, 2) + " [W]"); + ShowContinueError(state, + format("User-Specified Rated Total Cooling Capacity (gross) of {:.2R} [W]", CoolingCapacityUser)); + ShowContinueError( + state, format("differs from Design Size Rated Total Cooling Capacity (gross) of {:.2R} [W]", CoolingCapacityDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7829,10 +8069,9 @@ namespace HVACVariableRefrigerantFlow { if ((std::abs(HeatingCapacityDes - HeatingCapacityUser) / HeatingCapacityUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + ' ' + VRFTU(VRFCond).Name); - ShowContinueError(state, "User-Specified Rated Total Heating Capacity of " + RoundSigDigits(HeatingCapacityUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Rated Total Heating Capacity of " + - RoundSigDigits(HeatingCapacityDes, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Rated Total Heating Capacity of {:.2R} [W]", HeatingCapacityUser)); + ShowContinueError(state, + format("differs from Design Size Rated Total Heating Capacity of {:.2R} [W]", HeatingCapacityDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7851,7 +8090,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFCond).PipingCorrectionCooling = min( 1.0, max(0.5, - CurveValue(state, VRF(VRFCond).PCFLengthCoolPtr, VRF(VRFCond).EquivPipeLngthCool, VRF(VRFCond).CoolingCombinationRatio) + + CurveValue( + state, VRF(VRFCond).PCFLengthCoolPtr, VRF(VRFCond).EquivPipeLngthCool, VRF(VRFCond).CoolingCombinationRatio) + VRF(VRFCond).VertPipeLngth * VRF(VRFCond).PCFHeightCool)); } else { VRF(VRFCond).PipingCorrectionCooling = @@ -7871,7 +8111,8 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFCond).PipingCorrectionHeating = min( 1.0, max(0.5, - CurveValue(state, VRF(VRFCond).PCFLengthHeatPtr, VRF(VRFCond).EquivPipeLngthHeat, VRF(VRFCond).HeatingCombinationRatio) + + CurveValue( + state, VRF(VRFCond).PCFLengthHeatPtr, VRF(VRFCond).EquivPipeLngthHeat, VRF(VRFCond).HeatingCombinationRatio) + VRF(VRFCond).VertPipeLngth * VRF(VRFCond).PCFHeightHeat)); } else { VRF(VRFCond).PipingCorrectionHeating = @@ -7958,10 +8199,10 @@ namespace HVACVariableRefrigerantFlow { if ((std::abs(CoolingCapacityDes - CoolingCapacityUser) / CoolingCapacityUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + ' ' + VRFTU(VRFCond).Name); - ShowContinueError(state, "User-Specified Rated Total Cooling Capacity (gross) of " + RoundSigDigits(CoolingCapacityUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Rated Total Cooling Capacity (gross) of " + - RoundSigDigits(CoolingCapacityDes, 2) + " [W]"); + ShowContinueError(state, + format("User-Specified Rated Total Cooling Capacity (gross) of {:.2R} [W]", CoolingCapacityUser)); + ShowContinueError( + state, format("differs from Design Size Rated Total Cooling Capacity (gross) of {:.2R} [W]", CoolingCapacityDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7969,9 +8210,9 @@ namespace HVACVariableRefrigerantFlow { if ((std::abs(HeatingCapacityDes - HeatingCapacityUser) / HeatingCapacityUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + ' ' + VRFTU(VRFCond).Name); - ShowContinueError(state, "User-Specified Rated Total Heating Capacity of " + RoundSigDigits(HeatingCapacityUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Rated Total Heating Capacity of " + RoundSigDigits(HeatingCapacityDes, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Rated Total Heating Capacity of {:.2R} [W]", HeatingCapacityUser)); + ShowContinueError(state, + format("differs from Design Size Rated Total Heating Capacity of {:.2R} [W]", HeatingCapacityDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -8009,10 +8250,10 @@ namespace HVACVariableRefrigerantFlow { if ((std::abs(DefrostCapacityDes - DefrostCapacityUser) / DefrostCapacityUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + ' ' + VRFTU(VRFCond).Name); - ShowContinueError(state, "User-Specified Resistive Defrost Heater Capacity of " + RoundSigDigits(DefrostCapacityUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Resistive Defrost Heater Capacity of " + - RoundSigDigits(DefrostCapacityDes, 2) + " [W]"); + ShowContinueError(state, + format("User-Specified Resistive Defrost Heater Capacity of {:.2R} [W]", DefrostCapacityUser)); + ShowContinueError( + state, format("differs from Design Size Resistive Defrost Heater Capacity of {:.2R} [W]", DefrostCapacityDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -8046,10 +8287,11 @@ namespace HVACVariableRefrigerantFlow { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + ' ' + VRFTU(VRFCond).Name); - ShowContinueError(state, "User-Specified Evaporative Condenser Air Flow Rate of " + - RoundSigDigits(EvapCondAirVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Evaporative Condenser Air Flow Rate of " + - RoundSigDigits(EvapCondAirVolFlowRateDes, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Evaporative Condenser Air Flow Rate of {:.5R} [m3/s]", EvapCondAirVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Evaporative Condenser Air Flow Rate of {:.5R} [m3/s]", + EvapCondAirVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -8083,10 +8325,12 @@ namespace HVACVariableRefrigerantFlow { if ((std::abs(EvapCondPumpPowerDes - EvapCondPumpPowerUser) / EvapCondPumpPowerUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVRF: Potential issue with equipment sizing for " + cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + ' ' + VRFTU(VRFCond).Name); - ShowContinueError(state, "User-Specified Evaporative Condenser Pump Rated Power Consumption of " + - RoundSigDigits(EvapCondPumpPowerUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Evaporative Condenser Pump Rated Power Consumption of " + - RoundSigDigits(EvapCondPumpPowerDes, 2) + " [W]"); + ShowContinueError( + state, + format("User-Specified Evaporative Condenser Pump Rated Power Consumption of {:.2R} [W]", EvapCondPumpPowerUser)); + ShowContinueError(state, + format("differs from Design Size Evaporative Condenser Pump Rated Power Consumption of {:.2R} [W]", + EvapCondPumpPowerDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -8173,8 +8417,11 @@ namespace HVACVariableRefrigerantFlow { this->WaterCondVolFlowRate); } - rho = FluidProperties::GetDensityGlycol( - state, PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + rho = FluidProperties::GetDensityGlycol(state, + PlantLoop(this->SourceLoopNum).FluidName, + DataGlobalConstants::CWInitConvTemp(), + PlantLoop(this->SourceLoopNum).FluidIndex, + RoutineName); this->WaterCondenserDesignMassFlow = this->WaterCondVolFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, this->WaterCondenserDesignMassFlow, @@ -8510,7 +8757,7 @@ namespace HVACVariableRefrigerantFlow { ShowWarningMessage(state, DataHVACGlobals::cVRFTUTypes(this->VRFTUType_Num) + " \"" + this->Name + "\""); ShowContinueError(state, format(" Iteration limit exceeded calculating terminal unit part-load ratio, maximum iterations = {}", MaxIte)); - ShowContinueErrorTimeStamp(state, " Part-load ratio returned = " + General::RoundSigDigits(PartLoadRatio, 3)); + ShowContinueErrorTimeStamp(state, format(" Part-load ratio returned = {:.3R}", PartLoadRatio)); if (VRF(VRFCond).VRFAlgorithmTypeNum == AlgorithmTypeFluidTCtrl) { // Algorithm Type: VRF model based on physics, applicable for Fluid Temperature Control @@ -8521,8 +8768,7 @@ namespace HVACVariableRefrigerantFlow { this->CalcVRF(state, VRFTUNum, FirstHVACIteration, PartLoadRatio, TempOutput, OnOffAirFlowRatio, SuppHeatCoilLoad); } - ShowContinueError(state, " Load requested = " + General::TrimSigDigits(QZnReq, 5) + - ", Load delivered = " + General::TrimSigDigits(TempOutput, 5)); + ShowContinueError(state, format(" Load requested = {:.5T}, Load delivered = {:.5T}", QZnReq, TempOutput)); ShowRecurringWarningErrorAtEnd(state, DataHVACGlobals::cVRFTUTypes(this->VRFTUType_Num) + " \"" + this->Name + "\" -- Terminal unit Iteration limit exceeded error continues...", this->IterLimitExceeded); @@ -9309,7 +9555,8 @@ namespace HVACVariableRefrigerantFlow { } } else { // simulate OA Mixer - if (VRFTU(TUIndex).OAMixerUsed) SimOAMixer(state, VRFTU(TUIndex).OAMixerName, FirstHVACIteration, VRFTU(TUIndex).OAMixerIndex); + if (VRFTU(TUIndex).OAMixerUsed) + SimOAMixer(state, VRFTU(TUIndex).OAMixerName, FirstHVACIteration, VRFTU(TUIndex).OAMixerIndex); } } // identify a coil inlet temperature @@ -10160,7 +10407,7 @@ namespace HVACVariableRefrigerantFlow { using FluidProperties::GetSupHeatTempRefrig; using FluidProperties::RefrigData; using General::SolveRoot; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using Psychrometrics::RhoH2O; using TempSolveRoot::SolveRoot; @@ -10451,8 +10698,9 @@ namespace HVACVariableRefrigerantFlow { Psuction = Pevap; Tsuction = this->IUEvaporatingTemp; // GetSatTemperatureRefrig(state, this->RefrigerantName, max( min( Psuction, RefPHigh ), RefPLow ), // RefrigerantIndex, RoutineName ); - this->EvaporatingTemp = this->IUEvaporatingTemp; // GetSatTemperatureRefrig(state, this->RefrigerantName, max( min( Pevap, RefPHigh ), RefPLow - // ), RefrigerantIndex, RoutineName ); + this->EvaporatingTemp = + this->IUEvaporatingTemp; // GetSatTemperatureRefrig(state, this->RefrigerantName, max( min( Pevap, RefPHigh ), RefPLow + // ), RefrigerantIndex, RoutineName ); // Condenser (OU side) operation ranges CapMaxPc = min(Psuction + this->CompMaxDeltaP, RefMaxPc); @@ -10474,10 +10722,11 @@ namespace HVACVariableRefrigerantFlow { // Initialization for h_IU_evap_in iterations (Label12) h_IU_evap_in_low = - GetSatEnthalpyRefrig(state, this->RefrigerantName, OutdoorDryBulb - this->SC, 0.0, RefrigerantIndex, RoutineName); // Tc = Tamb - h_IU_evap_in_up = GetSatEnthalpyRefrig(state, this->RefrigerantName, CapMaxTc - this->SC, 0.0, RefrigerantIndex, RoutineName); // Tc = CapMaxTc - h_IU_evap_in = - GetSatEnthalpyRefrig(state, this->RefrigerantName, OutdoorDryBulb + 10 - this->SC, 0.0, RefrigerantIndex, RoutineName); // Tc = Tamb+10 + GetSatEnthalpyRefrig(state, this->RefrigerantName, OutdoorDryBulb - this->SC, 0.0, RefrigerantIndex, RoutineName); // Tc = Tamb + h_IU_evap_in_up = + GetSatEnthalpyRefrig(state, this->RefrigerantName, CapMaxTc - this->SC, 0.0, RefrigerantIndex, RoutineName); // Tc = CapMaxTc + h_IU_evap_in = GetSatEnthalpyRefrig( + state, this->RefrigerantName, OutdoorDryBulb + 10 - this->SC, 0.0, RefrigerantIndex, RoutineName); // Tc = Tamb+10 NumIteHIUIn = 1; Label12:; @@ -10511,7 +10760,8 @@ namespace HVACVariableRefrigerantFlow { TUIndex = TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); CoolCoilIndex = VRFTU(TUIndex).CoolCoilIndex; - RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pevap, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + RefTSat = + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pevap, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); h_IU_evap_out_i = GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, this->IUEvaporatingTemp + DXCoil(CoolCoilIndex).ActualSH), @@ -10534,7 +10784,8 @@ namespace HVACVariableRefrigerantFlow { h_IU_evap_out = h_IU_evap_out / m_ref_IU_evap; SH_IU_merged = SH_IU_merged / m_ref_IU_evap; } else { - RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pevap, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + RefTSat = + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pevap, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); h_IU_evap_out = GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, this->IUEvaporatingTemp + 3), @@ -10547,10 +10798,17 @@ namespace HVACVariableRefrigerantFlow { } // *Calculate piping loss - this->VRFOU_PipeLossC( - state, m_ref_IU_evap, max(min(Pevap, RefPHigh), RefPLow), h_IU_evap_out, SH_IU_merged, OutdoorDryBulb, Pipe_Q_c, Pipe_DeltP_c, h_comp_in); - Tsuction = - GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pevap - Pipe_DeltP_c, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + this->VRFOU_PipeLossC(state, + m_ref_IU_evap, + max(min(Pevap, RefPHigh), RefPLow), + h_IU_evap_out, + SH_IU_merged, + OutdoorDryBulb, + Pipe_Q_c, + Pipe_DeltP_c, + h_comp_in); + Tsuction = GetSatTemperatureRefrig( + state, this->RefrigerantName, max(min(Pevap - Pipe_DeltP_c, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); Psuction = Pevap - Pipe_DeltP_c; // This Psuction is used for rps > min; will be updated for rps = min // Perform iteration to calculate T_comp_in @@ -10623,7 +10881,8 @@ namespace HVACVariableRefrigerantFlow { } // Update h_IU_evap_in in iterations Label12 - h_IU_evap_in_new = GetSatEnthalpyRefrig(state, this->RefrigerantName, this->CondensingTemp - this->SC, 0.0, RefrigerantIndex, RoutineName); + h_IU_evap_in_new = + GetSatEnthalpyRefrig(state, this->RefrigerantName, this->CondensingTemp - this->SC, 0.0, RefrigerantIndex, RoutineName); if ((std::abs(h_IU_evap_in - h_IU_evap_in_new) > Tolerance * h_IU_evap_in) && (h_IU_evap_in < h_IU_evap_in_up) && (h_IU_evap_in > h_IU_evap_in_low)) { h_IU_evap_in = h_IU_evap_in_new; @@ -10649,7 +10908,8 @@ namespace HVACVariableRefrigerantFlow { Tdischarge = this->CondensingTemp; // outdoor unit condensing temperature this->CoolingCapacity = this->CoffEvapCap * this->RatedEvapCapacity * - CurveValue(state, this->OUCoolingCAPFT(NumOfCompSpdInput), Tdischarge, Tsuction); // Include the piping loss, at the highest compressor speed + CurveValue( + state, this->OUCoolingCAPFT(NumOfCompSpdInput), Tdischarge, Tsuction); // Include the piping loss, at the highest compressor speed this->PipingCorrectionCooling = TU_CoolingLoad / (TU_CoolingLoad + Pipe_Q_c); MaxCoolingCapacity(VRFCond) = this->CoolingCapacity; // for report, maximum evaporating capacity of the system @@ -10675,16 +10935,18 @@ namespace HVACVariableRefrigerantFlow { // Evaporative capacity ranges_Max CapMaxTe = OutdoorDryBulb - this->SH; - CompEvaporatingCAPSpdMax = - this->CoffEvapCap * this->RatedEvapCapacity * CurveValue(state, this->OUCoolingCAPFT(NumOfCompSpdInput), this->IUCondensingTemp, CapMaxTe); - CompEvaporatingPWRSpdMax = this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(NumOfCompSpdInput), this->IUCondensingTemp, CapMaxTe); + CompEvaporatingCAPSpdMax = this->CoffEvapCap * this->RatedEvapCapacity * + CurveValue(state, this->OUCoolingCAPFT(NumOfCompSpdInput), this->IUCondensingTemp, CapMaxTe); + CompEvaporatingPWRSpdMax = + this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(NumOfCompSpdInput), this->IUCondensingTemp, CapMaxTe); // Initialization of h_comp_out iterations (Label23) Pcond = GetSatPressureRefrig(state, this->RefrigerantName, 40.0, RefrigerantIndex, RoutineName); RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, Pcond, RefrigerantIndex, RoutineName); h_IU_cond_in_up = GetSupHeatEnthalpyRefrig( state, this->RefrigerantName, max(RefTSat, min(this->IUCondensingTemp + 50, RefTHigh)), Pcond, RefrigerantIndex, RoutineName); - h_IU_cond_in_low = GetSatEnthalpyRefrig(state, this->RefrigerantName, this->IUCondensingTemp, 1.0, RefrigerantIndex, RoutineName); // Quality=1 + h_IU_cond_in_low = + GetSatEnthalpyRefrig(state, this->RefrigerantName, this->IUCondensingTemp, 1.0, RefrigerantIndex, RoutineName); // Quality=1 h_IU_cond_in = h_IU_cond_in_low; Label23:; @@ -10699,12 +10961,13 @@ namespace HVACVariableRefrigerantFlow { Q_h_TU_PL = CompEvaporatingCAPSpdMax; TU_HeatingLoad = CompEvaporatingCAPSpdMax; this->TUHeatingLoad = TU_HeatingLoad; - h_IU_cond_out = GetSatEnthalpyRefrig(state, - this->RefrigerantName, - GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) - 5.0, - 0.0, - RefrigerantIndex, - RoutineName); // Quality=0 + h_IU_cond_out = GetSatEnthalpyRefrig( + state, + this->RefrigerantName, + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) - 5.0, + 0.0, + RefrigerantIndex, + RoutineName); // Quality=0 h_IU_cond_out_ave = h_IU_cond_out; SC_IU_merged = 5; m_ref_IU_cond = TU_HeatingLoad / (h_IU_cond_in - h_IU_cond_out); @@ -10714,13 +10977,14 @@ namespace HVACVariableRefrigerantFlow { if (TerminalUnitList(TUListNum).TotalHeatLoad(NumTU) > 0) { TUIndex = TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); HeatCoilIndex = VRFTU(TUIndex).HeatCoilIndex; - h_IU_cond_out_i = GetSatEnthalpyRefrig(state, - this->RefrigerantName, - GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) - - DXCoil(HeatCoilIndex).ActualSC, - 0.0, - RefrigerantIndex, - RoutineName); // Quality=0 + h_IU_cond_out_i = GetSatEnthalpyRefrig( + state, + this->RefrigerantName, + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) - + DXCoil(HeatCoilIndex).ActualSC, + 0.0, + RefrigerantIndex, + RoutineName); // Quality=0 m_ref_IU_cond_i = (TerminalUnitList(TUListNum).TotalHeatLoad(NumTU) <= 0.0) ? 0.0 : (TerminalUnitList(TUListNum).TotalHeatLoad(NumTU) / (h_IU_cond_in - h_IU_cond_out_i)); @@ -10733,12 +10997,14 @@ namespace HVACVariableRefrigerantFlow { h_IU_cond_out_ave = h_IU_cond_out_ave / m_ref_IU_cond; // h_merge SC_IU_merged = SC_IU_merged / m_ref_IU_cond; } else { - h_IU_cond_out_ave = GetSatEnthalpyRefrig(state, - this->RefrigerantName, - GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) - 5.0, - 0.0, - RefrigerantIndex, - RoutineName); // Quality=0 + h_IU_cond_out_ave = GetSatEnthalpyRefrig( + state, + this->RefrigerantName, + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) - + 5.0, + 0.0, + RefrigerantIndex, + RoutineName); // Quality=0 SC_IU_merged = 5; m_ref_IU_cond = TU_HeatingLoad / (h_IU_cond_in - h_IU_cond_out_ave); } @@ -10749,7 +11015,8 @@ namespace HVACVariableRefrigerantFlow { state, m_ref_IU_cond, max(min(Pcond, RefPHigh), RefPLow), h_IU_cond_in, OutdoorDryBulb, Pipe_Q_h, Pipe_DeltP_h, h_comp_out); Pdischarge = max(Pcond + Pipe_DeltP_h, Pcond); // affected by piping loss - Tdischarge = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pdischarge, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + Tdischarge = + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pdischarge, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); // Evaporative capacity ranges_Min CapMinPe = min(Pdischarge - this->CompMaxDeltaP, RefMinPe); @@ -10762,10 +11029,19 @@ namespace HVACVariableRefrigerantFlow { // *Calculate capacity modification factor RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(CapMinPe, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - h_comp_in = GetSupHeatEnthalpyRefrig( - state, this->RefrigerantName, max(RefTSat, CapMinTe + this->SH), max(min(CapMinPe, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - C_cap_operation = this->VRFOU_CapModFactor( - state, h_comp_in, h_IU_cond_out_ave, max(min(CapMinPe, RefPHigh), RefPLow), CapMinTe + this->SH, CapMinTe + 8, this->IUCondensingTemp - 5); + h_comp_in = GetSupHeatEnthalpyRefrig(state, + this->RefrigerantName, + max(RefTSat, CapMinTe + this->SH), + max(min(CapMinPe, RefPHigh), RefPLow), + RefrigerantIndex, + RoutineName); + C_cap_operation = this->VRFOU_CapModFactor(state, + h_comp_in, + h_IU_cond_out_ave, + max(min(CapMinPe, RefPHigh), RefPLow), + CapMinTe + this->SH, + CapMinTe + 8, + this->IUCondensingTemp - 5); if ((Q_c_OU * C_cap_operation) <= CompEvaporatingCAPSpdMin) { // Required heating load is smaller than the min heating capacity @@ -10822,7 +11098,8 @@ namespace HVACVariableRefrigerantFlow { // Update h_comp_out in iteration Label23 P_comp_in = GetSatPressureRefrig(state, this->RefrigerantName, this->EvaporatingTemp, RefrigerantIndex, RoutineName); - RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(P_comp_in, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + RefTSat = + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(P_comp_in, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); h_comp_in_new = GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, this->SH + this->EvaporatingTemp), @@ -10850,7 +11127,8 @@ namespace HVACVariableRefrigerantFlow { Tsuction = this->EvaporatingTemp; // Outdoor unit evaporating temperature this->HeatingCapacity = this->CoffEvapCap * this->RatedEvapCapacity * CurveValue(state, this->OUCoolingCAPFT(NumOfCompSpdInput), Tdischarge, Tsuction) + - this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(NumOfCompSpdInput), + this->RatedCompPower * CurveValue(state, + this->OUCoolingPWRFT(NumOfCompSpdInput), Tdischarge, Tsuction); // Include the piping loss, at the highest compressor speed this->PipingCorrectionHeating = TU_HeatingLoad / (TU_HeatingLoad + Pipe_Q_h); @@ -10897,8 +11175,12 @@ namespace HVACVariableRefrigerantFlow { Pcond = GetSatPressureRefrig(state, this->RefrigerantName, this->IUCondensingTemp, RefrigerantIndex, RoutineName); Real64 Pcond_temp = GetSatPressureRefrig(state, this->RefrigerantName, 40.0, RefrigerantIndex, RoutineName); RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, Pcond_temp, RefrigerantIndex, RoutineName); - h_IU_cond_in_up = GetSupHeatEnthalpyRefrig( - state, this->RefrigerantName, max(RefTSat, min(this->IUCondensingTemp + 50, RefTHigh)), Pcond_temp, RefrigerantIndex, RoutineName); + h_IU_cond_in_up = GetSupHeatEnthalpyRefrig(state, + this->RefrigerantName, + max(RefTSat, min(this->IUCondensingTemp + 50, RefTHigh)), + Pcond_temp, + RefrigerantIndex, + RoutineName); h_IU_cond_in_low = GetSatEnthalpyRefrig(state, this->RefrigerantName, this->IUCondensingTemp, 1.0, RefrigerantIndex, RoutineName); // Quality=1 h_IU_cond_in = h_IU_cond_in_low; @@ -10914,7 +11196,8 @@ namespace HVACVariableRefrigerantFlow { if (TerminalUnitList(TUListNum).TotalHeatLoad(NumTU) > 0) { TUIndex = TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); HeatCoilIndex = VRFTU(TUIndex).HeatCoilIndex; - h_IU_cond_out_i = GetSatEnthalpyRefrig(state, + h_IU_cond_out_i = GetSatEnthalpyRefrig( + state, this->RefrigerantName, GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) - DXCoil(HeatCoilIndex).ActualSC, @@ -10933,7 +11216,8 @@ namespace HVACVariableRefrigerantFlow { h_IU_cond_out_ave = h_IU_cond_out_ave / m_ref_IU_cond; SC_IU_merged = SC_IU_merged / m_ref_IU_cond; } else { - h_IU_cond_out_ave = GetSatEnthalpyRefrig(state, + h_IU_cond_out_ave = GetSatEnthalpyRefrig( + state, this->RefrigerantName, GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) - 5.0, 0.0, @@ -10947,7 +11231,8 @@ namespace HVACVariableRefrigerantFlow { this->VRFOU_PipeLossH( state, m_ref_IU_cond, max(min(Pcond, RefPHigh), RefPLow), h_IU_cond_in, OutdoorDryBulb, Pipe_Q_h, Pipe_DeltP_h, h_comp_out); Pdischarge = max(Pcond + Pipe_DeltP_h, Pcond); // affected by piping loss - Tdischarge = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pdischarge, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + Tdischarge = + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pdischarge, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); Q_h_TU_PL = TU_HeatingLoad + Pipe_Q_h; // *PL-c: Calculate total IU refrigerant flow rate and SH_IU_merged @@ -10960,7 +11245,8 @@ namespace HVACVariableRefrigerantFlow { TUIndex = TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); CoolCoilIndex = VRFTU(TUIndex).CoolCoilIndex; - RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pevap, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + RefTSat = + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pevap, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); h_IU_evap_out_i = GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, this->IUEvaporatingTemp + DXCoil(CoolCoilIndex).ActualSH), @@ -10995,8 +11281,15 @@ namespace HVACVariableRefrigerantFlow { } // *PL-c: Calculate piping loss - this->VRFOU_PipeLossC( - state, m_ref_IU_evap, max(min(Pevap, RefPHigh), RefPLow), h_IU_evap_out, SH_IU_merged, OutdoorDryBulb, Pipe_Q_c, Pipe_DeltP_c, h_IU_PLc_out); + this->VRFOU_PipeLossC(state, + m_ref_IU_evap, + max(min(Pevap, RefPHigh), RefPLow), + h_IU_evap_out, + SH_IU_merged, + OutdoorDryBulb, + Pipe_Q_c, + Pipe_DeltP_c, + h_IU_PLc_out); Psuction = min(Pevap - Pipe_DeltP_c, Pevap); // This Psuction is used for rps > min; will be updated for rps = min Tsuction = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Psuction, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); h_comp_in = h_IU_PLc_out; @@ -11170,11 +11463,15 @@ namespace HVACVariableRefrigerantFlow { if (!state.dataGlobal->WarmupFlag) { if (this->DefrostHeatErrorIndex == 0) { ShowSevereMessage(state, cVRFTypes(VRF_HeatPump) + " \"" + this->Name + "\":"); - ShowContinueError(state, " Defrost Energy Input Ratio Modifier curve (function of temperature) output is negative (" + - TrimSigDigits(DefrostEIRTempModFac, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an outdoor air dry-bulb temperature of " + - TrimSigDigits(OutdoorDryBulb, 1) + " C and an average indoor air wet-bulb temperature of " + - TrimSigDigits(InletAirWetBulbC, 1) + " C."); + ShowContinueError( + state, + format(" Defrost Energy Input Ratio Modifier curve (function of temperature) output is negative ({:.3T}).", + DefrostEIRTempModFac)); + ShowContinueError(state, + format(" Negative value occurs using an outdoor air dry-bulb temperature of {:.1T} C and an " + "average indoor air wet-bulb temperature of {:.1T} C.", + OutdoorDryBulb, + InletAirWetBulbC)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + this->Name + @@ -11484,9 +11781,9 @@ namespace HVACVariableRefrigerantFlow { // Use RegulaFalsi technique to iterate on part-load ratio until convergence is achieved. using DataEnvironment::OutDryBulbTemp; - using General::RoundSigDigits; + using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using ScheduleManager::GetCurrentScheduleValue; using TempSolveRoot::SolveRoot; @@ -11697,12 +11994,12 @@ namespace HVACVariableRefrigerantFlow { ShowWarningMessage(state, DataHVACGlobals::cVRFTUTypes(this->VRFTUType_Num) + " \"" + this->Name + "\""); ShowContinueError(state, format(" Iteration limit exceeded calculating terminal unit part-load ratio, maximum iterations = {}", MaxIte)); - ShowContinueErrorTimeStamp(state, " Part-load ratio returned = " + RoundSigDigits(PartLoadRatio, 3)); + ShowContinueErrorTimeStamp(state, format(" Part-load ratio returned = {:.3R}", PartLoadRatio)); this->CalcVRF_FluidTCtrl( state, VRFTUNum, FirstHVACIteration, TempMinPLR, TempOutput, OnOffAirFlowRatio, SuppHeatCoilLoad); - ShowContinueError(state, " Load requested = " + TrimSigDigits(QZnReq, 5) + ", Load delivered = " + TrimSigDigits(TempOutput, 5)); + ShowContinueError(state, format(" Load requested = {:.5T}, Load delivered = {:.5T}", QZnReq, TempOutput)); ShowRecurringWarningErrorAtEnd(state, DataHVACGlobals::cVRFTUTypes(this->VRFTUType_Num) + " \"" + this->Name + "\" -- Terminal unit Iteration limit exceeded error continues...", this->IterLimitExceeded); @@ -12295,7 +12592,6 @@ namespace HVACVariableRefrigerantFlow { // METHODOLOGY EMPLOYED: // This is part of the physics based VRF model applicable for Fluid Temperature Control. // - using General::TrimSigDigits; Real64 BF; // VRF OU bypass [-] Real64 deltaT; // Difference between Te/Tc and air temperature at coil surface [C] @@ -12310,9 +12606,9 @@ namespace HVACVariableRefrigerantFlow { if (m_air <= 0) { TeTc = this->CondensingTemp; - ShowSevereMessage(state, " Unreasonable outdoor unit airflow rate (" + TrimSigDigits(m_air, 3) + " ) for \"" + this->Name + "\":"); + ShowSevereMessage(state, format(" Unreasonable outdoor unit airflow rate ({:.3T} ) for \"{}\":", m_air, this->Name)); ShowContinueError(state, " This cannot be used to calculate outdoor unit refrigerant temperature."); - ShowContinueError(state, " Default condensing temperature is used: " + TrimSigDigits(TeTc, 3)); + ShowContinueError(state, format(" Default condensing temperature is used: {:.3T}", TeTc)); } BF = this->RateBFOUCond; // 0.219; @@ -12328,9 +12624,9 @@ namespace HVACVariableRefrigerantFlow { if (m_air <= 0) { TeTc = this->EvaporatingTemp; - ShowSevereMessage(state, " Unreasonable outdoor unit airflow rate (" + TrimSigDigits(m_air, 3) + " ) for \"" + this->Name + "\":"); + ShowSevereMessage(state, format(" Unreasonable outdoor unit airflow rate ({:.3T} ) for \"{}\":", m_air, this->Name)); ShowContinueError(state, " This cannot be used to calculate outdoor unit refrigerant temperature."); - ShowContinueError(state, " Default condensing temperature is used: " + TrimSigDigits(TeTc, 3)); + ShowContinueError(state, format(" Default condensing temperature is used: {:.3T}", TeTc)); } BF = this->RateBFOUEvap; // 0.45581; @@ -12379,7 +12675,6 @@ namespace HVACVariableRefrigerantFlow { // This is part of the physics based VRF model applicable for Fluid Temperature Control. using DataEnvironment::OutBaroPress; - using General::TrimSigDigits; Real64 BF; // VRF OU bypass [-] Real64 deltaT; // Difference between Te/Tc and air temperature at coil surface [C] @@ -12395,7 +12690,7 @@ namespace HVACVariableRefrigerantFlow { if (OperationMode == FlagCondMode) { // IU Cooling: OperationMode 0 if (m_air <= 0) { - ShowSevereMessage(state, " Unreasonable outdoor unit airflow rate (" + TrimSigDigits(m_air, 3) + " ) for \"" + this->Name + "\":"); + ShowSevereMessage(state, format(" Unreasonable outdoor unit airflow rate ({:.3T} ) for \"{}\":", m_air, this->Name)); ShowContinueError(state, " This cannot be used to calculate outdoor unit capacity."); } @@ -12408,7 +12703,7 @@ namespace HVACVariableRefrigerantFlow { } else if (OperationMode == FlagEvapMode) { // IU Heating: OperationMode 1 if (m_air <= 0) { - ShowSevereMessage(state, " Unreasonable outdoor unit airflow rate (" + TrimSigDigits(m_air, 3) + " ) for \"" + this->Name + "\":"); + ShowSevereMessage(state, format(" Unreasonable outdoor unit airflow rate ({:.3T} ) for \"{}\":", m_air, this->Name)); ShowContinueError(state, " This cannot be used to calculate outdoor unit capacity."); } @@ -12464,7 +12759,6 @@ namespace HVACVariableRefrigerantFlow { // This is part of the physics based VRF model applicable for Fluid Temperature Control. using DataEnvironment::OutBaroPress; - using General::TrimSigDigits; Real64 BF; // VRF OU bypass [-] Real64 deltaT; // Difference between Te/Tc and air temperature at coil surface [C] @@ -12543,7 +12837,6 @@ namespace HVACVariableRefrigerantFlow { // This is part of the physics based VRF model applicable for Fluid Temperature Control. using DataEnvironment::OutBaroPress; - using General::TrimSigDigits; Real64 BF; // VRF OU bypass [-] Real64 deltaT; // Difference between Te/Tc and air temperature at coil surface [C] @@ -12560,7 +12853,7 @@ namespace HVACVariableRefrigerantFlow { if (OperationMode == FlagCondMode) { // Cooling: OperationMode 0 if (m_air <= 0) { - ShowSevereMessage(state, " Unreasonable outdoor unit airflow rate (" + TrimSigDigits(m_air, 3) + " ) for \"" + this->Name + "\":"); + ShowSevereMessage(state, format(" Unreasonable outdoor unit airflow rate ({:.3T} ) for \"{}\":", m_air, this->Name)); ShowContinueError(state, " This cannot be used to calculate outdoor unit subcooling."); } @@ -12578,7 +12871,7 @@ namespace HVACVariableRefrigerantFlow { } else if (OperationMode == FlagEvapMode) { // Heating: OperationMode 1 if (m_air <= 0) { - ShowSevereMessage(state, " Unreasonable outdoor unit airflow rate (" + TrimSigDigits(m_air, 3) + " ) for \"" + this->Name + "\":"); + ShowSevereMessage(state, format(" Unreasonable outdoor unit airflow rate ({:.3T} ) for \"{}\":", m_air, this->Name)); ShowContinueError(state, " This cannot be used to calculate outdoor unit super heating."); } @@ -12664,7 +12957,8 @@ namespace HVACVariableRefrigerantFlow { RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, P_evap_real, RefrigerantIndex, RoutineName); // Enthalpy at rated conditions - h_evap_out_rate = GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, T_comp_in_rate), P_evap_real, RefrigerantIndex, RoutineName); + h_evap_out_rate = + GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, T_comp_in_rate), P_evap_real, RefrigerantIndex, RoutineName); h_evap_in_rate = GetSatEnthalpyRefrig(state, this->RefrigerantName, T_cond_out_rate, 0.0, RefrigerantIndex, RoutineName); // Density calculations @@ -12805,14 +13099,15 @@ namespace HVACVariableRefrigerantFlow { } else { Pipe_SH_merged = this->SH; RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, Pe_update, RefrigerantIndex, RoutineName); - Pipe_h_IU_out = - GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, Te_update + Pipe_SH_merged), Pe_update, RefrigerantIndex, RoutineName); + Pipe_h_IU_out = GetSupHeatEnthalpyRefrig( + state, this->RefrigerantName, max(RefTSat, Te_update + Pipe_SH_merged), Pe_update, RefrigerantIndex, RoutineName); } // Re-calculate piping loss this->VRFOU_PipeLossC(state, Pipe_m_ref, Pe_update, Pipe_h_IU_out, Pipe_SH_merged, OutdoorDryBulb, Pipe_Q, Pipe_DeltP, Pipe_h_comp_in); - Tsuction = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pe_update - Pipe_DeltP, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + Tsuction = + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pe_update - Pipe_DeltP, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); if ((std::abs(Tsuction - Te_low) > 0.5) && (Te_update < Te_up) && (Te_update > Te_low) && (NumTeIte < MaxNumTeIte)) { Te_update = Te_update - 0.1; @@ -12896,8 +13191,14 @@ namespace HVACVariableRefrigerantFlow { // variable initializations: system operational parameters P_suction = GetSatPressureRefrig(state, this->RefrigerantName, T_suction, RefrigerantIndex, RoutineName); - T_comp_in = GetSupHeatTempRefrig( - state, this->RefrigerantName, max(min(P_suction, RefPHigh), RefPLow), h_comp_in, T_suction + 3, T_suction + 30, RefrigerantIndex, RoutineName); + T_comp_in = GetSupHeatTempRefrig(state, + this->RefrigerantName, + max(min(P_suction, RefPHigh), RefPLow), + h_comp_in, + T_suction + 3, + T_suction + 30, + RefrigerantIndex, + RoutineName); SH_Comp = T_comp_in - T_suction; // Calculate capacity modification factor @@ -13081,8 +13382,14 @@ namespace HVACVariableRefrigerantFlow { // variable initializations: system operational parameters P_suction = GetSatPressureRefrig(state, this->RefrigerantName, T_suction, RefrigerantIndex, RoutineName); - T_comp_in = GetSupHeatTempRefrig( - state, this->RefrigerantName, max(min(P_suction, RefPHigh), RefPLow), h_comp_in, T_suction + 3, T_suction + 30, RefrigerantIndex, RoutineName); + T_comp_in = GetSupHeatTempRefrig(state, + this->RefrigerantName, + max(min(P_suction, RefPHigh), RefPLow), + h_comp_in, + T_suction + 3, + T_suction + 30, + RefrigerantIndex, + RoutineName); SH_Comp = T_comp_in - T_suction; // Calculate capacity modification factor @@ -13261,8 +13568,8 @@ namespace HVACVariableRefrigerantFlow { MinRefriPe = GetSatPressureRefrig(state, this->RefrigerantName, -15, RefrigerantIndex, RoutineName); MinOutdoorUnitPe = max(P_discharge - this->CompMaxDeltaP, MinRefriPe); - MinOutdoorUnitTe = - GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + MinOutdoorUnitTe = GetSatTemperatureRefrig( + state, this->RefrigerantName, max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); TempSolveRoot::SolveRoot(state, 1.0e-3, @@ -13272,7 +13579,7 @@ namespace HVACVariableRefrigerantFlow { CompResidual_FluidTCtrl, MinOutdoorUnitTe, T_suction, - Par); // SmallLoadTe is the updated Te' + Par); // SmallLoadTe is the updated Te' if (SolFla < 0) SmallLoadTe = 6; // MinOutdoorUnitTe; //SmallLoadTe( Te'_new ) is constant during iterations // Get an updated Te corresponding to the updated Te' @@ -13313,8 +13620,8 @@ namespace HVACVariableRefrigerantFlow { (-this->C2Te + std::pow((pow_2(this->C2Te) - 4 * (this->C1Te - Tfs + Pipe_Te_assumed) * this->C3Te), 0.5)) / (2 * this->C3Te); - RefTSat = GetSatTemperatureRefrig(state, - this->RefrigerantName, max(min(Pipe_Pe_assumed, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + RefTSat = GetSatTemperatureRefrig( + state, this->RefrigerantName, max(min(Pipe_Pe_assumed, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); Pipe_h_IU_out_i = GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, Pipe_Te_assumed + Modifi_SHin), @@ -13337,8 +13644,8 @@ namespace HVACVariableRefrigerantFlow { Pipe_SH_merged = Pipe_SH_merged / Pipe_m_ref; } else { Pipe_SH_merged = this->SH; - RefTSat = GetSatTemperatureRefrig(state, - this->RefrigerantName, max(min(Pipe_Pe_assumed, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + RefTSat = GetSatTemperatureRefrig( + state, this->RefrigerantName, max(min(Pipe_Pe_assumed, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); Pipe_h_IU_out = GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, Pipe_Te_assumed + Pipe_SH_merged), @@ -13358,8 +13665,8 @@ namespace HVACVariableRefrigerantFlow { Pipe_DeltP, Pipe_h_comp_in); - T_suction = GetSatTemperatureRefrig(state, - this->RefrigerantName, max(min(Pipe_Pe_assumed - Pipe_DeltP, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + T_suction = GetSatTemperatureRefrig( + state, this->RefrigerantName, max(min(Pipe_Pe_assumed - Pipe_DeltP, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); if ((std::abs(T_suction - SmallLoadTe) > 0.5) && (Pipe_Te_assumed < this->EvaporatingTemp) && (Pipe_Te_assumed > SmallLoadTe) && (NumIteTe < MaxNumIteTe)) { @@ -13404,8 +13711,13 @@ namespace HVACVariableRefrigerantFlow { T_discharge = min(MaxOutdoorUnitTc, T_discharge); // *Calculate capacity modification factor - C_cap_operation = this->VRFOU_CapModFactor( - state, Pipe_h_comp_in, Pipe_h_IU_in, max(min(P_suction, RefPHigh), RefPLow), T_suction + Modifi_SH, T_suction + 8, T_discharge - 5); + C_cap_operation = this->VRFOU_CapModFactor(state, + Pipe_h_comp_in, + Pipe_h_IU_in, + max(min(P_suction, RefPHigh), RefPLow), + T_suction + Modifi_SH, + T_suction + 8, + T_discharge - 5); Cap_Eva0 = (TU_load + Pipe_Q) * C_cap_operation; // New Pipe_Q & C_cap_operation Cap_Eva1 = this->CoffEvapCap * this->RatedEvapCapacity * @@ -13536,10 +13848,19 @@ namespace HVACVariableRefrigerantFlow { // Calculate capacity modification factor MinOutdoorUnitPe = GetSatPressureRefrig(state, this->RefrigerantName, T_suction, RefrigerantIndex, RoutineName); RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - Pipe_h_comp_in = GetSupHeatEnthalpyRefrig( - state, this->RefrigerantName, max(RefTSat, T_suction + this->SH), max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - C_cap_operation = this->VRFOU_CapModFactor( - state, Pipe_h_comp_in, Pipe_h_out_ave, max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), T_suction + this->SH, T_suction + 8, IUMaxCondTemp - 5); + Pipe_h_comp_in = GetSupHeatEnthalpyRefrig(state, + this->RefrigerantName, + max(RefTSat, T_suction + this->SH), + max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), + RefrigerantIndex, + RoutineName); + C_cap_operation = this->VRFOU_CapModFactor(state, + Pipe_h_comp_in, + Pipe_h_out_ave, + max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), + T_suction + this->SH, + T_suction + 8, + IUMaxCondTemp - 5); // Perform iterations to find the compressor speed that can meet the required heating load, Iteration DoName2 for (CounterCompSpdTemp = 1; CounterCompSpdTemp <= NumOfCompSpdInput; CounterCompSpdTemp++) { @@ -13596,7 +13917,8 @@ namespace HVACVariableRefrigerantFlow { Modifi_Pe = GetSatPressureRefrig(state, this->RefrigerantName, T_suction, RefrigerantIndex, RoutineName); // Calculate capacity modification factor - RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Modifi_Pe, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + RefTSat = + GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Modifi_Pe, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); Pipe_h_comp_in = GetSupHeatEnthalpyRefrig(state, this->RefrigerantName, max(RefTSat, T_suction + Modifi_SH), @@ -13612,8 +13934,8 @@ namespace HVACVariableRefrigerantFlow { IUMaxCondTemp - 5); Cap_Eva0 = Q_evap_req * C_cap_operation; - Cap_Eva1 = - this->CoffEvapCap * this->RatedEvapCapacity * CurveValue(state, this->OUCoolingCAPFT(CounterCompSpdTemp), T_discharge, T_suction); + Cap_Eva1 = this->CoffEvapCap * this->RatedEvapCapacity * + CurveValue(state, this->OUCoolingCAPFT(CounterCompSpdTemp), T_discharge, T_suction); CapDiff = std::abs(Cap_Eva1 - Cap_Eva0); if ((CapDiff > (Tolerance * Cap_Eva0)) && (NumIteCcap < 30)) { @@ -13694,7 +14016,7 @@ namespace HVACVariableRefrigerantFlow { using FluidProperties::GetSupHeatEnthalpyRefrig; using FluidProperties::RefrigData; using General::SolveRoot; - using General::TrimSigDigits; + using TempSolveRoot::SolveRoot; Array1D Par(7); // Parameters passed to RegulaFalsi @@ -13964,7 +14286,8 @@ namespace HVACVariableRefrigerantFlow { Real64 Pipe_h_IU_out; // Get an updated Te (Te_update) corresponding to the updated Te' (Tsuction_new). PL_c is re-performed. - this->VRFOU_TeModification(state, this->EvaporatingTemp, + this->VRFOU_TeModification(state, + this->EvaporatingTemp, Tsuction_new, h_IU_evap_in, OutDryBulbTemp, @@ -14157,11 +14480,15 @@ namespace HVACVariableRefrigerantFlow { 8.3817 * Ref_Coe_v1 * Ref_Coe_v3 - 218.48 * Ref_Coe_v2 * Ref_Coe_v3 + 21.58; if (Pipe_viscosity_ref <= 0) Pipe_viscosity_ref = 16.26; // default superheated vapor viscosity data (MuPa*s) at T=353.15 K, P=2MPa - Pipe_v_ref = - Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaSuc) * 0.25) / - GetSupHeatDensityRefrig( - state, this->RefrigerantName, this->EvaporatingTemp + Pipe_SH_merged, max(min(Pevap, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - Pipe_Num_Re = Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaSuc) * 0.25) * this->RefPipDiaSuc / Pipe_viscosity_ref * 1000000; + Pipe_v_ref = Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaSuc) * 0.25) / + GetSupHeatDensityRefrig(state, + this->RefrigerantName, + this->EvaporatingTemp + Pipe_SH_merged, + max(min(Pevap, RefPHigh), RefPLow), + RefrigerantIndex, + RoutineName); + Pipe_Num_Re = + Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaSuc) * 0.25) * this->RefPipDiaSuc / Pipe_viscosity_ref * 1000000; Pipe_Num_Pr = Pipe_viscosity_ref * Pipe_cp_ref * 0.001 / Pipe_conductivity_ref; Pipe_Num_Nu = 0.023 * std::pow(Pipe_Num_Re, 0.8) * std::pow(Pipe_Num_Pr, 0.3); Pipe_Num_St = Pipe_Num_Nu / Pipe_Num_Re / Pipe_Num_Pr; @@ -14192,9 +14519,10 @@ namespace HVACVariableRefrigerantFlow { Pipe_Coe_k2 = 9999.9; } - Pipe_Q = max(0.0, - (DataGlobalConstants::Pi() * this->RefPipLen) * (OutdoorDryBulb / 2 + Pipe_T_room / 2 - this->EvaporatingTemp - Pipe_SH_merged) / - (1 / Pipe_Coe_k1 + 1 / Pipe_Coe_k2 + 1 / Pipe_Coe_k3)); + Pipe_Q = + max(0.0, + (DataGlobalConstants::Pi() * this->RefPipLen) * (OutdoorDryBulb / 2 + Pipe_T_room / 2 - this->EvaporatingTemp - Pipe_SH_merged) / + (1 / Pipe_Coe_k1 + 1 / Pipe_Coe_k2 + 1 / Pipe_Coe_k3)); Pipe_h_comp_in = Pipe_h_IU_out + Pipe_Q / Pipe_m_ref; @@ -14319,10 +14647,11 @@ namespace HVACVariableRefrigerantFlow { 8.3817 * Ref_Coe_v1 * Ref_Coe_v3 - 218.48 * Ref_Coe_v2 * Ref_Coe_v3 + 21.58; if (Pipe_viscosity_ref <= 0) Pipe_viscosity_ref = 16.26; // default superheated vapor viscosity data (MuPa*s) at T=353.15 K, P=2MPa - Pipe_v_ref = - Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaDis) * 0.25) / - GetSupHeatDensityRefrig(state, this->RefrigerantName, Pipe_T_IU_in, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - Pipe_Num_Re = Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaDis) * 0.25) * this->RefPipDiaDis / Pipe_viscosity_ref * 1000000; + Pipe_v_ref = Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaDis) * 0.25) / + GetSupHeatDensityRefrig( + state, this->RefrigerantName, Pipe_T_IU_in, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + Pipe_Num_Re = + Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaDis) * 0.25) * this->RefPipDiaDis / Pipe_viscosity_ref * 1000000; Pipe_Num_Pr = Pipe_viscosity_ref * Pipe_cp_ref * 0.001 / Pipe_conductivity_ref; Pipe_Num_Nu = 0.023 * std::pow(Pipe_Num_Re, 0.8) * std::pow(Pipe_Num_Pr, 0.4); Pipe_Num_St = Pipe_Num_Nu / Pipe_Num_Re / Pipe_Num_Pr; @@ -14334,15 +14663,16 @@ namespace HVACVariableRefrigerantFlow { Pipe_Q = max(0.0, (DataGlobalConstants::Pi() * this->RefPipLen) * (Pipe_T_IU_in - OutdoorDryBulb / 2 - Pipe_T_room / 2) / (1 / Pipe_Coe_k1 + 1 / Pipe_Coe_k2 + 1 / Pipe_Coe_k3)); // [W] - Pipe_DeltP = max(0.0, - 8 * Pipe_Num_St * std::pow(Pipe_Num_Pr, 0.6667) * this->RefPipEquLen / this->RefPipDiaDis * - GetSupHeatDensityRefrig( - state, this->RefrigerantName, Pipe_T_IU_in, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) * - pow_2(Pipe_v_ref) / 2 - - this->RefPipHei * - GetSupHeatDensityRefrig( - state, this->RefrigerantName, Pipe_T_IU_in, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) * - 9.80665); + Pipe_DeltP = + max(0.0, + 8 * Pipe_Num_St * std::pow(Pipe_Num_Pr, 0.6667) * this->RefPipEquLen / this->RefPipDiaDis * + GetSupHeatDensityRefrig( + state, this->RefrigerantName, Pipe_T_IU_in, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) * + pow_2(Pipe_v_ref) / 2 - + this->RefPipHei * + GetSupHeatDensityRefrig( + state, this->RefrigerantName, Pipe_T_IU_in, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName) * + 9.80665); Pipe_h_comp_out = Pipe_h_IU_in + Pipe_Q / Pipe_m_ref; diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index 49fba08bb92..6690f0729ff 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -178,7 +178,7 @@ namespace HWBaseboardRadiator { // Using/Aliasing using DataLoopNode::Node; using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::TrimSigDigits; + using ScheduleManager::GetCurrentScheduleValue; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -203,13 +203,19 @@ namespace HWBaseboardRadiator { } else { BaseboardNum = CompIndex; if (BaseboardNum > NumHWBaseboards || BaseboardNum < 1) { - ShowFatalError(state, "SimHWBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + - ", Number of Units=" + TrimSigDigits(NumHWBaseboards) + ", Entered Unit name=" + EquipName); + ShowFatalError(state, + format("SimHWBaseboard: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + BaseboardNum, + NumHWBaseboards, + EquipName)); } if (CheckEquipName(BaseboardNum)) { if (EquipName != HWBaseboard(BaseboardNum).EquipID) { - ShowFatalError(state, "SimHWBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + ", Unit name=" + EquipName + - ", stored Unit Name for that index=" + HWBaseboard(BaseboardNum).EquipID); + ShowFatalError(state, + format("SimHWBaseboard: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + BaseboardNum, + EquipName, + HWBaseboard(BaseboardNum).EquipID)); } CheckEquipName(BaseboardNum) = false; } @@ -257,7 +263,7 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).BranchNum); } else { ShowSevereError(state, "SimBaseboard: Errors in Baseboard=" + HWBaseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Invalid or unimplemented equipment type=" + TrimSigDigits(HWBaseboard(BaseboardNum).EquipType)); + ShowContinueError(state, format("Invalid or unimplemented equipment type={}", HWBaseboard(BaseboardNum).EquipType)); ShowFatalError(state, "Preceding condition causes termination."); } } @@ -300,8 +306,7 @@ namespace HWBaseboardRadiator { using DataSizing::FractionOfAutosizedHeatingCapacity; using DataSizing::HeatingDesignCapacity; using DataSurfaces::Surface; - using General::RoundSigDigits; - using General::TrimSigDigits; + using GlobalNames::VerifyUniqueBaseboardName; using NodeInputManager::GetOnlySingleNode; using ScheduleManager::GetCurrentScheduleValue; @@ -398,12 +403,12 @@ namespace HWBaseboardRadiator { if (HWBaseboard(BaseboardNum).WaterTempAvg > MaxWaterTempAvg + 0.001) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(1) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxWaterTempAvg, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxWaterTempAvg)); HWBaseboard(BaseboardNum).WaterTempAvg = MaxWaterTempAvg; } else if (HWBaseboard(BaseboardNum).WaterTempAvg < MinWaterTempAvg - 0.001) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(1) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinWaterTempAvg, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinWaterTempAvg)); HWBaseboard(BaseboardNum).WaterTempAvg = MinWaterTempAvg; } @@ -412,7 +417,7 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).WaterMassFlowRateStd > HighWaterMassFlowRate + 0.0001) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(2) + " is an invalid Standard Water mass flow rate."); - ShowContinueError(state, "...reset to a default value=[" + RoundSigDigits(WaterMassFlowDefault, 1) + "]."); + ShowContinueError(state, format("...reset to a default value=[{:.1R}].", WaterMassFlowDefault)); HWBaseboard(BaseboardNum).WaterMassFlowRateStd = WaterMassFlowDefault; } @@ -424,8 +429,10 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatDesignCapacityNumericNum); if (HWBaseboard(BaseboardNum).ScaledHeatingCapacity < 0.0 && HWBaseboard(BaseboardNum).ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + HWBaseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatDesignCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatDesignCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatDesignCapacityNumericNum), + rNumericArgs(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } } else { @@ -441,8 +448,10 @@ namespace HWBaseboardRadiator { if (HWBaseboard(BaseboardNum).ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + HWBaseboard(BaseboardNum).EquipID); ShowContinueError(state, "Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum), + rNumericArgs(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } else if (HWBaseboard(BaseboardNum).ScaledHeatingCapacity == AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + HWBaseboard(BaseboardNum).EquipID); @@ -462,8 +471,10 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); if (HWBaseboard(BaseboardNum).ScaledHeatingCapacity < 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + HWBaseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum), + rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -482,12 +493,12 @@ namespace HWBaseboardRadiator { if (std::abs(HWBaseboard(BaseboardNum).WaterVolFlowRateMax) <= MinWaterFlowRate) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(6) + " was less than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinWaterFlowRate, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinWaterFlowRate)); HWBaseboard(BaseboardNum).WaterVolFlowRateMax = MinWaterFlowRate; } else if (HWBaseboard(BaseboardNum).WaterVolFlowRateMax > MaxWaterFlowRate) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(6) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxWaterFlowRate, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxWaterFlowRate)); HWBaseboard(BaseboardNum).WaterVolFlowRateMax = MaxWaterFlowRate; } @@ -496,7 +507,7 @@ namespace HWBaseboardRadiator { if (HWBaseboard(BaseboardNum).Offset <= 0.0) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(7) + " was less than the allowable minimum."); - ShowContinueError(state, "...reset to a default value=[" + RoundSigDigits(MaxFraction, 2) + "]."); + ShowContinueError(state, format("...reset to a default value=[{:.2R}].", MaxFraction)); HWBaseboard(BaseboardNum).Offset = 0.001; } @@ -504,13 +515,13 @@ namespace HWBaseboardRadiator { if (HWBaseboard(BaseboardNum).FracRadiant < MinFraction) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(8) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinFraction, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinFraction)); HWBaseboard(BaseboardNum).FracRadiant = MinFraction; } if (HWBaseboard(BaseboardNum).FracRadiant > MaxFraction) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(8) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxFraction)); HWBaseboard(BaseboardNum).FracRadiant = MaxFraction; } @@ -529,28 +540,28 @@ namespace HWBaseboardRadiator { if (HWBaseboard(BaseboardNum).FracDistribPerson < MinFraction) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(9) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinFraction, 3) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.3R}].", MinFraction)); HWBaseboard(BaseboardNum).FracDistribPerson = MinFraction; } if (HWBaseboard(BaseboardNum).FracDistribPerson > MaxFraction) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(9) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 3) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.3R}].", MaxFraction)); HWBaseboard(BaseboardNum).FracDistribPerson = MaxFraction; } HWBaseboard(BaseboardNum).TotSurfToDistrib = NumNumbers - 9; // IF (HWBaseboard(BaseboardNum)%TotSurfToDistrib > MaxDistribSurfaces) THEN - // CALL ShowWarningError(RoutineName//cCMO_BBRadiator_Water//'="'//TRIM(cAlphaArgs(1))// & + // CALL ShowWarningError(state, RoutineName//cCMO_BBRadiator_Water//'="'//TRIM(cAlphaArgs(1))// & // '", the number of surface/radiant fraction groups entered was higher than the allowable maximum.') - // CALL ShowContinueError('...only the maximum value=['//TRIM(RoundSigDigits(MaxDistribSurfaces))// & + // CALL ShowContinueError(state, '...only the maximum value=['//TRIM(RoundSigDigits(MaxDistribSurfaces))// & // '] will be processed.') // HWBaseboard(BaseboardNum)%TotSurfToDistrib = MaxDistribSurfaces // END IF if ((HWBaseboard(BaseboardNum).TotSurfToDistrib < MinDistribSurfaces) && (HWBaseboard(BaseboardNum).FracRadiant > MinFraction)) { ShowSevereError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", the number of surface/radiant fraction groups entered was less than the allowable minimum."); - ShowContinueError(state, "...the minimum that must be entered=[" + RoundSigDigits(MinDistribSurfaces) + "]."); + ShowContinueError(state, format("...the minimum that must be entered=[{}].", MinDistribSurfaces)); ErrorsFound = true; HWBaseboard(BaseboardNum).TotSurfToDistrib = 0; // error } @@ -591,13 +602,13 @@ namespace HWBaseboardRadiator { if (HWBaseboard(BaseboardNum).FracDistribToSurf(SurfNum) > MaxFraction) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(SurfNum + 9) + "was greater than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxFraction)); HWBaseboard(BaseboardNum).TotSurfToDistrib = MaxFraction; } if (HWBaseboard(BaseboardNum).FracDistribToSurf(SurfNum) < MinFraction) { ShowWarningError(state, RoutineName + cCMO_BBRadiator_Water + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(SurfNum + 9) + "was less than the allowable minimum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MinFraction, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MinFraction)); HWBaseboard(BaseboardNum).TotSurfToDistrib = MinFraction; } if (HWBaseboard(BaseboardNum).SurfacePtr(SurfNum) != 0) { @@ -948,7 +959,7 @@ namespace HWBaseboardRadiator { using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; using DataLoopNode::Node; - using General::RoundSigDigits; + using PlantUtilities::RegisterPlantCompDesignFlow; // Locals @@ -1120,10 +1131,10 @@ namespace HWBaseboardRadiator { ShowMessage(state, "SizeHWBaseboard: Potential issue with equipment sizing for ZoneHVAC:Baseboard:RadiantConvective:Water=\"" + HWBaseboard(BaseboardNum).EquipID + "\"."); - ShowContinueError(state, "User-Specified Maximum Water Flow Rate of " + RoundSigDigits(WaterVolFlowRateMaxUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Water Flow Rate of " + - RoundSigDigits(WaterVolFlowRateMaxDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Water Flow Rate of {:.5R} [m3/s]", WaterVolFlowRateMaxUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Water Flow Rate of {:.5R} [m3/s]", WaterVolFlowRateMaxDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1162,19 +1173,21 @@ namespace HWBaseboardRadiator { if (AirOutletTempStd >= WaterInletTempStd) { ShowSevereError(state, "SizeHWBaseboard: ZoneHVAC:Baseboard:RadiantConvective:Water=\"" + HWBaseboard(BaseboardNum).EquipID + "\"."); ShowContinueError(state, "...Air Outlet temperature must be below the Water Inlet temperature"); - ShowContinueError(state, "...Air Outlet Temperature=[" + RoundSigDigits(AirOutletTempStd, 2) + "], Water Inlet Temperature=[" + - RoundSigDigits(WaterInletTempStd, 2) + "]."); + ShowContinueError( + state, + format("...Air Outlet Temperature=[{:.2R}], Water Inlet Temperature=[{:.2R}].", AirOutletTempStd, WaterInletTempStd)); AirOutletTempStd = WaterInletTempStd - 0.01; - ShowContinueError(state, "...Air Outlet Temperature set to [" + RoundSigDigits(AirOutletTempStd, 2) + "]."); + ShowContinueError(state, format("...Air Outlet Temperature set to [{:.2R}].", AirOutletTempStd)); } // Check Tw,out < Ta,in if (AirInletTempStd >= WaterOutletTempStd) { ShowSevereError(state, "SizeHWBaseboard: ZoneHVAC:Baseboard:RadiantConvective:Water=\"" + HWBaseboard(BaseboardNum).EquipID + "\"."); ShowContinueError(state, "...Water Outlet temperature must be below the Air Inlet temperature"); - ShowContinueError(state, "...Air Inlet Temperature=[" + RoundSigDigits(AirInletTempStd, 2) + "], Water Outlet Temperature=[" + - RoundSigDigits(WaterOutletTempStd, 2) + "]."); + ShowContinueError( + state, + format("...Air Inlet Temperature=[{:.2R}], Water Outlet Temperature=[{:.2R}].", AirInletTempStd, WaterOutletTempStd)); WaterOutletTempStd = AirInletTempStd + 0.01; - ShowContinueError(state, "...Water Outlet Temperature set to [" + RoundSigDigits(WaterOutletTempStd, 2) + "]."); + ShowContinueError(state, format("...Water Outlet Temperature set to [{:.2R}].", WaterOutletTempStd)); } // LMTD calculation DeltaT1 = WaterInletTempStd - AirOutletTempStd; @@ -1218,19 +1231,19 @@ namespace HWBaseboardRadiator { if (AirOutletTempStd >= WaterInletTempStd) { ShowSevereError(state, "SizeHWBaseboard: ZoneHVAC:Baseboard:RadiantConvective:Water=\"" + HWBaseboard(BaseboardNum).EquipID + "\"."); ShowContinueError(state, "...Air Outlet temperature must be below the Water Inlet temperature"); - ShowContinueError(state, "...Air Outlet Temperature=[" + RoundSigDigits(AirOutletTempStd, 2) + "], Water Inlet Temperature=[" + - RoundSigDigits(WaterInletTempStd, 2) + "]."); + ShowContinueError( + state, format("...Air Outlet Temperature=[{:.2R}], Water Inlet Temperature=[{:.2R}].", AirOutletTempStd, WaterInletTempStd)); AirOutletTempStd = WaterInletTempStd - 0.01; - ShowContinueError(state, "...Air Outlet Temperature set to [" + RoundSigDigits(AirOutletTempStd, 2) + "]."); + ShowContinueError(state, format("...Air Outlet Temperature set to [{:.2R}].", AirOutletTempStd)); } // Check Tw,out < Ta,in if (AirInletTempStd >= WaterOutletTempStd) { ShowSevereError(state, "SizeHWBaseboard: ZoneHVAC:Baseboard:RadiantConvective:Water=\"" + HWBaseboard(BaseboardNum).EquipID + "\"."); ShowContinueError(state, "...Water Outlet temperature must be below the Air Inlet temperature"); - ShowContinueError(state, "...Air Inlet Temperature=[" + RoundSigDigits(AirInletTempStd, 2) + "], Water Outlet Temperature=[" + - RoundSigDigits(WaterOutletTempStd, 2) + "]."); + ShowContinueError( + state, format("...Air Inlet Temperature=[{:.2R}], Water Outlet Temperature=[{:.2R}].", AirInletTempStd, WaterOutletTempStd)); WaterOutletTempStd = AirInletTempStd + 0.01; - ShowContinueError(state, "...Water Outlet Temperature set to [" + RoundSigDigits(WaterOutletTempStd, 2) + "]."); + ShowContinueError(state, format("...Water Outlet Temperature set to [{:.2R}].", WaterOutletTempStd)); } // LMTD calculation DeltaT1 = WaterInletTempStd - AirOutletTempStd; @@ -1586,7 +1599,6 @@ namespace HWBaseboardRadiator { using DataHeatBalFanSys::QHWBaseboardSurf; using DataHeatBalFanSys::QHWBaseboardToPerson; using DataSurfaces::Surface; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1628,16 +1640,16 @@ namespace HWBaseboardRadiator { if (ThisSurfIntensity > MaxRadHeatFlux) { ShowSevereError(state, "DistributeBBRadGains: excessive thermal radiation heat flux intensity detected"); ShowContinueError(state, "Surface = " + Surface(SurfNum).Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(Surface(SurfNum).Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", Surface(SurfNum).Area)); ShowContinueError(state, "Occurs in " + cCMO_BBRadiator_Water + " = " + HWBaseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Radiation intensity = " + RoundSigDigits(ThisSurfIntensity, 2) + " [W/m2]"); + ShowContinueError(state, format("Radiation intensity = {:.2R} [W/m2]", ThisSurfIntensity)); ShowContinueError(state, "Assign a larger surface area or more surfaces in " + cCMO_BBRadiator_Water); ShowFatalError(state, "DistributeBBRadGains: excessive thermal radiation heat flux intensity detected"); } } else { ShowSevereError(state, "DistributeBBRadGains: surface not large enough to receive thermal radiation heat flux"); ShowContinueError(state, "Surface = " + Surface(SurfNum).Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(Surface(SurfNum).Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", Surface(SurfNum).Area)); ShowContinueError(state, "Occurs in " + cCMO_BBRadiator_Water + " = " + HWBaseboard(BaseboardNum).EquipID); ShowContinueError(state, "Assign a larger surface area or more surfaces in " + cCMO_BBRadiator_Water); ShowFatalError(state, "DistributeBBRadGains: surface not large enough to receive thermal radiation heat flux"); @@ -1786,7 +1798,7 @@ namespace HWBaseboardRadiator { using DataPlant::CriteriaType_MassFlowRate; using DataPlant::CriteriaType_Temperature; using DataPlant::TypeOf_Baseboard_Rad_Conv_Water; - using General::TrimSigDigits; + using PlantUtilities::PullCompInterconnectTrigger; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -1803,17 +1815,29 @@ namespace HWBaseboardRadiator { } else { BaseboardNum = CompIndex; if (BaseboardNum > NumHWBaseboards || BaseboardNum < 1) { - ShowFatalError(state, "UpdateHWBaseboardPlantConnection: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + - ", Number of baseboards=" + TrimSigDigits(NumHWBaseboards) + ", Entered baseboard name=" + BaseboardName); + ShowFatalError( + state, + format("UpdateHWBaseboardPlantConnection: Invalid CompIndex passed={}, Number of baseboards={}, Entered baseboard name={}", + BaseboardNum, + NumHWBaseboards, + BaseboardName)); } if (state.dataGlobal->KickOffSimulation) { if (BaseboardName != HWBaseboard(BaseboardNum).EquipID) { - ShowFatalError(state, "UpdateHWBaseboardPlantConnection: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + ", baseboard name=" + - BaseboardName + ", stored baseboard Name for that index=" + HWBaseboard(BaseboardNum).EquipID); + ShowFatalError(state, + format("UpdateHWBaseboardPlantConnection: Invalid CompIndex passed={}, baseboard name={}, stored baseboard Name " + "for that index={}", + BaseboardNum, + BaseboardName, + HWBaseboard(BaseboardNum).EquipID)); } if (BaseboardTypeNum != TypeOf_Baseboard_Rad_Conv_Water) { - ShowFatalError(state, "UpdateHWBaseboardPlantConnection: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + ", baseboard name=" + - BaseboardName + ", stored baseboard Name for that index=" + ccSimPlantEquipTypes(BaseboardTypeNum)); + ShowFatalError(state, + format("UpdateHWBaseboardPlantConnection: Invalid CompIndex passed={}, baseboard name={}, stored baseboard Name " + "for that index={}", + BaseboardNum, + BaseboardName, + ccSimPlantEquipTypes(BaseboardTypeNum))); } } } diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index 9e3f5466949..416e3548fef 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -232,7 +232,6 @@ namespace HeatBalFiniteDiffManager { using DataHeatBalance::CondFDRelaxFactor; using DataHeatBalance::CondFDRelaxFactorInput; using DataHeatBalance::MaxAllowedDelTempCondFD; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int IOStat; // IO Status when calling get input subroutine @@ -347,8 +346,8 @@ namespace HeatBalFiniteDiffManager { MaterialFD(MaterNum).numTempEnth = (MaterialNumProp - 1) / 2; if (MaterialFD(MaterNum).numTempEnth * 2 != (MaterialNumProp - 1)) { ShowSevereError(state, "GetCondFDInput: " + cCurrentModuleObject + "=\"" + MaterialNames(1) + "\", mismatched pairs"); - ShowContinueError(state, "...expected " + RoundSigDigits(MaterialFD(MaterNum).numTempEnth) + " pairs, but only entered " + - RoundSigDigits(MaterialNumProp - 1) + " numbers."); + ShowContinueError( + state, format("...expected {} pairs, but only entered {} numbers.", MaterialFD(MaterNum).numTempEnth, MaterialNumProp - 1)); ErrorsFound = true; } MaterialFD(MaterNum).TempEnth.dimension(2, MaterialFD(MaterNum).numTempEnth, 0.0); @@ -375,8 +374,9 @@ namespace HeatBalFiniteDiffManager { if (nonInc) { ShowSevereError(state, "GetCondFDInput: " + cCurrentModuleObject + "=\"" + MaterialNames(1) + "\", non increasing Temperatures. Temperatures must be strictly increasing."); - ShowContinueError(state, "...occurs first at item=[" + RoundSigDigits(inegptr) + "], value=[" + - RoundSigDigits(MaterialFD(MaterNum).TempEnth(1, inegptr), 2) + "]."); + ShowContinueError( + state, + format("...occurs first at item=[{}], value=[{:.2R}].", fmt::to_string(inegptr), MaterialFD(MaterNum).TempEnth(1, inegptr))); ErrorsFound = true; } nonInc = false; @@ -389,8 +389,8 @@ namespace HeatBalFiniteDiffManager { } if (nonInc) { ShowSevereError(state, "GetCondFDInput: " + cCurrentModuleObject + "=\"" + MaterialNames(1) + "\", non increasing Enthalpy."); - ShowContinueError(state, "...occurs first at item=[" + RoundSigDigits(inegptr) + "], value=[" + - RoundSigDigits(MaterialFD(MaterNum).TempEnth(2, inegptr), 2) + "]."); + ShowContinueError(state, + format("...occurs first at item=[{}], value=[{:.2R}].", inegptr, MaterialFD(MaterNum).TempEnth(2, inegptr))); ShowContinueError(state, "...These values may be Cp (Specific Heat) rather than Enthalpy. Please correct."); ErrorsFound = true; } @@ -437,8 +437,8 @@ namespace HeatBalFiniteDiffManager { MaterialFD(MaterNum).numTempCond = MaterialNumProp / 2; if (MaterialFD(MaterNum).numTempCond * 2 != MaterialNumProp) { ShowSevereError(state, "GetCondFDInput: " + cCurrentModuleObject + "=\"" + MaterialNames(1) + "\", mismatched pairs"); - ShowContinueError(state, "...expected " + RoundSigDigits(MaterialFD(MaterNum).numTempCond) + " pairs, but only entered " + - RoundSigDigits(MaterialNumProp) + " numbers."); + ShowContinueError( + state, format("...expected {} pairs, but only entered {} numbers.", MaterialFD(MaterNum).numTempCond, MaterialNumProp)); ErrorsFound = true; } MaterialFD(MaterNum).TempCond.dimension(2, MaterialFD(MaterNum).numTempCond, 0.0); @@ -465,8 +465,8 @@ namespace HeatBalFiniteDiffManager { if (nonInc) { ShowSevereError(state, "GetCondFDInput: " + cCurrentModuleObject + "=\"" + MaterialNames(1) + "\", non increasing Temperatures. Temperatures must be strictly increasing."); - ShowContinueError(state, "...occurs first at item=[" + RoundSigDigits(inegptr) + "], value=[" + - RoundSigDigits(MaterialFD(MaterNum).TempCond(1, inegptr), 2) + "]."); + ShowContinueError(state, + format("...occurs first at item=[{}], value=[{:.2R}].", inegptr, MaterialFD(MaterNum).TempCond(1, inegptr))); ErrorsFound = true; } } @@ -607,8 +607,6 @@ namespace HeatBalFiniteDiffManager { using DataHeatBalance::HighDiffusivityThreshold; using DataHeatBalance::ThinMaterialLayerThreshold; using DataSurfaces::HeatTransferModel_CondFD; - using General::RoundSigDigits; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Lay; @@ -785,16 +783,19 @@ namespace HeatBalFiniteDiffManager { "InitialInitHeatBalFiniteDiff: Found Material that is too thin and/or too highly conductive, material name = " + dataMaterial.Material(CurrentLayer).Name); ShowContinueError(state, - "High conductivity Material layers are not well supported by Conduction Finite Difference, material conductivity = " + - RoundSigDigits(dataMaterial.Material(CurrentLayer).Conductivity, 3) + " [W/m-K]"); - ShowContinueError(state, "Material thermal diffusivity = " + RoundSigDigits(Alpha, 3) + " [m2/s]"); - ShowContinueError(state, "Material with this thermal diffusivity should have thickness > " + - RoundSigDigits(ThicknessThreshold, 5) + " [m]"); + format("High conductivity Material layers are not well supported by Conduction Finite Difference, " + "material conductivity = {:.3R} [W/m-K]", + dataMaterial.Material(CurrentLayer).Conductivity)); + ShowContinueError(state, format("Material thermal diffusivity = {:.3R} [m2/s]", Alpha)); + ShowContinueError( + state, format("Material with this thermal diffusivity should have thickness > {:.5R} [m]", ThicknessThreshold)); if (dataMaterial.Material(CurrentLayer).Thickness < ThinMaterialLayerThreshold) { - ShowContinueError(state, "Material may be too thin to be modeled well, thickness = " + - RoundSigDigits(dataMaterial.Material(CurrentLayer).Thickness, 5) + " [m]"); - ShowContinueError(state, "Material with this thermal diffusivity should have thickness > " + - RoundSigDigits(ThinMaterialLayerThreshold, 5) + " [m]"); + ShowContinueError(state, + format("Material may be too thin to be modeled well, thickness = {:.5R} [m]", + dataMaterial.Material(CurrentLayer).Thickness)); + ShowContinueError( + state, + format("Material with this thermal diffusivity should have thickness > {:.5R} [m]", ThinMaterialLayerThreshold)); } ShowFatalError(state, "Preceding conditions cause termination."); } @@ -938,44 +939,51 @@ namespace HeatBalFiniteDiffManager { TotNodes = ConstructFD(Surface(SurfNum).Construction).TotNodes; // Full size nodes, start with outside face. for (Lay = 1; Lay <= TotNodes + 1; ++Lay) { // include inside face node - SetupOutputVariable(state, "CondFD Surface Temperature Node " + TrimSigDigits(Lay) + "", + SetupOutputVariable(state, + format("CondFD Surface Temperature Node {}", Lay), OutputProcessor::Unit::C, SurfaceFD(SurfNum).TDreport(Lay), "Zone", "State", Surface(SurfNum).Name); - SetupOutputVariable(state, "CondFD Surface Heat Flux Node " + TrimSigDigits(Lay) + "", + SetupOutputVariable(state, + format("CondFD Surface Heat Flux Node {}", Lay), OutputProcessor::Unit::W_m2, SurfaceFD(SurfNum).QDreport(Lay), "Zone", "State", Surface(SurfNum).Name); - SetupOutputVariable(state, "CondFD Phase Change State " + TrimSigDigits(Lay) + "", + SetupOutputVariable(state, + format("CondFD Phase Change State {}", Lay), OutputProcessor::Unit::None, SurfaceFD(SurfNum).PhaseChangeState(Lay), "Zone", "State", Surface(SurfNum).Name); - SetupOutputVariable(state, "CondFD Phase Change Previous State " + TrimSigDigits(Lay) + "", + SetupOutputVariable(state, + format("CondFD Phase Change Previous State {}", Lay), OutputProcessor::Unit::None, SurfaceFD(SurfNum).PhaseChangeStateOld(Lay), "Zone", "State", Surface(SurfNum).Name); - SetupOutputVariable(state, "CondFD Phase Change Node Temperature " + TrimSigDigits(Lay) + "", + SetupOutputVariable(state, + format("CondFD Phase Change Node Temperature {}", Lay), OutputProcessor::Unit::C, SurfaceFD(SurfNum).TDT(Lay), "Zone", "State", Surface(SurfNum).Name); if (state.dataGlobal->DisplayAdvancedReportVariables) { - SetupOutputVariable(state, "CondFD Surface Heat Capacitance Outer Half Node " + TrimSigDigits(Lay) + "", + SetupOutputVariable(state, + format("CondFD Surface Heat Capacitance Outer Half Node {}", Lay), OutputProcessor::Unit::W_m2K, SurfaceFD(SurfNum).CpDelXRhoS1(Lay), "Zone", "State", Surface(SurfNum).Name); - SetupOutputVariable(state, "CondFD Surface Heat Capacitance Inner Half Node " + TrimSigDigits(Lay) + "", + SetupOutputVariable(state, + format("CondFD Surface Heat Capacitance Inner Half Node {}", Lay), OutputProcessor::Unit::W_m2K, SurfaceFD(SurfNum).CpDelXRhoS2(Lay), "Zone", @@ -1197,7 +1205,7 @@ namespace HeatBalFiniteDiffManager { // Using/Aliasing using DataHeatBalance::CondFDRelaxFactorInput; using DataHeatBalance::MaxAllowedDelTempCondFD; - using General::RoundSigDigits; + using General::ScanForReports; // SUBROUTINE PARAMETER DEFINITIONS: @@ -2236,7 +2244,6 @@ namespace HeatBalFiniteDiffManager { // Use methodology similar to HBSurfaceManager // Using/Aliasing - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ZoneNum; @@ -2247,20 +2254,23 @@ namespace HeatBalFiniteDiffManager { if (!state.dataGlobal->WarmupFlag || WarmupSurfTemp > 10 || state.dataGlobal->DisplayExtraWarnings) { if (CheckTemperature < MinSurfaceTempLimit) { if (Surface(SurfNum).LowTempErrCount == 0) { - ShowSevereMessage(state, "Temperature (low) out of bounds [" + RoundSigDigits(CheckTemperature, 2) + "] for zone=\"" + - Zone(ZoneNum).Name + "\", for surface=\"" + Surface(SurfNum).Name + "\""); + ShowSevereMessage(state, + format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", + CheckTemperature, + Zone(ZoneNum).Name, + Surface(SurfNum).Name)); ShowContinueErrorTimeStamp(state, ""); if (!Zone(ZoneNum).TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + Zone(ZoneNum).Name + "\", Diagnostic Details:"); if (Zone(ZoneNum).FloorArea > 0.0) { - ShowContinueError(state, "...Internal Heat Gain [" + - RoundSigDigits(Zone(ZoneNum).InternalHeatGains / Zone(ZoneNum).FloorArea, 3) + "] W/m2"); + ShowContinueError( + state, format("...Internal Heat Gain [{:.3R}] W/m2", Zone(ZoneNum).InternalHeatGains / Zone(ZoneNum).FloorArea)); } else { - ShowContinueError(state, "...Internal Heat Gain (no floor) [" + RoundSigDigits(Zone(ZoneNum).InternalHeatGains, 3) + "] W"); + ShowContinueError(state, format("...Internal Heat Gain (no floor) [{:.3R}] W", Zone(ZoneNum).InternalHeatGains)); } if (AirflowNetwork::SimulateAirflowNetwork <= AirflowNetwork::AirflowNetworkControlSimple) { - ShowContinueError(state, "...Infiltration/Ventilation [" + RoundSigDigits(Zone(ZoneNum).NominalInfilVent, 3) + "] m3/s"); - ShowContinueError(state, "...Mixing/Cross Mixing [" + RoundSigDigits(Zone(ZoneNum).NominalMixing, 3) + "] m3/s"); + ShowContinueError(state, format("...Infiltration/Ventilation [{:.3R}] m3/s", Zone(ZoneNum).NominalInfilVent)); + ShowContinueError(state, format("...Mixing/Cross Mixing [{:.3R}] m3/s", Zone(ZoneNum).NominalMixing)); } else { ShowContinueError(state, "...Airflow Network Simulation: Nominal Infiltration/Ventilation/Mixing not available."); } @@ -2291,20 +2301,23 @@ namespace HeatBalFiniteDiffManager { } } else { if (Surface(SurfNum).HighTempErrCount == 0) { - ShowSevereMessage(state, "Temperature (high) out of bounds (" + RoundSigDigits(CheckTemperature, 2) + "] for zone=\"" + - Zone(ZoneNum).Name + "\", for surface=\"" + Surface(SurfNum).Name + "\""); + ShowSevereMessage(state, + format("Temperature (high) out of bounds ({:.2R}] for zone=\"{}\", for surface=\"{}\"", + CheckTemperature, + Zone(ZoneNum).Name, + Surface(SurfNum).Name)); ShowContinueErrorTimeStamp(state, ""); if (!Zone(ZoneNum).TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + Zone(ZoneNum).Name + "\", Diagnostic Details:"); if (Zone(ZoneNum).FloorArea > 0.0) { - ShowContinueError(state, "...Internal Heat Gain [" + - RoundSigDigits(Zone(ZoneNum).InternalHeatGains / Zone(ZoneNum).FloorArea, 3) + "] W/m2"); + ShowContinueError( + state, format("...Internal Heat Gain [{:.3R}] W/m2", Zone(ZoneNum).InternalHeatGains / Zone(ZoneNum).FloorArea)); } else { - ShowContinueError(state, "...Internal Heat Gain (no floor) [" + RoundSigDigits(Zone(ZoneNum).InternalHeatGains, 3) + "] W"); + ShowContinueError(state, format("...Internal Heat Gain (no floor) [{:.3R}] W", Zone(ZoneNum).InternalHeatGains)); } if (AirflowNetwork::SimulateAirflowNetwork <= AirflowNetwork::AirflowNetworkControlSimple) { - ShowContinueError(state, "...Infiltration/Ventilation [" + RoundSigDigits(Zone(ZoneNum).NominalInfilVent, 3) + "] m3/s"); - ShowContinueError(state, "...Mixing/Cross Mixing [" + RoundSigDigits(Zone(ZoneNum).NominalMixing, 3) + "] m3/s"); + ShowContinueError(state, format("...Infiltration/Ventilation [{:.3R}] m3/s", Zone(ZoneNum).NominalInfilVent)); + ShowContinueError(state, format("...Mixing/Cross Mixing [{:.3R}] m3/s", Zone(ZoneNum).NominalMixing)); } else { ShowContinueError(state, "...Airflow Network Simulation: Nominal Infiltration/Ventilation/Mixing not available."); } @@ -2348,7 +2361,6 @@ namespace HeatBalFiniteDiffManager { // DATE WRITTEN Sept-Nov 2015 // PURPOSE OF THIS SUBROUTINE: // Calculate flux at each condFD node - using General::RoundSigDigits; int node; // node counter diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index 73cdddcaa70..bddab22e7a0 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -354,7 +354,7 @@ namespace HeatBalanceAirManager { // Using/Aliasing using General::CheckCreatedZoneItemName; - using General::RoundSigDigits; + using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMinValue; @@ -650,8 +650,11 @@ namespace HeatBalanceAirManager { ZoneAirBalance(Loop).InducedAirRate = rNumericArgs(1); if (rNumericArgs(1) < 0.0) { ShowSevereError(state, - RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + - "\", invalid Induced Outdoor Air Due to Duct Leakage Unbalance specification [<0.0]=" + RoundSigDigits(rNumericArgs(1), 3)); + format("{}{}=\"{}\", invalid Induced Outdoor Air Due to Duct Leakage Unbalance specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + cAlphaArgs(1), + rNumericArgs(1))); ErrorsFound = true; } @@ -926,8 +929,12 @@ namespace HeatBalanceAirManager { } } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + Infiltration(Loop).Name + - "\", invalid flow/area specification [<0.0]=" + RoundSigDigits(rNumericArgs(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid flow/area specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + Infiltration(Loop).Name, + rNumericArgs(2))); ErrorsFound = true; } } @@ -946,8 +953,12 @@ namespace HeatBalanceAirManager { ", but Exterior Surface Area = 0. 0 Infiltration will result."); } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + " = \"" + Infiltration(Loop).Name + - "\", invalid flow/exteriorarea specification [<0.0]=" + RoundSigDigits(rNumericArgs(3), 3)); + ShowSevereError(state, + format("{}{} = \"{}\", invalid flow/exteriorarea specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + Infiltration(Loop).Name, + rNumericArgs(3))); ErrorsFound = true; } } @@ -965,8 +976,12 @@ namespace HeatBalanceAirManager { ", but Exterior Wall Area = 0. 0 Infiltration will result."); } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + " = \"" + Infiltration(Loop).Name + - "\", invalid flow/exteriorwallarea specification [<0.0]=" + RoundSigDigits(rNumericArgs(3), 3)); + ShowSevereError(state, + format("{}{} = \"{}\", invalid flow/exteriorwallarea specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + Infiltration(Loop).Name, + rNumericArgs(3))); ErrorsFound = true; } } @@ -985,8 +1000,11 @@ namespace HeatBalanceAirManager { } } else { ShowSevereError(state, - RoutineName + "In " + cCurrentModuleObject + " = \"" + Infiltration(Loop).Name + - "\", invalid ACH (air changes per hour) specification [<0.0]=" + RoundSigDigits(rNumericArgs(4), 3)); + format("{}In {} = \"{}\", invalid ACH (air changes per hour) specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + Infiltration(Loop).Name, + rNumericArgs(4))); ErrorsFound = true; } } @@ -1411,8 +1429,12 @@ namespace HeatBalanceAirManager { ", but Zone Floor Area = 0. 0 Ventilation will result."); } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + Ventilation(Loop).Name + - "\", invalid flow/area specification [<0.0]=" + RoundSigDigits(rNumericArgs(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid flow/area specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + Ventilation(Loop).Name, + rNumericArgs(2))); ErrorsFound = true; } } @@ -1431,8 +1453,12 @@ namespace HeatBalanceAirManager { ", but Zone Total Occupants = 0. 0 Ventilation will result."); } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + Ventilation(Loop).Name + - "\", invalid flow/person specification [<0.0]=" + RoundSigDigits(rNumericArgs(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid flow/person specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + Ventilation(Loop).Name, + rNumericArgs(3))); ErrorsFound = true; } } @@ -1452,8 +1478,11 @@ namespace HeatBalanceAirManager { } } else { ShowSevereError(state, - RoutineName + cCurrentModuleObject + "=\"" + Ventilation(Loop).Name + - "\", invalid ACH (air changes per hour) specification [<0.0]=" + RoundSigDigits(rNumericArgs(5), 3)); + format("{}{}=\"{}\", invalid ACH (air changes per hour) specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + Ventilation(Loop).Name, + rNumericArgs(5))); ErrorsFound = true; } } @@ -1554,7 +1583,7 @@ namespace HeatBalanceAirManager { if (Item1 == 1) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" must have " + cNumericFieldNames(11) + " between -100C and 100C."); - ShowContinueError(state, "...value entered=[" + RoundSigDigits(rNumericArgs(11), 2) + "]."); + ShowContinueError(state, format("...value entered=[{:.2R}].", rNumericArgs(11))); ErrorsFound = true; } } @@ -1578,18 +1607,24 @@ namespace HeatBalanceAirManager { } if (Ventilation(Loop).MinIndoorTempSchedPtr == 0 && lNumericFieldBlanks(11) && (!lAlphaFieldBlanks(6))) { if (Item1 == 1) { - ShowWarningError(state, RoutineName + cNumericFieldNames(11) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(-VentilTempLimit, 1) + ") "); + ShowWarningError( + state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(11), + -VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } } // Check Minimum indoor temperature value and schedule fields if (!lNumericFieldBlanks(11) && (!cAlphaArgs(6).empty() && Ventilation(Loop).MinIndoorTempSchedPtr == 0)) { if (Item1 == 1) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(6) + " = " + cAlphaArgs(6) + - " is invalid. The constant value will be used at " + RoundSigDigits(rNumericArgs(11), 1) + - " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(6), + cAlphaArgs(6), + rNumericArgs(11))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } } @@ -1626,18 +1661,24 @@ namespace HeatBalanceAirManager { } if (Ventilation(Loop).MaxIndoorTempSchedPtr == 0 && lNumericFieldBlanks(12) && (!lAlphaFieldBlanks(7))) { if (Item1 == 1) { - ShowWarningError(state, RoutineName + cNumericFieldNames(12) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(VentilTempLimit, 1) + ") "); + ShowWarningError( + state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(12), + VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } } // Check Maximum indoor temperature value and schedule fields if (!lNumericFieldBlanks(12) && ((!lAlphaFieldBlanks(7)) && Ventilation(Loop).MaxIndoorTempSchedPtr == 0)) { if (Item1 == 1) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(7) + " = " + cAlphaArgs(7) + - " is invalid. The constant value will be used at " + RoundSigDigits(rNumericArgs(12), 1) + - " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(7), + cAlphaArgs(7), + rNumericArgs(12))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } } @@ -1667,9 +1708,12 @@ namespace HeatBalanceAirManager { } if (Ventilation(Loop).DeltaTempSchedPtr == 0 && lNumericFieldBlanks(13) && (!lAlphaFieldBlanks(8))) { if (Item1 == 1) { - ShowWarningError(state, RoutineName + cNumericFieldNames(13) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(VentilTempLimit, 1) + ") "); + ShowWarningError( + state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(13), + VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } } @@ -1677,15 +1721,19 @@ namespace HeatBalanceAirManager { // Check delta temperature value and schedule fields // IF (lNumericFieldBlanks(13) .AND. cAlphaArgs(8) .EQ. BlankString) THEN // CALL ShowWarningError(state, RoutineName//'Both the delta temperature value and delta schedule are blank. ') - // CALL ShowContinueError(state, 'Will set the temperature to a constant value of '//TRIM(RoundSigDigits(-VentilTempLimit,1)) & + // CALL ShowContinueError(state, 'Will set the temperature to a constant value of '//TRIM(format("{:.1R}", -VentilTempLimit)) + // & // //' degrees C ') // CALL ShowContinueError(state, 'in the Ventilation object = '//TRIM(cAlphaArgs(1))//' and the simulation continues...') // END IF if (!lNumericFieldBlanks(13) && ((!lAlphaFieldBlanks(8)) && Ventilation(Loop).DeltaTempSchedPtr == 0)) { if (Item1 == 1) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(8) + " = " + cAlphaArgs(8) + - " is invalid. The constant value will be used at " + RoundSigDigits(rNumericArgs(13), 1) + - " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(8), + cAlphaArgs(8), + rNumericArgs(13))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } } @@ -1720,17 +1768,21 @@ namespace HeatBalanceAirManager { } } if (Ventilation(Loop).MinOutdoorTempSchedPtr == 0 && lNumericFieldBlanks(14) && (!lAlphaFieldBlanks(9))) { - ShowWarningError(state, RoutineName + - "Minimum Outdoor Temperature: the value field is blank and schedule field is invalid. The default value " - "will be used (" + - RoundSigDigits(-VentilTempLimit, 1) + ") "); + ShowWarningError(state, + format("{}Minimum Outdoor Temperature: the value field is blank and schedule field is invalid. The " + "default value will be used ({:.1R}) ", + RoutineName, + -VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } // Check Minimum outdoor temperature value and schedule fields if (!lNumericFieldBlanks(14) && ((!lAlphaFieldBlanks(9)) && Ventilation(Loop).MinOutdoorTempSchedPtr == 0)) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(9) + " = " + cAlphaArgs(9) + - " is invalid. The constant value will be used at " + RoundSigDigits(rNumericArgs(14), 1) + - " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(9), + cAlphaArgs(9), + rNumericArgs(14))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } } @@ -1765,15 +1817,22 @@ namespace HeatBalanceAirManager { } } if (Ventilation(Loop).MaxOutdoorTempSchedPtr == 0 && lNumericFieldBlanks(15) && (!lAlphaFieldBlanks(10))) { - ShowWarningError(state, RoutineName + cNumericFieldNames(15) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(VentilTempLimit, 1) + ") "); + ShowWarningError( + state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(15), + VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } // Check Maximum outdoor temperature value and schedule fields if (!lNumericFieldBlanks(15) && ((!lAlphaFieldBlanks(10)) && Ventilation(Loop).MaxOutdoorTempSchedPtr == 0)) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(10) + " = " + cAlphaArgs(10) + - "is invalid. The constant value will be used at " + RoundSigDigits(rNumericArgs(15), 1) + " degrees C "); + ShowWarningError(state, + format("{}{} = {}is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(10), + cAlphaArgs(10), + rNumericArgs(15))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } } @@ -2024,15 +2083,21 @@ namespace HeatBalanceAirManager { } } if (Ventilation(VentiCount).MinIndoorTempSchedPtr == 0 && lNumericFieldBlanks(6) && (!lAlphaFieldBlanks(4))) { - ShowWarningError(state, RoutineName + cNumericFieldNames(6) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(-VentilTempLimit, 1) + ") "); + ShowWarningError(state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(6), + -VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } // Check Minimum indoor temperature value and schedule fields if (!lNumericFieldBlanks(6) && (!cAlphaArgs(4).empty() && Ventilation(VentiCount).MinIndoorTempSchedPtr == 0)) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(4) + " = " + cAlphaArgs(4) + " is invalid. The constant value will be used at " + - RoundSigDigits(rNumericArgs(11), 1) + " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(4), + cAlphaArgs(4), + rNumericArgs(11))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } @@ -2063,15 +2128,21 @@ namespace HeatBalanceAirManager { } } if (Ventilation(VentiCount).MaxIndoorTempSchedPtr == 0 && lNumericFieldBlanks(7) && (!lAlphaFieldBlanks(5))) { - ShowWarningError(state, RoutineName + cNumericFieldNames(7) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(VentilTempLimit, 1) + ") "); + ShowWarningError(state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(7), + VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } // Check Maximum indoor temperature value and schedule fields if (!lNumericFieldBlanks(7) && ((!lAlphaFieldBlanks(5)) && Ventilation(VentiCount).MaxIndoorTempSchedPtr == 0)) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(7) + " = " + cAlphaArgs(5) + " is invalid. The constant value will be used at " + - RoundSigDigits(rNumericArgs(7), 1) + " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(7), + cAlphaArgs(5), + rNumericArgs(7))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } @@ -2095,14 +2166,20 @@ namespace HeatBalanceAirManager { } } if (Ventilation(VentiCount).DeltaTempSchedPtr == 0 && lNumericFieldBlanks(8) && (!lAlphaFieldBlanks(6))) { - ShowWarningError(state, RoutineName + cNumericFieldNames(8) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(VentilTempLimit, 1) + ") "); + ShowWarningError(state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(8), + VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } if (!lNumericFieldBlanks(8) && ((!lAlphaFieldBlanks(6)) && Ventilation(VentiCount).DeltaTempSchedPtr == 0)) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(6) + " = " + cAlphaArgs(6) + " is invalid. The constant value will be used at " + - RoundSigDigits(rNumericArgs(8), 1) + " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(6), + cAlphaArgs(6), + rNumericArgs(8))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } @@ -2134,15 +2211,20 @@ namespace HeatBalanceAirManager { } if (Ventilation(VentiCount).MinOutdoorTempSchedPtr == 0 && lNumericFieldBlanks(9) && (!lAlphaFieldBlanks(7))) { ShowWarningError(state, - RoutineName + - "Minimum Outdoor Temperature: the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(-VentilTempLimit, 1) + ") "); + format("{}Minimum Outdoor Temperature: the value field is blank and schedule field is invalid. The default value " + "will be used ({:.1R}) ", + RoutineName, + -VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } // Check Minimum outdoor temperature value and schedule fields if (!lNumericFieldBlanks(9) && ((!lAlphaFieldBlanks(7)) && Ventilation(VentiCount).MinOutdoorTempSchedPtr == 0)) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(7) + " = " + cAlphaArgs(7) + " is invalid. The constant value will be used at " + - RoundSigDigits(rNumericArgs(14), 1) + " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(7), + cAlphaArgs(7), + rNumericArgs(14))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } @@ -2172,15 +2254,21 @@ namespace HeatBalanceAirManager { } } if (Ventilation(VentiCount).MaxOutdoorTempSchedPtr == 0 && lNumericFieldBlanks(10) && (!lAlphaFieldBlanks(8))) { - ShowWarningError(state, RoutineName + cNumericFieldNames(10) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(VentilTempLimit, 1) + ") "); + ShowWarningError(state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(10), + VentilTempLimit)); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } // Check Maximum outdoor temperature value and schedule fields if (!lNumericFieldBlanks(10) && ((!lAlphaFieldBlanks(8)) && Ventilation(VentiCount).MaxOutdoorTempSchedPtr == 0)) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(8) + " = " + cAlphaArgs(8) + "is invalid. The constant value will be used at " + - RoundSigDigits(rNumericArgs(10), 1) + " degrees C "); + ShowWarningError(state, + format("{}{} = {}is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(8), + cAlphaArgs(8), + rNumericArgs(10))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } @@ -2372,8 +2460,12 @@ namespace HeatBalanceAirManager { " specifies " + cNumericFieldNames(2) + ", but Zone Floor Area = 0. 0 Mixing will result."); } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + - "\", invalid flow/person specification [<0.0]=" + RoundSigDigits(rNumericArgs(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid flow/person specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + cAlphaArgs(1), + rNumericArgs(2))); ErrorsFound = true; } } @@ -2391,8 +2483,12 @@ namespace HeatBalanceAirManager { " specifies " + cNumericFieldNames(3) + ", but Zone Total Occupants = 0. 0 Mixing will result."); } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + - "\", invalid flow/person specification [<0.0]=" + RoundSigDigits(rNumericArgs(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid flow/person specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + cAlphaArgs(1), + rNumericArgs(3))); ErrorsFound = true; } } @@ -2410,8 +2506,12 @@ namespace HeatBalanceAirManager { " specifies " + cNumericFieldNames(4) + ", but Zone Volume = 0. 0 Mixing will result."); } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + - "\", invalid flow/person specification [<0.0]=" + RoundSigDigits(rNumericArgs(4), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid flow/person specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + cAlphaArgs(1), + rNumericArgs(4))); ErrorsFound = true; } } @@ -2449,14 +2549,20 @@ namespace HeatBalanceAirManager { } } if (Mixing(Loop).DeltaTempSchedPtr == 0 && lNumericFieldBlanks(5) && (!lAlphaFieldBlanks(6))) { - ShowWarningError(state, RoutineName + cNumericFieldNames(5) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(rNumericArgs(5), 1) + ") "); + ShowWarningError(state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(5), + rNumericArgs(5))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } if (!lNumericFieldBlanks(5) && ((!lAlphaFieldBlanks(6)) && Mixing(Loop).DeltaTempSchedPtr == 0)) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(6) + " = " + cAlphaArgs(6) + " is invalid. The constant value will be used at " + - RoundSigDigits(rNumericArgs(5), 1) + " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(6), + cAlphaArgs(6), + rNumericArgs(5))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } @@ -2749,7 +2855,7 @@ namespace HeatBalanceAirManager { int airBoundaryIndex = Loop - inputCrossMixing - 1; //zero-based int zone1 = DataHeatBalance::AirBoundaryMixingZone1[airBoundaryIndex]; int zone2 = DataHeatBalance::AirBoundaryMixingZone2[airBoundaryIndex]; - CrossMixing(Loop).Name = "Air Boundary Mixing Zones " + General::RoundSigDigits(zone1) + " and " + General::RoundSigDigits(zone2); + CrossMixing(Loop).Name = fmt::format("Air Boundary Mixing Zones {} and {}", zone1, zone2); CrossMixing(Loop).ZonePtr = zone1; CrossMixing(Loop).SchedPtr = DataHeatBalance::AirBoundaryMixingSched[airBoundaryIndex]; CrossMixing(Loop).DesignLevel = DataHeatBalance::AirBoundaryMixingVol[airBoundaryIndex]; @@ -2813,8 +2919,12 @@ namespace HeatBalanceAirManager { } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + - "\", invalid flow/person specification [<0.0]=" + RoundSigDigits(rNumericArgs(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid flow/person specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + cAlphaArgs(1), + rNumericArgs(2))); ErrorsFound = true; } } @@ -2835,8 +2945,12 @@ namespace HeatBalanceAirManager { } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + - "\", invalid flow/person specification [<0.0]=" + RoundSigDigits(rNumericArgs(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid flow/person specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + cAlphaArgs(1), + rNumericArgs(3))); ErrorsFound = true; } } @@ -2856,8 +2970,12 @@ namespace HeatBalanceAirManager { } } else { - ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + - "\", invalid flow/person specification [<0.0]=" + RoundSigDigits(rNumericArgs(4), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid flow/person specification [<0.0]={:.3R}", + RoutineName, + cCurrentModuleObject, + cAlphaArgs(1), + rNumericArgs(4))); ErrorsFound = true; } } @@ -2896,14 +3014,20 @@ namespace HeatBalanceAirManager { } } if (CrossMixing(Loop).DeltaTempSchedPtr == 0 && lNumericFieldBlanks(5) && (!lAlphaFieldBlanks(6))) { - ShowWarningError(state, RoutineName + cNumericFieldNames(5) + - ": the value field is blank and schedule field is invalid. The default value will be used (" + - RoundSigDigits(rNumericArgs(5), 1) + ") "); + ShowWarningError(state, + format("{}{}: the value field is blank and schedule field is invalid. The default value will be used ({:.1R}) ", + RoutineName, + cNumericFieldNames(5), + rNumericArgs(5))); ShowContinueError(state, "in " + cCurrentModuleObject + " = " + cAlphaArgs(1) + " and the simulation continues..."); } if (!lNumericFieldBlanks(5) && ((!lAlphaFieldBlanks(6)) && CrossMixing(Loop).DeltaTempSchedPtr == 0)) { - ShowWarningError(state, RoutineName + cAlphaFieldNames(6) + " = " + cAlphaArgs(6) + " is invalid. The constant value will be used at " + - RoundSigDigits(rNumericArgs(5), 1) + " degrees C "); + ShowWarningError(state, + format("{}{} = {} is invalid. The constant value will be used at {:.1R} degrees C ", + RoutineName, + cAlphaFieldNames(6), + cAlphaArgs(6), + rNumericArgs(5))); ShowContinueError(state, "in the " + cCurrentModuleObject + " object = " + cAlphaArgs(1) + " and the simulation continues..."); } @@ -4092,7 +4216,7 @@ namespace HeatBalanceAirManager { // na // Using/Aliasing - using General::RoundSigDigits; + using ScheduleManager::GetCurrentScheduleValue; using ScheduleManager::GetScheduleIndex; diff --git a/src/EnergyPlus/HeatBalanceHAMTManager.cc b/src/EnergyPlus/HeatBalanceHAMTManager.cc index 954593aef66..c2780c6fd2c 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.cc +++ b/src/EnergyPlus/HeatBalanceHAMTManager.cc @@ -718,9 +718,8 @@ namespace HeatBalanceHAMTManager { // na // Using/Aliasing - using General::RoundSigDigits; + using General::ScanForReports; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1042,7 +1041,8 @@ namespace HeatBalanceHAMTManager { print(state.files.eio, "\n"); for (int cellid = Extcell(sid), concell = 1; cellid <= Intcell(sid); ++cellid, ++concell) { - SetupOutputVariable(state, "HAMT Surface Temperature Cell " + TrimSigDigits(concell) + "", + SetupOutputVariable(state, + format("HAMT Surface Temperature Cell {}", concell), OutputProcessor::Unit::C, cells(cellid).temp, "Zone", @@ -1050,7 +1050,8 @@ namespace HeatBalanceHAMTManager { Surface(sid).Name); } for (int cellid = Extcell(sid), concell = 1; cellid <= Intcell(sid); ++cellid, ++concell) { - SetupOutputVariable(state, "HAMT Surface Water Content Cell " + TrimSigDigits(concell) + "", + SetupOutputVariable(state, + format("HAMT Surface Water Content Cell {}", concell), OutputProcessor::Unit::kg_kg, cells(cellid).wreport, "Zone", @@ -1058,7 +1059,8 @@ namespace HeatBalanceHAMTManager { Surface(sid).Name); } for (int cellid = Extcell(sid), concell = 1; cellid <= Intcell(sid); ++cellid, ++concell) { - SetupOutputVariable(state, "HAMT Surface Relative Humidity Cell " + TrimSigDigits(concell) + "", + SetupOutputVariable(state, + format("HAMT Surface Relative Humidity Cell {}", concell), OutputProcessor::Unit::Perc, cells(cellid).rhp, "Zone", @@ -1102,7 +1104,6 @@ namespace HeatBalanceHAMTManager { using DataHeatBalSurface::SurfQAdditionalHeatSourceInside; using DataSurfaces::OSCM; using DataSurfaces::OtherSideCondModeledExt; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1379,8 +1380,8 @@ namespace HeatBalanceHAMTManager { if (tempmax > MaxSurfaceTempLimit) { if (!state.dataGlobal->WarmupFlag) { if (Surface(sid).HighTempErrCount == 0) { - ShowSevereMessage(state, "HAMT: Temperature (high) out of bounds (" + RoundSigDigits(tempmax, 2) + - ") for surface=" + Surface(sid).Name); + ShowSevereMessage(state, + format("HAMT: Temperature (high) out of bounds ({:.2R}) for surface={}", tempmax, Surface(sid).Name)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, "HAMT: Temperature Temperature (high) out of bounds; Surface=" + Surface(sid).Name, @@ -1394,8 +1395,8 @@ namespace HeatBalanceHAMTManager { } if (tempmax > MaxSurfaceTempLimitBeforeFatal) { if (!state.dataGlobal->WarmupFlag) { - ShowSevereError(state, "HAMT: HAMT: Temperature (high) out of bounds ( " + RoundSigDigits(tempmax, 2) + - ") for surface=" + Surface(sid).Name); + ShowSevereError(state, + format("HAMT: HAMT: Temperature (high) out of bounds ( {:.2R}) for surface={}", tempmax, Surface(sid).Name)); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Program terminates due to preceding condition."); } @@ -1403,8 +1404,7 @@ namespace HeatBalanceHAMTManager { if (tempmin < MinSurfaceTempLimit) { if (!state.dataGlobal->WarmupFlag) { if (Surface(sid).HighTempErrCount == 0) { - ShowSevereMessage(state, "HAMT: Temperature (low) out of bounds (" + RoundSigDigits(tempmin, 2) + - ") for surface=" + Surface(sid).Name); + ShowSevereMessage(state, format("HAMT: Temperature (low) out of bounds ({:.2R}) for surface={}", tempmin, Surface(sid).Name)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, "HAMT: Temperature Temperature (high) out of bounds; Surface=" + Surface(sid).Name, @@ -1418,8 +1418,8 @@ namespace HeatBalanceHAMTManager { } if (tempmin < MinSurfaceTempLimitBeforeFatal) { if (!state.dataGlobal->WarmupFlag) { - ShowSevereError(state, "HAMT: HAMT: Temperature (low) out of bounds ( " + RoundSigDigits(tempmin, 2) + - ") for surface=" + Surface(sid).Name); + ShowSevereError(state, + format("HAMT: HAMT: Temperature (low) out of bounds ( {:.2R}) for surface={}", tempmin, Surface(sid).Name)); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Program terminates due to preceding condition."); } diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 5560d919811..6d31b779f64 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -504,7 +504,7 @@ namespace HeatBalanceIntRadExchange { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using General::ScanForReports; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1122,7 +1122,6 @@ namespace HeatBalanceIntRadExchange { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; // Argument array dimensioning F.dim(N, N); @@ -1159,8 +1158,7 @@ namespace HeatBalanceIntRadExchange { if (NumNums < 3 * pow_2(N)) { ShowSevereError(state, "GetInputViewFactors: " + cCurrentModuleObject + "=\"" + ZoneName + "\", not enough values."); - ShowContinueError(state, "...Number of input values [" + TrimSigDigits(NumNums) + "] is less than the required number=[" + - TrimSigDigits(3 * pow_2(N)) + "]."); + ShowContinueError(state, format("...Number of input values [{}] is less than the required number=[{}].", NumNums, 3 * pow_2(N))); ErrorsFound = true; NumNums = 0; } @@ -1309,7 +1307,6 @@ namespace HeatBalanceIntRadExchange { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; // Argument array dimensioning F.dim(N, N); @@ -1351,8 +1348,11 @@ namespace HeatBalanceIntRadExchange { if (NumNums < pow_2(N)) { ShowWarningError(state, "GetInputViewFactors: " + cCurrentModuleObject + "=\"" + EnclosureName + "\", not enough values."); - ShowContinueError(state, "...Number of input values [" + TrimSigDigits(NumNums) + "] is less than the required number=[" + - TrimSigDigits(pow_2(N)) + "] Missing surface pairs will have a zero view factor."); + ShowContinueError( + state, + format("...Number of input values [{}] is less than the required number=[{}] Missing surface pairs will have a zero view factor.", + NumNums, + pow_2(N))); } F = 0.0; numinx1 = 0; @@ -1541,7 +1541,6 @@ namespace HeatBalanceIntRadExchange { // na // Using/Aliasing - using General::RoundSigDigits; // Argument array dimensioning EP_SIZE_CHECK(A, N); @@ -1714,8 +1713,11 @@ namespace HeatBalanceIntRadExchange { if (CheckConvergeTolerance > 0.005) { ShowWarningError(state, "FixViewFactors: View factors not complete. Check for bad surface descriptions or unenclosed zone=\"" + enclName + "\"."); - ShowContinueError(state, "Enforced reciprocity has tolerance (ideal is 0)=[" + RoundSigDigits(CheckConvergeTolerance, 6) + - "], Row Sum (ideal is " + RoundSigDigits(N) + ")=[" + RoundSigDigits(RowSum, 2) + "]."); + ShowContinueError(state, + format("Enforced reciprocity has tolerance (ideal is 0)=[{:.6R}], Row Sum (ideal is {})=[{:.2R}].", + CheckConvergeTolerance, + N, + RowSum)); ShowContinueError(state, "If zone is unusual, or tolerance is on the order of 0.001, view factors are probably OK."); } if (std::abs(FixedCheckValue) < std::abs(OriginalCheckValue)) { diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index b1636b4e7d0..d435cf576ca 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -62,13 +62,9 @@ #include #include #include -#include #include #include -#include #include -#include -#include #include #include #include @@ -136,8 +132,11 @@ namespace HeatBalanceKivaManager { constructionName = DataHeatBalance::Construct(constructionNum).Name; } - ss.dir = FileSystem::getAbsolutePath(DataStringGlobals::outDirPathName) + "/" + DataSurfaces::Surface(floorSurface).Name + " " + - General::RoundSigDigits(ground.foundation.foundationDepth, 2) + " " + constructionName; + ss.dir = format("{}/{} {:.2R} {}", + FileSystem::getAbsolutePath(DataStringGlobals::outDirPathName), + DataSurfaces::Surface(floorSurface).Name, + ground.foundation.foundationDepth, + constructionName); debugDir = ss.dir; plotNum = 0; @@ -293,9 +292,11 @@ namespace HeatBalanceKivaManager { } else { Tin = 0.0; - ShowSevereError(state, "Illegal control type for Zone=" + DataHeatBalance::Zone(zoneNum).Name + - ", Found value=" + General::TrimSigDigits(controlType) + - ", in Schedule=" + DataZoneControls::TempControlledZone(zoneControlNum).ControlTypeSchedName); + ShowSevereError(state, + format("Illegal control type for Zone={}, Found value={}, in Schedule={}", + DataHeatBalance::Zone(zoneNum).Name, + controlType, + DataZoneControls::TempControlledZone(zoneControlNum).ControlTypeSchedName)); } break; } @@ -772,7 +773,7 @@ namespace HeatBalanceKivaManager { "\", wall surfaces with more than four vertices referencing"); ShowContinueError(state, "...Foundation Outside Boundary Conditions may not be interpreted correctly in the 2D finite difference model."); - ShowContinueError(state, "Surface=\"" + Surfaces(wl).Name + "\", has " + General::TrimSigDigits(numVs) + " vertices."); + ShowContinueError(state, format("Surface=\"{}\", has {} vertices.", Surfaces(wl).Name, numVs)); ShowContinueError(state, "Consider separating the wall into separate surfaces, each spanning from the floor slab to the top of " "the foundation wall."); } @@ -969,11 +970,14 @@ namespace HeatBalanceKivaManager { } if (fnd.deepGroundDepth > initDeepGroundDepth) { - ShowWarningError(state, "Foundation:Kiva=\"" + foundationInputs[surface.OSCPtr].name + "\", the autocalculated deep ground depth (" + - General::TrimSigDigits(initDeepGroundDepth, 3) + " m) is shallower than foundation construction elements (" + - General::TrimSigDigits(fnd.deepGroundDepth - 1.0, 3) + " m)"); - ShowContinueError(state, "The deep ground depth will be set one meter below the lowest element (" + - General::TrimSigDigits(fnd.deepGroundDepth, 3) + " m)"); + ShowWarningError(state, + format("Foundation:Kiva=\"{}\", the autocalculated deep ground depth ({:.3T} m) is shallower than " + "foundation construction elements ({:.3T} m)", + foundationInputs[surface.OSCPtr].name, + initDeepGroundDepth, + fnd.deepGroundDepth - 1.0)); + ShowContinueError( + state, format("The deep ground depth will be set one meter below the lowest element ({:.3T} m)", fnd.deepGroundDepth)); } // polygon @@ -1144,8 +1148,8 @@ namespace HeatBalanceKivaManager { } } - gp.createFrame(std::to_string(DataEnvironment::Month) + "/" + std::to_string(DataEnvironment::DayOfMonth) + " " + - std::to_string(state.dataGlobal->HourOfDay) + ":00"); + gp.createFrame(fmt::to_string(DataEnvironment::Month) + "/" + fmt::to_string(DataEnvironment::DayOfMonth) + " " + + fmt::to_string(state.dataGlobal->HourOfDay) + ":00"); #ifndef NDEBUG diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 935308adb38..56ffcf666c9 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -74,7 +74,6 @@ #include #include #include -#include #include #include #include @@ -91,7 +90,6 @@ #include #include #include -#include #include #include #include @@ -109,7 +107,6 @@ #include #include #include -#include namespace EnergyPlus { @@ -500,7 +497,7 @@ namespace HeatBalanceManager { // Counts or details unused constructions. // Using/Aliasing - using General::RoundSigDigits; + using namespace DataIPShortCuts; // SUBROUTINE PARAMETER DEFINITIONS: @@ -551,10 +548,10 @@ namespace HeatBalanceManager { TotConstructs - std::count_if(state.dataConstruction->Construct.begin(), state.dataConstruction->Construct.end(), [](Construction::ConstructionProps const &e) { return e.IsUsed; }); if (Unused > 0) { if (!state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, "CheckUsedConstructions: There are " + RoundSigDigits(Unused) + " nominally unused constructions in input."); + ShowWarningError(state, format("CheckUsedConstructions: There are {} nominally unused constructions in input.", Unused)); ShowContinueError(state, "For explicit details on each unused construction, use Output:Diagnostics,DisplayExtraWarnings;"); } else { - ShowWarningError(state, "CheckUsedConstructions: There are " + RoundSigDigits(Unused) + " nominally unused constructions in input."); + ShowWarningError(state, format("CheckUsedConstructions: There are {} nominally unused constructions in input.", Unused)); ShowContinueError(state, "Each Unused construction is shown."); for (Loop = 1; Loop <= TotConstructs; ++Loop) { if (state.dataConstruction->Construct(Loop).IsUsed) continue; @@ -688,7 +685,6 @@ namespace HeatBalanceManager { // Using/Aliasing using DataHVACGlobals::HVACSystemRootFinding; using DataSystemVariables::lMinimalShadowing; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -779,15 +775,15 @@ namespace HeatBalanceManager { // Loads Convergence Tolerance Value LoadsConvergTol = BuildingNumbers(2); if (LoadsConvergTol <= 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + cNumericFieldNames(2) + " value invalid, [" + - RoundSigDigits(LoadsConvergTol, 3) + ']'); + ShowSevereError(state, + format("{}{}: {} value invalid, [{:.3R}]", RoutineName, CurrentModuleObject, cNumericFieldNames(2), LoadsConvergTol)); ErrorsFound = true; } // Temperature Convergence Tolerance Value TempConvergTol = BuildingNumbers(3); if (TempConvergTol <= 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + cNumericFieldNames(2) + " value invalid, [" + - RoundSigDigits(TempConvergTol, 3) + ']'); + ShowSevereError(state, + format("{}{}: {} value invalid, [{:.3R}]", RoutineName, CurrentModuleObject, cNumericFieldNames(2), TempConvergTol)); ErrorsFound = true; } // Solar Distribution @@ -820,8 +816,13 @@ namespace HeatBalanceManager { if (!lNumericFieldBlanks(4)) { MaxNumberOfWarmupDays = BuildingNumbers(4); if (MaxNumberOfWarmupDays <= 0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + ": " + cNumericFieldNames(4) + " invalid, [" + - RoundSigDigits(MaxNumberOfWarmupDays) + "], " + RoundSigDigits(DefaultMaxNumberOfWarmupDays) + " will be used"); + ShowSevereError(state, + format("{}{}: {} invalid, [{}], {} will be used", + RoutineName, + CurrentModuleObject, + cNumericFieldNames(4), + MaxNumberOfWarmupDays, + DefaultMaxNumberOfWarmupDays)); MaxNumberOfWarmupDays = DefaultMaxNumberOfWarmupDays; } } else { @@ -831,17 +832,28 @@ namespace HeatBalanceManager { if (!lNumericFieldBlanks(5)) { MinNumberOfWarmupDays = BuildingNumbers(5); if (MinNumberOfWarmupDays <= 0) { - ShowWarningError(state, RoutineName + CurrentModuleObject + ": " + cNumericFieldNames(5) + " invalid, [" + - RoundSigDigits(MinNumberOfWarmupDays) + "], " + RoundSigDigits(DefaultMinNumberOfWarmupDays) + " will be used"); + ShowWarningError(state, + format("{}{}: {} invalid, [{}], {} will be used", + RoutineName, + CurrentModuleObject, + cNumericFieldNames(5), + MinNumberOfWarmupDays, + DefaultMinNumberOfWarmupDays)); MinNumberOfWarmupDays = DefaultMinNumberOfWarmupDays; } } else { MinNumberOfWarmupDays = DefaultMinNumberOfWarmupDays; } if (MinNumberOfWarmupDays > MaxNumberOfWarmupDays) { - ShowWarningError(state, RoutineName + CurrentModuleObject + ": " + cNumericFieldNames(5) + " [" + RoundSigDigits(MinNumberOfWarmupDays) + - "] is greater than " + cNumericFieldNames(4) + " [" + RoundSigDigits(MaxNumberOfWarmupDays) + "], " + - RoundSigDigits(MinNumberOfWarmupDays) + " will be used."); + ShowWarningError(state, + format("{}{}: {} [{}] is greater than {} [{}], {} will be used.", + RoutineName, + CurrentModuleObject, + cNumericFieldNames(5), + MinNumberOfWarmupDays, + cNumericFieldNames(4), + MaxNumberOfWarmupDays, + MinNumberOfWarmupDays)); MaxNumberOfWarmupDays = MinNumberOfWarmupDays; } @@ -1011,9 +1023,12 @@ namespace HeatBalanceManager { DataHeatBalance::AnyCondFD = true; DataHeatBalance::AllCTF = false; if (state.dataGlobal->NumOfTimeStepInHour < 20) { - ShowSevereError(state, "GetSolutionAlgorithm: " + CurrentModuleObject + ' ' + cAlphaFieldNames(1) + - " is Conduction Finite Difference but Number of TimeSteps in Hour < 20, Value is " + - RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + '.'); + ShowSevereError( + state, + format("GetSolutionAlgorithm: {} {} is Conduction Finite Difference but Number of TimeSteps in Hour < 20, Value is {}.", + CurrentModuleObject, + cAlphaFieldNames(1), + state.dataGlobal->NumOfTimeStepInHour)); ShowContinueError(state, "...Suggested minimum number of time steps in hour for Conduction Finite Difference solutions is 20. " "Errors or inaccurate calculations may occur."); } @@ -1023,9 +1038,12 @@ namespace HeatBalanceManager { DataHeatBalance::AnyHAMT = true; DataHeatBalance::AllCTF = false; if (state.dataGlobal->NumOfTimeStepInHour < 20) { - ShowSevereError(state, "GetSolutionAlgorithm: " + CurrentModuleObject + ' ' + cAlphaFieldNames(1) + - " is Combined Heat and Moisture Finite Element but Number of TimeSteps in Hour < 20, Value is " + - RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + '.'); + ShowSevereError(state, + format("GetSolutionAlgorithm: {} {} is Combined Heat and Moisture Finite Element but Number of TimeSteps in " + "Hour < 20, Value is {}.", + CurrentModuleObject, + cAlphaFieldNames(1), + state.dataGlobal->NumOfTimeStepInHour)); ShowContinueError(state, "...Suggested minimum number of time steps in hour for Combined Heat and Moisture Finite Element solutions " "is 20. Errors or inaccurate calculations may occur."); ShowContinueError(state, "...If the simulation crashes, look at material properties (esp porosity), use timestep=60, or less layers " @@ -1414,7 +1432,6 @@ namespace HeatBalanceManager { // Reads the input data for the SITE ATMOSPHERIC VARIATION object. // Using/Aliasing - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumObjects; @@ -1499,9 +1516,8 @@ namespace HeatBalanceManager { using CurveManager::GetCurveIndex; using CurveManager::GetCurveMinMaxValues; - using General::RoundSigDigits; + using General::ScanForReports; - using General::TrimSigDigits; // if this has a size, then input has already been gotten if (UniqueMaterialNames.size()) { @@ -1750,7 +1766,7 @@ namespace HeatBalanceManager { for (Loop = 1; Loop <= TotFfactorConstructs + TotCfactorConstructs; ++Loop) { ++MaterNum; dataMaterial.Material(MaterNum).Group = RegularMaterial; - dataMaterial.Material(MaterNum).Name = "~FC_Insulation_" + RoundSigDigits(Loop); + dataMaterial.Material(MaterNum).Name = format("~FC_Insulation_{}", Loop); dataMaterial.Material(MaterNum).ROnly = true; dataMaterial.Material(MaterNum).Roughness = MediumRough; dataMaterial.Material(MaterNum).AbsorpSolar = 0.0; @@ -2104,29 +2120,35 @@ namespace HeatBalanceManager { GetCurveMinMaxValues(state, dataMaterial.Material(MaterNum).GlassSpecAngTransDataPtr, minAngValue, maxAngValue, minLamValue, maxLamValue); if (minAngValue > 1.0e-6) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid minimum value of angle = " + RoundSigDigits(minAngValue, 2) + "."); + ShowSevereError( + state, + format("{}=\"{}\", Invalid minimum value of angle = {:.2R}.", CurrentModuleObject, MaterialNames(1), minAngValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the minumum value = 0.0 in the entered table name=" + MaterialNames(5)); } if (std::abs(maxAngValue - 90.0) > 1.0e-6) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid maximum value of angle = " + RoundSigDigits(maxAngValue, 2) + "."); + ShowSevereError( + state, + format("{}=\"{}\", Invalid maximum value of angle = {:.2R}.", CurrentModuleObject, MaterialNames(1), maxAngValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the maximum value = 90.0 in the entered table name=" + MaterialNames(5)); } if (minLamValue < 0.1) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid minimum value of wavelength = " + RoundSigDigits(minLamValue, 2) + "."); + ShowSevereError( + state, + format( + "{}=\"{}\", Invalid minimum value of wavelength = {:.2R}.", CurrentModuleObject, MaterialNames(1), minLamValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the minumum value = 0.1 micron in the entered table name=" + MaterialNames(5)); } if (maxLamValue > 4.0) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid maximum value of wavelength = " + RoundSigDigits(maxLamValue, 2) + "."); + ShowSevereError( + state, + format( + "{}=\"{}\", Invalid maximum value of wavelength = {:.2R}.", CurrentModuleObject, MaterialNames(1), maxLamValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the maximum value = 4.0 microns in the entered table name=" + MaterialNames(5)); } @@ -2153,29 +2175,35 @@ namespace HeatBalanceManager { GetCurveMinMaxValues(state, dataMaterial.Material(MaterNum).GlassSpecAngFRefleDataPtr, minAngValue, maxAngValue, minLamValue, maxLamValue); if (minAngValue > 1.0e-6) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid minimum value of angle = " + RoundSigDigits(minAngValue, 2) + "."); + ShowSevereError( + state, + format("{}=\"{}\", Invalid minimum value of angle = {:.2R}.", CurrentModuleObject, MaterialNames(1), minAngValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the minumum value = 0.0 in the entered table name=" + MaterialNames(5)); } if (std::abs(maxAngValue - 90.0) > 1.0e-6) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid maximum value of angle = " + RoundSigDigits(maxAngValue, 2) + "."); + ShowSevereError( + state, + format("{}=\"{}\", Invalid maximum value of angle = {:.2R}.", CurrentModuleObject, MaterialNames(1), maxAngValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the maximum value = 90.0 in the entered table name=" + MaterialNames(5)); } if (minLamValue < 0.1) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid minimum value of wavelength = " + RoundSigDigits(minLamValue, 2) + "."); + ShowSevereError( + state, + format( + "{}=\"{}\", Invalid minimum value of wavelength = {:.2R}.", CurrentModuleObject, MaterialNames(1), minLamValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the minumum value = 0.1 micron in the entered table name=" + MaterialNames(5)); } if (maxLamValue > 4.0) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid maximum value of wavelength = " + RoundSigDigits(maxLamValue, 2) + "."); + ShowSevereError( + state, + format( + "{}=\"{}\", Invalid maximum value of wavelength = {:.2R}.", CurrentModuleObject, MaterialNames(1), maxLamValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the maximum value = 4.0 microns in the entered table name=" + MaterialNames(5)); } @@ -2202,29 +2230,35 @@ namespace HeatBalanceManager { GetCurveMinMaxValues(state, dataMaterial.Material(MaterNum).GlassSpecAngBRefleDataPtr, minAngValue, maxAngValue, minLamValue, maxLamValue); if (minAngValue > 1.0e-6) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid minimum value of angle = " + RoundSigDigits(minAngValue, 2) + "."); + ShowSevereError( + state, + format("{}=\"{}\", Invalid minimum value of angle = {:.2R}.", CurrentModuleObject, MaterialNames(1), minAngValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the minumum value = 0.0 in the entered table name=" + MaterialNames(5)); } if (std::abs(maxAngValue - 90.0) > 1.0e-6) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid maximum value of angle = " + RoundSigDigits(maxAngValue, 2) + "."); + ShowSevereError( + state, + format("{}=\"{}\", Invalid maximum value of angle = {:.2R}.", CurrentModuleObject, MaterialNames(1), maxAngValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the maximum value = 90.0 in the entered table name=" + MaterialNames(5)); } if (minLamValue < 0.1) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid minimum value of wavelength = " + RoundSigDigits(minLamValue, 2) + "."); + ShowSevereError( + state, + format( + "{}=\"{}\", Invalid minimum value of wavelength = {:.2R}.", CurrentModuleObject, MaterialNames(1), minLamValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the minumum value = 0.1 micron in the entered table name=" + MaterialNames(5)); } if (maxLamValue > 4.0) { ErrorsFound = true; - ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + - "\", Invalid maximum value of wavelength = " + RoundSigDigits(maxLamValue, 2) + "."); + ShowSevereError( + state, + format( + "{}=\"{}\", Invalid maximum value of wavelength = {:.2R}.", CurrentModuleObject, MaterialNames(1), maxLamValue)); ShowContinueError(state, cAlphaFieldNames(5) + " requires the maximum value = 4.0 microns in the entered table name=" + MaterialNames(5)); } @@ -2508,8 +2542,8 @@ namespace HeatBalanceManager { NominalR(MaterNum) = dataMaterial.Material(MaterNum).Thickness / DenomRGas; } else { ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Illegal value."); - ShowContinueError(state, "Nominal resistance of gap at room temperature calculated at a negative Conductivity=[" + - RoundSigDigits(DenomRGas, 3) + "]."); + ShowContinueError( + state, format("Nominal resistance of gap at room temperature calculated at a negative Conductivity=[{:.3R}].", DenomRGas)); ErrorsFound = true; } } @@ -2629,8 +2663,8 @@ namespace HeatBalanceManager { NominalR(MaterNum) = dataMaterial.Material(MaterNum).Thickness / DenomRGas; } else { ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Illegal value."); - ShowContinueError(state, "Nominal resistance of gap at room temperature calculated at a negative Conductivity=[" + - RoundSigDigits(DenomRGas, 3) + "]."); + ShowContinueError( + state, format("Nominal resistance of gap at room temperature calculated at a negative Conductivity=[{:.3R}].", DenomRGas)); ErrorsFound = true; } } @@ -3215,8 +3249,9 @@ namespace HeatBalanceManager { ShowContinueError(state, " ...and wire spacing using the formula = wire spacing * (1.0 - SQRT(Opennes))"); dataMaterial.Material(MaterNum).ScreenWireDiameter = dataMaterial.Material(MaterNum).ScreenWireSpacing * (1.0 - std::sqrt(dataMaterial.Material(MaterNum).TausFrontBeamBeam)); - ShowContinueError(state, " ...Recalculated " + cNumericFieldNames(10) + '=' + - RoundSigDigits(dataMaterial.Material(MaterNum).ScreenWireDiameter, 4) + " m"); + ShowContinueError( + state, + format(" ...Recalculated {}={:.4R} m", cNumericFieldNames(10), dataMaterial.Material(MaterNum).ScreenWireDiameter)); } } } @@ -3322,8 +3357,12 @@ namespace HeatBalanceManager { if (Blind(Loop).SlatWidth < Blind(Loop).SlatSeparation) { ShowWarningError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Slat Angles/Widths"); - ShowContinueError(state, cNumericFieldNames(1) + " [" + RoundSigDigits(Blind(Loop).SlatWidth, 2) + "] is less than " + - cNumericFieldNames(2) + " [" + RoundSigDigits(Blind(Loop).SlatSeparation, 2) + "]."); + ShowContinueError(state, + format("{} [{:.2R}] is less than {} [{:.2R}].", + cNumericFieldNames(1), + Blind(Loop).SlatWidth, + cNumericFieldNames(2), + Blind(Loop).SlatSeparation)); ShowContinueError(state, "This will allow direct beam to be transmitted when Slat angle = 0."); } @@ -3451,15 +3490,19 @@ namespace HeatBalanceManager { if (Blind(Loop).SlatAngle < MinSlatAngGeom) { ErrorsFound = true; ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Illegal value combination."); - ShowContinueError(state, cNumericFieldNames(4) + "=[" + RoundSigDigits(Blind(Loop).SlatAngle, 1) + - "], is less than smallest allowed by slat dimensions and spacing, [" + RoundSigDigits(MinSlatAngGeom, 1) + - "] deg."); + ShowContinueError(state, + format("{}=[{:.1R}], is less than smallest allowed by slat dimensions and spacing, [{:.1R}] deg.", + cNumericFieldNames(4), + Blind(Loop).SlatAngle, + MinSlatAngGeom)); } else if (Blind(Loop).SlatAngle > MaxSlatAngGeom) { ErrorsFound = true; ShowSevereError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Illegal value combination."); - ShowContinueError(state, cNumericFieldNames(4) + "=[" + RoundSigDigits(Blind(Loop).SlatAngle, 1) + - "], is greater than largest allowed by slat dimensions and spacing, [" + RoundSigDigits(MinSlatAngGeom, 1) + - "] deg."); + ShowContinueError(state, + format("{}=[{:.1R}], is greater than largest allowed by slat dimensions and spacing, [{:.1R}] deg.", + cNumericFieldNames(4), + Blind(Loop).SlatAngle, + MinSlatAngGeom)); } } @@ -3598,35 +3641,45 @@ namespace HeatBalanceManager { } if (dataMaterial.Material(MaterNum).SlatWidth < dataMaterial.Material(MaterNum).SlatSeparation) { ShowWarningError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Slat Seperation/Width"); - ShowContinueError(state, cNumericFieldNames(1) + " [" + RoundSigDigits(dataMaterial.Material(MaterNum).SlatWidth, 2) + "] is less than " + - cNumericFieldNames(2) + " [" + RoundSigDigits(dataMaterial.Material(MaterNum).SlatSeparation, 2) + "]."); + ShowContinueError(state, + format("{} [{:.2R}] is less than {} [{:.2R}].", + cNumericFieldNames(1), + dataMaterial.Material(MaterNum).SlatWidth, + cNumericFieldNames(2), + dataMaterial.Material(MaterNum).SlatSeparation)); ShowContinueError(state, "This will allow direct beam to be transmitted when Slat angle = 0."); } if (dataMaterial.Material(MaterNum).SlatSeparation < 0.001) { ShowWarningError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Slat Seperation"); - ShowContinueError(state, cNumericFieldNames(2) + " [" + RoundSigDigits(dataMaterial.Material(MaterNum).SlatSeparation, 2) + - "]. Slate spacing must be > 0.0"); + ShowContinueError( + state, format("{} [{:.2R}]. Slate spacing must be > 0.0", cNumericFieldNames(2), dataMaterial.Material(MaterNum).SlatSeparation)); ShowContinueError(state, "...Setting slate spacing to default value of 0.025 m and simulation continues."); dataMaterial.Material(MaterNum).SlatSeparation = 0.025; } if (dataMaterial.Material(MaterNum).SlatWidth < 0.001 || dataMaterial.Material(MaterNum).SlatWidth >= 2.0 * dataMaterial.Material(MaterNum).SlatSeparation) { ShowWarningError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Slat Width"); - ShowContinueError(state, cNumericFieldNames(1) + " [" + RoundSigDigits(dataMaterial.Material(MaterNum).SlatWidth, 2) + - "]. Slat width range is 0 < Width <= 2*Spacing"); + ShowContinueError(state, + format("{} [{:.2R}]. Slat width range is 0 < Width <= 2*Spacing", + cNumericFieldNames(1), + dataMaterial.Material(MaterNum).SlatWidth)); ShowContinueError(state, "...Setting slate width equal to slate spacing and simulation continues."); dataMaterial.Material(MaterNum).SlatWidth = dataMaterial.Material(MaterNum).SlatSeparation; } if (dataMaterial.Material(MaterNum).SlatCrown < 0.0 || dataMaterial.Material(MaterNum).SlatCrown >= 0.5 * dataMaterial.Material(MaterNum).SlatWidth) { ShowWarningError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Slat Crown"); - ShowContinueError(state, cNumericFieldNames(3) + " [" + RoundSigDigits(dataMaterial.Material(MaterNum).SlatCrown, 2) + - "]. Slat crwon range is 0 <= crown < 0.5*Width"); + ShowContinueError(state, + format("{} [{:.2R}]. Slat crwon range is 0 <= crown < 0.5*Width", + cNumericFieldNames(3), + dataMaterial.Material(MaterNum).SlatCrown)); ShowContinueError(state, "...Setting slate crown to 0.0 and simulation continues."); dataMaterial.Material(MaterNum).SlatCrown = 0.0; } if (dataMaterial.Material(MaterNum).SlatAngle < -90.0 || dataMaterial.Material(MaterNum).SlatAngle > 90.0) { ShowWarningError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Slat Angle"); - ShowContinueError(state, cNumericFieldNames(4) + " [" + RoundSigDigits(dataMaterial.Material(MaterNum).SlatAngle, 2) + - "]. Slat angle range is -90.0 <= Angle < 90.0"); + ShowContinueError(state, + format("{} [{:.2R}]. Slat angle range is -90.0 <= Angle < 90.0", + cNumericFieldNames(4), + dataMaterial.Material(MaterNum).SlatAngle)); ShowContinueError(state, "...Setting slate angle to 0.0 and simulation continues."); dataMaterial.Material(MaterNum).SlatAngle = 0.0; } @@ -3735,10 +3788,12 @@ namespace HeatBalanceManager { if (dataMaterial.Material(MaterNum).InitMoisture > dataMaterial.Material(MaterNum).Porosity) { ShowWarningError(state, CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Illegal value combination."); ShowContinueError(state, cNumericFieldNames(15) + " is greater than " + cNumericFieldNames(13) + ". It must be less or equal."); - ShowContinueError(state, cNumericFieldNames(13) + " = " + TrimSigDigits(dataMaterial.Material(MaterNum).Porosity, 3) + "."); - ShowContinueError(state, cNumericFieldNames(15) + " = " + TrimSigDigits(dataMaterial.Material(MaterNum).InitMoisture, 3) + "."); - ShowContinueError(state, cNumericFieldNames(15) + - " is reset to the maximum (saturation) value = " + TrimSigDigits(dataMaterial.Material(MaterNum).Porosity, 3) + "."); + ShowContinueError(state, format("{} = {:.3T}.", cNumericFieldNames(13), dataMaterial.Material(MaterNum).Porosity)); + ShowContinueError(state, format("{} = {:.3T}.", cNumericFieldNames(15), dataMaterial.Material(MaterNum).InitMoisture)); + ShowContinueError(state, + format("{} is reset to the maximum (saturation) value = {:.3T}.", + cNumericFieldNames(15), + dataMaterial.Material(MaterNum).Porosity)); ShowContinueError(state, "Simulation continues."); dataMaterial.Material(MaterNum).InitMoisture = dataMaterial.Material(MaterNum).Porosity; } @@ -3949,7 +4004,6 @@ namespace HeatBalanceManager { // na // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4009,17 +4063,19 @@ namespace HeatBalanceManager { TotLam = SpecDataNumProp / 4; if (mod(SpecDataNumProp, 4) != 0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + SpecDataNames(1) + "\" invalid set."); - ShowContinueError(state, "... set not even multiple of 4 items (Wavelength,Trans,ReflFront,ReflBack), number of items in dataset = " + - TrimSigDigits(SpecDataNumProp)); - ShowContinueError(state, "... remainder after div by 4 = " + TrimSigDigits(mod(SpecDataNumProp, 4)) + - ", remainder items will be set to 0.0"); + ShowContinueError( + state, + format("... set not even multiple of 4 items (Wavelength,Trans,ReflFront,ReflBack), number of items in dataset = {}", + SpecDataNumProp)); + ShowContinueError(state, format("... remainder after div by 4 = {}, remainder items will be set to 0.0", mod(SpecDataNumProp, 4))); SpecDataProps({SpecDataNumProp + 1, min(SpecDataNumProp + 4, Construction::MaxSpectralDataElements * 4)}) = 0.0; } if (TotLam > Construction::MaxSpectralDataElements) { ErrorsFound = true; ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + SpecDataNames(1) + "\" invalid set."); - ShowContinueError(state, "... More than max [" + TrimSigDigits(Construction::MaxSpectralDataElements) + - "] (Wavelength,Trans,ReflFront,ReflBack) entries in set."); + ShowContinueError( + state, + format("... More than max [{}] (Wavelength,Trans,ReflFront,ReflBack) entries in set.", Construction::MaxSpectralDataElements)); continue; } SpectralData(Loop).NumOfWavelengths = TotLam; @@ -4049,17 +4105,19 @@ namespace HeatBalanceManager { if (SpectralData(Loop).WaveLength(LamNum + 1) <= Lam) { ErrorsFound = true; ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + SpecDataNames(1) + "\" invalid set."); - ShowContinueError(state, "... Wavelengths not in increasing order. at wavelength#=" + TrimSigDigits(LamNum) + ", value=[" + - TrimSigDigits(Lam, 4) + "], next is [" + TrimSigDigits(SpectralData(Loop).WaveLength(LamNum + 1), 4) + - "]."); + ShowContinueError(state, + format("... Wavelengths not in increasing order. at wavelength#={}, value=[{:.4T}], next is [{:.4T}].", + LamNum, + Lam, + SpectralData(Loop).WaveLength(LamNum + 1))); } } if (Lam < 0.1 || Lam > 4.0) { ErrorsFound = true; ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + SpecDataNames(1) + "\" invalid value."); - ShowContinueError(state, "... A wavelength is not in the range 0.1 to 4.0 microns; at wavelength#=" + TrimSigDigits(LamNum) + - ", value=[" + TrimSigDigits(Lam, 4) + "]."); + ShowContinueError( + state, format("... A wavelength is not in the range 0.1 to 4.0 microns; at wavelength#={}, value=[{:.4T}].", LamNum, Lam)); } // TH 2/15/2011. CR 8343 @@ -4068,25 +4126,22 @@ namespace HeatBalanceManager { if (Tau > 1.01) { ErrorsFound = true; ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + SpecDataNames(1) + "\" invalid value."); - ShowContinueError(state, "... A transmittance is > 1.0; at wavelength#=" + TrimSigDigits(LamNum) + ", value=[" + TrimSigDigits(Tau, 4) + - "]."); + ShowContinueError(state, format("... A transmittance is > 1.0; at wavelength#={}, value=[{:.4T}].", LamNum, Tau)); } if (RhoF < 0.0 || RhoF > 1.02 || RhoB < 0.0 || RhoB > 1.02) { ErrorsFound = true; ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + SpecDataNames(1) + "\" invalid value."); - ShowContinueError(state, "... A reflectance is < 0.0 or > 1.0; at wavelength#=" + TrimSigDigits(LamNum) + ", RhoF value=[" + - TrimSigDigits(RhoF, 4) + "]."); - ShowContinueError(state, "... A reflectance is < 0.0 or > 1.0; at wavelength#=" + TrimSigDigits(LamNum) + ", RhoB value=[" + - TrimSigDigits(RhoB, 4) + "]."); + ShowContinueError(state, format("... A reflectance is < 0.0 or > 1.0; at wavelength#={}, RhoF value=[{:.4T}].", LamNum, RhoF)); + ShowContinueError(state, format("... A reflectance is < 0.0 or > 1.0; at wavelength#={}, RhoB value=[{:.4T}].", LamNum, RhoB)); } if ((Tau + RhoF) > 1.03 || (Tau + RhoB) > 1.03) { ErrorsFound = true; ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + SpecDataNames(1) + "\" invalid value."); - ShowContinueError(state, "... Transmittance + reflectance) > 1.0 for an entry; at wavelength#=" + TrimSigDigits(LamNum) + - ", value(Tau+RhoF)=[" + TrimSigDigits((Tau + RhoF), 4) + "], value(Tau+RhoB)=[" + - TrimSigDigits((Tau + RhoB), 4) + "]."); + ShowContinueError(state, + "... Transmittance + reflectance) > 1.0 for an entry; at wavelength#=" + + format("{}, value(Tau+RhoF)=[{:.4T}], value(Tau+RhoB)=[{:.4T}].", LamNum, (Tau + RhoF), (Tau + RhoB))); } } } @@ -5561,7 +5616,6 @@ namespace HeatBalanceManager { // Using/Aliasing using DataSystemVariables::ReportDetailedWarmupConvergence; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ZoneNum; @@ -5643,7 +5697,6 @@ namespace HeatBalanceManager { // na // Using/Aliasing - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -5723,8 +5776,10 @@ namespace HeatBalanceManager { if (state.dataGlobal->DayOfSim >= MaxNumberOfWarmupDays && state.dataGlobal->WarmupFlag) { // Check convergence for individual zone if (sum(WarmupConvergenceValues(ZoneNum).PassFlag) != 8) { // pass=2 * 4 values for convergence - ShowSevereError(state, "CheckWarmupConvergence: Loads Initialization, Zone=\"" + Zone(ZoneNum).Name + "\" did not converge after " + - RoundSigDigits(MaxNumberOfWarmupDays) + " warmup days."); + ShowSevereError(state, + format("CheckWarmupConvergence: Loads Initialization, Zone=\"{}\" did not converge after {} warmup days.", + Zone(ZoneNum).Name, + MaxNumberOfWarmupDays)); if (!WarmupConvergenceWarning && !state.dataGlobal->DoingSizing) { ShowContinueError(state, "See Warmup Convergence Information in .eio file for details."); WarmupConvergenceWarning = true; @@ -5738,18 +5793,26 @@ namespace HeatBalanceManager { ShowContinueError(state, "...Environment(SizingPeriod)=\"" + EnvironmentName + "\""); } - ShowContinueError(state, "..Max Temp Comparison = " + RoundSigDigits(WarmupConvergenceValues(ZoneNum).TestMaxTempValue, 2) + - " vs Temperature Convergence Tolerance=" + RoundSigDigits(TempConvergTol, 2) + " - " + - PassFail(WarmupConvergenceValues(ZoneNum).PassFlag(1)) + " Convergence"); - ShowContinueError(state, "..Min Temp Comparison = " + RoundSigDigits(WarmupConvergenceValues(ZoneNum).TestMinTempValue, 2) + - " vs Temperature Convergence Tolerance=" + RoundSigDigits(TempConvergTol, 2) + " - " + - PassFail(WarmupConvergenceValues(ZoneNum).PassFlag(2)) + " Convergence"); - ShowContinueError(state, "..Max Heat Load Comparison = " + RoundSigDigits(WarmupConvergenceValues(ZoneNum).TestMaxHeatLoadValue, 4) + - " vs Loads Convergence Tolerance=" + RoundSigDigits(LoadsConvergTol, 2) + " - " + - PassFail(WarmupConvergenceValues(ZoneNum).PassFlag(3)) + " Convergence"); - ShowContinueError(state, "..Max Cool Load Comparison = " + RoundSigDigits(WarmupConvergenceValues(ZoneNum).TestMaxCoolLoadValue, 4) + - " vs Loads Convergence Tolerance=" + RoundSigDigits(LoadsConvergTol, 2) + " - " + - PassFail(WarmupConvergenceValues(ZoneNum).PassFlag(4)) + " Convergence"); + ShowContinueError(state, + format("..Max Temp Comparison = {:.2R} vs Temperature Convergence Tolerance={:.2R} - {} Convergence", + WarmupConvergenceValues(ZoneNum).TestMaxTempValue, + TempConvergTol, + PassFail(WarmupConvergenceValues(ZoneNum).PassFlag(1)))); + ShowContinueError(state, + format("..Min Temp Comparison = {:.2R} vs Temperature Convergence Tolerance={:.2R} - {} Convergence", + WarmupConvergenceValues(ZoneNum).TestMinTempValue, + TempConvergTol, + PassFail(WarmupConvergenceValues(ZoneNum).PassFlag(2)))); + ShowContinueError(state, + format("..Max Heat Load Comparison = {:.4R} vs Loads Convergence Tolerance={:.2R} - {} Convergence", + WarmupConvergenceValues(ZoneNum).TestMaxHeatLoadValue, + LoadsConvergTol, + PassFail(WarmupConvergenceValues(ZoneNum).PassFlag(3)))); + ShowContinueError(state, + format("..Max Cool Load Comparison = {:.4R} vs Loads Convergence Tolerance={:.2R} - {} Convergence", + WarmupConvergenceValues(ZoneNum).TestMaxCoolLoadValue, + LoadsConvergTol, + PassFail(WarmupConvergenceValues(ZoneNum).PassFlag(4)))); } } @@ -5773,10 +5836,9 @@ namespace HeatBalanceManager { if ((state.dataGlobal->DayOfSim >= MaxNumberOfWarmupDays) && state.dataGlobal->WarmupFlag && ConvergenceChecksFailed) { if (MaxNumberOfWarmupDays < DefaultMaxNumberOfWarmupDays) { - ShowSevereError(state, "CheckWarmupConvergence: User supplied maximum warmup days=" + RoundSigDigits(MaxNumberOfWarmupDays) + - " is insufficient."); - ShowContinueError(state, "Suggest setting maximum number of warmup days to at least " + RoundSigDigits(DefaultMaxNumberOfWarmupDays) + - '.'); + ShowSevereError(state, + format("CheckWarmupConvergence: User supplied maximum warmup days={} is insufficient.", MaxNumberOfWarmupDays)); + ShowContinueError(state, format("Suggest setting maximum number of warmup days to at least {}.", DefaultMaxNumberOfWarmupDays)); } } @@ -5815,7 +5877,6 @@ namespace HeatBalanceManager { // na // Using/Aliasing - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -6204,7 +6265,6 @@ namespace HeatBalanceManager { using DataSystemVariables::CheckForActualFileName; using DataSystemVariables::iUnicode_end; using General::POLYF; // POLYF ! Polynomial in cosine of angle of incidence - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static Array1D_string const NumName(5, {"1", "2", "3", "4", "5"}); @@ -6357,8 +6417,11 @@ namespace HeatBalanceManager { ++FileLineCount; readItem(NextLine.data.substr(19), NGlSys); if (NGlSys <= 0 || NGlSys > 2) { - ShowFatalError(state, "Construction=" + DesiredConstructionName + " from the Window5 data file cannot be used: it has " + - TrimSigDigits(NGlSys) + " glazing systems; only 1 or 2 are allowed."); + ShowFatalError( + state, + format("Construction={} from the Window5 data file cannot be used: it has {} glazing systems; only 1 or 2 are allowed.", + DesiredConstructionName, + NGlSys)); } NextLine = W5DataFile.readLine(); if (NextLine.eof) goto Label1000; @@ -6377,38 +6440,50 @@ namespace HeatBalanceManager { SHGCCenter(IGlSys), TVisCenter(IGlSys)); if (!succeeded) { - ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of glazing system values. For glazing system=" + - TrimSigDigits(IGlSys)); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount) + ") in error (first 100 characters)=" + NextLine.data.substr(0, 100)); + ShowSevereError( + state, + format("HeatBalanceManager: SearchWindow5DataFile: Error in Read of glazing system values. For glazing system={}", IGlSys)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount, NextLine.data.substr(0, 100))); ErrorsFound = true; } if (WinHeight(IGlSys) == 0.0 || WinWidth(IGlSys) == 0.0) { - ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + - " from the Window5 data file cannot be used: it has window height or width = 0 for glazing system " + - TrimSigDigits(IGlSys)); + ShowSevereError(state, + format("HeatBalanceManager: SearchWindow5DataFile: Construction={} from the Window5 data file cannot be used: it " + "has window height or width = 0 for glazing system {}", + DesiredConstructionName, + IGlSys)); ErrorsFound = true; } if (NGlass(IGlSys) <= 0 || NGlass(IGlSys) > 4) { - ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + - " from the Window5 data file cannot be used: it has 0 or more than 4 glass layers in glazing system " + - TrimSigDigits(IGlSys)); + ShowSevereError(state, + format("HeatBalanceManager: SearchWindow5DataFile: Construction={} from the Window5 data file cannot be used: it " + "has 0 or more than 4 glass layers in glazing system {}", + DesiredConstructionName, + IGlSys)); ErrorsFound = true; } if (UValCenter(IGlSys) <= 0.0) { - ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + - " from the Window5 data file cannot be used: it has Center-of-Glass U-value <= 0 in glazing system " + - TrimSigDigits(IGlSys)); + ShowSevereError(state, + format("HeatBalanceManager: SearchWindow5DataFile: Construction={} from the Window5 data file cannot be used: it " + "has Center-of-Glass U-value <= 0 in glazing system {}", + DesiredConstructionName, + IGlSys)); ErrorsFound = true; } if (SCCenter(IGlSys) <= 0.0) { - ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + - " from the Window5 data file cannot be used: it has Shading Coefficient <= 0 in glazing system " + - TrimSigDigits(IGlSys)); + ShowSevereError(state, + format("HeatBalanceManager: SearchWindow5DataFile: Construction={} from the Window5 data file cannot be used: it " + "has Shading Coefficient <= 0 in glazing system {}", + DesiredConstructionName, + IGlSys)); ErrorsFound = true; } if (SHGCCenter(IGlSys) <= 0.0) { - ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + - " from the Window5 data file cannot be used: it has SHGC <= 0 in glazing system " + TrimSigDigits(IGlSys)); + ShowSevereError(state, + format("HeatBalanceManager: SearchWindow5DataFile: Construction={} from the Window5 data file cannot be used: it " + "has SHGC <= 0 in glazing system {}", + DesiredConstructionName, + IGlSys)); ErrorsFound = true; } WinHeight(IGlSys) *= 0.001; @@ -6426,15 +6501,15 @@ namespace HeatBalanceManager { if (NGlSys == 2) { if (!readItem(DataLine(10).substr(19), MullionWidth)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Mullion Width."); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 10) + - ") in error (first 100 characters)=" + DataLine(10).substr(0, 100)); + ShowContinueError(state, + format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 10, DataLine(10).substr(0, 100))); ErrorsFound = true; } MullionWidth *= 0.001; if (!readItem(DataLine(10).substr(88), MullionOrientation)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Mullion Orientation."); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 10) + - ") in error (first 100 characters)=" + DataLine(10).substr(0, 100)); + ShowContinueError(state, + format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 10, DataLine(10).substr(0, 100))); ErrorsFound = true; } } @@ -6460,7 +6535,7 @@ namespace HeatBalanceManager { FrameEmis); if (!succeeded) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of frame data values."); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 11) + ") in error (first 100 characters)=" + DataLine(11).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 11, DataLine(11).substr(0, 100))); ErrorsFound = true; } if (FrameWidth > 0.0) { @@ -6514,9 +6589,11 @@ namespace HeatBalanceManager { HorDividers(IGlSys), VertDividers(IGlSys)); if (!dividerReadSucceeded) { - ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of divider data values. For Glazing System=" + - TrimSigDigits(IGlSys)); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 11) + ") in error (first 100 characters)=" + NextLine.data.substr(0, 100)); + ShowSevereError( + state, + format("HeatBalanceManager: SearchWindow5DataFile: Error in Read of divider data values. For Glazing System={}", IGlSys)); + ShowContinueError(state, + format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 11, NextLine.data.substr(0, 100))); ErrorsFound = true; } uppercase(DividerType(IGlSys)); @@ -6524,39 +6601,40 @@ namespace HeatBalanceManager { if (HorDividers(IGlSys) == 0 && VertDividers(IGlSys) == 0) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + " from the Window5 data file cannot be used:"); - ShowContinueError(state, "glazing system " + TrimSigDigits(IGlSys) + - " has a divider but number of horizontal and vertical divider elements = 0"); + ShowContinueError( + state, format("glazing system {} has a divider but number of horizontal and vertical divider elements = 0", IGlSys)); ErrorsFound = true; } if (DividerConductance(IGlSys) <= 0.0) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + " from the Window5 data file cannot be used:"); - ShowContinueError(state, "glazing system " + TrimSigDigits(IGlSys) + " has Divider Conductance <= 0.0"); + ShowContinueError(state, format("glazing system {} has Divider Conductance <= 0.0", IGlSys)); ErrorsFound = true; } if (DivEdgeToCenterGlCondRatio(IGlSys) < 1.0) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + " from the Window5 data file cannot be used:"); - ShowContinueError(state, "glazing system " + TrimSigDigits(IGlSys) + " has Divider Edge-Of-Glass Conduction Ratio < 1.0"); + ShowContinueError(state, format("glazing system {} has Divider Edge-Of-Glass Conduction Ratio < 1.0", IGlSys)); ErrorsFound = true; } if (DividerSolAbsorp(IGlSys) < 0.0 || DividerSolAbsorp(IGlSys) > 1.0) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + " from the Window5 data file cannot be used:"); - ShowContinueError(state, "glazing system " + TrimSigDigits(IGlSys) + " has Divider Solar Absorptance < 0.0 or > 1.0"); + ShowContinueError(state, format("glazing system {} has Divider Solar Absorptance < 0.0 or > 1.0", IGlSys)); ErrorsFound = true; } if (DividerEmis(IGlSys) <= 0.0 || DividerEmis(IGlSys) >= 1.0) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + " from the Window5 data file cannot be used:"); - ShowContinueError(state, "glazing system " + TrimSigDigits(IGlSys) + " has Divider Emissivity <= 0.0 or >= 1.0"); + ShowContinueError(state, format("glazing system {} has Divider Emissivity <= 0.0 or >= 1.0", IGlSys)); ErrorsFound = true; } if (DividerType(IGlSys) != "DIVIDEDLITE" && DividerType(IGlSys) != "SUSPENDED") { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Construction=" + DesiredConstructionName + " from the Window5 data file cannot be used:"); - ShowContinueError(state, "glazing system " + TrimSigDigits(IGlSys) + " has Divider Type = " + DividerType(IGlSys) + - "; it should be DIVIDEDLITE or SUSPENDED."); + ShowContinueError( + state, + format("glazing system {} has Divider Type = {}; it should be DIVIDEDLITE or SUSPENDED.", IGlSys, DividerType(IGlSys))); ErrorsFound = true; } } @@ -6863,25 +6941,29 @@ namespace HeatBalanceManager { ++FileLineCount; if (!readItem(NextLine.data.substr(5), Tsol)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of TSol values."); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount) + ") in error (first 100 characters)=" + NextLine.data.substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount, NextLine.data.substr(0, 100))); ErrorsFound = true; } else if (any_lt(Tsol, 0.0) || any_gt(Tsol, 1.0)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of TSol values. (out of range [0,1])"); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount) + ") in error (first 100 characters)=" + NextLine.data.substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount, NextLine.data.substr(0, 100))); ErrorsFound = true; } for (IGlass = 1; IGlass <= NGlass(IGlSys); ++IGlass) { NextLine = W5DataFile.readLine(); ++FileLineCount; if (!readItem(NextLine.data.substr(5), AbsSol(_, IGlass))) { - ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of AbsSol values. For Glass=" + - TrimSigDigits(IGlass)); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount) + ") in error (first 100 characters)=" + NextLine.data.substr(0, 100)); + ShowSevereError(state, + format("HeatBalanceManager: SearchWindow5DataFile: Error in Read of AbsSol values. For Glass={}", IGlass)); + ShowContinueError(state, + format("Line (~{}) in error (first 100 characters)={}", FileLineCount, NextLine.data.substr(0, 100))); ErrorsFound = true; } else if (any_lt(AbsSol(_, IGlass), 0.0) || any_gt(AbsSol(_, IGlass), 1.0)) { - ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of AbsSol values. (out of range [0,1]) For Glass=" + - TrimSigDigits(IGlass)); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount) + ") in error (first 100 characters)=" + NextLine.data.substr(0, 100)); + ShowSevereError( + state, + format("HeatBalanceManager: SearchWindow5DataFile: Error in Read of AbsSol values. (out of range [0,1]) For Glass={}", + IGlass)); + ShowContinueError(state, + format("Line (~{}) in error (first 100 characters)={}", FileLineCount, NextLine.data.substr(0, 100))); ErrorsFound = true; } } @@ -6892,58 +6974,48 @@ namespace HeatBalanceManager { if (!readItem(DataLine(1).substr(5), Rfsol)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of RfSol values."); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 1) + - ") in error (first 100 characters)=" + DataLine(1).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 1, DataLine(1).substr(0, 100))); ErrorsFound = true; } else if (any_lt(Rfsol, 0.0) || any_gt(Rfsol, 1.0)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of RfSol values. (out of range [0,1])"); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 1) + - ") in error (first 100 characters)=" + DataLine(1).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 1, DataLine(1).substr(0, 100))); ErrorsFound = true; } if (!readItem(DataLine(2).substr(5), Rbsol)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of RbSol values."); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 2) + - ") in error (first 100 characters)=" + DataLine(2).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 2, DataLine(2).substr(0, 100))); ErrorsFound = true; } else if (any_lt(Rbsol, 0.0) || any_gt(Rbsol, 1.0)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of RbSol values. (out of range [0,1])"); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 2) + - ") in error (first 100 characters)=" + DataLine(2).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 2, DataLine(2).substr(0, 100))); ErrorsFound = true; } if (!readItem(DataLine(3).substr(5), Tvis)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Tvis values."); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 3) + - ") in error (first 100 characters)=" + DataLine(3).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 3, DataLine(3).substr(0, 100))); ErrorsFound = true; } else if (any_lt(Tvis, 0.0) || any_gt(Tvis, 1.0)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Tvis values. (out of range [0,1])"); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 3) + - ") in error (first 100 characters)=" + DataLine(3).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 3, DataLine(3).substr(0, 100))); ErrorsFound = true; } if (!readItem(DataLine(4).substr(5), Rfvis)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Rfvis values."); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 4) + - ") in error (first 100 characters)=" + DataLine(4).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 4, DataLine(4).substr(0, 100))); ErrorsFound = true; } else if (any_lt(Rfvis, 0.0) || any_gt(Rfvis, 1.0)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Rfvis values. (out of range [0,1])"); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 4) + - ") in error (first 100 characters)=" + DataLine(4).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 4, DataLine(4).substr(0, 100))); ErrorsFound = true; } if (!readItem(DataLine(5).substr(5), Rbvis)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Rbvis values."); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 5) + - ") in error (first 100 characters)=" + DataLine(5).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 5, DataLine(5).substr(0, 100))); ErrorsFound = true; } else if (any_lt(Rbvis, 0.0) || any_gt(Rbvis, 1.0)) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Rbvis values. (out of range [0,1])"); - ShowContinueError(state, "Line (~" + TrimSigDigits(FileLineCount + 5) + - ") in error (first 100 characters)=" + DataLine(5).substr(0, 100)); + ShowContinueError(state, format("Line (~{}) in error (first 100 characters)={}", FileLineCount + 5, DataLine(5).substr(0, 100))); ErrorsFound = true; } FileLineCount += 5; @@ -7157,7 +7229,6 @@ namespace HeatBalanceManager { // Using/Aliasing using namespace DataStringGlobals; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7255,19 +7326,19 @@ namespace HeatBalanceManager { if (Ffactor <= 0.0) { ShowSevereError(state, CurrentModuleObject + "=\"" + ConstructAlphas(1) + "\" has " + cNumericFieldNames(1) + " <= 0.0, must be > 0.0."); - ShowContinueError(state, "Entered value=[" + RoundSigDigits(Ffactor, 2) + ']'); + ShowContinueError(state, format("Entered value=[{:.2R}]", Ffactor)); ErrorsFound = true; } if (Area <= 0.0) { ShowSevereError(state, CurrentModuleObject + "=\"" + ConstructAlphas(1) + "\" has " + cNumericFieldNames(2) + " <= 0.0, must be > 0.0."); - ShowContinueError(state, "Entered value=[" + RoundSigDigits(Area, 2) + ']'); + ShowContinueError(state, format("Entered value=[{:.2R}]", Area)); ErrorsFound = true; } if (PerimeterExposed < 0.0) { ShowSevereError(state, CurrentModuleObject + "=\"" + ConstructAlphas(1) + "\" has " + cNumericFieldNames(3) + " <= 0.0, must be > 0.0."); - ShowContinueError(state, "Entered value=[" + RoundSigDigits(PerimeterExposed, 2) + ']'); + ShowContinueError(state, format("Entered value=[{:.2R}]", PerimeterExposed)); ErrorsFound = true; } @@ -7278,7 +7349,7 @@ namespace HeatBalanceManager { state.dataConstruction->Construct(ConstrNum).LayerPoint(2) = iFCConcreteLayer; // The fictitious insulation is the outside layer - MaterNum = UtilityRoutines::FindItemInList("~FC_Insulation_" + RoundSigDigits(Loop), dataMaterial.Material); + MaterNum = UtilityRoutines::FindItemInList(format("~FC_Insulation_{}", Loop), dataMaterial.Material); state.dataConstruction->Construct(ConstrNum).LayerPoint(1) = MaterNum; // Calculate the thermal resistance of the fictitious insulation layer @@ -7292,7 +7363,7 @@ namespace HeatBalanceManager { Rfic = Reff - Rcon; if (Rfic <= 0.0) { ShowSevereError(state, CurrentModuleObject + "=\"" + ConstructAlphas(1) + "\" has calculated R value <= 0.0, must be > 0.0."); - ShowContinueError(state, "Calculated value=[" + RoundSigDigits(Rfic, 2) + "] Check definition."); + ShowContinueError(state, format("Calculated value=[{:.2R}] Check definition.", Rfic)); ErrorsFound = true; } @@ -7340,13 +7411,13 @@ namespace HeatBalanceManager { if (Cfactor <= 0.0) { ShowSevereError(state, CurrentModuleObject + ' ' + ConstructAlphas(1) + " has " + cNumericFieldNames(1) + " <= 0.0, must be > 0.0."); - ShowContinueError(state, "Entered value=[" + RoundSigDigits(Cfactor, 2) + ']'); + ShowContinueError(state, format("Entered value=[{:.2R}]", Cfactor)); ErrorsFound = true; } if (Height <= 0.0) { ShowSevereError(state, CurrentModuleObject + ' ' + ConstructAlphas(1) + " has " + cNumericFieldNames(2) + " <= 0.0, must be > 0.0."); - ShowContinueError(state, "Entered value=[" + RoundSigDigits(Height, 2) + ']'); + ShowContinueError(state, format("Entered value=[{:.2R}]", Height)); ErrorsFound = true; } @@ -7357,7 +7428,7 @@ namespace HeatBalanceManager { state.dataConstruction->Construct(ConstrNum).LayerPoint(2) = iFCConcreteLayer; // The fictitious insulation is the outside layer - MaterNum = UtilityRoutines::FindItemInList("~FC_Insulation_" + RoundSigDigits(Loop + TotFfactorConstructs), dataMaterial.Material); + MaterNum = UtilityRoutines::FindItemInList("~FC_Insulation_" + fmt::to_string(Loop + TotFfactorConstructs), dataMaterial.Material); state.dataConstruction->Construct(ConstrNum).LayerPoint(1) = MaterNum; // CR 8886 Rsoil should be in SI unit. From ASHRAE 90.1-2010 SI @@ -7375,7 +7446,7 @@ namespace HeatBalanceManager { Rfic = Reff - Rcon; if (Rfic <= 0) { ShowSevereError(state, CurrentModuleObject + "=\"" + ConstructAlphas(1) + "\" has calculated R value <= 0.0, must be > 0.0."); - ShowContinueError(state, "Calculated value=[" + RoundSigDigits(Rfic, 2) + "] Check definition."); + ShowContinueError(state, format("Calculated value=[{:.2R}] Check definition.", Rfic)); ErrorsFound = true; } @@ -7514,7 +7585,7 @@ namespace HeatBalanceManager { using DataSurfaces::TotFenLayAbsSSG; using DataSurfaces::TotSurfaces; using DataSurfaces::TotSurfIncSolSSG; - using General::TrimSigDigits; + using ScheduleManager::GetScheduleIndex; // SUBROUTINE PARAMETER DEFINITIONS: @@ -7542,8 +7613,9 @@ namespace HeatBalanceManager { // Check if IDD definition is correct inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumArgs, NumAlpha, NumNumeric); if (NumAlpha != 4) { - ShowSevereError(state, RoutineName + cCurrentModuleObject + - ": Object Definition indicates not = 4 Alpha Objects, Number Indicated=" + TrimSigDigits(NumAlpha)); + ShowSevereError( + state, + format("{}{}: Object Definition indicates not = 4 Alpha Objects, Number Indicated={}", RoutineName, cCurrentModuleObject, NumAlpha)); ErrorsFound = true; } @@ -7677,8 +7749,12 @@ namespace HeatBalanceManager { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Number of scheduled surface gains for each layer does not match number of layers in referenced construction."); - ShowContinueError(state, cAlphaArgs(1) + " have " + TrimSigDigits(NumOfScheduledLayers) + " scheduled layers and " + cAlphaArgs(3) + - " have " + TrimSigDigits(state.dataConstruction->Construct(ConstrNum).TotSolidLayers) + " layers."); + ShowContinueError(state, + format("{} have {} schedule layers and {} have {} layers.", + cAlphaArgs(1), + NumOfScheduledLayers, + cAlphaArgs(3), + state.dataConstruction->Construct(ConstrNum).TotSolidLayers)); ErrorsFound = true; } @@ -7833,7 +7909,6 @@ namespace HeatBalanceManager { // Using/Aliasing using namespace DataStringGlobals; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7883,7 +7958,8 @@ namespace HeatBalanceManager { for (iTC = 1; iTC <= iMat; ++iTC) { ++NumNewConst; state.dataConstruction->Construct(NumNewConst) = state.dataConstruction->Construct(Loop); // copy data - state.dataConstruction->Construct(NumNewConst).Name = state.dataConstruction->Construct(Loop).Name + "_TC_" + RoundSigDigits(TCGlazings(iTCG).SpecTemp(iTC), 0); + state.dataConstruction->Construct(NumNewConst).Name = + format("{}_TC_{:.0R}", state.dataConstruction->Construct(Loop).Name, TCGlazings(iTCG).SpecTemp(iTC)); state.dataConstruction->Construct(NumNewConst).TCLayer = TCGlazings(iTCG).LayerPoint(iTC); state.dataConstruction->Construct(NumNewConst).LayerPoint(state.dataConstruction->Construct(Loop).TCLayerID) = state.dataConstruction->Construct(NumNewConst).TCLayer; state.dataConstruction->Construct(NumNewConst).TCFlag = 1; @@ -8109,7 +8185,6 @@ namespace HeatBalanceManager { // na // Using/Aliasing - using General::RoundSigDigits; // SUBROUTINE ARGUMENT DEFINITIONS: @@ -8157,14 +8232,14 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(1) + " has been found."); - ShowContinueError(state, cNumericFieldNames(1) + " must be > 0, entered value = " + RoundSigDigits(rNumericArgs(1), 2)); + ShowContinueError(state, format("{} must be > 0, entered value = {:.2R}", cNumericFieldNames(1), rNumericArgs(1))); } if (rNumericArgs(2) <= 0.0) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(2) + " has been found."); - ShowContinueError(state, cNumericFieldNames(2) + " must be > 0, entered value = " + RoundSigDigits(rNumericArgs(2), 2)); + ShowContinueError(state, format("{} must be > 0, entered value = {:.2R}", cNumericFieldNames(2), rNumericArgs(2))); } } @@ -8198,7 +8273,7 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(1) + " has been found."); - ShowContinueError(state, cNumericFieldNames(1) + " must be >= 0, entered value = " + RoundSigDigits(rNumericArgs(1), 2)); + ShowContinueError(state, format("{} must be >= 0, entered value = {:.2R}", cNumericFieldNames(1), rNumericArgs(1))); } } @@ -8237,7 +8312,7 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(1) + " has been found."); - ShowContinueError(state, cNumericFieldNames(1) + " must be > 0, entered " + RoundSigDigits(rNumericArgs(1), 2)); + ShowContinueError(state, format("{} must be > 0, entered {:.2R}", cNumericFieldNames(1), rNumericArgs(1))); } dataMaterial.Material(MaterNum).Pressure = rNumericArgs(2); @@ -8245,7 +8320,7 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(2) + " has been found."); - ShowContinueError(state, cNumericFieldNames(2) + " must be > 0, entered " + RoundSigDigits(rNumericArgs(2), 2)); + ShowContinueError(state, format("{} must be > 0, entered {:.2R}", cNumericFieldNames(2), rNumericArgs(2))); } if (!lAlphaFieldBlanks(2)) { @@ -8364,70 +8439,70 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(1) + " has been found."); - ShowContinueError(state, cNumericFieldNames(1) + " must be > 0, entered value = " + RoundSigDigits(rNumericArgs(1), 2)); + ShowContinueError(state, format("{} must be > 0, entered value = {:.2R}", cNumericFieldNames(1), rNumericArgs(1))); } if (rNumericArgs(2) <= 0.0) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(2) + " has been found."); - ShowContinueError(state, cNumericFieldNames(2) + " must be > 0, entered value = " + RoundSigDigits(rNumericArgs(2), 2)); + ShowContinueError(state, format("{} must be > 0, entered value = {:.2R}", cNumericFieldNames(2), rNumericArgs(2))); } if ((rNumericArgs(3) < 0.0) || (rNumericArgs(3) > 1.0)) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(3) + " has been found."); - ShowContinueError(state, cNumericFieldNames(3) + " value must be >= 0 and <= 1, entered value = " + RoundSigDigits(rNumericArgs(3), 2)); + ShowContinueError(state, format("{} value must be >= 0 and <= 1, entered value = {:.2R}", cNumericFieldNames(3), rNumericArgs(3))); } if ((rNumericArgs(4) <= 0.0) || (rNumericArgs(4) > 1.0)) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(4) + " has been found."); - ShowContinueError(state, cNumericFieldNames(4) + " value must be >= 0 and <= 1, entered value = " + RoundSigDigits(rNumericArgs(4), 2)); + ShowContinueError(state, format("{} value must be >= 0 and <= 1, entered value = {:.2R}", cNumericFieldNames(4), rNumericArgs(4))); } if ((rNumericArgs(5) <= 0.0) || (rNumericArgs(5) > 1.0)) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(5) + " has been found."); - ShowContinueError(state, cNumericFieldNames(5) + " value must be >= 0 and <= 1, entered value = " + RoundSigDigits(rNumericArgs(5), 2)); + ShowContinueError(state, format("{} value must be >= 0 and <= 1, entered value = {:.2R}", cNumericFieldNames(5), rNumericArgs(5))); } if ((rNumericArgs(6) < 0.0) || (rNumericArgs(6) > 1.0)) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(6) + " has been found."); - ShowContinueError(state, cNumericFieldNames(6) + " must be >= 0 or <= 1, entered value = " + RoundSigDigits(rNumericArgs(6), 2)); + ShowContinueError(state, format("{} must be >= 0 or <= 1, entered value = {:.2R}", cNumericFieldNames(6), rNumericArgs(6))); } if ((rNumericArgs(7) < 0.0) || (rNumericArgs(7) > 1.0)) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(7) + " has been found."); - ShowContinueError(state, cNumericFieldNames(7) + " must be >=0 or <=1, entered " + RoundSigDigits(rNumericArgs(7), 2)); + ShowContinueError(state, format("{} must be >=0 or <=1, entered {:.2R}", cNumericFieldNames(7), rNumericArgs(7))); } if ((rNumericArgs(8) < 0.0) || (rNumericArgs(8) > 1.0)) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(8) + " has been found."); - ShowContinueError(state, cNumericFieldNames(8) + " must be >=0 or <=1, entered value = " + RoundSigDigits(rNumericArgs(8), 2)); + ShowContinueError(state, format("{} must be >=0 or <=1, entered value = {:.2R}", cNumericFieldNames(8), rNumericArgs(8))); } if ((rNumericArgs(9) < 0.0) || (rNumericArgs(9) > 1.0)) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(9) + " has been found."); - ShowContinueError(state, cNumericFieldNames(9) + " must be >=0 or <=1, entered value = " + RoundSigDigits(rNumericArgs(9), 2)); + ShowContinueError(state, format("{} must be >=0 or <=1, entered value = {:.2R}", cNumericFieldNames(9), rNumericArgs(9))); } if ((rNumericArgs(10) < 0.0) || (rNumericArgs(10) > 1.0)) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(10) + " has been found."); - ShowContinueError(state, cNumericFieldNames(10) + " must be >=0 or <=1, entered value = " + RoundSigDigits(rNumericArgs(10), 2)); + ShowContinueError(state, format("{} must be >=0 or <=1, entered value = {:.2R}", cNumericFieldNames(10), rNumericArgs(10))); } if (ComplexShade(Loop).LayerType == csVenetianHorizontal || ComplexShade(Loop).LayerType == csVenetianVertical) { @@ -8435,43 +8510,43 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(11) + " has been found."); - ShowContinueError(state, cNumericFieldNames(11) + " must be >0, entered value = " + RoundSigDigits(rNumericArgs(11), 2)); + ShowContinueError(state, format("{} must be >0, entered value = {:.2R}", cNumericFieldNames(11), rNumericArgs(11))); } if (rNumericArgs(12) <= 0.0) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(12) + " has been found."); - ShowContinueError(state, cNumericFieldNames(12) + " must be >0, entered value = " + RoundSigDigits(rNumericArgs(12), 2)); + ShowContinueError(state, format("{} must be >0, entered value = {:.2R}", cNumericFieldNames(12), rNumericArgs(12))); } if (rNumericArgs(13) <= 0.0) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(13) + " has been found."); - ShowContinueError(state, cNumericFieldNames(13) + " must be >0, entered value = " + RoundSigDigits(rNumericArgs(13), 2)); + ShowContinueError(state, format("{} must be >0, entered value = {:.2R}", cNumericFieldNames(13), rNumericArgs(13))); } if ((rNumericArgs(14) < -90.0) || (rNumericArgs(14) > 90.0)) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(14) + " has been found."); - ShowContinueError(state, cNumericFieldNames(14) + " must be >=-90 and <=90, entered value = " + RoundSigDigits(rNumericArgs(14), 2)); + ShowContinueError(state, format("{} must be >=-90 and <=90, entered value = {:.2R}", cNumericFieldNames(14), rNumericArgs(14))); } if (rNumericArgs(15) <= 0.0) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(15) + " has been found."); - ShowContinueError(state, cNumericFieldNames(15) + " must be >0, entered value = " + RoundSigDigits(rNumericArgs(15), 2)); + ShowContinueError(state, format("{} must be >0, entered value = {:.2R}", cNumericFieldNames(15), rNumericArgs(15))); } if ((rNumericArgs(16) < 0.0) || ((rNumericArgs(16) > 0.0) && (rNumericArgs(16) < (rNumericArgs(11) / 2)))) { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(16) + " has been found."); - ShowContinueError(state, cNumericFieldNames(16) + - " must be =0 or greater than SlatWidth/2, entered value = " + RoundSigDigits(rNumericArgs(16), 2)); + ShowContinueError( + state, format("{} must be =0 or greater than SlatWidth/2, entered value = {:.2R}", cNumericFieldNames(16), rNumericArgs(16))); } } @@ -8501,7 +8576,6 @@ namespace HeatBalanceManager { using namespace DataIPShortCuts; using namespace MatrixDataManager; using namespace DataBSDFWindow; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("SetupComlexFenestrationStateInput: "); @@ -8565,7 +8639,7 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(1) + " has been found."); - ShowContinueError(state, cNumericFieldNames(1) + " should be >= 0.0 and <= 1.0, entered value = " + RoundSigDigits(rNumericArgs(1), 2)); + ShowContinueError(state, format("{} should be >= 0.0 and <= 1.0, entered value = {:.2R}", cNumericFieldNames(1), rNumericArgs(1))); } { @@ -8628,7 +8702,7 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(2) + " has been found."); - ShowContinueError(state, cNumericFieldNames(2) + " must be > 0, entered value = " + RoundSigDigits(rNumericArgs(2), 2)); + ShowContinueError(state, format("{} must be > 0, entered value = {:.2R}", cNumericFieldNames(2), rNumericArgs(2))); } WindowThermalModel(Loop).InitialTemperature = rNumericArgs(3); @@ -8636,7 +8710,7 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(3) + " has been found."); - ShowContinueError(state, cNumericFieldNames(3) + " must be > 0, entered value = " + RoundSigDigits(rNumericArgs(3), 2)); + ShowContinueError(state, format("{} must be > 0, entered value = {:.2R}", cNumericFieldNames(3), rNumericArgs(3))); } WindowThermalModel(Loop).InitialPressure = rNumericArgs(4); @@ -8644,7 +8718,7 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + ", object. Illegal value for " + cNumericFieldNames(4) + " has been found."); - ShowContinueError(state, cNumericFieldNames(4) + " must be > 0, entered value = " + RoundSigDigits(rNumericArgs(4), 2)); + ShowContinueError(state, format("{} must be > 0, entered value = {:.2R}", cNumericFieldNames(4), rNumericArgs(4))); } } @@ -8941,19 +9015,24 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + " = \"" + locAlphaArgs(1) + "\", object. Incorrect matrix dimension."); - ShowContinueError(state, "Front absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + " must have only one row."); + ShowContinueError(state, + format("Front absorbtance Matrix:TwoDimension = \"{}\" for layer {} must have only one row.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); } if (NumCols != NBasis) { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + " = \"" + locAlphaArgs(1) + "\", object. Incorrect matrix dimension."); - ShowContinueError(state, "Front absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + - " must have same number of columns as it is defined by basis matrix."); - ShowContinueError(state, "Matrix has " + RoundSigDigits(NumCols) + " number of columns, while basis definition specifies " + - RoundSigDigits(NBasis) + " number of columns."); + ShowContinueError(state, + format("Front absorbtance Matrix:TwoDimension = \"{}\" for layer {} must have same number of columns " + "as it is defined by basis matrix.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); + ShowContinueError( + state, + format("Matrix has {} number of columns, while basis definition specifies {} number of columns.", NumCols, NBasis)); } state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).AbsNcols = NumCols; @@ -8962,8 +9041,10 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + "=\"" + locAlphaArgs(1) + ", object. Referenced Matrix:TwoDimension is missing from the input file."); - ShowContinueError(state, "Front absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + " is missing from the input file."); + ShowContinueError(state, + format("Front absorbtance Matrix:TwoDimension = \"{}\" for layer {} is missing from the input file.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); } else { Get2DMatrix(state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).FrtAbsIndex, state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).FrtAbs); @@ -8980,19 +9061,24 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + " = \"" + locAlphaArgs(1) + "\", object. Incorrect matrix dimension."); - ShowContinueError(state, "Back absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + " must have only one row."); + ShowContinueError(state, + format("Back absorbtance Matrix:TwoDimension = \"{}\" for layer {} must have only one row.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); } if (NumCols != NBasis) { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + " = \"" + locAlphaArgs(1) + "\", object. Incorrect matrix dimension."); - ShowContinueError(state, "Back absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + - " must have same number of columns as it is defined by basis matrix."); - ShowContinueError(state, "Matrix has " + RoundSigDigits(NumCols) + " number of columns, while basis definition specifies " + - RoundSigDigits(NBasis) + " number of columns."); + ShowContinueError(state, + format("Back absorbtance Matrix:TwoDimension = \"{}\" for layer {} must have same number of columns as " + "it is defined by basis matrix.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); + ShowContinueError( + state, + format("Matrix has {} number of columns, while basis definition specifies {} number of columns.", NumCols, NBasis)); } state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).BkAbs.allocate(NumCols, NumRows); @@ -9000,8 +9086,10 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + "=\"" + locAlphaArgs(1) + ", object. Referenced Matrix:TwoDimension is missing from the input file."); - ShowContinueError(state, "Back absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + " is missing from the input file."); + ShowContinueError(state, + format("Back absorbtance Matrix:TwoDimension = \"{}\" for layer {} is missing from the input file.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); } else { Get2DMatrix(state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).BkAbsIndex, state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).BkAbs); @@ -9195,19 +9283,24 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + " = \"" + locAlphaArgs(1) + "\", object. Incorrect matrix dimension."); - ShowContinueError(state, "Front absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + " must have only one row."); + ShowContinueError(state, + format("Front absorbtance Matrix:TwoDimension = \"{}\" for layer {} must have only one row.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); } if (NumCols != NBasis) { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + " = \"" + locAlphaArgs(1) + "\", object. Incorrect matrix dimension."); - ShowContinueError(state, "Front absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + - " must have same number of columns as it is defined by basis matrix."); - ShowContinueError(state, "Matrix has " + RoundSigDigits(NumCols) + " number of columns, while basis definition specifies " + - RoundSigDigits(NBasis) + " number of columns."); + ShowContinueError(state, + format("Front absorbtance Matrix:TwoDimension = \"{}\" for layer {} must have same number of columns " + "as it is defined by basis matrix.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); + ShowContinueError( + state, + format("Matrix has {} number of columns, while basis definition specifies {} number of columns.", NumCols, NBasis)); } state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).AbsNcols = NumCols; @@ -9217,8 +9310,10 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + "=\"" + locAlphaArgs(1) + ", object. Referenced Matrix:TwoDimension is missing from the input file."); - ShowContinueError(state, "Front absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + " is missing from the input file."); + ShowContinueError(state, + format("Front absorbtance Matrix:TwoDimension = \"{}\" for layer {} is missing from the input file.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); } else { Get2DMatrix(state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).FrtAbsIndex, state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).FrtAbs); @@ -9235,19 +9330,24 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + " = \"" + locAlphaArgs(1) + "\", object. Incorrect matrix dimension."); - ShowContinueError(state, "Back absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + " must have only one row."); + ShowContinueError(state, + format("Back absorbtance Matrix:TwoDimension = \"{}\" for layer {} must have only one row.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); } if (NumCols != NBasis) { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + " = \"" + locAlphaArgs(1) + "\", object. Incorrect matrix dimension."); - ShowContinueError(state, "Back absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + - " must have same number of columns as it is defined by basis matrix."); - ShowContinueError(state, "Matrix has " + RoundSigDigits(NumCols) + " number of columns, while basis definition specifies " + - RoundSigDigits(NBasis) + " number of columns."); + ShowContinueError(state, + format("Back absorbtance Matrix:TwoDimension = \"{}\" for layer {} must have same number of columns as " + "it is defined by basis matrix.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); + ShowContinueError( + state, + format("Matrix has {} number of columns, while basis definition specifies {} number of columns.", NumCols, NBasis)); } state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).BkAbs.allocate(NumCols, NumRows); @@ -9256,8 +9356,10 @@ namespace HeatBalanceManager { ErrorsFound = true; ShowSevereError(state, RoutineName + locCurrentModuleObject + "=\"" + locAlphaArgs(1) + ", object. Referenced Matrix:TwoDimension is missing from the input file."); - ShowContinueError(state, "Back absorbtance Matrix:TwoDimension = \"" + locAlphaArgs(AlphaIndex) + "\" for layer " + - RoundSigDigits(currentOpticalLayer) + " is missing from the input file."); + ShowContinueError(state, + format("Back absorbtance Matrix:TwoDimension = \"{}\" for layer {} is missing from the input file.", + locAlphaArgs(AlphaIndex), + currentOpticalLayer)); } else { Get2DMatrix(state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).BkAbsIndex, state.dataConstruction->Construct(ConstrNum).BSDFInput.Layer(currentOpticalLayer).BkAbs); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index d6be09cad73..05673b664be 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -605,33 +605,34 @@ namespace HeatBalanceSurfaceManager { } else { elOpened = false; } - // IF (iwriteStatus /= 0) THEN - // CALL ShowFatalError('InitSurfaceHeatBalance: Could not open file "eplusout.delighteldmp" for output (readwrite).') - // ENDIF - // Open(unit=iDElightErrorFile, file='eplusout.delighteldmp', action='READ') - - // Sequentially read lines in DElight Electric Lighting Error File - // and process them using standard EPlus warning/error handling calls - bEndofErrFile = false; - iReadStatus = 0; - while (!bEndofErrFile && elOpened) { - auto cErrorLine = iDElightErrorFile.readLine(); - if (cErrorLine.eof) { - bEndofErrFile = true; - continue; - } - - // Is the current line a Warning message? - if (has_prefix(cErrorLine.data, "WARNING: ")) { - cErrorMsg = cErrorLine.data.substr(9); - ShowWarningError(state, cErrorMsg); - } - // Is the current line an Error message? - if (has_prefix(cErrorLine.data, "ERROR: ")) { - cErrorMsg = cErrorLine.data.substr(7); - ShowSevereError(state, cErrorMsg); - iErrorFlag = 1; - } + // IF (iwriteStatus /= 0) THEN + // CALL ShowFatalError(state, 'InitSurfaceHeatBalance: Could not open file "eplusout.delighteldmp" for output + // (readwrite).') + // ENDIF + // Open(unit=iDElightErrorFile, file='eplusout.delighteldmp', action='READ') + + // Sequentially read lines in DElight Electric Lighting Error File + // and process them using standard EPlus warning/error handling calls + bEndofErrFile = false; + iReadStatus = 0; + while (!bEndofErrFile && elOpened) { + auto cErrorLine = iDElightErrorFile.readLine(); + if (cErrorLine.eof) { + bEndofErrFile = true; + continue; + } + + // Is the current line a Warning message? + if (has_prefix(cErrorLine.data, "WARNING: ")) { + cErrorMsg = cErrorLine.data.substr(9); + ShowWarningError(state, cErrorMsg); + } + // Is the current line an Error message? + if (has_prefix(cErrorLine.data, "ERROR: ")) { + cErrorMsg = cErrorLine.data.substr(7); + ShowSevereError(state, cErrorMsg); + iErrorFlag = 1; + } } // Close DElight Error File and delete @@ -4420,7 +4421,6 @@ namespace HeatBalanceSurfaceManager { // Using/Aliasing using DataRuntimeLanguage::EMSConstructActuatorChecked; using DataRuntimeLanguage::EMSConstructActuatorIsOkay; - using General::TrimSigDigits; using HeatBalFiniteDiffManager::ConstructFD; // Locals @@ -4475,12 +4475,14 @@ namespace HeatBalanceSurfaceManager { ShowWarningError(state, "InitEMSControlledConstructions: EMS Construction State Actuator may be unrealistic, incompatible " "CTF timescales are being used."); ShowContinueError(state, - "Construction named = " + state.dataConstruction->Construct(Surface(SurfNum).Construction).Name + - " has CTF timesteps = " + TrimSigDigits(state.dataConstruction->Construct(Surface(SurfNum).Construction).NumHistories)); - ShowContinueError(state, - "While construction named = " + state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name + - " has CTF timesteps = " + - TrimSigDigits(state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).NumHistories)); + format("Construction named = {} has CTF timesteps = {}", + state.dataConstruction->Construct(Surface(SurfNum).Construction).Name, + state.dataConstruction->Construct(Surface(SurfNum).Construction).NumHistories)); + ShowContinueError( + state, + format("While construction named = {} has CTF timesteps = {}", + state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name, + state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).NumHistories)); ShowContinueError(state, "Transient heat transfer modeling may not be valid for surface name = " + Surface(SurfNum).Name + ", and the simulation continues"); } @@ -4489,13 +4491,15 @@ namespace HeatBalanceSurfaceManager { // thow warning, but allow ShowWarningError(state, "InitEMSControlledConstructions: EMS Construction State Actuator may be unrealistic, incompatible " "CTF terms are being used."); - ShowContinueError(state, "Construction named = " + state.dataConstruction->Construct(Surface(SurfNum).Construction).Name + - " has number of CTF terms = " + - TrimSigDigits(state.dataConstruction->Construct(Surface(SurfNum).Construction).NumCTFTerms)); ShowContinueError(state, - "While construction named = " + state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name + - " has number of CTF terms = " + - TrimSigDigits(state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).NumCTFTerms)); + format("Construction named = {} has number of CTF terms = {}", + state.dataConstruction->Construct(Surface(SurfNum).Construction).Name, + state.dataConstruction->Construct(Surface(SurfNum).Construction).NumCTFTerms)); + ShowContinueError( + state, + format("While construction named = {} has number of CTF terms = {}", + state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name, + state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).NumCTFTerms)); ShowContinueError(state, "The actuator is allowed but the transient heat transfer modeling may not be valid for surface name = " + Surface(SurfNum).Name + ", and the simulation continues"); @@ -4529,12 +4533,13 @@ namespace HeatBalanceSurfaceManager { // thow warning, and do not allow ShowSevereError(state, "InitEMSControlledConstructions: EMS Construction State Actuator not valid."); ShowContinueError(state, - "Construction named = " + state.dataConstruction->Construct(Surface(SurfNum).Construction).Name + - " has number of finite difference nodes =" + TrimSigDigits(ConstructFD(Surface(SurfNum).Construction).TotNodes)); + format("Construction named = {} has number of finite difference nodes ={}", + state.dataConstruction->Construct(Surface(SurfNum).Construction).Name, + ConstructFD(Surface(SurfNum).Construction).TotNodes)); ShowContinueError(state, - "While construction named = " + state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name + - "has number of finite difference nodes =" + - TrimSigDigits(ConstructFD(Surface(SurfNum).EMSConstructionOverrideValue).TotNodes)); + format("While construction named = {}has number of finite difference nodes ={}", + state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name, + ConstructFD(Surface(SurfNum).EMSConstructionOverrideValue).TotNodes)); ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); @@ -6992,14 +6997,18 @@ namespace HeatBalanceSurfaceManager { ++calcHeatBalInsideSurfErrCount; if (calcHeatBalInsideSurfErrCount < 16) { if (!DataHeatBalance::AnyCondFD) { - ShowWarningError(state, "Inside surface heat balance did not converge with Max Temp Difference [C] =" + - General::RoundSigDigits(MaxDelTemp, 3) + - " vs Max Allowed Temp Diff [C] =" + General::RoundSigDigits(MaxAllowedDelTemp, 3)); + ShowWarningError(state, + format("Inside surface heat balance did not converge with Max Temp Difference [C] ={:.3R} vs Max " + "Allowed Temp Diff [C] ={:.3R}", + MaxDelTemp, + MaxAllowedDelTemp)); ShowContinueErrorTimeStamp(state, ""); } else { - ShowWarningError(state, "Inside surface heat balance did not converge with Max Temp Difference [C] =" + - General::RoundSigDigits(MaxDelTemp, 3) + - " vs Max Allowed Temp Diff [C] =" + General::RoundSigDigits(MaxAllowedDelTempCondFD, 6)); + ShowWarningError(state, + format("Inside surface heat balance did not converge with Max Temp Difference [C] ={:.3R} vs Max " + "Allowed Temp Diff [C] ={:.6R}", + MaxDelTemp, + MaxAllowedDelTempCondFD)); ShowContinueErrorTimeStamp(state, ""); } } else { @@ -7689,8 +7698,10 @@ namespace HeatBalanceSurfaceManager { ++calcHeatBalInsideSurfErrCount; if (calcHeatBalInsideSurfErrCount < 16) { ShowWarningError(state, - "Inside surface heat balance did not converge with Max Temp Difference [C] =" + General::RoundSigDigits(MaxDelTemp, 3) + - " vs Max Allowed Temp Diff [C] =" + General::RoundSigDigits(MaxAllowedDelTempCondFD, 6)); + format("Inside surface heat balance did not converge with Max Temp Difference [C] ={:.3R} vs Max Allowed " + "Temp Diff [C] ={:.6R}", + MaxDelTemp, + MaxAllowedDelTempCondFD)); ShowContinueErrorTimeStamp(state, ""); } else { ShowRecurringWarningErrorAtEnd(state, "Inside surface heat balance convergence problem continues", @@ -7766,26 +7777,26 @@ namespace HeatBalanceSurfaceManager { void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, SurfaceData &surface, ZoneData &zone, int WarmupSurfTemp) { - using General::RoundSigDigits; if ((TH12 > MaxSurfaceTempLimit) || (TH12 < MinSurfaceTempLimit)) { if (state.dataGlobal->WarmupFlag) ++WarmupSurfTemp; if (!state.dataGlobal->WarmupFlag || WarmupSurfTemp > 10 || state.dataGlobal->DisplayExtraWarnings) { if (TH12 < MinSurfaceTempLimit) { if (surface.LowTempErrCount == 0) { - ShowSevereMessage(state, "Temperature (low) out of bounds [" + RoundSigDigits(TH12, 2) + "] for zone=\"" + zone.Name + - "\", for surface=\"" + surface.Name + "\""); + ShowSevereMessage( + state, + format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surface.Name)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); if (zone.FloorArea > 0.0) { - ShowContinueError(state, "...Internal Heat Gain [" + RoundSigDigits(zone.InternalHeatGains / zone.FloorArea, 3) + "] W/m2"); + ShowContinueError(state, format("...Internal Heat Gain [{:.3R}] W/m2", zone.InternalHeatGains / zone.FloorArea)); } else { - ShowContinueError(state, "...Internal Heat Gain (no floor) [" + RoundSigDigits(zone.InternalHeatGains, 3) + "] W"); + ShowContinueError(state, format("...Internal Heat Gain (no floor) [{:.3R}] W", zone.InternalHeatGains)); } if (AirflowNetwork::SimulateAirflowNetwork <= AirflowNetwork::AirflowNetworkControlSimple) { - ShowContinueError(state, "...Infiltration/Ventilation [" + RoundSigDigits(zone.NominalInfilVent, 3) + "] m3/s"); - ShowContinueError(state, "...Mixing/Cross Mixing [" + RoundSigDigits(zone.NominalMixing, 3) + "] m3/s"); + ShowContinueError(state, format("...Infiltration/Ventilation [{:.3R}] m3/s", zone.NominalInfilVent)); + ShowContinueError(state, format("...Mixing/Cross Mixing [{:.3R}] m3/s", zone.NominalMixing)); } else { ShowContinueError(state, "...Airflow Network Simulation: Nominal Infiltration/Ventilation/Mixing not available."); } @@ -7814,19 +7825,20 @@ namespace HeatBalanceSurfaceManager { } } else { if (surface.HighTempErrCount == 0) { - ShowSevereMessage(state, "Temperature (high) out of bounds (" + RoundSigDigits(TH12, 2) + "] for zone=\"" + zone.Name + - "\", for surface=\"" + surface.Name + "\""); + ShowSevereMessage( + state, + format("Temperature (high) out of bounds ({:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surface.Name)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); if (zone.FloorArea > 0.0) { - ShowContinueError(state, "...Internal Heat Gain [" + RoundSigDigits(zone.InternalHeatGains / zone.FloorArea, 3) + "] W/m2"); + ShowContinueError(state, format("...Internal Heat Gain [{:.3R}] W/m2", zone.InternalHeatGains / zone.FloorArea)); } else { - ShowContinueError(state, "...Internal Heat Gain (no floor) [" + RoundSigDigits(zone.InternalHeatGains, 3) + "] W"); + ShowContinueError(state, format("...Internal Heat Gain (no floor) [{:.3R}] W", zone.InternalHeatGains)); } if (AirflowNetwork::SimulateAirflowNetwork <= AirflowNetwork::AirflowNetworkControlSimple) { - ShowContinueError(state, "...Infiltration/Ventilation [" + RoundSigDigits(zone.NominalInfilVent, 3) + "] m3/s"); - ShowContinueError(state, "...Mixing/Cross Mixing [" + RoundSigDigits(zone.NominalMixing, 3) + "] m3/s"); + ShowContinueError(state, format("...Infiltration/Ventilation [{:.3R}] m3/s", zone.NominalInfilVent)); + ShowContinueError(state, format("...Mixing/Cross Mixing [{:.3R}] m3/s", zone.NominalMixing)); } else { ShowContinueError(state, "...Airflow Network Simulation: Nominal Infiltration/Ventilation/Mixing not available."); } @@ -7868,20 +7880,19 @@ namespace HeatBalanceSurfaceManager { if ((TH12 > MaxSurfaceTempLimitBeforeFatal) || (TH12 < MinSurfaceTempLimitBeforeFatal)) { if (!state.dataGlobal->WarmupFlag) { if (TH12 < MinSurfaceTempLimitBeforeFatal) { - ShowSevereError(state, "Temperature (low) out of bounds [" + RoundSigDigits(TH12, 2) + "] for zone=\"" + zone.Name + - "\", for surface=\"" + surface.Name + "\""); + ShowSevereError( + state, format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surface.Name)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); if (zone.FloorArea > 0.0) { - ShowContinueError(state, "...Internal Heat Gain [" + RoundSigDigits(zone.InternalHeatGains / zone.FloorArea, 3) + "] W/m2"); + ShowContinueError(state, format("...Internal Heat Gain [{:.3R}] W/m2", zone.InternalHeatGains / zone.FloorArea)); } else { - ShowContinueError(state, "...Internal Heat Gain (no floor) [" + RoundSigDigits(zone.InternalHeatGains / zone.FloorArea, 3) + - "] W"); + ShowContinueError(state, format("...Internal Heat Gain (no floor) [{:.3R}] W", zone.InternalHeatGains / zone.FloorArea)); } if (AirflowNetwork::SimulateAirflowNetwork <= AirflowNetwork::AirflowNetworkControlSimple) { - ShowContinueError(state, "...Infiltration/Ventilation [" + RoundSigDigits(zone.NominalInfilVent, 3) + "] m3/s"); - ShowContinueError(state, "...Mixing/Cross Mixing [" + RoundSigDigits(zone.NominalMixing, 3) + "] m3/s"); + ShowContinueError(state, format("...Infiltration/Ventilation [{:.3R}] m3/s", zone.NominalInfilVent)); + ShowContinueError(state, format("...Mixing/Cross Mixing [{:.3R}] m3/s", zone.NominalMixing)); } else { ShowContinueError(state, "...Airflow Network Simulation: Nominal Infiltration/Ventilation/Mixing not available."); } @@ -7894,20 +7905,20 @@ namespace HeatBalanceSurfaceManager { } ShowFatalError(state, "Program terminates due to preceding condition."); } else { - ShowSevereError(state, "Temperature (high) out of bounds [" + RoundSigDigits(TH12, 2) + "] for zone=\"" + zone.Name + - "\", for surface=\"" + surface.Name + "\""); + ShowSevereError( + state, + format("Temperature (high) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surface.Name)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); if (zone.FloorArea > 0.0) { - ShowContinueError(state, "...Internal Heat Gain [" + RoundSigDigits(zone.InternalHeatGains / zone.FloorArea, 3) + "] W/m2"); + ShowContinueError(state, format("...Internal Heat Gain [{:.3R}] W/m2", zone.InternalHeatGains / zone.FloorArea)); } else { - ShowContinueError(state, "...Internal Heat Gain (no floor) [" + RoundSigDigits(zone.InternalHeatGains / zone.FloorArea, 3) + - "] W"); + ShowContinueError(state, format("...Internal Heat Gain (no floor) [{:.3R}] W", zone.InternalHeatGains / zone.FloorArea)); } if (AirflowNetwork::SimulateAirflowNetwork <= AirflowNetwork::AirflowNetworkControlSimple) { - ShowContinueError(state, "...Infiltration/Ventilation [" + RoundSigDigits(zone.NominalInfilVent, 3) + "] m3/s"); - ShowContinueError(state, "...Mixing/Cross Mixing [" + RoundSigDigits(zone.NominalMixing, 3) + "] m3/s"); + ShowContinueError(state, format("...Infiltration/Ventilation [{:.3R}] m3/s", zone.NominalInfilVent)); + ShowContinueError(state, format("...Mixing/Cross Mixing [{:.3R}] m3/s", zone.NominalMixing)); } else { ShowContinueError(state, "...Airflow Network Simulation: Nominal Infiltration/Ventilation/Mixing not available."); } @@ -7922,8 +7933,11 @@ namespace HeatBalanceSurfaceManager { } } else { if (TH12 < -10000. || TH12 > 10000.) { - ShowSevereError(state, "CalcHeatBalanceInsideSurf: The temperature of " + RoundSigDigits(TH12, 2) + " C for zone=\"" + zone.Name + - "\", for surface=\"" + surface.Name + "\""); + ShowSevereError(state, + format("CalcHeatBalanceInsideSurf: The temperature of {:.2R} C for zone=\"{}\", for surface=\"{}\"", + TH12, + zone.Name, + surface.Name)); ShowContinueError(state, "..is very far out of bounds during warmup. This may be an indication of a malformed zone."); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Program terminates due to preceding condition."); diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc index 31ff00bacb9..bfecb3017ee 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc @@ -790,16 +790,20 @@ namespace HeatPumpWaterToWaterCOOLING { if (SourceSidePressure < this->LowPressCutoff) { ShowSevereError(state, ModuleCompName + "=\"" + this->Name + "\" Cooling Source Side Pressure Less than the Design Minimum"); - ShowContinueError(state, "Cooling Source Side Pressure=" + General::TrimSigDigits(SourceSidePressure, 2) + - " and user specified Design Minimum Pressure=" + General::TrimSigDigits(this->LowPressCutoff, 2)); + ShowContinueError(state, + format("Cooling Source Side Pressure={:.2T} and user specified Design Minimum Pressure={:.2T}", + SourceSidePressure, + this->LowPressCutoff)); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Preceding Conditions cause termination."); } if (LoadSidePressure > this->HighPressCutoff) { ShowSevereError(state, ModuleCompName + "=\"" + this->Name + "\" Cooling Load Side Pressure greater than the Design Maximum"); - ShowContinueError(state, "Cooling Load Side Pressure=" + General::TrimSigDigits(LoadSidePressure, 2) + - " and user specified Design Maximum Pressure=" + General::TrimSigDigits(this->HighPressCutoff, 2)); + ShowContinueError(state, + format("Cooling Load Side Pressure={:.2T} and user specified Design Maximum Pressure={:.2T}", + LoadSidePressure, + this->HighPressCutoff)); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Preceding Conditions cause termination."); } @@ -810,16 +814,19 @@ namespace HeatPumpWaterToWaterCOOLING { if (SuctionPr < this->LowPressCutoff) { ShowSevereError(state, ModuleCompName + "=\"" + this->Name + "\" Cooling Suction Pressure Less than the Design Minimum"); - ShowContinueError(state, "Cooling Suction Pressure=" + General::TrimSigDigits(SuctionPr, 2) + - " and user specified Design Minimum Pressure=" + General::TrimSigDigits(this->LowPressCutoff, 2)); + ShowContinueError( + state, + format("Cooling Suction Pressure={:.2T} and user specified Design Minimum Pressure={:.2T}", SuctionPr, this->LowPressCutoff)); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Preceding Conditions cause termination."); } if (DischargePr > this->HighPressCutoff) { ShowSevereError(state, ModuleCompName + "=\"" + this->Name + "\" Cooling Discharge Pressure greater than the Design Maximum"); - ShowContinueError(state, "Cooling Discharge Pressure=" + General::TrimSigDigits(DischargePr, 2) + - " and user specified Design Maximum Pressure=" + General::TrimSigDigits(this->HighPressCutoff, 2)); + ShowContinueError(state, + format("Cooling Discharge Pressure={:.2T} and user specified Design Maximum Pressure={:.2T}", + DischargePr, + this->HighPressCutoff)); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Preceding Conditions cause termination."); } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc index f0dc5f1b2a0..33055c6d6b6 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc @@ -556,7 +556,7 @@ namespace HeatPumpWaterToWaterHEATING { using DataHVACGlobals::SysTimeElapsed; using namespace FluidProperties; using DataPlant::PlantLoop; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; // SUBROUTINE PARAMETER DEFINITIONS: @@ -730,14 +730,17 @@ namespace HeatPumpWaterToWaterHEATING { // check cutoff pressures if (SourceSidePressure < this->LowPressCutoff) { ShowSevereError(state, ModuleCompName + "=\"" + this->Name + "\" Heating Source Side Pressure Less than the Design Minimum"); - ShowContinueError(state, "Source Side Pressure=" + TrimSigDigits(SourceSidePressure, 2) + - " and user specified Design Minimum Pressure=" + TrimSigDigits(this->LowPressCutoff, 2)); + ShowContinueError(state, + format("Source Side Pressure={:.2T} and user specified Design Minimum Pressure={:.2T}", + SourceSidePressure, + this->LowPressCutoff)); ShowFatalError(state, "Preceding Conditions cause termination."); } if (LoadSidePressure > this->HighPressCutoff) { ShowSevereError(state, ModuleCompName + "=\"" + this->Name + "\" Heating Load Side Pressure greater than the Design Maximum"); - ShowContinueError(state, "Load Side Pressure=" + TrimSigDigits(LoadSidePressure, 2) + - " and user specified Design Maximum Pressure=" + TrimSigDigits(this->HighPressCutoff, 2)); + ShowContinueError( + state, + format("Load Side Pressure={:.2T} and user specified Design Maximum Pressure={:.2T}", LoadSidePressure, this->HighPressCutoff)); ShowFatalError(state, "Preceding Conditions cause termination."); } @@ -748,14 +751,17 @@ namespace HeatPumpWaterToWaterHEATING { // check cutoff pressures if (SuctionPr < this->LowPressCutoff) { ShowSevereError(state, ModuleCompName + "=\"" + this->Name + "\" Heating Suction Pressure Less than the Design Minimum"); - ShowContinueError(state, "Heating Suction Pressure=" + TrimSigDigits(SuctionPr, 2) + - " and user specified Design Minimum Pressure=" + TrimSigDigits(this->LowPressCutoff, 2)); + ShowContinueError( + state, + format("Heating Suction Pressure={:.2T} and user specified Design Minimum Pressure={:.2T}", SuctionPr, this->LowPressCutoff)); ShowFatalError(state, "Preceding Conditions cause termination."); } if (DischargePr > this->HighPressCutoff) { ShowSevereError(state, ModuleCompName + "=\"" + this->Name + "\" Heating Discharge Pressure greater than the Design Maximum"); - ShowContinueError(state, "Heating Discharge Pressure=" + TrimSigDigits(DischargePr, 2) + - " and user specified Design Maximum Pressure=" + TrimSigDigits(this->HighPressCutoff, 2)); + ShowContinueError(state, + format("Heating Discharge Pressure={:.2T} and user specified Design Maximum Pressure={:.2T}", + DischargePr, + this->HighPressCutoff)); ShowFatalError(state, "Preceding Conditions cause termination."); } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index e08681169d1..f5178a1cb83 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -102,7 +102,6 @@ namespace HeatPumpWaterToWaterSimple { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using General::TrimSigDigits; using namespace DataLoopNode; // MODULE PARAMETER DEFINITIONS @@ -1027,9 +1026,8 @@ namespace HeatPumpWaterToWaterSimple { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpCoolingCap - nomCoolingCapUser) / nomCoolingCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "sizeCoolingWaterToWaterHP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(nomCoolingCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpCoolingCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", nomCoolingCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpCoolingCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1073,10 +1071,11 @@ namespace HeatPumpWaterToWaterSimple { if ((std::abs(tmpLoadSideVolFlowRate - nomLoadSideVolFlowUser) / nomLoadSideVolFlowUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "sizeCoolingWaterToWaterHP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Load Side Volume Flow Rate of " + - General::RoundSigDigits(nomLoadSideVolFlowUser, 2) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Load Side Volume Flow Rate of " + - General::RoundSigDigits(tmpLoadSideVolFlowRate, 2) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Load Side Volume Flow Rate of {:.2R} [m3/s]", nomLoadSideVolFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Load Side Volume Flow Rate of {:.2R} [m3/s]", tmpLoadSideVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1192,10 +1191,10 @@ namespace HeatPumpWaterToWaterSimple { if ((std::abs(tmpSourceSideVolFlowRate - nomSourceSideVolFlowUser) / nomSourceSideVolFlowUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "sizeCoolingWaterToWaterHP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Source Side Volume Flow Rate of " + - General::RoundSigDigits(nomSourceSideVolFlowUser, 2) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Source Side Volume Flow Rate of " + - General::RoundSigDigits(tmpSourceSideVolFlowRate, 2) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Source Side Volume Flow Rate of {:.2R} [m3/s]", nomSourceSideVolFlowUser)); + ShowContinueError( + state, format("differs from Design Size Source Side Volume Flow Rate of {:.2R} [m3/s]", tmpSourceSideVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1237,9 +1236,8 @@ namespace HeatPumpWaterToWaterSimple { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpPowerDraw - nomPowerDrawUser) / nomPowerDrawUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "sizeCoolingWaterToWaterHP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Cooling Power Consumption of " + General::RoundSigDigits(nomPowerDrawUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Cooling Power Consumption of " + General::RoundSigDigits(tmpPowerDraw, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Cooling Power Consumption of {:.2R} [W]", nomPowerDrawUser)); + ShowContinueError(state, format("differs from Design Size Cooling Power Consumption of {:.2R} [W]", tmpPowerDraw)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1364,9 +1362,8 @@ namespace HeatPumpWaterToWaterSimple { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpHeatingCap - nomHeatingCapUser) / nomHeatingCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "sizeHeatingWaterToWaterHP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(nomHeatingCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpHeatingCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", nomHeatingCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpHeatingCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1410,10 +1407,11 @@ namespace HeatPumpWaterToWaterSimple { if ((std::abs(tmpLoadSideVolFlowRate - nomLoadSideVolFlowUser) / nomLoadSideVolFlowUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "sizeHeatingWaterToWaterHP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Load Side Volume Flow Rate of " + - General::RoundSigDigits(nomLoadSideVolFlowUser, 2) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Load Side Volume Flow Rate of " + - General::RoundSigDigits(tmpLoadSideVolFlowRate, 2) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Load Side Volume Flow Rate of {:.2R} [m3/s]", nomLoadSideVolFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Load Side Volume Flow Rate of {:.2R} [m3/s]", tmpLoadSideVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1528,10 +1526,10 @@ namespace HeatPumpWaterToWaterSimple { if ((std::abs(tmpSourceSideVolFlowRate - nomSourceSideVolFlowUser) / nomSourceSideVolFlowUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "sizeHeatingWaterToWaterHP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Source Side Volume Flow Rate of " + - General::RoundSigDigits(nomSourceSideVolFlowUser, 2) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Source Side Volume Flow Rate of " + - General::RoundSigDigits(tmpSourceSideVolFlowRate, 2) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Source Side Volume Flow Rate of {:.2R} [m3/s]", nomSourceSideVolFlowUser)); + ShowContinueError( + state, format("differs from Design Size Source Side Volume Flow Rate of {:.2R} [m3/s]", tmpSourceSideVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1573,9 +1571,8 @@ namespace HeatPumpWaterToWaterSimple { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpPowerDraw - nomPowerDrawUser) / nomPowerDrawUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "sizeHeatingWaterToWaterHP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Heating Power Consumption of " + General::RoundSigDigits(nomPowerDrawUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Heating Power Consumption of " + General::RoundSigDigits(tmpPowerDraw, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Heating Power Consumption of {:.2R} [W]", nomPowerDrawUser)); + ShowContinueError(state, format("differs from Design Size Heating Power Consumption of {:.2R} [W]", tmpPowerDraw)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1718,12 +1715,12 @@ namespace HeatPumpWaterToWaterSimple { if (this->CoolCapNegativeCounter < 1) { ++this->CoolCapNegativeCounter; ShowWarningError(state, HPEqFitCooling + " \"" + this->Name + "\":"); - ShowContinueError(state, " Cooling capacity curve output is <= 0.0 (" + TrimSigDigits(QLoad, 4) + ")."); - ShowContinueError(state, " Zero or negative value occurs with a load-side inlet temperature of " + TrimSigDigits(LoadSideInletTemp, 2) + - " C,"); - ShowContinueError(state, " a source-side inlet temperature of " + TrimSigDigits(SourceSideInletTemp, 2) + " C,"); - ShowContinueError(state, " a load-side mass flow rate of " + TrimSigDigits(LoadSideMassFlowRate, 3) + " kg/s,"); - ShowContinueError(state, " and a source-side mass flow rate of " + TrimSigDigits(SourceSideMassFlowRate, 3) + " kg/s."); + ShowContinueError(state, format(" Cooling capacity curve output is <= 0.0 ({:.4T}).", QLoad)); + ShowContinueError(state, + format(" Zero or negative value occurs with a load-side inlet temperature of {:.2T} C,", LoadSideInletTemp)); + ShowContinueError(state, format(" a source-side inlet temperature of {:.2T} C,", SourceSideInletTemp)); + ShowContinueError(state, format(" a load-side mass flow rate of {:.3T} kg/s,", LoadSideMassFlowRate)); + ShowContinueError(state, format(" and a source-side mass flow rate of {:.3T} kg/s.", SourceSideMassFlowRate)); ShowContinueErrorTimeStamp(state, " The heat pump is turned off for this time step but simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, HPEqFitCooling + " \"" + this->Name + @@ -1737,12 +1734,12 @@ namespace HeatPumpWaterToWaterSimple { if (this->CoolPowerNegativeCounter < 1) { ++this->CoolPowerNegativeCounter; ShowWarningError(state, HPEqFitCooling + " \"" + this->Name + "\":"); - ShowContinueError(state, " Cooling compressor power curve output is <= 0.0 (" + TrimSigDigits(Power, 4) + ")."); - ShowContinueError(state, " Zero or negative value occurs with a load-side inlet temperature of " + TrimSigDigits(LoadSideInletTemp, 2) + - " C,"); - ShowContinueError(state, " a source-side inlet temperature of " + TrimSigDigits(SourceSideInletTemp, 2) + " C,"); - ShowContinueError(state, " a load-side mass flow rate of " + TrimSigDigits(LoadSideMassFlowRate, 3) + " kg/s,"); - ShowContinueError(state, " and a source-side mass flow rate of " + TrimSigDigits(SourceSideMassFlowRate, 3) + " kg/s."); + ShowContinueError(state, format(" Cooling compressor power curve output is <= 0.0 ({:.4T}).", Power)); + ShowContinueError(state, + format(" Zero or negative value occurs with a load-side inlet temperature of {:.2T} C,", LoadSideInletTemp)); + ShowContinueError(state, format(" a source-side inlet temperature of {:.2T} C,", SourceSideInletTemp)); + ShowContinueError(state, format(" a load-side mass flow rate of {:.3T} kg/s,", LoadSideMassFlowRate)); + ShowContinueError(state, format(" and a source-side mass flow rate of {:.3T} kg/s.", SourceSideMassFlowRate)); ShowContinueErrorTimeStamp(state, " The heat pump is turned off for this time step but simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, HPEqFitCooling + " \"" + this->Name + @@ -1897,12 +1894,12 @@ namespace HeatPumpWaterToWaterSimple { if (this->HeatCapNegativeCounter < 1) { ++this->HeatCapNegativeCounter; ShowWarningError(state, HPEqFitHeating + " \"" + this->Name + "\":"); - ShowContinueError(state, " Heating capacity curve output is <= 0.0 (" + TrimSigDigits(QLoad, 4) + ")."); - ShowContinueError(state, " Zero or negative value occurs with a load-side inlet temperature of " + TrimSigDigits(LoadSideInletTemp, 2) + - " C,"); - ShowContinueError(state, " a source-side inlet temperature of " + TrimSigDigits(SourceSideInletTemp, 2) + " C,"); - ShowContinueError(state, " a load-side mass flow rate of " + TrimSigDigits(LoadSideMassFlowRate, 3) + " kg/s,"); - ShowContinueError(state, " and a source-side mass flow rate of " + TrimSigDigits(SourceSideMassFlowRate, 3) + " kg/s."); + ShowContinueError(state, format(" Heating capacity curve output is <= 0.0 ({:.4T}).", QLoad)); + ShowContinueError(state, + format(" Zero or negative value occurs with a load-side inlet temperature of {:.2T} C,", LoadSideInletTemp)); + ShowContinueError(state, format(" a source-side inlet temperature of {:.2T} C,", SourceSideInletTemp)); + ShowContinueError(state, format(" a load-side mass flow rate of {:.3T} kg/s,", LoadSideMassFlowRate)); + ShowContinueError(state, format(" and a source-side mass flow rate of {:.3T} kg/s.", SourceSideMassFlowRate)); ShowContinueErrorTimeStamp(state, " The heat pump is turned off for this time step but simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, HPEqFitHeating + " \"" + this->Name + @@ -1916,12 +1913,12 @@ namespace HeatPumpWaterToWaterSimple { if (this->HeatPowerNegativeCounter < 1) { ++this->HeatPowerNegativeCounter; ShowWarningError(state, HPEqFitHeating + " \"" + this->Name + "\":"); - ShowContinueError(state, " Heating compressor power curve output is <= 0.0 (" + TrimSigDigits(Power, 4) + ")."); - ShowContinueError(state, " Zero or negative value occurs with a load-side inlet temperature of " + TrimSigDigits(LoadSideInletTemp, 2) + - " C,"); - ShowContinueError(state, " a source-side inlet temperature of " + TrimSigDigits(SourceSideInletTemp, 2) + " C,"); - ShowContinueError(state, " a load-side mass flow rate of " + TrimSigDigits(LoadSideMassFlowRate, 3) + " kg/s,"); - ShowContinueError(state, " and a source-side mass flow rate of " + TrimSigDigits(SourceSideMassFlowRate, 3) + " kg/s."); + ShowContinueError(state, format(" Heating compressor power curve output is <= 0.0 ({:.4T}).", Power)); + ShowContinueError(state, + format(" Zero or negative value occurs with a load-side inlet temperature of {:.2T} C,", LoadSideInletTemp)); + ShowContinueError(state, format(" a source-side inlet temperature of {:.2T} C,", SourceSideInletTemp)); + ShowContinueError(state, format(" a load-side mass flow rate of {:.3T} kg/s,", LoadSideMassFlowRate)); + ShowContinueError(state, format(" and a source-side mass flow rate of {:.3T} kg/s.", SourceSideMassFlowRate)); ShowContinueErrorTimeStamp(state, " The heat pump is turned off for this time step but simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, HPEqFitHeating + " \"" + this->Name + diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index 7a3d581ba83..4a454cfed7b 100644 --- a/src/EnergyPlus/HeatRecovery.cc +++ b/src/EnergyPlus/HeatRecovery.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -68,10 +67,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -120,7 +117,7 @@ namespace HeatRecovery { // Use statements for access to subroutines in other modules using namespace ScheduleManager; - using General::RoundSigDigits; + using General::SolveRoot; using namespace Psychrometrics; @@ -238,7 +235,6 @@ namespace HeatRecovery { // Manage the simulation of a heat recovery unit // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int HeatExchNum; // index of unit being simulated @@ -263,13 +259,19 @@ namespace HeatRecovery { } else { HeatExchNum = CompIndex; if (HeatExchNum > NumHeatExchangers || HeatExchNum < 1) { - ShowFatalError(state, "SimHeatRecovery: Invalid CompIndex passed=" + TrimSigDigits(HeatExchNum) + - ", Number of Units=" + TrimSigDigits(NumHeatExchangers) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimHeatRecovery: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + HeatExchNum, + NumHeatExchangers, + CompName)); } if (CheckEquipName(HeatExchNum)) { if (CompName != ExchCond(HeatExchNum).Name) { - ShowFatalError(state, "SimHeatRecovery: Invalid CompIndex passed=" + TrimSigDigits(HeatExchNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + ExchCond(HeatExchNum).Name); + ShowFatalError(state, + format("SimHeatRecovery: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + HeatExchNum, + CompName, + ExchCond(HeatExchNum).Name)); } CheckEquipName(HeatExchNum) = false; } @@ -729,7 +731,7 @@ namespace HeatRecovery { BalDesDehumPerfData(PerfDataNum).NomSupAirVolFlow != DataSizing::AutoSize) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Nominal air flow rate must be greater than zero."); - ShowContinueError(state, "... value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).NomSupAirVolFlow, 6)); + ShowContinueError(state, format("... value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).NomSupAirVolFlow)); ErrorsFound = true; } @@ -740,7 +742,7 @@ namespace HeatRecovery { BalDesDehumPerfData(PerfDataNum).NomProcAirFaceVel > 6.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Nominal air face velocity cannot be less than or equal to zero or greater than 6 m/s."); - ShowContinueError(state, "... value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).NomProcAirFaceVel, 6)); + ShowContinueError(state, format("... value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).NomProcAirFaceVel)); ErrorsFound = true; } BalDesDehumPerfData(PerfDataNum).NomElecPower = rNumericArgs(3); @@ -748,7 +750,7 @@ namespace HeatRecovery { if (BalDesDehumPerfData(PerfDataNum).NomElecPower < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Nominal electric power cannot be less than zero."); - ShowContinueError(state, "... value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).NomElecPower, 6)); + ShowContinueError(state, format("... value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).NomElecPower)); ErrorsFound = true; } @@ -769,22 +771,26 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of regeneration inlet air humidity ratio must be less than the maximum."); - ShowContinueError(state, "... minimum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInHumRat, 6)); - ShowContinueError(state, "... maximum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInHumRat, 6)); + ShowContinueError(state, + format("... minimum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInHumRat)); + ShowContinueError(state, + format("... maximum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInHumRat < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of regeneration inlet air humidity ratio must be greater than or equal to 0."); - ShowContinueError(state, "... minimum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInHumRat, 6)); + ShowContinueError(state, + format("... minimum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInHumRat > 1.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the maximum value of regeneration inlet air humidity ratio must be less than or equal to 1."); - ShowContinueError(state, "... maximum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInHumRat, 6)); + ShowContinueError(state, + format("... maximum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInHumRat)); ErrorsFound = true; } @@ -794,8 +800,8 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of regeneration inlet air temperature must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInTemp, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInTemp, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInTemp)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInTemp)); ErrorsFound = true; } @@ -805,22 +811,22 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of process inlet air humidity ratio must be less than the maximum."); - ShowContinueError(state, "... minimum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinProcAirInHumRat, 6)); - ShowContinueError(state, "... maximum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInHumRat, 6)); + ShowContinueError(state, format("... minimum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinProcAirInHumRat)); + ShowContinueError(state, format("... maximum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).T_MinProcAirInHumRat < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of process inlet air humidity ratio must be greater than or equal to 0."); - ShowContinueError(state, "... minimum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinProcAirInHumRat, 6)); + ShowContinueError(state, format("... minimum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinProcAirInHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInHumRat > 1.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the maximum value of process inlet air humidity ratio must be less than or equal to 1."); - ShowContinueError(state, "... maximum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInHumRat, 6)); + ShowContinueError(state, format("... maximum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInHumRat)); ErrorsFound = true; } @@ -830,8 +836,8 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of process inlet air temperature must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinProcAirInTemp, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInTemp, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinProcAirInTemp)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInTemp)); ErrorsFound = true; } @@ -841,8 +847,8 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of regen air velocity must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinFaceVel, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxFaceVel, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinFaceVel)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxFaceVel)); ErrorsFound = true; } @@ -852,8 +858,8 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of regen outlet air temperature must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).MinRegenAirOutTemp, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).MaxRegenAirOutTemp, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).MinRegenAirOutTemp)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).MaxRegenAirOutTemp)); ErrorsFound = true; } @@ -863,22 +869,26 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of regen inlet air relative humidity must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInRelHum * 100.0, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInRelHum * 100.0, 6)); + ShowContinueError(state, + format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInRelHum * 100.0)); + ShowContinueError(state, + format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInRelHum * 100.0)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInRelHum < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of regen inlet air relative humidity must be greater than or equal to 0."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInRelHum * 100.0, 6)); + ShowContinueError(state, + format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinRegenAirInRelHum * 100.0)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInRelHum > 1.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the maximum value of regen inlet air relative humidity must be less than or equal to 100."); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInRelHum * 100.0, 6)); + ShowContinueError(state, + format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxRegenAirInRelHum * 100.0)); ErrorsFound = true; } @@ -888,22 +898,22 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of process inlet air relative humidity must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinProcAirInRelHum * 100.0, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInRelHum * 100.0, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinProcAirInRelHum * 100.0)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInRelHum * 100.0)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).T_MinProcAirInRelHum < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the minimum value of process inlet air relative humidity must be greater than or equal to 0."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MinProcAirInRelHum * 100.0, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MinProcAirInRelHum * 100.0)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInRelHum > 1.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in max boundary for the regen outlet air temperature equation."); ShowContinueError(state, "... the maximum value of process inlet air relative humidity must be less than or equal to 100."); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInRelHum * 100.0, 6)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).T_MaxProcAirInRelHum * 100.0)); ErrorsFound = true; } @@ -924,22 +934,26 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of regeneration inlet air humidity ratio must be less than the maximum."); - ShowContinueError(state, "... minimum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInHumRat, 6)); - ShowContinueError(state, "... maximum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInHumRat, 6)); + ShowContinueError(state, + format("... minimum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInHumRat)); + ShowContinueError(state, + format("... maximum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInHumRat < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of regeneration inlet air humidity ratio must be greater than or equal to 0."); - ShowContinueError(state, "... minimum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInHumRat, 6)); + ShowContinueError(state, + format("... minimum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInHumRat > 1.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the maximum value of regeneration inlet air humidity ratio must be less than or equal to 1."); - ShowContinueError(state, "... maximum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInHumRat, 6)); + ShowContinueError(state, + format("... maximum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInHumRat)); ErrorsFound = true; } @@ -949,8 +963,8 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of regeneration inlet air temperature must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInTemp, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInTemp, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInTemp)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInTemp)); ErrorsFound = true; } @@ -960,22 +974,22 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of process inlet air humidity ratio must be less than the maximum."); - ShowContinueError(state, "... minimum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinProcAirInHumRat, 6)); - ShowContinueError(state, "... maximum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInHumRat, 6)); + ShowContinueError(state, format("... minimum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinProcAirInHumRat)); + ShowContinueError(state, format("... maximum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).H_MinProcAirInHumRat < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of process inlet air humidity ratio must be greater than or equal to 0."); - ShowContinueError(state, "... minimum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinProcAirInHumRat, 6)); + ShowContinueError(state, format("... minimum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinProcAirInHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInHumRat > 1.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the maximum value of process inlet air humidity ratio must be less than or equal to 1."); - ShowContinueError(state, "... maximum value entered by user = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInHumRat, 6)); + ShowContinueError(state, format("... maximum value entered by user = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInHumRat)); ErrorsFound = true; } @@ -985,8 +999,8 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of process inlet air temperature must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinProcAirInTemp, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInTemp, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinProcAirInTemp)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInTemp)); ErrorsFound = true; } @@ -996,8 +1010,8 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of regen air velocity must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinFaceVel, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxFaceVel, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinFaceVel)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxFaceVel)); ErrorsFound = true; } @@ -1007,22 +1021,22 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of regen outlet air humidity ratio must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).MinRegenAirOutHumRat, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).MaxRegenAirOutHumRat, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).MinRegenAirOutHumRat)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).MaxRegenAirOutHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).MinRegenAirOutHumRat < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of regen outlet air humidity ratio must be greater than or equal to 0."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).MinRegenAirOutHumRat, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).MinRegenAirOutHumRat)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).MaxRegenAirOutHumRat > 1.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the maximum value of regen outlet air humidity ratio must be less or equal to 1."); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).MaxRegenAirOutHumRat, 6)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).MaxRegenAirOutHumRat)); ErrorsFound = true; } @@ -1032,22 +1046,26 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of regen inlet air relative humidity must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInRelHum * 100.0, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInRelHum * 100.0, 6)); + ShowContinueError(state, + format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInRelHum * 100.0)); + ShowContinueError(state, + format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInRelHum * 100.0)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInRelHum < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of regen inlet air relative humidity must be greater than or equal to 0."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInRelHum * 100.0, 6)); + ShowContinueError(state, + format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinRegenAirInRelHum * 100.0)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInRelHum > 1.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the maximum value of regen inlet air relative humidity must be less or equal to 100."); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInRelHum * 100.0, 6)); + ShowContinueError(state, + format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxRegenAirInRelHum * 100.0)); ErrorsFound = true; } @@ -1057,22 +1075,22 @@ namespace HeatRecovery { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min/max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of process inlet air relative humidity must be less than the maximum."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinProcAirInRelHum * 100.0, 6)); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInRelHum * 100.0, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinProcAirInRelHum * 100.0)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInRelHum * 100.0)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).H_MinProcAirInRelHum < 0.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in min boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the minimum value of process inlet air relative humidity must be greater than or equal to 0."); - ShowContinueError(state, "... minimum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MinProcAirInRelHum * 100.0, 6)); + ShowContinueError(state, format("... minimum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MinProcAirInRelHum * 100.0)); ErrorsFound = true; } if (BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInRelHum > 1.0) { ShowSevereError(state, cCurrentModuleObject + " \"" + BalDesDehumPerfData(PerfDataNum).Name + "\""); ShowContinueError(state, "Error found in max boundary for the regen outlet air humidity ratio equation."); ShowContinueError(state, "... the maximum value of process inlet air relative humidity must be less than or equal to 100."); - ShowContinueError(state, "... maximum value entered = " + RoundSigDigits(BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInRelHum * 100.0, 6)); + ShowContinueError(state, format("... maximum value entered = {:.6R}", BalDesDehumPerfData(PerfDataNum).H_MaxProcAirInRelHum * 100.0)); ErrorsFound = true; } } @@ -1273,7 +1291,7 @@ namespace HeatRecovery { // Using/Aliasing using DXCoils::DXCoilFullLoadOutAirHumRat; using DXCoils::DXCoilFullLoadOutAirTemp; - using General::RoundSigDigits; + // USE DataZoneEquipment, ONLY: ZoneEquipInputsFilled,CheckZoneEquipmentList using EMSManager::CheckIfNodeSetPointManagedByEMS; using EMSManager::iHumidityRatioMaxSetPoint; @@ -1370,58 +1388,60 @@ namespace HeatRecovery { FatalError = true; ShowSevereError(state, "In the HeatExchanger:AirToAir:FlatPlate component " + ExchCond(ExIndex).Name); ShowContinueError(state, " the mass flow ratio is out of bounds"); - ShowContinueError(state, "The mass flow ratio is (Min_Mass_Flow_Rate / Max_Mass_Flow_Rate) = " + RoundSigDigits(Z, 2)); + ShowContinueError(state, format("The mass flow ratio is (Min_Mass_Flow_Rate / Max_Mass_Flow_Rate) = {:.2R}", Z)); ShowContinueError(state, "The mass flow ratio should be >= 0.0 and <= 1.0"); - ShowContinueError(state, "Min_Mass_Flow_Rate = " + RoundSigDigits(RhoAir, 2) + " [air density] * " + - RoundSigDigits(min(ExchCond(ExIndex).NomSupAirVolFlow, ExchCond(ExIndex).NomSecAirVolFlow), 1) + - " [Min_Vol_Flow_Rate]"); - ShowContinueError(state, "Max_Mass_Flow_Rate = " + RoundSigDigits(RhoAir, 2) + " [air density] * " + - RoundSigDigits(max(ExchCond(ExIndex).NomSupAirVolFlow, ExchCond(ExIndex).NomSecAirVolFlow), 1) + - " [Max_Vol_Flow_Rate]"); + ShowContinueError(state, + format("Min_Mass_Flow_Rate = {:.2R} [air density] * {:.1R} [Min_Vol_Flow_Rate]", + RhoAir, + min(ExchCond(ExIndex).NomSupAirVolFlow, ExchCond(ExIndex).NomSecAirVolFlow))); + ShowContinueError(state, + format("Max_Mass_Flow_Rate = {:.2R} [air density] * {:.1R} [Max_Vol_Flow_Rate]", + RhoAir, + max(ExchCond(ExIndex).NomSupAirVolFlow, ExchCond(ExIndex).NomSecAirVolFlow))); } else if (ErrStat == 2) { FatalError = true; ShowSevereError(state, "In the HeatExchanger:AirToAir:FlatPlate component " + ExchCond(ExIndex).Name); ShowContinueError(state, " the calculated nominal effectiveness is out of bounds"); - ShowContinueError(state, "The effectiveness is " + RoundSigDigits(Eps0, 3)); - ShowContinueError(state, "The effectiveness should be >= 0.0 and <= " + RoundSigDigits(1.0 / (1.0 + Z), 3)); + ShowContinueError(state, format("The effectiveness is {:.3R}", Eps0)); + ShowContinueError(state, format("The effectiveness should be >= 0.0 and <= {:.3R}", 1.0 / (1.0 + Z))); ShowContinueError(state, "Eff = (Nom_Sup_Mass_Flow_Rate/Min_Mass_Flow_Rate)*(T_nom_sup_out-T_nom_sup_in)/(T_nom_sec_in-T_nom_sup_in)"); ShowContinueError(state, "The temperatures are user inputs. The mass flow rates are user input volume flow rates"); - ShowContinueError(state, " times the density of air [" + RoundSigDigits(RhoAir, 2) + " kg/m3]"); + ShowContinueError(state, format(" times the density of air [{:.2R} kg/m3]", RhoAir)); ShowContinueError(state, "Change these inputs to obtain a physically realizable heat exchanger effectiveness"); } else if (ErrStat == 3) { FatalError = true; ShowSevereError(state, "In the HeatExchanger:AirToAir:FlatPlate component " + ExchCond(ExIndex).Name); ShowContinueError(state, " the calculated nominal effectiveness is out of bounds"); - ShowContinueError(state, "The effectiveness is " + RoundSigDigits(Eps0, 3)); - ShowContinueError(state, "The effectiveness should be >= 0.0 and <= " + RoundSigDigits((1.0 - std::exp(-Z)) / Z, 3)); + ShowContinueError(state, format("The effectiveness is {:.3R}", Eps0)); + ShowContinueError(state, format("The effectiveness should be >= 0.0 and <= {:.3R}", (1.0 - std::exp(-Z)) / Z)); ShowContinueError(state, "Eff = (Nom_Sup_Mass_Flow_Rate/Min_Mass_Flow_Rate)*(T_nom_sup_out-T_nom_sup_in)/(T_nom_sec_in-T_nom_sup_in)"); ShowContinueError(state, "The temperatures are user inputs. The mass flow rates are user input volume flow rates"); - ShowContinueError(state, " times the density of air [" + RoundSigDigits(RhoAir, 2) + " kg/m3]"); + ShowContinueError(state, format(" times the density of air [{:.2R} kg/m3]", RhoAir)); ShowContinueError(state, "Change these inputs to obtain a physically realizable heat exchanger effectiveness"); } else if (ErrStat == 4) { FatalError = true; ShowSevereError(state, "In the HeatExchanger:AirToAir:FlatPlate component " + ExchCond(ExIndex).Name); ShowContinueError(state, " the quantity Eff_nom*(Min_Mass_Flow_Rate / Max_Mass_Flow_Rate) is out of bounds"); - ShowContinueError(state, "The value is " + RoundSigDigits(Eps0 * Z, 3)); - ShowContinueError(state, "The value should be >= 0.0 and <= " + RoundSigDigits(1.0 - std::exp(Z * (SMALL - 1.0)), 3)); + ShowContinueError(state, format("The value is {:.3R}", Eps0 * Z)); + ShowContinueError(state, format("The value should be >= 0.0 and <= {:.3R}", 1.0 - std::exp(Z * (SMALL - 1.0)))); ShowContinueError(state, "Eff_nom = (Nom_Sup_Mass_Flow_Rate/Min_Mass_Flow_Rate) * (T_nom_sup_out - T_nom_sup_in)/(T_nom_sec_in - T_nom_sup_in)"); ShowContinueError(state, "The temperatures are user inputs. The mass flow rates are user input volume flow rates"); - ShowContinueError(state, " times the density of air [" + RoundSigDigits(RhoAir, 2) + " kg/m3]"); + ShowContinueError(state, format(" times the density of air [{:.2R} kg/m3]", RhoAir)); ShowContinueError(state, "Change these inputs to obtain a physically realizable product of effectiveness times min/max mass ratio " "for this heat exchanger"); } else if (ErrStat == 5) { FatalError = true; ShowSevereError(state, "In the HeatExchanger:AirToAir:FlatPlate component " + ExchCond(ExIndex).Name); ShowContinueError(state, " the calculated nominal effectiveness is out of bounds"); - ShowContinueError(state, "The effectiveness is " + RoundSigDigits(Eps0, 3)); + ShowContinueError(state, format("The effectiveness is {:.3R}", Eps0)); ShowContinueError(state, "The effectiveness should be >= 0.0 and <= 1.0"); ShowContinueError(state, "Eff = (Nom_Sup_Mass_Flow_Rate/Min_Mass_Flow_Rate)*(T_nom_sup_out-T_nom_sup_in)/(T_nom_sec_in-T_nom_sup_in)"); ShowContinueError(state, "The temperatures are user inputs. The mass flow rates are user input volume flow rates"); - ShowContinueError(state, " times the density of air [" + RoundSigDigits(RhoAir, 2) + " kg/m3]"); + ShowContinueError(state, format(" times the density of air [{:.2R} kg/m3]", RhoAir)); ShowContinueError(state, "Change these inputs to obtain a physically realizable heat exchanger effectiveness"); } @@ -2133,8 +2153,8 @@ namespace HeatRecovery { if (ExchCond(ExNum).UnBalancedErrCount <= 2) { ShowSevereError(state, cHXTypes(ExchCond(ExNum).ExchTypeNum) + ": \"" + ExchCond(ExNum).Name + "\" unbalanced air volume flow ratio through the heat exchanger is greater than 2:1."); - ShowContinueErrorTimeStamp(state, - "...HX Supply air to Exhaust air flow ratio = " + RoundSigDigits(HXSupAirVolFlowRate / HXSecAirVolFlowRate, 5) + '.'); + ShowContinueErrorTimeStamp( + state, format("...HX Supply air to Exhaust air flow ratio = {:.5R}.", HXSupAirVolFlowRate / HXSecAirVolFlowRate)); } else { ShowRecurringWarningErrorAtEnd(state, cHXTypes(ExchCond(ExNum).ExchTypeNum) + " \"" + ExchCond(ExNum).Name + @@ -2156,7 +2176,7 @@ namespace HeatRecovery { if (ExchCond(ExNum).LowFlowErrCount == 1) { ShowWarningError(state, cHXTypes(ExchCond(ExNum).ExchTypeNum) + " \"" + ExchCond(ExNum).Name + "\""); ShowContinueError(state, "Average air volume flow rate is <50% or >130% of the nominal HX supply air volume flow rate."); - ShowContinueErrorTimeStamp(state, "Air volume flow rate ratio = " + RoundSigDigits(HXAirVolFlowRatio, 3) + '.'); + ShowContinueErrorTimeStamp(state, format("Air volume flow rate ratio = {:.3R}.", HXAirVolFlowRatio)); } else { ShowRecurringWarningErrorAtEnd(state, cHXTypes(ExchCond(ExNum).ExchTypeNum) + " \"" + ExchCond(ExNum).Name + @@ -2205,19 +2225,19 @@ namespace HeatRecovery { ShowWarningError(state, "HeatExchanger:AirToAir:SensibleAndLatent =\"" + ExchCond(ExNum).Name + "\"" + " sensible effectiveness is less than zero. Check the following inputs."); if (ExchCond(ExNum).SupInTemp < ExchCond(ExNum).SecInTemp) { - ShowContinueError(state, "...Sensible Effectiveness at 100% Heating Air Flow = " + - RoundSigDigits(ExchCond(ExNum).HeatEffectSensible100, 2)); - ShowContinueError(state, "...Sensible Effectiveness at 75% Heating Air Flow = " + - RoundSigDigits(ExchCond(ExNum).HeatEffectSensible75, 2)); + ShowContinueError( + state, format("...Sensible Effectiveness at 100% Heating Air Flow = {:.2R}", ExchCond(ExNum).HeatEffectSensible100)); + ShowContinueError(state, + format("...Sensible Effectiveness at 75% Heating Air Flow = {:.2R}", ExchCond(ExNum).HeatEffectSensible75)); ShowContinueError(state, "...Sensible effectiveness reset to zero and the simulation continues."); } else { - ShowContinueError(state, "...Sensible Effectiveness at 100% Cooling Air Flow = " + - RoundSigDigits(ExchCond(ExNum).CoolEffectSensible100, 2)); - ShowContinueError(state, "...Sensible Effectiveness at 75% Cooling Air Flow = " + - RoundSigDigits(ExchCond(ExNum).CoolEffectSensible75, 2)); + ShowContinueError( + state, format("...Sensible Effectiveness at 100% Cooling Air Flow = {:.2R}", ExchCond(ExNum).CoolEffectSensible100)); + ShowContinueError(state, + format("...Sensible Effectiveness at 75% Cooling Air Flow = {:.2R}", ExchCond(ExNum).CoolEffectSensible75)); ShowContinueError(state, "...Sensible effectiveness reset to zero and the simulation continues."); } - ShowContinueError(state, "...Heat Exchanger Air Volume Flow Ratio = " + RoundSigDigits(HXAirVolFlowRatio, 2)); + ShowContinueError(state, format("...Heat Exchanger Air Volume Flow Ratio = {:.2R}", HXAirVolFlowRatio)); ExchCond(ExNum).SensEffectivenessFlag = true; } } @@ -2228,19 +2248,19 @@ namespace HeatRecovery { ShowWarningError(state, "HeatExchanger:AirToAir:SensibleAndLatent =\"" + ExchCond(ExNum).Name + "\"" + " latent effectiveness is less than zero. Check the following inputs."); if (ExchCond(ExNum).SupInTemp < ExchCond(ExNum).SecInTemp) { - ShowContinueError(state, "...Latent Effectiveness at 100% Heating Air Flow = " + - RoundSigDigits(ExchCond(ExNum).HeatEffectLatent100, 2)); - ShowContinueError(state, "...Latent Effectiveness at 75% Heating Air Flow = " + - RoundSigDigits(ExchCond(ExNum).HeatEffectLatent75, 2)); + ShowContinueError(state, + format("...Latent Effectiveness at 100% Heating Air Flow = {:.2R}", ExchCond(ExNum).HeatEffectLatent100)); + ShowContinueError(state, + format("...Latent Effectiveness at 75% Heating Air Flow = {:.2R}", ExchCond(ExNum).HeatEffectLatent75)); ShowContinueError(state, "...Latent effectiveness reset to zero and the simulation continues."); } else { - ShowContinueError(state, "...Latent Effectiveness at 100% Cooling Air Flow = " + - RoundSigDigits(ExchCond(ExNum).CoolEffectLatent100, 2)); - ShowContinueError(state, "...Latent Effectiveness at 75% Cooling Air Flow = " + - RoundSigDigits(ExchCond(ExNum).CoolEffectLatent75, 2)); + ShowContinueError(state, + format("...Latent Effectiveness at 100% Cooling Air Flow = {:.2R}", ExchCond(ExNum).CoolEffectLatent100)); + ShowContinueError(state, + format("...Latent Effectiveness at 75% Cooling Air Flow = {:.2R}", ExchCond(ExNum).CoolEffectLatent75)); ShowContinueError(state, "...Latent effectiveness reset to zero and the simulation continues."); } - ShowContinueError(state, "...Heat Exchanger Air Volume Flow Ratio = " + RoundSigDigits(HXAirVolFlowRatio, 2)); + ShowContinueError(state, format("...Heat Exchanger Air Volume Flow Ratio = {:.2R}", HXAirVolFlowRatio)); ExchCond(ExNum).LatEffectivenessFlag = true; } } @@ -2336,19 +2356,23 @@ namespace HeatRecovery { ShowWarningError(state, "HeatExchanger:AirToAir:SensibleAndLatent =\"" + ExchCond(ExNum).Name + "\"" + " sensible effectiveness is less than zero. Check the following inputs."); if (ExchCond(ExNum).SupInTemp < ExchCond(ExNum).SecInTemp) { - ShowContinueError(state, "...Sensible Effectiveness at 100% Heating Air Flow = " + - RoundSigDigits(ExchCond(ExNum).HeatEffectSensible100, 2)); - ShowContinueError(state, "...Sensible Effectiveness at 75% Heating Air Flow = " + - RoundSigDigits(ExchCond(ExNum).HeatEffectSensible75, 2)); + ShowContinueError( + state, + format("...Sensible Effectiveness at 100% Heating Air Flow = {:.2R}", ExchCond(ExNum).HeatEffectSensible100)); + ShowContinueError( + state, + format("...Sensible Effectiveness at 75% Heating Air Flow = {:.2R}", ExchCond(ExNum).HeatEffectSensible75)); ShowContinueError(state, "...Sensible effectiveness reset to zero and the simulation continues."); } else { - ShowContinueError(state, "...Sensible Effectiveness at 100% Cooling Air Flow = " + - RoundSigDigits(ExchCond(ExNum).CoolEffectSensible100, 2)); - ShowContinueError(state, "...Sensible Effectiveness at 75% Cooling Air Flow = " + - RoundSigDigits(ExchCond(ExNum).CoolEffectSensible75, 2)); + ShowContinueError( + state, + format("...Sensible Effectiveness at 100% Cooling Air Flow = {:.2R}", ExchCond(ExNum).CoolEffectSensible100)); + ShowContinueError( + state, + format("...Sensible Effectiveness at 75% Cooling Air Flow = {:.2R}", ExchCond(ExNum).CoolEffectSensible75)); ShowContinueError(state, "...Sensible effectiveness reset to zero and the simulation continues."); } - ShowContinueError(state, "...Heat Exchanger Air Volume Flow Ratio = " + RoundSigDigits(HXAirVolFlowRatio, 2)); + ShowContinueError(state, format("...Heat Exchanger Air Volume Flow Ratio = {:.2R}", HXAirVolFlowRatio)); ExchCond(ExNum).SensEffectivenessFlag = true; } } @@ -2359,19 +2383,23 @@ namespace HeatRecovery { ShowWarningError(state, "HeatExchanger:AirToAir:SensibleAndLatent =\"" + ExchCond(ExNum).Name + "\"" + " latent effectiveness is less than zero. Check the following inputs."); if (ExchCond(ExNum).SupInTemp < ExchCond(ExNum).SecInTemp) { - ShowContinueError(state, "...Latent Effectiveness at 100% Heating Air Flow = " + - RoundSigDigits(ExchCond(ExNum).HeatEffectLatent100, 2)); - ShowContinueError(state, "...Latent Effectiveness at 75% Heating Air Flow = " + - RoundSigDigits(ExchCond(ExNum).HeatEffectLatent75, 2)); + ShowContinueError( + state, + format("...Latent Effectiveness at 100% Heating Air Flow = {:.2R}", ExchCond(ExNum).HeatEffectLatent100)); + ShowContinueError( + state, + format("...Latent Effectiveness at 75% Heating Air Flow = {:.2R}", ExchCond(ExNum).HeatEffectLatent75)); ShowContinueError(state, "...Latent effectiveness reset to zero and the simulation continues."); } else { - ShowContinueError(state, "...Latent Effectiveness at 100% Cooling Air Flow = " + - RoundSigDigits(ExchCond(ExNum).CoolEffectLatent100, 2)); - ShowContinueError(state, "...Latent Effectiveness at 75% Cooling Air Flow = " + - RoundSigDigits(ExchCond(ExNum).CoolEffectLatent75, 2)); + ShowContinueError( + state, + format("...Latent Effectiveness at 100% Cooling Air Flow = {:.2R}", ExchCond(ExNum).CoolEffectLatent100)); + ShowContinueError( + state, + format("...Latent Effectiveness at 75% Cooling Air Flow = {:.2R}", ExchCond(ExNum).CoolEffectLatent75)); ShowContinueError(state, "...Latent effectiveness reset to zero and the simulation continues."); } - ShowContinueError(state, "...Heat Exchanger Air Volume Flow Ratio = " + RoundSigDigits(HXAirVolFlowRatio, 2)); + ShowContinueError(state, format("...Heat Exchanger Air Volume Flow Ratio = {:.2R}", HXAirVolFlowRatio)); ExchCond(ExNum).LatEffectivenessFlag = true; } } @@ -3403,7 +3431,7 @@ namespace HeatRecovery { // check input validity if (Z < 0.0 || Z > 1.0) { - ShowFatalError(state, "Variable Z (" + RoundSigDigits(Z, 2) + ") out of range [0.0,1.0] in CalculateEpsFromNTUandZ"); + ShowFatalError(state, format("Variable Z ({:.2R}) out of range [0.0,1.0] in CalculateEpsFromNTUandZ", Z)); } // effectiveness @@ -3430,7 +3458,7 @@ namespace HeatRecovery { } else if (SELECT_CASE_var == Cross_Flow_Other) { // CROSS FLOW, Cmax MIXED, Cmin UNMIXED Eps = (1.0 - std::exp(-Z * (1.0 - std::exp(-NTU)))) / Z; } else { - ShowFatalError(state, "HeatRecovery: Illegal flow arrangement in CalculateEpsFromNTUandZ, Value=" + RoundSigDigits(FlowArr)); + ShowFatalError(state, format("HeatRecovery: Illegal flow arrangement in CalculateEpsFromNTUandZ, Value={}", FlowArr)); } } } @@ -3539,7 +3567,7 @@ namespace HeatRecovery { } else if (SELECT_CASE_var == Cross_Flow_Other) { // CROSS FLOW, Cmax MIXED, Cmin UNMIXED NTU = -std::log(1.0 + std::log(1.0 - Eps * Z) / Z); } else { - ShowFatalError(state, "HeatRecovery: Illegal flow arrangement in CalculateNTUfromEpsAndZ, Value=" + RoundSigDigits(FlowArr)); + ShowFatalError(state, format("HeatRecovery: Illegal flow arrangement in CalculateNTUfromEpsAndZ, Value={}", FlowArr)); } } } @@ -3699,7 +3727,6 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -3851,9 +3878,9 @@ namespace HeatRecovery { if (T_RegenInTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInTemp || T_RegenInTemp > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxRegenAirInTemp) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_RegenInTempLast = T_RegenInTemp; - OutputChar = RoundSigDigits(T_RegenInTemp, 2); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInTemp, 2); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxRegenAirInTemp, 2); + OutputChar = format("{:.2R}", T_RegenInTemp); + OutputCharLo = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInTemp); + OutputCharHi = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxRegenAirInTemp); if (T_RegenInTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInTemp) { T_RegenInTemp = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInTemp; } @@ -3870,7 +3897,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_RegenInTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(T_RegenInTemp, 6); + CharValue = format("{:.6R}", T_RegenInTemp); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_RegenInTempBuffer3 = "...Regeneration outlet air temperature equation: regeneration inlet air temperature passed to the model = " + CharValue; } else { @@ -3883,9 +3910,9 @@ namespace HeatRecovery { if (T_RegenInHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInHumRat || T_RegenInHumRat > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxRegenAirInHumRat) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_RegenInHumRatLast = T_RegenInHumRat; - OutputChar = RoundSigDigits(T_RegenInHumRat, 6); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInHumRat, 6); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxRegenAirInHumRat, 6); + OutputChar = format("{:.6R}", T_RegenInHumRat); + OutputCharLo = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInHumRat); + OutputCharHi = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxRegenAirInHumRat); if (T_RegenInHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInHumRat) { T_RegenInHumRat = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInHumRat; } @@ -3902,7 +3929,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_RegenInHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(T_RegenInHumRat, 6); + CharValue = format("{:.6R}", T_RegenInHumRat); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_RegenInHumRatBuffer3 = "...Regeneration outlet air temperature equation: regeneration inlet air humidity ratio passed to the model = " + CharValue; } else { @@ -3915,9 +3942,9 @@ namespace HeatRecovery { if (T_ProcInTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInTemp || T_ProcInTemp > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxProcAirInTemp) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_ProcInTempLast = T_ProcInTemp; - OutputChar = RoundSigDigits(T_ProcInTemp, 2); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInTemp, 2); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxProcAirInTemp, 2); + OutputChar = format("{:.2R}", T_ProcInTemp); + OutputCharLo = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInTemp); + OutputCharHi = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxProcAirInTemp); if (T_ProcInTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInTemp) { T_ProcInTemp = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInTemp; } @@ -3937,7 +3964,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_ProcInTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ',' + CurMnDy + ' ' + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(T_ProcInTemp, 6); + CharValue = format("{:.6R}", T_ProcInTemp); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_ProcInTempBuffer3 = "...Regeneration outlet air temperature equation: process inlet air temperature passed to the model = " + CharValue; } else { @@ -3950,9 +3977,9 @@ namespace HeatRecovery { if (T_ProcInHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInHumRat || T_ProcInHumRat > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxProcAirInHumRat) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_ProcInHumRatLast = T_ProcInHumRat; - OutputChar = RoundSigDigits(T_ProcInHumRat, 6); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInHumRat, 6); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxProcAirInHumRat, 6); + OutputChar = format("{:.6R}", T_ProcInHumRat); + OutputCharLo = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInHumRat); + OutputCharHi = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxProcAirInHumRat); if (T_ProcInHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInHumRat) { T_ProcInHumRat = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInHumRat; } @@ -3972,7 +3999,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_ProcInHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(T_ProcInHumRat, 6); + CharValue = format("{:.6R}", T_ProcInHumRat); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_ProcInHumRatBuffer3 = "...Regeneration outlet air temperature equation: process inlet air humidity ratio passed to the model = " + CharValue; } else { @@ -3985,9 +4012,9 @@ namespace HeatRecovery { if (T_FaceVel < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinFaceVel || T_FaceVel > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxFaceVel) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_FaceVelLast = T_FaceVel; - OutputChar = RoundSigDigits(T_FaceVel, 6); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinFaceVel, 6); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxFaceVel, 6); + OutputChar = format("{:.6R}", T_FaceVel); + OutputCharLo = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinFaceVel); + OutputCharHi = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxFaceVel); if (T_FaceVel < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinFaceVel) { T_FaceVel = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinFaceVel; } @@ -4004,7 +4031,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_FaceVelBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(T_FaceVel, 6); + CharValue = format("{:.6R}", T_FaceVel); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_FaceVelBuffer3 = "...Regeneration outlet air temperature equation: process and regen face velocity passed to the model = " + CharValue; } else { @@ -4049,7 +4076,6 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4201,9 +4227,9 @@ namespace HeatRecovery { if (H_RegenInTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInTemp || H_RegenInTemp > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxRegenAirInTemp) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_RegenInTempLast = H_RegenInTemp; - OutputChar = RoundSigDigits(H_RegenInTemp, 2); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInTemp, 2); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxRegenAirInTemp, 2); + OutputChar = format("{:.2R}", H_RegenInTemp); + OutputCharLo = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInTemp); + OutputCharHi = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxRegenAirInTemp); if (H_RegenInTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInTemp) { H_RegenInTemp = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInTemp; } @@ -4220,7 +4246,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_RegenInTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + " , " + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(H_RegenInTemp, 2); + CharValue = format("{:.2R}", H_RegenInTemp); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_RegenInTempBuffer3 = "...Regeneration outlet air humidity ratio equation: regeneration inlet air temperature passed to the model = " + CharValue; } else { @@ -4233,9 +4259,9 @@ namespace HeatRecovery { if (H_RegenInHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInHumRat || H_RegenInHumRat > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxRegenAirInHumRat) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_RegenInHumRatLast = H_RegenInHumRat; - OutputChar = RoundSigDigits(H_RegenInHumRat, 6); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInHumRat, 6); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxRegenAirInHumRat, 6); + OutputChar = format("{:.6R}", H_RegenInHumRat); + OutputCharLo = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInHumRat); + OutputCharHi = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxRegenAirInHumRat); if (H_RegenInHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInHumRat) { H_RegenInHumRat = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInHumRat; } @@ -4252,7 +4278,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_RegenInHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(H_RegenInHumRat, 6); + CharValue = format("{:.6R}", H_RegenInHumRat); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_RegenInHumRatBuffer3 = "...Regeneration outlet air humidity ratio equation: regeneration inlet air humidity ratio passed to the model = " + CharValue; } else { @@ -4265,9 +4291,9 @@ namespace HeatRecovery { if (H_ProcInTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInTemp || H_ProcInTemp > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxProcAirInTemp) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_ProcInTempLast = H_ProcInTemp; - OutputChar = RoundSigDigits(H_ProcInTemp, 2); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInTemp, 2); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxProcAirInTemp, 2); + OutputChar = format("{:.2R}", H_ProcInTemp); + OutputCharLo = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInTemp); + OutputCharHi = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxProcAirInTemp); if (H_ProcInTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInTemp) { H_ProcInTemp = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInTemp; } @@ -4287,7 +4313,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_ProcInTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(H_ProcInTemp, 6); + CharValue = format("{:.6R}", H_ProcInTemp); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_ProcInTempBuffer3 = "...Regeneration outlet air humidity ratio equation: process inlet air temperature passed to the model = " + CharValue; } else { @@ -4300,9 +4326,9 @@ namespace HeatRecovery { if (H_ProcInHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInHumRat || H_ProcInHumRat > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxProcAirInHumRat) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_ProcInHumRatLast = H_ProcInHumRat; - OutputChar = RoundSigDigits(H_ProcInHumRat, 6); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInHumRat, 6); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxProcAirInHumRat, 6); + OutputChar = format("{:.6R}", H_ProcInHumRat); + OutputCharLo = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInHumRat); + OutputCharHi = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxProcAirInHumRat); if (H_ProcInHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInHumRat) { H_ProcInHumRat = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInHumRat; } @@ -4322,7 +4348,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_ProcInHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(H_ProcInHumRat, 6); + CharValue = format("{:.6R}", H_ProcInHumRat); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_ProcInHumRatBuffer3 = "...Regeneration outlet air humidity ratio equation: process inlet air humidity ratio passed to the model = " + CharValue; } else { @@ -4335,9 +4361,9 @@ namespace HeatRecovery { if (H_FaceVel < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinFaceVel || H_FaceVel > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxFaceVel) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_FaceVelLast = H_FaceVel; - OutputChar = RoundSigDigits(H_FaceVel, 6); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinFaceVel, 6); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxFaceVel, 6); + OutputChar = format("{:.6R}", H_FaceVel); + OutputCharLo = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinFaceVel); + OutputCharHi = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxFaceVel); if (H_FaceVel < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinFaceVel) { H_FaceVel = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinFaceVel; } @@ -4355,7 +4381,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_FaceVelBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(H_FaceVel, 6); + CharValue = format("{:.6R}", H_FaceVel); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_FaceVelBuffer3 = "...Regeneration outlet air humidity ratio equation: process and regeneration face velocity passed to the model = " + CharValue; } else { @@ -4397,7 +4423,6 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4477,8 +4502,8 @@ namespace HeatRecovery { // checking model regeneration outlet temperature to always be less than or equal to regeneration inlet temperature if (RegenOutTemp > RegenInTemp) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutTempFailedLast = RegenOutTemp; - OutputChar = RoundSigDigits(RegenOutTemp, 2); - OutputCharHi = RoundSigDigits(RegenInTemp, 2); + OutputChar = format("{:.2R}", RegenOutTemp); + OutputCharHi = format("{:.2R}", RegenInTemp); // IF(RegenOutTemp .GT. RegenInTemp)THEN // RegenOutTemp = RegenInTemp // END IF @@ -4491,7 +4516,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutTempFailedBuffer2 = "...Regen inlet air temperature = " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(RegenOutTemp, 6); + CharValue = format("{:.6R}", RegenOutTemp); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutTempFailedBuffer3 = "...Regen outlet air temperature equation: regeneration outlet air temperature allowed from the model = " + CharValue; } else { @@ -4506,9 +4531,9 @@ namespace HeatRecovery { if (RegenOutTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutTemp || RegenOutTemp > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MaxRegenAirOutTemp) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutTempLast = RegenOutTemp; - OutputChar = RoundSigDigits(RegenOutTemp, 2); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutTemp, 2); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MaxRegenAirOutTemp, 2); + OutputChar = format("{:.2R}", RegenOutTemp); + OutputCharLo = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutTemp); + OutputCharHi = format("{:.2R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MaxRegenAirOutTemp); if (RegenOutTemp < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutTemp) { RegenOutTemp = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutTemp; } @@ -4524,7 +4549,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(RegenOutTemp, 6); + CharValue = format("{:.6R}", RegenOutTemp); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutTempBuffer3 = "...Regen outlet air temperature equation: regeneration outlet air temperature allowed from the model = " + CharValue; } else { @@ -4566,7 +4591,6 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -4645,8 +4669,8 @@ namespace HeatRecovery { // checking for regeneration outlet humidity ratio less than or equal to regeneration inlet humidity ratio if (RegenOutHumRat < RegenInHumRat) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutHumRatFailedLast = RegenOutHumRat; - OutputChar = RoundSigDigits(RegenOutHumRat, 6); - OutputCharHi = RoundSigDigits(RegenInHumRat, 6); + OutputChar = format("{:.6R}", RegenOutHumRat); + OutputCharHi = format("{:.6R}", RegenInHumRat); // IF(RegenOutHumRat .LT. RegenInHumRat)THEN // RegenOutHumRat = RegenInHumRat // END IF @@ -4659,7 +4683,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutHumRatFailedBuffer2 = "...Regen inlet air humidity ratio = " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(RegenOutHumRat, 6); + CharValue = format("{:.6R}", RegenOutHumRat); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutHumRatFailedBuffer3 = "...Regen outlet air humidity ratio equation: regeneration outlet air humidity ratio allowed from the model = " + CharValue; } else { @@ -4674,9 +4698,9 @@ namespace HeatRecovery { if (RegenOutHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutHumRat || RegenOutHumRat > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MaxRegenAirOutHumRat) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutHumRatLast = RegenOutHumRat; - OutputChar = RoundSigDigits(RegenOutHumRat, 6); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutHumRat, 6); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MaxRegenAirOutHumRat, 6); + OutputChar = format("{:.6R}", RegenOutHumRat); + OutputCharLo = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutHumRat); + OutputCharHi = format("{:.6R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MaxRegenAirOutHumRat); if (RegenOutHumRat < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutHumRat) { RegenOutHumRat = BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).MinRegenAirOutHumRat; } @@ -4692,7 +4716,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(state); - CharValue = RoundSigDigits(RegenOutHumRat, 6); + CharValue = format("{:.6R}", RegenOutHumRat); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutHumRatBuffer3 = "...Regen outlet air humidity ratio equation: regeneration outlet air humidity ratio allowed from the model = " + CharValue; } else { @@ -4736,7 +4760,7 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + using Psychrometrics::PsyRhFnTdbWPb; // Locals @@ -4851,9 +4875,9 @@ namespace HeatRecovery { if (RegenInletRH < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInRelHum || RegenInletRH > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxRegenAirInRelHum) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenInRelHumTempLast = RegenInletRH * 100.0; - OutputChar = RoundSigDigits(RegenInletRH * 100.0, 1); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInRelHum * 100.0, 1); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxRegenAirInRelHum * 100.0, 1); + OutputChar = format("{:.1R}", RegenInletRH * 100.0); + OutputCharLo = format("{:.1R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinRegenAirInRelHum * 100.0); + OutputCharHi = format("{:.1R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxRegenAirInRelHum * 100.0); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).PrintRegenInRelHumTempMess = true; BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenInRelHumTempBuffer1 = @@ -4872,9 +4896,9 @@ namespace HeatRecovery { if (ProcInletRH < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInRelHum || ProcInletRH > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxProcAirInRelHum) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).ProcInRelHumTempLast = ProcInletRH * 100.0; - OutputChar = RoundSigDigits(ProcInletRH * 100.0, 1); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInRelHum * 100.0, 1); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxProcAirInRelHum * 100.0, 1); + OutputChar = format("{:.1R}", ProcInletRH * 100.0); + OutputCharLo = format("{:.1R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MinProcAirInRelHum * 100.0); + OutputCharHi = format("{:.1R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_MaxProcAirInRelHum * 100.0); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).PrintProcInRelHumTempMess = true; BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).ProcInRelHumTempBuffer1 = @@ -4923,7 +4947,7 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + using Psychrometrics::PsyRhFnTdbWPb; // Locals @@ -5039,9 +5063,9 @@ namespace HeatRecovery { if (RegenInletRH < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInRelHum || RegenInletRH > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxRegenAirInRelHum) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenInRelHumHumRatLast = RegenInletRH * 100.0; - OutputChar = RoundSigDigits(RegenInletRH * 100.0, 1); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInRelHum * 100.0, 1); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxRegenAirInRelHum * 100.0, 1); + OutputChar = format("{:.1R}", RegenInletRH * 100.0); + OutputCharLo = format("{:.1R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinRegenAirInRelHum * 100.0); + OutputCharHi = format("{:.1R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxRegenAirInRelHum * 100.0); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).PrintRegenInRelHumHumRatMess = true; BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenInRelHumHumRatBuffer1 = @@ -5060,9 +5084,9 @@ namespace HeatRecovery { if (ProcInletRH < BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInRelHum || ProcInletRH > BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxProcAirInRelHum) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).ProcInRelHumHumRatLast = ProcInletRH * 100.0; - OutputChar = RoundSigDigits(ProcInletRH * 100.0, 1); - OutputCharLo = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInRelHum * 100.0, 1); - OutputCharHi = RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxProcAirInRelHum * 100.0, 1); + OutputChar = format("{:.1R}", ProcInletRH * 100.0); + OutputCharLo = format("{:.1R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MinProcAirInRelHum * 100.0); + OutputCharHi = format("{:.1R}", BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_MaxProcAirInRelHum * 100.0); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).PrintProcInRelHumHumRatMess = true; BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).ProcInRelHumHumRatBuffer1 = @@ -5104,7 +5128,6 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -5168,8 +5191,8 @@ namespace HeatRecovery { ABSImbalancedFlow = std::abs(RegenInMassFlow - ProcessInMassFlow) / RegenInMassFlow; if (ABSImbalancedFlow > 0.02) { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).ABSImbalancedFlow = ABSImbalancedFlow; - OutputCharRegen = RoundSigDigits(RegenInMassFlow, 6); - OutputCharProc = RoundSigDigits(ProcessInMassFlow, 6); + OutputCharRegen = format("{:.6R}", RegenInMassFlow); + OutputCharProc = format("{:.6R}", ProcessInMassFlow); BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).PrintImbalancedMassFlowMess = true; BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).ImbalancedMassFlowBuffer1 = @@ -5451,7 +5474,6 @@ namespace HeatRecovery { // na // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index c4f038cc8d9..59c6d0ff55b 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -207,7 +206,6 @@ namespace HeatingCoils { // This subroutine manages HeatingCoil component simulation. // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -238,13 +236,20 @@ namespace HeatingCoils { } else { CoilNum = CompIndex; if (CoilNum > NumHeatingCoils || CoilNum < 1) { - ShowFatalError(state, "SimulateHeatingCoilComponents: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Number of Heating Coils=" + TrimSigDigits(NumHeatingCoils) + ", Coil name=" + CompName); + ShowFatalError(state, + format("SimulateHeatingCoilComponents: Invalid CompIndex passed={}, Number of Heating Coils={}, Coil name={}", + CoilNum, + NumHeatingCoils, + CompName)); } if (CheckEquipName(CoilNum)) { if (!CompName.empty() && CompName != HeatingCoil(CoilNum).Name) { - ShowFatalError(state, "SimulateHeatingCoilComponents: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Coil name=" + CompName + ", stored Coil Name for that index=" + HeatingCoil(CoilNum).Name); + ShowFatalError( + state, + format("SimulateHeatingCoilComponents: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + CoilNum, + CompName, + HeatingCoil(CoilNum).Name)); } CheckEquipName(CoilNum) = false; } @@ -1500,8 +1505,7 @@ namespace HeatingCoils { // Using/Aliasing using namespace DataSizing; - using General::RoundSigDigits; - using General::TrimSigDigits; + using namespace OutputReportPredefined; // Locals @@ -1617,9 +1621,8 @@ namespace HeatingCoils { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(NominalCapacityDes - NominalCapacityUser) / NominalCapacityUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHeatingCoil: Potential issue with equipment sizing for " + CompType + ", " + CompName); - ShowContinueError(state, "User-Specified Nominal Capacity of " + RoundSigDigits(NominalCapacityUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + RoundSigDigits(NominalCapacityDes, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NominalCapacityUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", NominalCapacityDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1639,11 +1642,15 @@ namespace HeatingCoils { // Ensure capacity at lower Stage must be lower or equal to the capacity at higher Stage. for (StageNum = 1; StageNum <= HeatingCoil(CoilNum).NumOfStages - 1; ++StageNum) { if (HeatingCoil(CoilNum).MSNominalCapacity(StageNum) > HeatingCoil(CoilNum).MSNominalCapacity(StageNum + 1)) { - ShowSevereError(state, "SizeHeatingCoil: " + HeatingCoil(CoilNum).HeatingCoilType + ' ' + HeatingCoil(CoilNum).Name + ", Stage " + - TrimSigDigits(StageNum) + " Nominal Capacity (" + - RoundSigDigits(HeatingCoil(CoilNum).MSNominalCapacity(StageNum), 2) + " W) must be less than or equal to Stage " + - TrimSigDigits(StageNum + 1) + " Nominal Capacity (" + - RoundSigDigits(HeatingCoil(CoilNum).MSNominalCapacity(StageNum + 1), 2) + " W)."); + ShowSevereError(state, + format("SizeHeatingCoil: {} {}, Stage {} Nominal Capacity ({:.2R} W) must be less than or equal to Stage {} " + "Nominal Capacity ({:.2R} W).", + HeatingCoil(CoilNum).HeatingCoilType, + HeatingCoil(CoilNum).Name, + StageNum, + HeatingCoil(CoilNum).MSNominalCapacity(StageNum), + StageNum + 1, + HeatingCoil(CoilNum).MSNominalCapacity(StageNum + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -1884,8 +1891,7 @@ namespace HeatingCoils { using DataHVACGlobals::ElecHeatingCoilPower; using DataHVACGlobals::MSHPMassFlowRateHigh; using DataHVACGlobals::MSHPMassFlowRateLow; - using General::RoundSigDigits; - using General::TrimSigDigits; + using Psychrometrics::PsyRhFnTdbWPb; using Psychrometrics::PsyTdbFnHW; using Psychrometrics::PsyTsatFnHPb; @@ -2097,7 +2103,6 @@ namespace HeatingCoils { using CurveManager::CurveValue; using DataHVACGlobals::TempControlTol; using FaultsManager::FaultsCoilSATSensor; - using General::TrimSigDigits; // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2220,8 +2225,7 @@ namespace HeatingCoils { ++HeatingCoil(CoilNum).PLFErrorCount; ShowWarningError(state, "CalcFuelHeatingCoil: " + cAllCoilTypes(HeatingCoil(CoilNum).HCoilType_Num) + "=\"" + HeatingCoil(CoilNum).Name + "\", PLF curve values"); - ShowContinueError(state, "The PLF curve value = " + TrimSigDigits(PLF, 5) + - " for part-load ratio = " + TrimSigDigits(PartLoadRat, 5)); + ShowContinueError(state, format("The PLF curve value = {:.5T} for part-load ratio = {:.5T}", PLF, PartLoadRat)); ShowContinueError(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and the simulation continues..."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:Fuel]."); } else { @@ -2239,7 +2243,7 @@ namespace HeatingCoils { ++HeatingCoil(CoilNum).RTFErrorCount; ShowWarningError(state, "CalcFuelHeatingCoil: " + cAllCoilTypes(HeatingCoil(CoilNum).HCoilType_Num) + "=\"" + HeatingCoil(CoilNum).Name + "\", runtime fraction"); - ShowContinueError(state, "The runtime fraction exceeded 1.0. [" + TrimSigDigits(HeatingCoil(CoilNum).RTF, 4) + "]."); + ShowContinueError(state, format("The runtime fraction exceeded 1.0. [{:.4T}].", HeatingCoil(CoilNum).RTF)); ShowContinueError(state, "Runtime fraction is set to 1.0 and the simulation continues..."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:Fuel]."); } else { @@ -2314,8 +2318,7 @@ namespace HeatingCoils { using DataHVACGlobals::ElecHeatingCoilPower; using DataHVACGlobals::MSHPMassFlowRateHigh; using DataHVACGlobals::MSHPMassFlowRateLow; - using General::RoundSigDigits; - using General::TrimSigDigits; + using Psychrometrics::PsyRhFnTdbWPb; using Psychrometrics::PsyTdbFnHW; using Psychrometrics::PsyTsatFnHPb; @@ -2516,8 +2519,7 @@ namespace HeatingCoils { ++HeatingCoil(CoilNum).PLFErrorCount; ShowWarningError(state, "CalcFuelHeatingCoil: " + cAllCoilTypes(HeatingCoil(CoilNum).HCoilType_Num) + "=\"" + HeatingCoil(CoilNum).Name + "\", PLF curve values"); - ShowContinueError(state, "The PLF curve value = " + TrimSigDigits(PLF, 5) + - " for part-load ratio = " + TrimSigDigits(PartLoadRat, 5)); + ShowContinueError(state, format("The PLF curve value = {:.5T} for part-load ratio = {:.5T}", PLF, PartLoadRat)); ShowContinueError(state, "PLF curve values must be >= 0.7. PLF has been reset to 0.7 and the simulation continues..."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:Fuel]."); } else { @@ -2535,7 +2537,7 @@ namespace HeatingCoils { ++HeatingCoil(CoilNum).RTFErrorCount; ShowWarningError(state, "CalcFuelHeatingCoil: " + cAllCoilTypes(HeatingCoil(CoilNum).HCoilType_Num) + "=\"" + HeatingCoil(CoilNum).Name + "\", runtime fraction"); - ShowContinueError(state, "The runtime fraction exceeded 1.0. [" + TrimSigDigits(HeatingCoil(CoilNum).RTF, 4) + "]."); + ShowContinueError(state, format("The runtime fraction exceeded 1.0. [{:.4T}].", HeatingCoil(CoilNum).RTF)); ShowContinueError(state, "Runtime fraction is set to 1.0 and the simulation continues..."); ShowContinueError(state, "Check the IO reference manual for PLF curve guidance [Coil:Heating:Fuel]."); } else { @@ -2967,7 +2969,6 @@ namespace HeatingCoils { // the heating coil is scheduled to be on. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CoilNum; @@ -2995,12 +2996,18 @@ namespace HeatingCoils { } else { CoilNum = CompIndex; if (CoilNum > NumHeatingCoils || CoilNum < 1) { - ShowFatalError(state, "CheckHeatingCoilSchedule: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Number of Heating Coils=" + TrimSigDigits(NumHeatingCoils) + ", Coil name=" + CompName); + ShowFatalError(state, + format("CheckHeatingCoilSchedule: Invalid CompIndex passed={}, Number of Heating Coils={}, Coil name={}", + CoilNum, + NumHeatingCoils, + CompName)); } if (CompName != HeatingCoil(CoilNum).Name) { - ShowSevereError(state, "CheckHeatingCoilSchedule: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + ", Coil name=" + CompName + - ", stored Coil Name for that index=" + HeatingCoil(CoilNum).Name); + ShowSevereError(state, + format("CheckHeatingCoilSchedule: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + CoilNum, + CompName, + HeatingCoil(CoilNum).Name)); ShowContinueError(state, "...expected type=\"" + CompType + "\", actual type=\"" + cAllCoilTypes(HeatingCoil(CoilNum).HCoilType_Num) + "\"."); ShowFatalError(state, "Program terminates due to preceding conditions."); @@ -3575,7 +3582,6 @@ namespace HeatingCoils { // This function sets data to Heating Coil using the coil index and arguments passed // Using/Aliasing - using General::TrimSigDigits; if (GetCoilsInputFlag) { GetHeatingCoilInput(state); @@ -3583,8 +3589,8 @@ namespace HeatingCoils { } if (CoilNum <= 0 || CoilNum > NumHeatingCoils) { - ShowSevereError(state, "SetHeatingCoilData: called with heating coil Number out of range=" + TrimSigDigits(CoilNum) + " should be >0 and <" + - TrimSigDigits(NumHeatingCoils)); + ShowSevereError( + state, format("SetHeatingCoilData: called with heating coil Number out of range={} should be >0 and <{}", CoilNum, NumHeatingCoils)); ErrorsFound = true; return; } diff --git a/src/EnergyPlus/HighTempRadiantSystem.cc b/src/EnergyPlus/HighTempRadiantSystem.cc index 85135d35c96..e468c668b6f 100644 --- a/src/EnergyPlus/HighTempRadiantSystem.cc +++ b/src/EnergyPlus/HighTempRadiantSystem.cc @@ -60,9 +60,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -201,7 +201,6 @@ namespace HighTempRadiantSystem { // Standard EnergyPlus manager subroutine layout // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool ErrorsFoundInGet; // Set to true when there are severe errors during the Get routine @@ -225,13 +224,19 @@ namespace HighTempRadiantSystem { } else { RadSysNum = CompIndex; if (RadSysNum > NumOfHighTempRadSys || RadSysNum < 1) { - ShowFatalError(state, "SimHighTempRadiantSystem: Invalid CompIndex passed=" + TrimSigDigits(RadSysNum) + - ", Number of Units=" + TrimSigDigits(NumOfHighTempRadSys) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimHighTempRadiantSystem: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + RadSysNum, + NumOfHighTempRadSys, + CompName)); } if (CheckEquipName(RadSysNum)) { if (CompName != HighTempRadSys(RadSysNum).Name) { - ShowFatalError(state, "SimHighTempRadiantSystem: Invalid CompIndex passed=" + TrimSigDigits(RadSysNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + HighTempRadSys(RadSysNum).Name); + ShowFatalError(state, + format("SimHighTempRadiantSystem: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + RadSysNum, + CompName, + HighTempRadSys(RadSysNum).Name)); } CheckEquipName(RadSysNum) = false; } @@ -277,7 +282,7 @@ namespace HighTempRadiantSystem { using DataSizing::CapacityPerFloorArea; using DataSizing::FractionOfAutosizedHeatingCapacity; using DataSizing::HeatingDesignCapacity; - using General::TrimSigDigits; + using ScheduleManager::GetScheduleIndex; using namespace DataIPShortCuts; @@ -370,8 +375,10 @@ namespace HighTempRadiantSystem { HighTempRadSys(Item).ScaledHeatingCapacity = rNumericArgs(iHeatDesignCapacityNumericNum); if (HighTempRadSys(Item).ScaledHeatingCapacity < 0.0 && HighTempRadSys(Item).ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + HighTempRadSys(Item).Name); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatDesignCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatDesignCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatDesignCapacityNumericNum), + rNumericArgs(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } } else { @@ -387,8 +394,10 @@ namespace HighTempRadiantSystem { if (HighTempRadSys(Item).ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + HighTempRadSys(Item).Name); ShowContinueError(state, "Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum), + rNumericArgs(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } else if (HighTempRadSys(Item).ScaledHeatingCapacity == AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + HighTempRadSys(Item).Name); @@ -408,8 +417,10 @@ namespace HighTempRadiantSystem { HighTempRadSys(Item).ScaledHeatingCapacity = rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); if (HighTempRadSys(Item).ScaledHeatingCapacity < 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + HighTempRadSys(Item).Name); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum), + rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -601,12 +612,13 @@ namespace HighTempRadiantSystem { FracOfRadPotentiallyLost = 1.0 - AllFracsSummed; ShowSevereError(state, "Fraction of radiation distributed to surfaces and people sums up to less than 1 for " + cAlphaArgs(1)); ShowContinueError(state, "This would result in some of the radiant energy delivered by the high temp radiant heater being lost."); - ShowContinueError(state, "The sum of all radiation fractions to surfaces = " + TrimSigDigits(TotalFracToSurfs, 5)); - ShowContinueError(state, "The radiant fraction to people = " + TrimSigDigits(HighTempRadSys(Item).FracDistribPerson, 5)); - ShowContinueError(state, "So, all radiant fractions including surfaces and people = " + TrimSigDigits(AllFracsSummed, 5)); + ShowContinueError(state, format("The sum of all radiation fractions to surfaces = {:.5T}", TotalFracToSurfs)); + ShowContinueError(state, format("The radiant fraction to people = {:.5T}", HighTempRadSys(Item).FracDistribPerson)); + ShowContinueError(state, format("So, all radiant fractions including surfaces and people = {:.5T}", AllFracsSummed)); ShowContinueError(state, - "This means that the fraction of radiant energy that would be lost from the high temperature radiant heater would be = " + - TrimSigDigits(FracOfRadPotentiallyLost, 5)); + format("This means that the fraction of radiant energy that would be lost from the high temperature radiant heater " + "would be = {:.5T}", + FracOfRadPotentiallyLost)); ShowContinueError(state, "Please check and correct this so that all radiant energy is accounted for in " + cCurrentModuleObject + " = " + cAlphaArgs(1)); ErrorsFound = true; @@ -791,7 +803,6 @@ namespace HighTempRadiantSystem { using namespace DataSizing; using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1324,7 +1335,6 @@ namespace HighTempRadiantSystem { using DataHeatBalFanSys::SumConvHTRadSys; using DataHeatBalFanSys::SumLatentHTRadSys; using DataSurfaces::Surface; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1374,16 +1384,16 @@ namespace HighTempRadiantSystem { if (ThisSurfIntensity > MaxRadHeatFlux) { // CR 8074, trap for excessive intensity (throws off surface balance ) ShowSevereError(state, "DistributeHTRadGains: excessive thermal radiation heat flux intensity detected"); ShowContinueError(state, "Surface = " + Surface(SurfNum).Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(Surface(SurfNum).Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", Surface(SurfNum).Area)); ShowContinueError(state, "Occurs in ZoneHVAC:HighTemperatureRadiant = " + HighTempRadSys(RadSysNum).Name); - ShowContinueError(state, "Radiation intensity = " + RoundSigDigits(ThisSurfIntensity, 2) + " [W/m2]"); + ShowContinueError(state, format("Radiation intensity = {:.2R} [W/m2]", ThisSurfIntensity)); ShowContinueError(state, "Assign a larger surface area or more surfaces in ZoneHVAC:HighTemperatureRadiant"); ShowFatalError(state, "DistributeHTRadGains: excessive thermal radiation heat flux intensity detected"); } } else { // small surface ShowSevereError(state, "DistributeHTRadGains: surface not large enough to receive thermal radiation heat flux"); ShowContinueError(state, "Surface = " + Surface(SurfNum).Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(Surface(SurfNum).Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", Surface(SurfNum).Area)); ShowContinueError(state, "Occurs in ZoneHVAC:HighTemperatureRadiant = " + HighTempRadSys(RadSysNum).Name); ShowContinueError(state, "Assign a larger surface area or more surfaces in ZoneHVAC:HighTemperatureRadiant"); ShowFatalError(state, "DistributeHTRadGains: surface not large enough to receive thermal radiation heat flux"); diff --git a/src/EnergyPlus/Humidifiers.cc b/src/EnergyPlus/Humidifiers.cc index 4b1fe1a997a..867eaeee0ff 100644 --- a/src/EnergyPlus/Humidifiers.cc +++ b/src/EnergyPlus/Humidifiers.cc @@ -167,7 +167,6 @@ namespace Humidifiers { // Manage the simulation of an air humidifier // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int HumNum; // index of humidifier unit being simulated @@ -188,13 +187,17 @@ namespace Humidifiers { } else { HumNum = CompIndex; if (HumNum > NumHumidifiers || HumNum < 1) { - ShowFatalError(state, "SimHumidifier: Invalid CompIndex passed=" + TrimSigDigits(HumNum) + - ", Number of Units=" + TrimSigDigits(NumHumidifiers) + ", Entered Unit name=" + CompName); + ShowFatalError( + state, + format("SimHumidifier: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", HumNum, NumHumidifiers, CompName)); } if (CheckEquipName(HumNum)) { if (CompName != Humidifier(HumNum).Name) { - ShowFatalError(state, "SimHumidifier: Invalid CompIndex passed=" + TrimSigDigits(HumNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + Humidifier(HumNum).Name); + ShowFatalError(state, + format("SimHumidifier: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + HumNum, + CompName, + Humidifier(HumNum).Name)); } CheckEquipName(HumNum) = false; } @@ -222,7 +225,7 @@ namespace Humidifiers { thisHum.CalcGasSteamHumidifier(state, WaterAddNeeded); } else { - ShowSevereError(state, "SimHumidifier: Invalid Humidifier Type Code=" + TrimSigDigits(thisHum.HumType_Code)); + ShowSevereError(state, format("SimHumidifier: Invalid Humidifier Type Code={}", thisHum.HumType_Code)); ShowContinueError(state, "...Component Name=[" + CompName + "]."); ShowFatalError(state, "Preceding Condition causes termination."); } @@ -732,7 +735,7 @@ namespace Humidifiers { using FluidProperties::FindRefrigerant; using FluidProperties::GetSatEnthalpyRefrig; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::RhoH2O; @@ -876,9 +879,8 @@ namespace Humidifiers { if ((std::abs(NomCapVolDes - NomCapVolUser) / NomCapVolUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHumidifier: Potential issue with equipment sizing for " + HumidifierType(HumType_Code) + " = \"" + Name + "\"."); - ShowContinueError(state, "User-Specified Nominal Capacity Volume of " + RoundSigDigits(NomCapVolUser, 2) + " [Wm3/s]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity Volume of " + RoundSigDigits(NomCapVolDes, 2) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Nominal Capacity Volume of {:.2R} [Wm3/s]", NomCapVolUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity Volume of {:.2R} [m3/s]", NomCapVolDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -909,11 +911,13 @@ namespace Humidifiers { } else { ShowMessage(state, CalledFrom + ": capacity and thermal efficiency mismatch for " + HumidifierType(HumType_Code) + " =\"" + Name + "\"."); - ShowContinueError(state, "User-Specified Rated Gas Use Rate of " + RoundSigDigits(NomPower, 2) + " [W]"); - ShowContinueError(state, "User-Specified or Autosized Rated Capacity of " + RoundSigDigits(NomCapVol, 2) + " [m3/s]"); - ShowContinueError(state, "Rated Gas Use Rate at the Rated Capacity of " + RoundSigDigits(NomCapVol, 2) + " [m3/s]" + - " must be greater than the ideal, i.e., 100% thermal efficiency gas use rate of " + - RoundSigDigits(NomPowerDes, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Rated Gas Use Rate of {:.2R} [W]", NomPower)); + ShowContinueError(state, format("User-Specified or Autosized Rated Capacity of {:.2R} [m3/s]", NomCapVol)); + ShowContinueError(state, + format("Rated Gas Use Rate at the Rated Capacity of {:.2R} [m3/s] must be greater than the ideal, i.e., " + "100% thermal efficiency gas use rate of {:.2R} [W]", + NomCapVol, + NomPowerDes)); ShowContinueError(state, "Resize the Rated Gas Use Rate by dividing the ideal gas use rate with expected thermal efficiency. "); // Changing this from a hard-stop condition to just a limiting condition of eta=1.0 // ErrorsFound = true; @@ -946,8 +950,8 @@ namespace Humidifiers { if ((std::abs(NomPowerDes - NomPowerUser) / NomPowerUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHumidifier: Potential issue with equipment sizing for " + HumidifierType(HumType_Code) + " =\"" + Name + "\"."); - ShowContinueError(state, "User-Specified Rated Power of " + RoundSigDigits(NomPowerUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Rated Power of " + RoundSigDigits(NomPowerDes, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Rated Power of {:.2R} [W]", NomPowerUser)); + ShowContinueError(state, format("differs from Design Size Rated Power of {:.2R} [W]", NomPowerDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -955,8 +959,8 @@ namespace Humidifiers { if (NomPower < NominalPower) { ShowWarningError(state, HumidifierType(HumType_Code) + ": specified Rated Power is less than nominal Rated Power for " + ModuleObjectType + " steam humidifier = " + Name + ". "); - ShowContinueError(state, " specified Rated Power = " + RoundSigDigits(NomPower, 2)); - ShowContinueError(state, " while expecting a minimum Rated Power = " + RoundSigDigits(NominalPower, 2)); + ShowContinueError(state, format(" specified Rated Power = {:.2R}", NomPower)); + ShowContinueError(state, format(" while expecting a minimum Rated Power = {:.2R}", NominalPower)); } } else { ShowWarningError(state, HumidifierType(HumType_Code) + ": specified nominal capacity is zero for " + ModuleObjectType + diff --git a/src/EnergyPlus/HybridEvapCoolingModel.cc b/src/EnergyPlus/HybridEvapCoolingModel.cc index 3ac49f710c2..3c99900baf3 100644 --- a/src/EnergyPlus/HybridEvapCoolingModel.cc +++ b/src/EnergyPlus/HybridEvapCoolingModel.cc @@ -1248,7 +1248,7 @@ namespace HybridEvapCoolingModel { // na // Using/Aliasing - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: // The CStepInputs are defined in the CStepInputs class definition. @@ -1633,22 +1633,35 @@ namespace HybridEvapCoolingModel { // day, so report", but that doesn't seem to exist. if ((TimeElapsed > 24) && WarnOnceFlag && !state.dataGlobal->WarmupFlag) { if (count_EnvironmentConditionsNotMet > 0) - ShowWarningError(state, "In day " + RoundSigDigits((Real64)state.dataGlobal->DayOfSim, 1) + " of simulation, " + Name.c_str() + " was unable to operate for " + - RoundSigDigits((Real64)count_EnvironmentConditionsNotMet, 1) + - " timesteps because environment conditions were beyond the allowable operating range for any mode."); + ShowWarningError(state, + format("In day {:.1R} was unable to operate for of simulation, {}{:.1R} timesteps because environment conditions " + "were beyond the allowable operating range for any mode.", + (Real64)state.dataGlobal->DayOfSim, + Name, + (Real64)count_EnvironmentConditionsNotMet)); if (count_SAHR_OC_MetOnce > 0) - ShowWarningError(state, "In day " + RoundSigDigits((Real64)state.dataGlobal->DayOfSim, 1) + " of simulation, " + Name.c_str() + - " failed to meet supply air humidity ratio for " + RoundSigDigits(Real64(count_SAHR_OC_MetOnce), 1) + - " time steps. For these time steps For these time steps" + Name.c_str() + " was set to mode 0"); + ShowWarningError(state, + format("In day {:.1R} of simulation, {} failed to meet supply air humidity ratio for {:.1R} time steps. For these " + "time steps For these time steps was set to mode 0{}", + (Real64)state.dataGlobal->DayOfSim, + Name, + Real64(count_SAHR_OC_MetOnce), + Name)); if (count_SAT_OC_MetOnce > 0) - ShowWarningError(state, "In day " + RoundSigDigits((Real64)state.dataGlobal->DayOfSim, 1) + " of simulation, " + Name.c_str() + - " failed to meet supply air temperature constraints for " + RoundSigDigits(Real64(count_SAT_OC_MetOnce), 1) + - " time steps. For these time steps For these time steps" + Name.c_str() + " was set to mode 0"); - - ShowWarningError(state, "In day " + RoundSigDigits((Real64)state.dataGlobal->DayOfSim, 1) + " of simulation, " + Name.c_str() + - " failed to satisfy sensible load for " + RoundSigDigits((Real64)count_DidWeNotMeetLoad, 1) + - " time steps. For these time steps settings were selected to provide as much sensible cooling or heating as possible, " - "given other constraints."); + ShowWarningError(state, + format("In day {:.1R} of simulation, {} failed to meet supply air temperature constraints for {:.1R} time steps. " + "For these time steps For these time steps{} was set to mode 0", + (Real64)state.dataGlobal->DayOfSim, + Name, + Real64(count_SAT_OC_MetOnce), + Name)); + + ShowWarningError(state, + format("In day {:.1R} of simulation, {} failed to satisfy sensible load for {:.1R} time steps. For these time steps " + "settings were selected to provide as much sensible cooling or heating as possible, given other constraints.", + (Real64)state.dataGlobal->DayOfSim, + Name, + (Real64)count_DidWeNotMeetLoad)); count_SAT_OC_MetOnce = 0; count_DidWeNotMeetLoad = 0; diff --git a/src/EnergyPlus/HybridUnitaryAirConditioners.cc b/src/EnergyPlus/HybridUnitaryAirConditioners.cc index f799b5e50e8..3ac50eb9bb7 100644 --- a/src/EnergyPlus/HybridUnitaryAirConditioners.cc +++ b/src/EnergyPlus/HybridUnitaryAirConditioners.cc @@ -120,7 +120,7 @@ namespace HybridUnitaryAirConditioners { // na // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CompNum; bool errorsfound = false; @@ -138,13 +138,20 @@ namespace HybridUnitaryAirConditioners { } else { CompNum = CompIndex; if (CompNum < 1 || CompNum > NumZoneHybridEvap) { - ShowFatalError(state, "SimZoneHybridUnitaryAirConditioners: Invalid CompIndex passed=" + TrimSigDigits(CompNum) + - ", Number of units =" + TrimSigDigits(NumZoneHybridEvap) + ", Entered Unit name = " + CompName); + ShowFatalError(state, + format("SimZoneHybridUnitaryAirConditioners: Invalid CompIndex passed={}, Number of units ={}, Entered Unit name = {}", + CompNum, + NumZoneHybridEvap, + CompName)); } if (CheckZoneHybridEvapName(CompNum)) { if (CompName != ZoneHybridUnitaryAirConditioner(CompNum).Name) { - ShowFatalError(state, "SimZoneHybridUnitaryAirConditioners: Invalid CompIndex passed=" + TrimSigDigits(CompNum) + - ", Unit name=" + CompName + ", stored unit name for that index=" + ZoneHybridUnitaryAirConditioner(CompNum).Name); + ShowFatalError( + state, + format("SimZoneHybridUnitaryAirConditioners: Invalid CompIndex passed={}, Unit name={}, stored unit name for that index={}", + CompNum, + CompName, + ZoneHybridUnitaryAirConditioner(CompNum).Name)); } CheckZoneHybridEvapName(CompNum) = false; } @@ -152,22 +159,34 @@ namespace HybridUnitaryAirConditioners { try { InitZoneHybridUnitaryAirConditioners(state, CompNum, ZoneNum); } catch (int e) { - ShowFatalError(state, "An exception occurred in InitZoneHybridUnitaryAirConditioners" + TrimSigDigits(CompNum) + ", Unit name=" + CompName + - ", stored unit name for that index=" + ZoneHybridUnitaryAirConditioner(CompNum).Name + ". Please check idf."); + ShowFatalError(state, + format("An exception occurred in InitZoneHybridUnitaryAirConditioners{}, Unit name={}, stored unit name for that " + "index={}. Please check idf.", + CompNum, + CompName, + ZoneHybridUnitaryAirConditioner(CompNum).Name)); return; } try { CalcZoneHybridUnitaryAirConditioners(state, CompNum, ZoneNum, SensibleOutputProvided, LatentOutputProvided); } catch (int e) { - ShowFatalError(state, "An exception occurred in CalcZoneHybridUnitaryAirConditioners" + TrimSigDigits(CompNum) + ", Unit name=" + CompName + - ", stored unit name for that index=" + ZoneHybridUnitaryAirConditioner(CompNum).Name + ". Please check idf."); + ShowFatalError(state, + format("An exception occurred in CalcZoneHybridUnitaryAirConditioners{}, Unit name={}, stored unit name for that " + "index={}. Please check idf.", + CompNum, + CompName, + ZoneHybridUnitaryAirConditioner(CompNum).Name)); return; } try { ReportZoneHybridUnitaryAirConditioners(CompNum); } catch (int e) { - ShowFatalError(state, "An exception occurred in ReportZoneHybridUnitaryAirConditioners" + TrimSigDigits(CompNum) + ", Unit name=" + CompName + - ", stored unit name for that index=" + ZoneHybridUnitaryAirConditioner(CompNum).Name + ". Please check idf."); + ShowFatalError(state, + format("An exception occurred in ReportZoneHybridUnitaryAirConditioners{}, Unit name={}, stored unit name for that " + "index={}. Please check idf.", + CompNum, + CompName, + ZoneHybridUnitaryAirConditioner(CompNum).Name)); return; } } @@ -1177,31 +1196,36 @@ namespace HybridUnitaryAirConditioners { int index = 0; for (auto &thisSetting : ZoneHybridUnitaryAirConditioner(UnitLoop).CurrentOperatingSettings) { - SetupOutputVariable(state, "Zone Hybrid Unitary HVAC Runtime Fraction in Setting " + std::to_string(index), + SetupOutputVariable(state, + format("Zone Hybrid Unitary HVAC Runtime Fraction in Setting {}", index), OutputProcessor::Unit::None, thisSetting.Runtime_Fraction, "Zone", "Average", ZoneHybridUnitaryAirConditioner(UnitLoop).Name); - SetupOutputVariable(state, "Zone Hybrid Unitary HVAC Mode in Setting " + std::to_string(index), + SetupOutputVariable(state, + format("Zone Hybrid Unitary HVAC Mode in Setting {}", index), OutputProcessor::Unit::None, thisSetting.Mode, "Zone", "Average", ZoneHybridUnitaryAirConditioner(UnitLoop).Name); - SetupOutputVariable(state, "Zone Hybrid Unitary HVAC Outdoor Air Fraction in Setting " + std::to_string(index), + SetupOutputVariable(state, + format("Zone Hybrid Unitary HVAC Outdoor Air Fraction in Setting {}", index), OutputProcessor::Unit::kg_s, thisSetting.Outdoor_Air_Fraction, "Zone", "Average", ZoneHybridUnitaryAirConditioner(UnitLoop).Name); - SetupOutputVariable(state, "Zone Hybrid Unitary HVAC Supply Air Mass Flow Rate in Setting " + std::to_string(index), + SetupOutputVariable(state, + format("Zone Hybrid Unitary HVAC Supply Air Mass Flow Rate in Setting {}", index), OutputProcessor::Unit::kg_s, thisSetting.Unscaled_Supply_Air_Mass_Flow_Rate, "Zone", "Average", ZoneHybridUnitaryAirConditioner(UnitLoop).Name); - SetupOutputVariable(state, "Zone Hybrid Unitary HVAC Supply Air Mass Flow Rate Ratio in Setting " + std::to_string(index), + SetupOutputVariable(state, + format("Zone Hybrid Unitary HVAC Supply Air Mass Flow Rate Ratio in Setting {}", index), OutputProcessor::Unit::None, thisSetting.Supply_Air_Mass_Flow_Rate_Ratio, "Zone", diff --git a/src/EnergyPlus/ICEngineElectricGenerator.cc b/src/EnergyPlus/ICEngineElectricGenerator.cc index efdae6ef6fd..8fa66ef76f6 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.cc +++ b/src/EnergyPlus/ICEngineElectricGenerator.cc @@ -175,7 +175,7 @@ namespace ICEngineElectricGenerator { ICEngineGenerator(genNum).RatedPowerOutput = NumArray(1); if (NumArray(1) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + General::RoundSigDigits(NumArray(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), NumArray(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ErrorsFound = true; } @@ -232,9 +232,9 @@ namespace ICEngineElectricGenerator { Real64 xValue = CurveManager::CurveValue(state, ICEngineGenerator(genNum).ExhaustTempCurve, 1.0); if (xValue < ReferenceTemp) { ShowSevereError(state, "GetICEngineGeneratorInput: " + DataIPShortCuts::cAlphaFieldNames(7) + " output has very low value."); - ShowContinueError(state, "...curve generates [" + General::RoundSigDigits(xValue, 3) + " C] at PLR=1.0"); - ShowContinueError(state, "...this is less than the Reference Temperature [" + General::RoundSigDigits(ReferenceTemp, 2) + - " C] and may cause errors."); + ShowContinueError(state, format("...curve generates [{:.3R} C] at PLR=1.0", xValue)); + ShowContinueError(state, + format("...this is less than the Reference Temperature [{:.2R} C] and may cause errors.", ReferenceTemp)); } } @@ -580,8 +580,7 @@ namespace ICEngineElectricGenerator { if (this->ErrExhaustTempIndex == 0) { ShowWarningMessage(state, "CalcICEngineGeneratorModel: " + this->TypeOf + "=\"" + this->Name + "\" low Exhaust Temperature from Curve Value"); - ShowContinueError(state, "...curve generated temperature=[" + General::RoundSigDigits(exhaustTemp, 3) + " C], PLR=[" + - General::RoundSigDigits(PLR, 3) + "]."); + ShowContinueError(state, format("...curve generated temperature=[{:.3R} C], PLR=[{:.3R}].", exhaustTemp, PLR)); ShowContinueError(state, "...simulation will continue with exhaust heat reclaim set to 0."); } ShowRecurringWarningErrorAtEnd(state, "CalcICEngineGeneratorModel: " + this->TypeOf + "=\"" + this->Name + diff --git a/src/EnergyPlus/IOFiles.hh b/src/EnergyPlus/IOFiles.hh index c757ed30fd6..6245d8c4dad 100644 --- a/src/EnergyPlus/IOFiles.hh +++ b/src/EnergyPlus/IOFiles.hh @@ -466,9 +466,9 @@ template void print(InputIterator first, InputIterator las std::copy(first, last, std::ostream_iterator::value_type>(*outputStream)); } -template std::string format(fmt::string_view format_str, const Args &... args) +template std::string format(::fmt::string_view format_str, const Args &... args) { - return EnergyPlus::vprint(format_str, fmt::make_format_args(args...), sizeof...(Args)); + return EnergyPlus::vprint(format_str, ::fmt::make_format_args(args...), sizeof...(Args)); } } // namespace EnergyPlus diff --git a/src/EnergyPlus/IceThermalStorage.cc b/src/EnergyPlus/IceThermalStorage.cc index 15cdecb9f33..05acdb5aa6a 100644 --- a/src/EnergyPlus/IceThermalStorage.cc +++ b/src/EnergyPlus/IceThermalStorage.cc @@ -770,8 +770,7 @@ namespace IceThermalStorage { SimpleIceStorage(iceNum).ITSNomCap = DataIPShortCuts::rNumericArgs(1) * 1.e+09; if (DataIPShortCuts::rNumericArgs(1) == 0.0) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowContinueError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ErrorsFound = true; } @@ -870,8 +869,7 @@ namespace IceThermalStorage { DetailedIceStorage(iceNum).NomCapacity = DataIPShortCuts::rNumericArgs(1) * (1.e+09) / (DataGlobalConstants::SecInHour()); if (DataIPShortCuts::rNumericArgs(1) <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } @@ -986,8 +984,7 @@ namespace IceThermalStorage { DetailedIceStorage(iceNum).CurveFitTimeStep = DataIPShortCuts::rNumericArgs(2); if ((DetailedIceStorage(iceNum).CurveFitTimeStep <= 0.0) || (DetailedIceStorage(iceNum).CurveFitTimeStep > 1.0)) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 3)); + ShowSevereError(state, format("Invalid {}={:.3R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Curve fit time step invalid, less than zero or greater than 1 for " + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; @@ -1014,32 +1011,29 @@ namespace IceThermalStorage { DetailedIceStorage(iceNum).FreezingTemp = DataIPShortCuts::rNumericArgs(6); if ((DetailedIceStorage(iceNum).DischargeParaElecLoad < 0.0) || (DetailedIceStorage(iceNum).DischargeParaElecLoad > 1.0)) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(3) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(3), 3)); + ShowSevereError(state, format("Invalid {}={:.3R}", DataIPShortCuts::cNumericFieldNames(3), DataIPShortCuts::rNumericArgs(3))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value is either less than/equal to zero or greater than 1"); ErrorsFound = true; } if ((DetailedIceStorage(iceNum).ChargeParaElecLoad < 0.0) || (DetailedIceStorage(iceNum).ChargeParaElecLoad > 1.0)) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(4) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(4), 3)); + ShowSevereError(state, format("Invalid {}={:.3R}", DataIPShortCuts::cNumericFieldNames(4), DataIPShortCuts::rNumericArgs(4))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value is either less than/equal to zero or greater than 1"); ErrorsFound = true; } if ((DetailedIceStorage(iceNum).TankLossCoeff < 0.0) || (DetailedIceStorage(iceNum).TankLossCoeff > 0.1)) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(5) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(5), 3)); + ShowSevereError(state, format("Invalid {}={:.3R}", DataIPShortCuts::cNumericFieldNames(5), DataIPShortCuts::rNumericArgs(5))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value is either less than/equal to zero or greater than 0.1 (10%)"); ErrorsFound = true; } if ((DetailedIceStorage(iceNum).FreezingTemp < -10.0) || (DetailedIceStorage(iceNum).FreezingTemp > 10.0)) { - ShowWarningError(state, "Potentially invalid " + DataIPShortCuts::cNumericFieldNames(6) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(6), 3)); + ShowWarningError(state, + format("Potentially invalid {}={:.3R}", DataIPShortCuts::cNumericFieldNames(6), DataIPShortCuts::rNumericArgs(6))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value is either less than -10.0C or greater than 10.0C"); ShowContinueError(state, "This value will be allowed but the user should verify that this temperature is correct"); diff --git a/src/EnergyPlus/InputProcessing/IdfParser.cc b/src/EnergyPlus/InputProcessing/IdfParser.cc index cd0807faa71..70d81b7edfe 100644 --- a/src/EnergyPlus/InputProcessing/IdfParser.cc +++ b/src/EnergyPlus/InputProcessing/IdfParser.cc @@ -46,6 +46,7 @@ // POSSIBILITY OF SUCH DAMAGE. #include +#include #include #include @@ -212,8 +213,7 @@ json IdfParser::parse_idf(std::string const &idf, size_t &index, bool &success, next_token(idf, index); continue; } else if (token == Token::COMMA) { - errors_.emplace_back("Line: " + std::to_string(cur_line_num) + " Index: " + std::to_string(index_into_cur_line) + - " - Extraneous comma found."); + errors_.emplace_back(fmt::format("Line: {} Index: {} - Extraneous comma found.", cur_line_num, index_into_cur_line)); success = false; return root; } else if (token == Token::EXCLAMATION) { @@ -223,18 +223,18 @@ json IdfParser::parse_idf(std::string const &idf, size_t &index, bool &success, auto const parsed_obj_name = parse_string(idf, index, success); auto const obj_name = normalizeObjectType(parsed_obj_name); if (obj_name.empty()) { - errors_.emplace_back("Line: " + std::to_string(cur_line_num) + " Index: " + std::to_string(index_into_cur_line) + " - \"" + - parsed_obj_name + "\" is not a valid Object Type."); + errors_.emplace_back(fmt::format("Line: {} Index: {} - \"", cur_line_num, index_into_cur_line) + parsed_obj_name + + "\" is not a valid Object Type."); while (token != Token::SEMICOLON && token != Token::END) token = next_token(idf, index); continue; } else if (obj_name.find("Parametric:") != std::string::npos) { - errors_.emplace_back("Line: " + std::to_string(cur_line_num) + " You must run Parametric Preprocessor for \"" + obj_name + "\""); + errors_.emplace_back(fmt::format("Line: {} You must run Parametric Preprocessor for \"{}\"", cur_line_num, obj_name)); while (token != Token::SEMICOLON && token != Token::END) token = next_token(idf, index); continue; } else if (obj_name.find("Template") != std::string::npos) { - errors_.emplace_back("Line: " + std::to_string(cur_line_num) + " You must run the ExpandObjects program for \"" + obj_name + "\""); + errors_.emplace_back(fmt::format("Line: {} You must run the ExpandObjects program for \"{}\"", cur_line_num, obj_name)); while (token != Token::SEMICOLON && token != Token::END) token = next_token(idf, index); continue; @@ -250,8 +250,8 @@ json IdfParser::parse_idf(std::string const &idf, size_t &index, bool &success, if (found_index != std::string::npos) { line = idf.substr(beginning_of_line_index, found_index - beginning_of_line_index); } - errors_.emplace_back("Line: " + std::to_string(cur_line_num) + " Index: " + std::to_string(index_into_cur_line) + - " - Error parsing \"" + obj_name + "\". Error in following line."); + errors_.emplace_back(fmt::format("Line: {} Index: {}", cur_line_num, index_into_cur_line) + " - Error parsing \"" + obj_name + + "\". Error in following line."); errors_.emplace_back("~~~ " + line); success = false; continue; @@ -383,8 +383,10 @@ json IdfParser::parse_object( eat_comment(idf, index); } else if (legacy_idd_index >= legacy_idd_fields_array.size()) { if (legacy_idd_extensibles_iter == legacy_idd.end()) { - errors_.emplace_back("Line: " + std::to_string(cur_line_num) + " Index: " + std::to_string(index_into_cur_line) + - " - Object contains more field values than maximum number of IDD fields and is not extensible."); + errors_.emplace_back( + fmt::format("Line: {} Index: {} - Object contains more field values than maximum number of IDD fields and is not extensible.", + cur_line_num, + index_into_cur_line)); success = false; return root; } @@ -524,7 +526,8 @@ json IdfParser::parse_value(std::string const &idf, size_t &index, bool &success auto const &anyOf_it = field_loc.find("anyOf"); if (anyOf_it == field_loc.end()) { - errors_.emplace_back("Line: " + std::to_string(cur_line_num) + " Index: " + std::to_string(index_into_cur_line) + " - Field cannot be Autosize or Autocalculate"); + errors_.emplace_back( + fmt::format("Line: {} Index: {} - Field cannot be Autosize or Autocalculate", cur_line_num, index_into_cur_line)); return parsed_string; } // The following is hacky because it abuses knowing the consistent generated structure diff --git a/src/EnergyPlus/IntegratedHeatPump.cc b/src/EnergyPlus/IntegratedHeatPump.cc index 558b65d2ae5..279d7c14e8a 100644 --- a/src/EnergyPlus/IntegratedHeatPump.cc +++ b/src/EnergyPlus/IntegratedHeatPump.cc @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -73,7 +72,6 @@ namespace IntegratedHeatPump { // Using/Aliasing using namespace DataLoopNode; - using General::RoundSigDigits; // MODULE PARAMETER DEFINITIONS static std::string const BlankString; @@ -117,7 +115,6 @@ namespace IntegratedHeatPump { // This subroutine manages variable-speed integrated Air source heat pump simulation. // Using/Aliasing - using General::TrimSigDigits; using VariableSpeedCoils::InitVarSpeedCoil; using VariableSpeedCoils::SimVariableSpeedCoils; using VariableSpeedCoils::UpdateVarSpeedCoil; @@ -143,12 +140,18 @@ namespace IntegratedHeatPump { } else { DXCoilNum = CompIndex; if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "SimIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + CompName); + ShowFatalError(state, + format("SimIHP: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name={}", + DXCoilNum, + IntegratedHeatPumps.size(), + CompName)); } if (!CompName.empty() && CompName != IntegratedHeatPumps(DXCoilNum).Name) { - ShowFatalError(state, "SimIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + ", Integrated HP name=" + CompName + - ", stored Integrated HP Name for that index=" + IntegratedHeatPumps(DXCoilNum).Name); + ShowFatalError(state, + format("SimIHP: Invalid CompIndex passed={}, Integrated HP name={}, stored Integrated HP Name for that index={}", + DXCoilNum, + CompName, + IntegratedHeatPumps(DXCoilNum).Name)); } }; @@ -1100,7 +1103,6 @@ namespace IntegratedHeatPump { using BranchNodeConnections::SetUpCompSets; using BranchNodeConnections::TestCompSet; using GlobalNames::VerifyUniqueCoilName; - using General::TrimSigDigits; using VariableSpeedCoils::GetCoilIndexVariableSpeed; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1922,7 +1924,6 @@ namespace IntegratedHeatPump { void SizeIHP(EnergyPlusData &state, int const DXCoilNum) { using DataSizing::AutoSize; - using General::TrimSigDigits; using VariableSpeedCoils::SetVarSpeedCoilData; using VariableSpeedCoils::SimVariableSpeedCoils; using VariableSpeedCoils::SizeVarSpeedCoil; @@ -1937,8 +1938,9 @@ namespace IntegratedHeatPump { }; if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "SizeIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError( + state, + format("SizeIHP: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", DXCoilNum, IntegratedHeatPumps.size())); } if (IntegratedHeatPumps(DXCoilNum).IHPCoilsSized) { @@ -2041,8 +2043,6 @@ namespace IntegratedHeatPump { void InitializeIHP(EnergyPlusData &state, int const DXCoilNum) { - using General::TrimSigDigits; - // Obtains and Allocates AS-IHP related parameters from input file if (GetCoilsInputFlag) { // First time subroutine has been entered GetIHPInput(state); @@ -2050,8 +2050,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "InitializeIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("InitializeIHP: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } IntegratedHeatPumps(DXCoilNum).AirLoopFlowRate = 0.0; // air loop mass flow rate [kg/s] @@ -2074,7 +2076,6 @@ namespace IntegratedHeatPump { void UpdateIHP(EnergyPlusData &state, int const DXCoilNum) { using DataHVACGlobals::TimeStepSys; - using General::TrimSigDigits; int VSCoilIndex(0); Real64 ReportingConstant(0.0); @@ -2087,8 +2088,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "UpdateIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("UpdateIHP: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } switch (IntegratedHeatPumps(DXCoilNum).CurMode) { @@ -2197,7 +2200,6 @@ namespace IntegratedHeatPump { using DataEnvironment::OutDryBulbTemp; using DataHVACGlobals::SmallLoad; using DataHVACGlobals::TimeStepSys; - using General::TrimSigDigits; using WaterThermalTanks::GetWaterThermalTankInput; Real64 MyLoad(0.0); @@ -2211,8 +2213,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "DecideWorkMode: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("DecideWorkMode: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } if (IntegratedHeatPumps(DXCoilNum).IHPCoilsSized == false) SizeIHP(state, DXCoilNum); @@ -2329,7 +2333,6 @@ namespace IntegratedHeatPump { void ClearCoils(EnergyPlusData &state, int const DXCoilNum) { - using General::TrimSigDigits; using VariableSpeedCoils::SimVariableSpeedCoils; Real64 EMP1(0.0), EMP2(0.0), EMP3(0.0); // place holder to calling clear up function @@ -2343,8 +2346,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "ClearCoils: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("ClearCoils: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } // clear up @@ -2370,8 +2375,6 @@ namespace IntegratedHeatPump { IHPOperationMode GetCurWorkMode(EnergyPlusData &state, int const DXCoilNum) { - using General::TrimSigDigits; - // Obtains and Allocates WatertoAirHP related parameters from input file if (GetCoilsInputFlag) { // First time subroutine has been entered GetIHPInput(state); @@ -2380,8 +2383,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "GetCurWorkMode: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("GetCurWorkMode: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } if (IntegratedHeatPumps(DXCoilNum).IHPCoilsSized == false) SizeIHP(state, DXCoilNum); @@ -2678,8 +2683,6 @@ namespace IntegratedHeatPump { int GetLowSpeedNumIHP(EnergyPlusData &state, int const DXCoilNum) { - using General::TrimSigDigits; - int SpeedNum(0); // Obtains and Allocates WatertoAirHP related parameters from input file @@ -2690,8 +2693,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "GetLowSpeedNumIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("GetLowSpeedNumIHP: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } switch (IntegratedHeatPumps(DXCoilNum).CurMode) { @@ -2728,8 +2733,6 @@ namespace IntegratedHeatPump { int GetMaxSpeedNumIHP(EnergyPlusData &state, int const DXCoilNum) { - using General::TrimSigDigits; - // Obtains and Allocates WatertoAirHP related parameters from input file if (GetCoilsInputFlag) { // First time subroutine has been entered GetIHPInput(state); @@ -2738,8 +2741,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "GetMaxSpeedNumIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("GetMaxSpeedNumIHP: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } int SpeedNum(0); @@ -2782,8 +2787,6 @@ namespace IntegratedHeatPump { bool const IsCallbyWH // whether the call from the water heating loop or air loop, true = from water heating loop ) { - using General::TrimSigDigits; - int IHPCoilIndex(0); Real64 AirVolFlowRate(0.0); Real64 FlowScale(1.0); @@ -2796,8 +2799,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "GetAirVolFlowRateIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("GetAirVolFlowRateIHP: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } if (!IntegratedHeatPumps(DXCoilNum).IHPCoilsSized) SizeIHP(state, DXCoilNum); @@ -2890,8 +2895,6 @@ namespace IntegratedHeatPump { [[maybe_unused]] bool const IsCallbyWH // whether the call from the water heating loop or air loop, true = from water heating loop ) { - using General::TrimSigDigits; - int IHPCoilIndex(0); Real64 WaterVolFlowRate(0.0); @@ -2902,8 +2905,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "GetWaterVolFlowRateIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("GetWaterVolFlowRateIHP: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } if (!IntegratedHeatPumps(DXCoilNum).IHPCoilsSized) SizeIHP(state, DXCoilNum); @@ -2966,8 +2971,6 @@ namespace IntegratedHeatPump { bool const IsCallbyWH // whether the call from the water heating loop or air loop, true = from water heating loop ) { - using General::TrimSigDigits; - int IHPCoilIndex(0); Real64 AirMassFlowRate(0.0); Real64 FlowScale(1.0); @@ -2981,8 +2984,10 @@ namespace IntegratedHeatPump { } if (DXCoilNum > static_cast(IntegratedHeatPumps.size()) || DXCoilNum < 1) { - ShowFatalError(state, "GetAirMassFlowRateIHP: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Integrated HPs=" + TrimSigDigits(IntegratedHeatPumps.size()) + ", IHP name=" + "AS-IHP"); + ShowFatalError(state, + format("GetAirMassFlowRateIHP: Invalid CompIndex passed={}, Number of Integrated HPs={}, IHP name=AS-IHP", + DXCoilNum, + IntegratedHeatPumps.size())); } if (!IntegratedHeatPumps(DXCoilNum).IHPCoilsSized) SizeIHP(state, DXCoilNum); diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index d0e513cc477..070c5f08660 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -219,7 +219,7 @@ namespace InternalHeatGains { using namespace DataIPShortCuts; using namespace ScheduleManager; using General::CheckCreatedZoneItemName; - using General::RoundSigDigits; + using namespace OutputReportPredefined; using namespace DataLoopNode; using CurveManager::GetCurveIndex; @@ -504,8 +504,8 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } } @@ -513,8 +513,8 @@ namespace InternalHeatGains { if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -540,8 +540,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Zone Floor Area = 0. 0 People will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + People(Loop).Name + "\", invalid " + - cNumericFieldNames(2) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + People(Loop).Name, + cNumericFieldNames(2), + IHGNumbers(2))); ErrorsFound = true; } } @@ -559,8 +564,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Zone Floor Area = 0. 0 People will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + People(Loop).Name + "\", invalid " + - cNumericFieldNames(3) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + People(Loop).Name, + cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } @@ -591,8 +601,13 @@ namespace InternalHeatGains { People(Loop).FractionConvected = 1.0 - People(Loop).FractionRadiant; if (Item1 == 1) { if (People(Loop).FractionConvected < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cNumericFieldNames(4) + - " < 0.0, value =" + RoundSigDigits(IHGNumbers(4), 2)); + ShowSevereError(state, + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(4), + IHGNumbers(4))); ErrorsFound = true; } } @@ -609,8 +624,13 @@ namespace InternalHeatGains { People(Loop).CO2RateFactor = 3.82e-8; // m3/s-W } if (People(Loop).CO2RateFactor < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cNumericFieldNames(6) + - " < 0.0, value =" + RoundSigDigits(IHGNumbers(6), 2)); + ShowSevereError(state, + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(6), + IHGNumbers(6))); ErrorsFound = true; } @@ -634,8 +654,8 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(5) + " minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(5) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); ErrorsFound = true; } } @@ -643,8 +663,8 @@ namespace InternalHeatGains { if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(5) + " maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(5) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); ErrorsFound = true; } } @@ -653,8 +673,7 @@ namespace InternalHeatGains { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(5) + " values"); ShowContinueError(state, "fall outside typical range [70,1000] W/person for Thermal Comfort Reporting."); ShowContinueError(state, "Odd comfort values may result; Schedule=\"" + AlphaName(5) + "\"."); - ShowContinueError(state, "Entered min/max range=[" + RoundSigDigits(SchMin, 1) + ',' + RoundSigDigits(SchMax, 1) + - "] W/person."); + ShowContinueError(state, format("Entered min/max range=[{:.1R},] W/person.{:.1R}", SchMin, SchMax)); } } } @@ -808,8 +827,9 @@ namespace InternalHeatGains { if (Item1 == 1) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(9) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(9) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError( + state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMin)); ErrorsFound = true; } } @@ -817,8 +837,9 @@ namespace InternalHeatGains { if (Item1 == 1) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(9) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(9) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError( + state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(9), SchMax)); ErrorsFound = true; } } @@ -827,8 +848,11 @@ namespace InternalHeatGains { if (Item1 == 1) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(9) + ", maximum is > 1.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(9) + "\"; Entered min/max range=[" + - RoundSigDigits(SchMin, 1) + ',' + RoundSigDigits(SchMax, 1) + "] Work Efficiency."); + ShowContinueError(state, + format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Work Efficiency.", + AlphaName(9), + SchMin, + SchMax)); } } } @@ -860,8 +884,10 @@ namespace InternalHeatGains { if (Item1 == 1) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(12) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(12) + "\". Minimum is [" + - RoundSigDigits(SchMin, 1) + "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", + AlphaName(12), + SchMin)); ErrorsFound = true; } } @@ -869,8 +895,10 @@ namespace InternalHeatGains { if (Item1 == 1) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(12) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(12) + "\". Maximum is [" + - RoundSigDigits(SchMax, 1) + "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", + AlphaName(12), + SchMax)); ErrorsFound = true; } } @@ -879,8 +907,11 @@ namespace InternalHeatGains { if (Item1 == 1) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(12) + ", maximum is > 2.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(12) + "\"; Entered min/max range=[" + - RoundSigDigits(SchMin, 1) + ',' + RoundSigDigits(SchMax, 1) + "] Clothing."); + ShowContinueError(state, + format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Clothing.", + AlphaName(12), + SchMin, + SchMax)); } } } @@ -935,8 +966,9 @@ namespace InternalHeatGains { if (Item1 == 1) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(13) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(13) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError( + state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMin)); ErrorsFound = true; } } @@ -944,8 +976,9 @@ namespace InternalHeatGains { if (Item1 == 1) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(13) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(13) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError( + state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(13), SchMax)); ErrorsFound = true; } } @@ -1097,10 +1130,11 @@ namespace InternalHeatGains { if (Zone(Loop).FloorArea > 0.0 && Zone(Loop).FloorArea / Zone(Loop).TotOccupants < 0.1) { ShowWarningError(state, RoutineName + "Zone=\"" + Zone(Loop).Name + "\" occupant density is extremely high."); if (Zone(Loop).FloorArea > 0.0) { - ShowContinueError(state, "Occupant Density=[" + RoundSigDigits(Zone(Loop).TotOccupants / Zone(Loop).FloorArea, 0) + "] person/m2."); + ShowContinueError(state, format("Occupant Density=[{:.0R}] person/m2.", Zone(Loop).TotOccupants / Zone(Loop).FloorArea)); } - ShowContinueError(state, "Occupant Density=[" + RoundSigDigits(Zone(Loop).FloorArea / Zone(Loop).TotOccupants, 3) + - "] m2/person. Problems in Temperature Out of Bounds may result."); + ShowContinueError(state, + format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", + Zone(Loop).FloorArea / Zone(Loop).TotOccupants)); } maxOccupLoad = 0.0; for (Loop1 = 1; Loop1 <= TotPeople; ++Loop1) { @@ -1116,10 +1150,11 @@ namespace InternalHeatGains { ShowWarningError(state, RoutineName + "Zone=\"" + Zone(Loop).Name + "\" occupant density at a maximum schedule value is extremely high."); if (Zone(Loop).FloorArea > 0.0) { - ShowContinueError(state, "Occupant Density=[" + RoundSigDigits(maxOccupLoad / Zone(Loop).FloorArea, 0) + "] person/m2."); + ShowContinueError(state, format("Occupant Density=[{:.0R}] person/m2.", maxOccupLoad / Zone(Loop).FloorArea)); } - ShowContinueError(state, "Occupant Density=[" + RoundSigDigits(Zone(Loop).FloorArea / maxOccupLoad, 3) + - "] m2/person. Problems in Temperature Out of Bounds may result."); + ShowContinueError(state, + format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.", + Zone(Loop).FloorArea / maxOccupLoad)); ShowContinueError(state, "Check values in People=" + People(OptionNum).Name + ", Number of People Schedule=" + GetScheduleName(state, MaxNumber)); } @@ -1251,8 +1286,8 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } } @@ -1260,8 +1295,8 @@ namespace InternalHeatGains { if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -1287,8 +1322,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Zone Floor Area = 0. 0 Lights will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Lights(Loop).Name + "\", invalid " + - cNumericFieldNames(2) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + Lights(Loop).Name, + cNumericFieldNames(2), + IHGNumbers(2))); ErrorsFound = true; } } @@ -1306,8 +1346,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Total Occupants = 0. 0 Lights will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Lights(Loop).Name + "\", invalid " + - cNumericFieldNames(3) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + Lights(Loop).Name, + cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } @@ -1700,15 +1745,15 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -1733,8 +1778,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Zone Floor Area = 0. 0 Electric Equipment will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - cNumericFieldNames(2) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(2), + IHGNumbers(2))); ErrorsFound = true; } } @@ -1752,8 +1802,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Total Occupants = 0. 0 Electric Equipment will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - cNumericFieldNames(3) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } @@ -2098,8 +2153,8 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } } @@ -2107,8 +2162,8 @@ namespace InternalHeatGains { if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -2134,8 +2189,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Zone Floor Area = 0. 0 Gas Equipment will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + ZoneGas(Loop).Name + "\", invalid " + - cNumericFieldNames(2) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + ZoneGas(Loop).Name, + cNumericFieldNames(2), + IHGNumbers(2))); ErrorsFound = true; } } @@ -2153,8 +2213,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Total Occupants = 0. 0 Gas Equipment will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + ZoneGas(Loop).Name + "\", invalid " + - cNumericFieldNames(3) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + ZoneGas(Loop).Name, + cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } @@ -2185,13 +2250,23 @@ namespace InternalHeatGains { ZoneGas(Loop).CO2RateFactor = IHGNumbers(7); } if (ZoneGas(Loop).CO2RateFactor < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cNumericFieldNames(7) + - " < 0.0, value =" + RoundSigDigits(IHGNumbers(7), 2)); + ShowSevereError(state, + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(7), + IHGNumbers(7))); ErrorsFound = true; } if (ZoneGas(Loop).CO2RateFactor > 4.0e-7) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cNumericFieldNames(7) + - " > 4.0E-7, value =" + RoundSigDigits(IHGNumbers(7), 2)); + ShowSevereError(state, + format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(7), + IHGNumbers(7))); ErrorsFound = true; } // FractionConvected is a calculated field @@ -2494,15 +2569,15 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -2527,8 +2602,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - cNumericFieldNames(2) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(2), + IHGNumbers(2))); ErrorsFound = true; } } @@ -2546,8 +2626,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Total Occupants = 0. 0 Hot Water Equipment will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - cNumericFieldNames(3) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } @@ -2888,15 +2973,15 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, + format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -2921,8 +3006,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Zone Floor Area = 0. 0 Hot Water Equipment will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - cNumericFieldNames(2) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(2), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(2), + IHGNumbers(2))); ErrorsFound = true; } } @@ -2940,8 +3030,13 @@ namespace InternalHeatGains { cNumericFieldNames(2) + ", but Total Occupants = 0. 0 Hot Water Equipment will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + - cNumericFieldNames(3) + ", value [<0.0]=" + RoundSigDigits(IHGNumbers(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } @@ -3375,13 +3470,23 @@ namespace InternalHeatGains { ZoneOtherEq(Loop).CO2RateFactor = IHGNumbers(7); } if (ZoneOtherEq(Loop).CO2RateFactor < 0.0) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cNumericFieldNames(7) + - " < 0.0, value =" + RoundSigDigits(IHGNumbers(7), 2)); + ShowSevereError(state, + format("{}{}=\"{}\", {} < 0.0, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(7), + IHGNumbers(7))); ErrorsFound = true; } if (ZoneOtherEq(Loop).CO2RateFactor > 4.0e-7) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cNumericFieldNames(7) + - " > 4.0E-7, value =" + RoundSigDigits(IHGNumbers(7), 2)); + ShowSevereError(state, + format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(7), + IHGNumbers(7))); ErrorsFound = true; } @@ -3659,8 +3764,13 @@ namespace InternalHeatGains { cNumericFieldNames(3) + ", but Zone Floor Area = 0. 0 IT Equipment will result."); } } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " + cNumericFieldNames(3) + - ", value [<0.0]=" + RoundSigDigits(IHGNumbers(3), 3)); + ShowSevereError(state, + format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}", + RoutineName, + CurrentModuleObject, + AlphaName(1), + cNumericFieldNames(3), + IHGNumbers(3))); ErrorsFound = true; } } @@ -3695,15 +3805,13 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(5) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(5) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(5) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(5) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(5), SchMax)); ErrorsFound = true; } } @@ -3727,15 +3835,13 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(6) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(6) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(6) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(6) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(6), SchMax)); ErrorsFound = true; } } @@ -4401,15 +4507,13 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -4596,15 +4700,13 @@ namespace InternalHeatGains { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index bb35ca0d879..e464bff56d2 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -272,7 +272,6 @@ namespace LowTempRadiantSystem { // DATE WRITTEN November 2000 // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int RadSysNum; // Radiant system number/index in local derived types @@ -307,13 +306,19 @@ namespace LowTempRadiantSystem { RadSysNum = CompIndex; SystemType = RadSysTypes(RadSysNum).SystemType; if (RadSysNum > TotalNumOfRadSystems || RadSysNum < 1) { - ShowFatalError(state, "SimLowTempRadiantSystem: Invalid CompIndex passed=" + TrimSigDigits(RadSysNum) + - ", Number of Units=" + TrimSigDigits(TotalNumOfRadSystems) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimLowTempRadiantSystem: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + RadSysNum, + TotalNumOfRadSystems, + CompName)); } if (CheckEquipName(RadSysNum)) { if (CompName != RadSysTypes(RadSysNum).Name) { - ShowFatalError(state, "SimLowTempRadiantSystem: Invalid CompIndex passed=" + TrimSigDigits(RadSysNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + RadSysTypes(RadSysNum).Name); + ShowFatalError(state, + format("SimLowTempRadiantSystem: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + RadSysNum, + CompName, + RadSysTypes(RadSysNum).Name)); } CheckEquipName(RadSysNum) = false; } @@ -369,7 +374,7 @@ namespace LowTempRadiantSystem { using DataSizing::FractionOfAutosizedHeatingCapacity; using DataSizing::HeatingDesignCapacity; using FluidProperties::FindGlycol; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; using ScheduleManager::GetScheduleIndex; using namespace DataLoopNode; @@ -593,7 +598,7 @@ namespace LowTempRadiantSystem { thisRadSys.ScaledHeatingCapacity = Numbers(5); if (thisRadSys.ScaledHeatingCapacity < 0.0 && thisRadSys.ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + thisRadSys.Name); - ShowContinueError(state, "Illegal " + cNumericFields(5) + " = " + TrimSigDigits(Numbers(5), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(5), Numbers(5))); ErrorsFound = true; } } else { @@ -611,7 +616,7 @@ namespace LowTempRadiantSystem { if (thisRadSys.ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + thisRadSys.Name); ShowContinueError(state, "Input for " + cAlphaFields(8) + " = " + Alphas(8)); - ShowContinueError(state, "Illegal " + cNumericFields(6) + " = " + TrimSigDigits(Numbers(6), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(6), Numbers(6))); ErrorsFound = true; } else if (thisRadSys.ScaledHeatingCapacity == AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + thisRadSys.Name); @@ -631,7 +636,7 @@ namespace LowTempRadiantSystem { thisRadSys.ScaledHeatingCapacity = Numbers(7); if (thisRadSys.ScaledHeatingCapacity < 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + thisRadSys.Name); - ShowContinueError(state, "Illegal " + cNumericFields(7) + " = " + TrimSigDigits(Numbers(7), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(7), Numbers(7))); ErrorsFound = true; } } else { @@ -684,7 +689,7 @@ namespace LowTempRadiantSystem { thisRadSys.ScaledCoolingCapacity = Numbers(10); if (thisRadSys.ScaledCoolingCapacity < 0.0 && thisRadSys.ScaledCoolingCapacity != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + thisRadSys.Name); - ShowContinueError(state, "Illegal " + cNumericFields(10) + " = " + TrimSigDigits(Numbers(10), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(10), Numbers(10))); ErrorsFound = true; } } else { @@ -702,7 +707,7 @@ namespace LowTempRadiantSystem { if (thisRadSys.CoolingCapMethod <= 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + thisRadSys.Name); ShowContinueError(state, "Input for " + cAlphaFields(12) + " = " + Alphas(12)); - ShowContinueError(state, "Illegal " + cNumericFields(11) + " = " + TrimSigDigits(Numbers(11), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(11), Numbers(11))); ErrorsFound = true; } else if (thisRadSys.ScaledCoolingCapacity == AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + thisRadSys.Name); @@ -722,7 +727,7 @@ namespace LowTempRadiantSystem { thisRadSys.ScaledCoolingCapacity = Numbers(12); if (thisRadSys.ScaledCoolingCapacity < 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + thisRadSys.Name); - ShowContinueError(state, "Illegal " + cNumericFields(12) + " = " + TrimSigDigits(Numbers(12), 7)); + ShowContinueError(state, format("Illegal {} = {:.7T}", cNumericFields(12), Numbers(12))); ErrorsFound = true; } } else { @@ -1141,8 +1146,9 @@ namespace LowTempRadiantSystem { thisElecSys.MaxElecPower = thisElecSys.ScaledHeatingCapacity; if (thisElecSys.ScaledHeatingCapacity < 0.0 && thisElecSys.ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + thisElecSys.Name); - ShowContinueError(state, "Illegal " + cNumericFields(iHeatDesignCapacityNumericNum) + " = " + - TrimSigDigits(Numbers(iHeatDesignCapacityNumericNum), 7)); + ShowContinueError( + state, + format("Illegal {} = {:.7T}", cNumericFields(iHeatDesignCapacityNumericNum), Numbers(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } } else { @@ -1159,8 +1165,10 @@ namespace LowTempRadiantSystem { if (thisElecSys.ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + thisElecSys.Name); ShowContinueError(state, "Input for " + cAlphaFields(iHeatCAPMAlphaNum) + " = " + Alphas(iHeatCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iHeatCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(Numbers(iHeatCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iHeatCapacityPerFloorAreaNumericNum), + Numbers(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } else if (thisElecSys.ScaledHeatingCapacity == AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + thisElecSys.Name); @@ -1181,8 +1189,10 @@ namespace LowTempRadiantSystem { thisElecSys.MaxElecPower = thisElecSys.ScaledHeatingCapacity; if (thisElecSys.ScaledHeatingCapacity < 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + thisElecSys.Name); - ShowContinueError(state, "Illegal " + cNumericFields(iHeatFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(Numbers(iHeatFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iHeatFracOfAutosizedCapacityNumericNum), + Numbers(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -1710,7 +1720,7 @@ namespace LowTempRadiantSystem { using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::ZoneEquipInputsFilled; using FluidProperties::GetDensityGlycol; - using General::RoundSigDigits; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; @@ -2427,7 +2437,7 @@ namespace LowTempRadiantSystem { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -2711,10 +2721,10 @@ namespace LowTempRadiantSystem { ShowMessage(state, "SizeLowTempRadiantSystem: Potential issue with equipment sizing for " "ZoneHVAC:LowTemperatureRadiant:VariableFlow = \"" + HydrRadSys(RadSysNum).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Hot Water Flow of " + RoundSigDigits(WaterVolFlowMaxHeatUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Hot Water Flow of " + - RoundSigDigits(WaterVolFlowMaxHeatDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Hot Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxHeatUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Hot Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxHeatDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2871,10 +2881,10 @@ namespace LowTempRadiantSystem { ShowMessage(state, "SizeLowTempRadiantSystem: Potential issue with equipment sizing for " "ZoneHVAC:LowTemperatureRadiant:VariableFlow = \"" + HydrRadSys(RadSysNum).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Cool Water Flow of " + RoundSigDigits(WaterVolFlowMaxCoolUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Cool Water Flow of " + - RoundSigDigits(WaterVolFlowMaxCoolDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Cool Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxCoolUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Cool Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxCoolDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2914,9 +2924,8 @@ namespace LowTempRadiantSystem { ShowMessage(state, "SizeLowTempRadiantSystem: Potential issue with equipment sizing for " "ZoneHVAC:LowTemperatureRadiant:VariableFlow = \"" + HydrRadSys(RadSysNum).Name + "\"."); - ShowContinueError(state, "User-Specified Hydronic Tubing Length of " + RoundSigDigits(TubeLengthUser, 5) + " [m]"); - ShowContinueError(state, "differs from Design Size Hydronic Tubing Length of " + RoundSigDigits(TubeLengthDes, 5) + - " [m]"); + ShowContinueError(state, format("User-Specified Hydronic Tubing Length of {:.5R} [m]", TubeLengthUser)); + ShowContinueError(state, format("differs from Design Size Hydronic Tubing Length of {:.5R} [m]", TubeLengthDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3066,9 +3075,9 @@ namespace LowTempRadiantSystem { ShowMessage(state, "SizeLowTempRadiantSystem: Potential issue with equipment sizing for " "ZoneHVAC:LowTemperatureRadiant:ConstantFlow = \" " + CFloRadSys(RadSysNum).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Water Flow of " + RoundSigDigits(WaterVolFlowMaxUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Water Flow of " + RoundSigDigits(WaterVolFlowMaxDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3114,9 +3123,8 @@ namespace LowTempRadiantSystem { ShowMessage(state, "SizeLowTempRadiantSystem: Potential issue with equipment sizing for " "ZoneHVAC:LowTemperatureRadiant:ConstantFlow = \" " + CFloRadSys(RadSysNum).Name + "\"."); - ShowContinueError(state, "User-Specified Hydronic Tubing Length of " + RoundSigDigits(TubeLengthUser, 5) + " [m]"); - ShowContinueError(state, "differs from Design Size Hydronic Tubing Length of " + RoundSigDigits(TubeLengthDes, 5) + - " [m]"); + ShowContinueError(state, format("User-Specified Hydronic Tubing Length of {:.5R} [m]", TubeLengthUser)); + ShowContinueError(state, format("differs from Design Size Hydronic Tubing Length of {:.5R} [m]", TubeLengthDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3384,7 +3392,7 @@ namespace LowTempRadiantSystem { using DataSurfaces::HeatTransferModel_CondFD; using DataSurfaces::HeatTransferModel_CTF; using DataSurfaces::Surface; - using General::RoundSigDigits; + using PlantUtilities::SetComponentFlowRate; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -3637,13 +3645,14 @@ namespace LowTempRadiantSystem { ShowContinueError(state, "Surface [" + Surface(this->SurfacePtr(RadSurfNum2)).Name + "] temperature below dew-point temperature--potential for condensation exists"); ShowContinueError(state, "Flow to the radiant system will be shut-off to avoid condensation"); - ShowContinueError(state, "Predicted radiant system surface temperature = " + - RoundSigDigits(TH(2, 1, this->SurfacePtr(RadSurfNum2)), 2)); - ShowContinueError(state, "Zone dew-point temperature + safety delta T= " + - RoundSigDigits(DewPointTemp + this->CondDewPtDeltaT, 2)); + ShowContinueError( + state, format("Predicted radiant system surface temperature = {:.2R}", TH(2, 1, this->SurfacePtr(RadSurfNum2)))); + ShowContinueError( + state, format("Zone dew-point temperature + safety delta T= {:.2R}", DewPointTemp + this->CondDewPtDeltaT)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Note that a " + RoundSigDigits(this->CondDewPtDeltaT, 4) + - " C safety was chosen in the input for the shut-off criteria"); + ShowContinueError( + state, + format("Note that a {:.4R} C safety was chosen in the input for the shut-off criteria", this->CondDewPtDeltaT)); ShowContinueError(state, "Note also that this affects all surfaces that are part of this radiant system"); } ShowRecurringWarningErrorAtEnd(state, cHydronicSystem + " [" + this->Name + "] condensation shut-off occurrence continues.", @@ -3803,13 +3812,14 @@ namespace LowTempRadiantSystem { ShowContinueError(state, "Surface [" + Surface(this->SurfacePtr(CondSurfNum)).Name + "] temperature below dew-point temperature--potential for condensation exists"); ShowContinueError(state, "Flow to the radiant system will be shut-off to avoid condensation"); - ShowContinueError(state, "Predicted radiant system surface temperature = " + - RoundSigDigits(TH(2, 1, this->SurfacePtr(CondSurfNum)), 2)); - ShowContinueError(state, "Zone dew-point temperature + safety delta T= " + - RoundSigDigits(DewPointTemp + this->CondDewPtDeltaT, 2)); + ShowContinueError( + state, format("Predicted radiant system surface temperature = {:.2R}", TH(2, 1, this->SurfacePtr(CondSurfNum)))); + ShowContinueError( + state, format("Zone dew-point temperature + safety delta T= {:.2R}", DewPointTemp + this->CondDewPtDeltaT)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Note that a " + RoundSigDigits(this->CondDewPtDeltaT, 4) + - " C safety was chosen in the input for the shut-off criteria"); + ShowContinueError( + state, + format("Note that a {:.4R} C safety was chosen in the input for the shut-off criteria", this->CondDewPtDeltaT)); ShowContinueError(state, "Note also that this affects all surfaces that are part of this radiant system"); } ShowRecurringWarningErrorAtEnd(state, cHydronicSystem + " [" + this->Name + "] condensation shut-off occurrence continues.", @@ -3876,7 +3886,7 @@ namespace LowTempRadiantSystem { using DataHVACGlobals::SmallLoad; using DataLoopNode::Node; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using ScheduleManager::GetCurrentScheduleValue; @@ -4329,7 +4339,7 @@ namespace LowTempRadiantSystem { // Error check, just in case if (this->WaterRecircRate < 0.0) { ShowWarningError(state, "Flow mismatch in radiant system--result will be an energy imbalance--should not get this error"); - ShowContinueErrorTimeStamp(state, "WaterRecircRate=" + TrimSigDigits(this->WaterRecircRate, 2) + ", in Radiant System=" + this->Name + ','); + ShowContinueErrorTimeStamp(state, format("WaterRecircRate={:.2T}, in Radiant System={},", this->WaterRecircRate, this->Name)); this->WaterRecircRate = 0.0; this->WaterInjectionRate = this->WaterMassFlowRate; } @@ -4388,7 +4398,7 @@ namespace LowTempRadiantSystem { using DataSurfaces::HeatTransferModel_CTF; using DataSurfaces::Surface; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::SetComponentFlowRate; // SUBROUTINE PARAMETER DEFINITIONS: @@ -4735,13 +4745,14 @@ namespace LowTempRadiantSystem { ShowContinueError(state, "Surface [" + Surface(this->SurfacePtr(RadSurfNum2)).Name + "] temperature below dew-point temperature--potential for condensation exists"); ShowContinueError(state, "Flow to the radiant system will be shut-off to avoid condensation"); - ShowContinueError(state, "Predicted radiant system surface temperature = " + - RoundSigDigits(TH(2, 1, this->SurfacePtr(RadSurfNum2)), 2)); - ShowContinueError(state, "Zone dew-point temperature + safety delta T= " + - RoundSigDigits(DewPointTemp + this->CondDewPtDeltaT, 2)); + ShowContinueError( + state, format("Predicted radiant system surface temperature = {:.2R}", TH(2, 1, this->SurfacePtr(RadSurfNum2)))); + ShowContinueError( + state, format("Zone dew-point temperature + safety delta T= {:.2R}", DewPointTemp + this->CondDewPtDeltaT)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Note that a " + RoundSigDigits(this->CondDewPtDeltaT, 4) + - " C safety was chosen in the input for the shut-off criteria"); + ShowContinueError( + state, + format("Note that a {:.4R} C safety was chosen in the input for the shut-off criteria", this->CondDewPtDeltaT)); ShowContinueError(state, "Note also that this affects all surfaces that are part of this radiant system"); } ShowRecurringWarningErrorAtEnd(state, cConstantFlowSystem + " [" + this->Name + "] condensation shut-off occurrence continues.", @@ -4796,13 +4807,15 @@ namespace LowTempRadiantSystem { ShowContinueError(state, "Surface [" + Surface(this->SurfacePtr(RadSurfNum2)).Name + "] temperature below dew-point temperature--potential for condensation exists"); ShowContinueError(state, "Flow to the radiant system will be shut-off to avoid condensation"); - ShowContinueError(state, "Predicted radiant system surface temperature = " + - RoundSigDigits(TH(2, 1, this->SurfacePtr(RadSurfNum2)), 2)); - ShowContinueError(state, "Zone dew-point temperature + safety delta T= " + - RoundSigDigits(DewPointTemp + this->CondDewPtDeltaT, 2)); + ShowContinueError( + state, + format("Predicted radiant system surface temperature = {:.2R}", TH(2, 1, this->SurfacePtr(RadSurfNum2)))); + ShowContinueError( + state, format("Zone dew-point temperature + safety delta T= {:.2R}", DewPointTemp + this->CondDewPtDeltaT)); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Note that a " + RoundSigDigits(this->CondDewPtDeltaT, 4) + - " C safety was chosen in the input for the shut-off criteria"); + ShowContinueError(state, + format("Note that a {:.4R} C safety was chosen in the input for the shut-off criteria", + this->CondDewPtDeltaT)); ShowContinueError(state, "Note also that this affects all surfaces that are part of this radiant system"); } ShowRecurringWarningErrorAtEnd(state, cConstantFlowSystem + " [" + this->Name + @@ -5196,7 +5209,6 @@ namespace LowTempRadiantSystem { // check for crazy, out of range temperature results for fluid leaving radiant system // Using/Aliasing - using General::RoundSigDigits; Real64 const upperRangeLimit(500.0); // high error trigger limit for when model is not working Real64 const lowerRangeLimit(-300.0); // Low error trigger limit for when model is not working @@ -5214,8 +5226,8 @@ namespace LowTempRadiantSystem { if (this->OutRangeLoErrorCount == 0) { ShowSevereMessage(state, "UpdateLowTempRadiantSystem: model result for fluid outlet temperature is not physical."); ShowContinueError(state, "Occurs for radiant system name = " + this->Name); - ShowContinueError(state, "Calculated radiant system outlet temperature = " + RoundSigDigits(outletTemp, 3) + " [C]"); - ShowContinueError(state, "Radiant system inlet temperature = " + RoundSigDigits(inletTemp, 3) + " [C]"); + ShowContinueError(state, format("Calculated radiant system outlet temperature = {:.3R} [C]", outletTemp)); + ShowContinueError(state, format("Radiant system inlet temperature = {:.3R} [C]", inletTemp)); ShowContinueError(state, "A possible cause is that the materials used in the internal source construction are not compatible with the model."); } @@ -5230,8 +5242,8 @@ namespace LowTempRadiantSystem { if (this->OutRangeHiErrorCount == 0) { ShowSevereMessage(state, "UpdateLowTempRadiantSystem: model result for fluid outlet temperature is not physical."); ShowContinueError(state, "Occurs for radiant system name = " + this->Name); - ShowContinueError(state, "Calculated radiant system outlet temperature = " + RoundSigDigits(outletTemp, 3) + " [C]"); - ShowContinueError(state, "Radiant system inlet temperature = " + RoundSigDigits(inletTemp, 3) + " [C]"); + ShowContinueError(state, format("Calculated radiant system outlet temperature = {:.3R} [C]", outletTemp)); + ShowContinueError(state, format("Radiant system inlet temperature = {:.3R} [C]", inletTemp)); ShowContinueError(state, "A possible cause is that the materials used in the internal source construction are not compatible with the model."); } diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.cc b/src/EnergyPlus/MicroCHPElectricGenerator.cc index ea08b1c576a..075ee1c319f 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -230,14 +230,14 @@ namespace MicroCHPElectricGenerator { MicroCHPParamInput(CHPParamNum).RadiativeFraction = NumArray(9); // N9 radiative fraction for skin losses MicroCHPParamInput(CHPParamNum).MCeng = NumArray(10); // N10 Aggregated Thermal Mass of Generator MC_eng if (MicroCHPParamInput(CHPParamNum).MCeng <= 0.0) { - ShowSevereError(state, "Invalid, " + DataIPShortCuts::cNumericFieldNames(10) + " = " + General::RoundSigDigits(NumArray(10), 5)); + ShowSevereError(state, format("Invalid, {} = {:.5R}", DataIPShortCuts::cNumericFieldNames(10), NumArray(10))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, "Thermal mass must be greater than zero"); ErrorsFound = true; } MicroCHPParamInput(CHPParamNum).MCcw = NumArray(11); // Aggregated Thermal Mass of Heat Recovery MC_cw if (MicroCHPParamInput(CHPParamNum).MCcw <= 0.0) { - ShowSevereError(state, "Invalid, " + DataIPShortCuts::cNumericFieldNames(11) + " = " + General::RoundSigDigits(NumArray(11), 5)); + ShowSevereError(state, format("Invalid, {} = {:.5R}", DataIPShortCuts::cNumericFieldNames(11), NumArray(11))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, "Thermal mass must be greater than zero"); ErrorsFound = true; diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index 636ba892c01..a1352e5b88e 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -174,7 +174,7 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).RefElecPowerOutput = NumArray(1); if (MTGenerator(GeneratorNum).RefElecPowerOutput <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + General::RoundSigDigits(NumArray(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), NumArray(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(1) + " must be greater than 0."); ErrorsFound = true; @@ -184,7 +184,7 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).MaxElecPowerOutput = NumArray(3); if (MTGenerator(GeneratorNum).MinElecPowerOutput < 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + General::RoundSigDigits(NumArray(2), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(2), NumArray(2))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " must be greater than 0."); ErrorsFound = true; @@ -194,7 +194,7 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).MaxElecPowerOutput = MTGenerator(GeneratorNum).RefElecPowerOutput; } else { if (MTGenerator(GeneratorNum).MaxElecPowerOutput <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(3) + '=' + General::RoundSigDigits(NumArray(3), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(3), NumArray(3))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(3) + " must be greater than 0."); ErrorsFound = true; @@ -203,8 +203,12 @@ namespace MicroturbineElectricGenerator { if (MTGenerator(GeneratorNum).MinElecPowerOutput >= MTGenerator(GeneratorNum).MaxElecPowerOutput) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "= " + MTGenerator(GeneratorNum).Name); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " [" + General::RoundSigDigits(NumArray(2), 2) + "] > " + - DataIPShortCuts::cNumericFieldNames(3) + " [" + General::RoundSigDigits(NumArray(3), 2) + ']'); + ShowContinueError(state, + format("{} [{:.2R}] > {} [{:.2R}]", + DataIPShortCuts::cNumericFieldNames(2), + NumArray(2), + DataIPShortCuts::cNumericFieldNames(3), + NumArray(3))); ShowContinueError(state, "Minimum Full Load Electrical Power Output must be less than or equal"); ShowContinueError(state, "to Maximum Full Load Electrical Power Output."); ErrorsFound = true; @@ -215,16 +219,16 @@ namespace MicroturbineElectricGenerator { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "= " + MTGenerator(GeneratorNum).Name); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(1) + " must be >= " + DataIPShortCuts::cNumericFieldNames(2)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(1) + " must be <= " + DataIPShortCuts::cNumericFieldNames(3)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(1) + " = " + General::RoundSigDigits(NumArray(1), 2)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(NumArray(2), 2)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(3) + " = " + General::RoundSigDigits(NumArray(3), 2)); + ShowContinueError(state, format("{} = {:.2R}", DataIPShortCuts::cNumericFieldNames(1), NumArray(1))); + ShowContinueError(state, format("{} = {:.2R}", DataIPShortCuts::cNumericFieldNames(2), NumArray(2))); + ShowContinueError(state, format("{} = {:.2R}", DataIPShortCuts::cNumericFieldNames(3), NumArray(3))); ErrorsFound = true; } MTGenerator(GeneratorNum).RefElecEfficiencyLHV = NumArray(4); if (MTGenerator(GeneratorNum).RefElecEfficiencyLHV <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(4) + '=' + General::RoundSigDigits(NumArray(4), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(4), NumArray(4))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(4) + " must be greater than 0."); ErrorsFound = true; @@ -235,7 +239,7 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).RefElevation = NumArray(7); if (MTGenerator(GeneratorNum).RefCombustAirInletHumRat <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(6) + '=' + General::RoundSigDigits(NumArray(6), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(6), NumArray(6))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(6) + " must be greater than 0."); ErrorsFound = true; @@ -265,11 +269,12 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(2) + " = " + AlphArray(2)); ShowContinueError(state, "...Curve output at reference conditions should equal 1 (+-10%)."); - ShowContinueError(state, "...Reference combustion air inlet temperature = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefCombustAirInletTemp, 4) + " C"); - ShowContinueError(state, "...Reference elevation = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefElevation, 4) + " m"); - ShowContinueError(state, "...Curve output = " + General::TrimSigDigits(ElectOutFTempElevOutput, 4)); + ShowContinueError( + state, + format("...Reference combustion air inlet temperature = {:.4T} C", MTGenerator(GeneratorNum).RefCombustAirInletTemp)); + ShowContinueError(state, + format("...Reference elevation = {:.4T} m", MTGenerator(GeneratorNum).RefElevation)); + ShowContinueError(state, format("...Curve output = {:.4T}", ElectOutFTempElevOutput)); } } } @@ -291,9 +296,10 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(3) + " = " + AlphArray(3)); ShowContinueError(state, "... Curve output at reference condition should equal 1 (+-10%)."); - ShowContinueError(state, "... Reference combustion air inlet temperature = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefCombustAirInletTemp, 4) + " C"); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(ElecEfficFTempOutput, 4)); + ShowContinueError( + state, + format("... Reference combustion air inlet temperature = {:.4T} C", MTGenerator(GeneratorNum).RefCombustAirInletTemp)); + ShowContinueError(state, format("... Curve output = {:.4T}", ElecEfficFTempOutput)); } } } @@ -314,7 +320,7 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(4) + " = " + AlphArray(4)); ShowContinueError(state, "... Curve output at a part-load ratio of 1 should equal 1 (+-10%)."); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(ElecEfficFPLROutput, 4)); + ShowContinueError(state, format("... Curve output = {:.4T}", ElecEfficFPLROutput)); } Real64 Var1Min(0.0); @@ -339,14 +345,14 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).FuelLowerHeatingValue = NumArray(9); if (MTGenerator(GeneratorNum).FuelLowerHeatingValue <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(9) + '=' + General::RoundSigDigits(NumArray(9), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(9), NumArray(9))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(9) + " must be greater than 0."); ErrorsFound = true; } if (MTGenerator(GeneratorNum).FuelHigherHeatingValue <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(8) + '=' + General::RoundSigDigits(NumArray(8), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(8), NumArray(8))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(8) + " must be greater than 0."); ErrorsFound = true; @@ -355,14 +361,14 @@ namespace MicroturbineElectricGenerator { if (MTGenerator(GeneratorNum).FuelLowerHeatingValue > MTGenerator(GeneratorNum).FuelHigherHeatingValue) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(8) + " must be greater than the " + DataIPShortCuts::cNumericFieldNames(9)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(8) + '=' + General::RoundSigDigits(NumArray(8), 2)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(9) + '=' + General::RoundSigDigits(NumArray(9), 2)); + ShowContinueError(state, format("{}={:.2R}", DataIPShortCuts::cNumericFieldNames(8), NumArray(8))); + ShowContinueError(state, format("{}={:.2R}", DataIPShortCuts::cNumericFieldNames(9), NumArray(9))); ErrorsFound = true; } MTGenerator(GeneratorNum).StandbyPower = NumArray(10); if (MTGenerator(GeneratorNum).StandbyPower < 0.0) { - ShowWarningError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(10) + '=' + General::RoundSigDigits(NumArray(10), 2)); + ShowWarningError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(10), NumArray(10))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(10) + " must be greater than 0."); ShowContinueError(state, "Resetting to 0 and the simulation continues."); @@ -371,7 +377,7 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).AncillaryPower = NumArray(11); if (MTGenerator(GeneratorNum).AncillaryPower < 0.0) { - ShowWarningError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(11) + '=' + General::RoundSigDigits(NumArray(11), 2)); + ShowWarningError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(11), NumArray(11))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(11) + " must be greater than 0."); ShowContinueError(state, "Resetting to 0 and the simulation continues."); @@ -397,14 +403,17 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(6) + " = " + AlphArray(6)); ShowContinueError(state, "... Curve output at reference conditions should equal 1 (+-10%)."); - ShowContinueError(state, "... Reference Electrical Power Output = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefElecPowerOutput, 2) + " W"); - ShowContinueError(state, "... Reference Electrical Efficiency (LHV basis) = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefElecEfficiencyLHV, 4)); - ShowContinueError(state, "... Fuel Lower Heating Value = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).FuelLowerHeatingValue, 2) + " kJ/kg"); - ShowContinueError(state, "... Calculated fuel flow = " + General::TrimSigDigits(RefFuelUseMdot, 4) + " kg/s"); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(AncillaryPowerOutput, 4)); + ShowContinueError( + state, + format("... Reference Electrical Power Output = {:.2T} W", MTGenerator(GeneratorNum).RefElecPowerOutput)); + ShowContinueError( + state, + format("... Reference Electrical Efficiency (LHV basis) = {:.4T}", MTGenerator(GeneratorNum).RefElecEfficiencyLHV)); + ShowContinueError(state, + format("... Fuel Lower Heating Value = {:.2T} kJ/kg", + MTGenerator(GeneratorNum).FuelLowerHeatingValue)); + ShowContinueError(state, format("... Calculated fuel flow = {:.4T} kg/s", RefFuelUseMdot)); + ShowContinueError(state, format("... Curve output = {:.4T}", AncillaryPowerOutput)); } } } @@ -485,7 +494,7 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).RefHeatRecVolFlowRate = NumArray(14); if (MTGenerator(GeneratorNum).RefHeatRecVolFlowRate <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(14) + '=' + General::RoundSigDigits(NumArray(14), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(14), NumArray(14))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(14) + " must be greater than 0."); ErrorsFound = true; @@ -514,10 +523,12 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(11) + " = " + AlphArray(11)); ShowContinueError(state, "... Curve output at reference conditions should equal 1 (+-10%)."); - ShowContinueError(state, "... Reference combustion air inlet temperature = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefCombustAirInletTemp, 4) + " C"); - ShowContinueError(state, "... Reference elevation = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefElevation, 4) + " m"); + ShowContinueError(state, + format("... Reference combustion air inlet temperature = {:.4T} C", + MTGenerator(GeneratorNum).RefCombustAirInletTemp)); + ShowContinueError( + state, + format("... Reference elevation = {:.4T} m", MTGenerator(GeneratorNum).RefElevation)); } } } @@ -534,7 +545,7 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(12) + " = " + AlphArray(12)); ShowContinueError(state, "... Curve output at a part-load ratio of 1 should equal 1 (+-10%)."); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(HeatRecRateFPLROutput, 4)); + ShowContinueError(state, format("... Curve output = {:.4T}", HeatRecRateFPLROutput)); } } } @@ -552,9 +563,10 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(13) + " = " + AlphArray(13)); ShowContinueError(state, "... Curve output at reference condition should equal 1 (+-10%)."); - ShowContinueError(state, "... Reference inlet water temperature temperature = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefInletWaterTemp, 4) + " C"); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(HeatRecRateFTempOutput, 4)); + ShowContinueError(state, + format("... Reference inlet water temperature temperature = {:.4T} C", + MTGenerator(GeneratorNum).RefInletWaterTemp)); + ShowContinueError(state, format("... Curve output = {:.4T}", HeatRecRateFTempOutput)); } } } @@ -572,9 +584,10 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(14) + " = " + AlphArray(14)); ShowContinueError(state, "... Curve output at reference condition should equal 1 (+-10%)."); - ShowContinueError(state, "... Reference Heat Recovery Water Flow Rate = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefHeatRecVolFlowRate, 4) + " m3/s"); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(HeatRecRateFFlowOutput, 4)); + ShowContinueError(state, + format("... Reference Heat Recovery Water Flow Rate = {:.4T} m3/s", + MTGenerator(GeneratorNum).RefHeatRecVolFlowRate)); + ShowContinueError(state, format("... Curve output = {:.4T}", HeatRecRateFFlowOutput)); } } } @@ -673,7 +686,7 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).ExhAirCalcsActive = true; MTGenerator(GeneratorNum).RefExhaustAirMassFlowRate = NumArray(18); if (MTGenerator(GeneratorNum).RefExhaustAirMassFlowRate <= 0.0 && !DataIPShortCuts::lNumericFieldBlanks(18)) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(18) + '=' + General::RoundSigDigits(NumArray(18), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(18), NumArray(18))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(18) + " must be greater than 0."); ErrorsFound = true; @@ -692,9 +705,10 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(17) + " = " + AlphArray(17)); ShowContinueError(state, "... Curve output at reference condition should equal 1 (+-10%)."); - ShowContinueError(state, "... Reference combustion air inlet temperature = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefCombustAirInletTemp, 4) + " C"); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(ExhFlowFTempOutput, 4)); + ShowContinueError(state, + format("... Reference combustion air inlet temperature = {:.4T} C", + MTGenerator(GeneratorNum).RefCombustAirInletTemp)); + ShowContinueError(state, format("... Curve output = {:.4T}", ExhFlowFTempOutput)); } } } @@ -711,7 +725,7 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(18) + " = " + AlphArray(18)); ShowContinueError(state, "... Curve output at a part-load ratio of 1 should equal 1 (+-10%)."); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(ExhFlowFPLROutput, 4)); + ShowContinueError(state, format("... Curve output = {:.4T}", ExhFlowFPLROutput)); } } } @@ -731,9 +745,10 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(19) + " = " + AlphArray(19)); ShowContinueError(state, "... Curve output at reference condition should equal 1 (+-10%)."); - ShowContinueError(state, "... Reference combustion air inlet temperature = " + - General::TrimSigDigits(MTGenerator(GeneratorNum).RefCombustAirInletTemp, 4) + " C"); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(ExhAirTempFTempOutput, 4)); + ShowContinueError(state, + format("... Reference combustion air inlet temperature = {:.4T} C", + MTGenerator(GeneratorNum).RefCombustAirInletTemp)); + ShowContinueError(state, format("... Curve output = {:.4T}", ExhAirTempFTempOutput)); } } } @@ -750,7 +765,7 @@ namespace MicroturbineElectricGenerator { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " \"" + MTGenerator(GeneratorNum).Name + "\""); ShowContinueError(state, DataIPShortCuts::cAlphaFieldNames(20) + " = " + AlphArray(20)); ShowContinueError(state, "... Curve output at a part-load ratio of 1 should equal 1 (+-10%)."); - ShowContinueError(state, "... Curve output = " + General::TrimSigDigits(ExhOutAirTempFPLROutput, 4)); + ShowContinueError(state, format("... Curve output = {:.4T}", ExhOutAirTempFPLROutput)); } } } @@ -1170,11 +1185,12 @@ namespace MicroturbineElectricGenerator { if (this->PowerFTempElevErrorIndex == 0) { // MTGenerator(GeneratorNum)%PowerFTempElevErrorCount = MTGenerator(GeneratorNum)%PowerFTempElevErrorCount + 1 ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "... Electrical Power Modifier curve (function of temperature and elevation) output is less than zero (" + - General::TrimSigDigits(PowerFTempElev, 4) + ")."); - ShowContinueError(state, "... Value occurs using a combustion inlet air temperature of " + - General::TrimSigDigits(CombustionAirInletTemp, 2) + " C."); - ShowContinueError(state, "... and an elevation of " + General::TrimSigDigits(DataEnvironment::Elevation, 2) + " m."); + ShowContinueError( + state, + format("... Electrical Power Modifier curve (function of temperature and elevation) output is less than zero ({:.4T}).", + PowerFTempElev)); + ShowContinueError(state, format("... Value occurs using a combustion inlet air temperature of {:.2T} C.", CombustionAirInletTemp)); + ShowContinueError(state, format("... and an elevation of {:.2T} m.", DataEnvironment::Elevation)); ShowContinueErrorTimeStamp(state, "... Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, "GENERATOR:MICROTURBINE \"" + this->Name + @@ -1232,10 +1248,11 @@ namespace MicroturbineElectricGenerator { if (this->EffFTempErrorIndex == 0) { // MTGenerator(GeneratorNum)%EffFTempErrorCount = MTGenerator(GeneratorNum)%EffFTempErrorCount + 1 ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "... Electrical Efficiency Modifier (function of temperature) output is less than zero (" + - General::TrimSigDigits(ElecEfficiencyFTemp, 4) + ")."); - ShowContinueError(state, "... Value occurs using a combustion inlet air temperature of " + - General::TrimSigDigits(CombustionAirInletTemp, 2) + " C."); + ShowContinueError(state, + format("... Electrical Efficiency Modifier (function of temperature) output is less than zero ({:.4T}).", + ElecEfficiencyFTemp)); + ShowContinueError(state, + format("... Value occurs using a combustion inlet air temperature of {:.2T} C.", CombustionAirInletTemp)); ShowContinueErrorTimeStamp(state, "... Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -1255,9 +1272,10 @@ namespace MicroturbineElectricGenerator { if (ElecEfficiencyFPLR < 0.0) { if (this->EffFPLRErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "... Electrical Efficiency Modifier (function of part-load ratio) output is less than zero (" + - General::TrimSigDigits(ElecEfficiencyFPLR, 4) + ")."); - ShowContinueError(state, "... Value occurs using a part-load ratio of " + General::TrimSigDigits(PLR, 3) + '.'); + ShowContinueError(state, + format("... Electrical Efficiency Modifier (function of part-load ratio) output is less than zero ({:.4T}).", + ElecEfficiencyFPLR)); + ShowContinueError(state, format("... Value occurs using a part-load ratio of {:.3T}.", PLR)); ShowContinueErrorTimeStamp(state, "... Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -1295,10 +1313,10 @@ namespace MicroturbineElectricGenerator { if (AnciPowerFMdotFuel < 0.0) { if (this->AnciPowerFMdotFuelErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "... Ancillary Power Modifier (function of fuel input) output is less than zero (" + - General::TrimSigDigits(AnciPowerFMdotFuel, 4) + ")."); - ShowContinueError(state, "... Value occurs using a fuel input mass flow rate of " + General::TrimSigDigits(this->FuelMdot, 4) + - " kg/s."); + ShowContinueError( + state, + format("... Ancillary Power Modifier (function of fuel input) output is less than zero ({:.4T}).", AnciPowerFMdotFuel)); + ShowContinueError(state, format("... Value occurs using a fuel input mass flow rate of {:.4T} kg/s.", this->FuelMdot)); ShowContinueErrorTimeStamp(state, "... Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -1329,8 +1347,8 @@ namespace MicroturbineElectricGenerator { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); ShowContinueError(state, "... Iteration loop for electric power generation is not converging within tolerance."); ShowContinueError(state, "... Check the Ancillary Power Modifier Curve (function of fuel input)."); - ShowContinueError(state, "... Ancillary Power = " + General::TrimSigDigits(ancillaryPowerRate, 1) + " W."); - ShowContinueError(state, "... Fuel input rate = " + General::TrimSigDigits(AnciPowerFMdotFuel, 4) + " kg/s."); + ShowContinueError(state, format("... Ancillary Power = {:.1T} W.", ancillaryPowerRate)); + ShowContinueError(state, format("... Fuel input rate = {:.4T} kg/s.", AnciPowerFMdotFuel)); ShowContinueErrorTimeStamp(state, "... Simulation will continue."); } ShowRecurringWarningErrorAtEnd(state, "GENERATOR:MICROTURBINE \"" + this->Name + @@ -1362,11 +1380,13 @@ namespace MicroturbineElectricGenerator { if (ThermalEffFTempElev < 0.0) { if (this->ThermEffFTempElevErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "... Electrical Power Modifier curve (function of temperature and elevation) output is less than zero (" + - General::TrimSigDigits(PowerFTempElev, 4) + ")."); - ShowContinueError(state, "... Value occurs using a combustion inlet air temperature of " + - General::TrimSigDigits(CombustionAirInletTemp, 2) + " C."); - ShowContinueError(state, "... and an elevation of " + General::TrimSigDigits(DataEnvironment::Elevation, 2) + " m."); + ShowContinueError( + state, + format("... Electrical Power Modifier curve (function of temperature and elevation) output is less than zero ({:.4T}).", + PowerFTempElev)); + ShowContinueError(state, + format("... Value occurs using a combustion inlet air temperature of {:.2T} C.", CombustionAirInletTemp)); + ShowContinueError(state, format("... and an elevation of {:.2T} m.", DataEnvironment::Elevation)); ShowContinueErrorTimeStamp(state, "... Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, "GENERATOR:MICROTURBINE \"" + this->Name + @@ -1390,9 +1410,10 @@ namespace MicroturbineElectricGenerator { if (HeatRecRateFPLR < 0.0) { if (this->HeatRecRateFPLRErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "... Heat Recovery Rate Modifier (function of part-load ratio) output is less than zero (" + - General::TrimSigDigits(HeatRecRateFPLR, 4) + ")."); - ShowContinueError(state, "... Value occurs using a part-load ratio of " + General::TrimSigDigits(PLR, 3) + '.'); + ShowContinueError(state, + format("... Heat Recovery Rate Modifier (function of part-load ratio) output is less than zero ({:.4T}).", + HeatRecRateFPLR)); + ShowContinueError(state, format("... Value occurs using a part-load ratio of {:.3T}.", PLR)); ShowContinueErrorTimeStamp(state, "... Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -1415,10 +1436,10 @@ namespace MicroturbineElectricGenerator { if (HeatRecRateFTemp < 0.0) { if (this->HeatRecRateFTempErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "... Heat Recovery Rate Modifier (function of inlet water temp) output is less than zero (" + - General::TrimSigDigits(HeatRecRateFTemp, 4) + ")."); - ShowContinueError(state, "... Value occurs using an inlet water temperature temperature of " + - General::TrimSigDigits(HeatRecInTemp, 2) + " C."); + ShowContinueError(state, + format("... Heat Recovery Rate Modifier (function of inlet water temp) output is less than zero ({:.4T}).", + HeatRecRateFTemp)); + ShowContinueError(state, format("... Value occurs using an inlet water temperature temperature of {:.2T} C.", HeatRecInTemp)); ShowContinueErrorTimeStamp(state, "... Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -1446,9 +1467,10 @@ namespace MicroturbineElectricGenerator { if (HeatRecRateFFlow < 0.0) { if (this->HeatRecRateFFlowErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "... Heat Recovery Rate Modifier (function of water flow rate) output is less than zero (" + - General::TrimSigDigits(HeatRecRateFFlow, 4) + ")."); - ShowContinueError(state, "... Value occurs using a water flow rate of " + General::TrimSigDigits(HeatRecVolFlowRate, 4) + " m3/s."); + ShowContinueError(state, + format("... Heat Recovery Rate Modifier (function of water flow rate) output is less than zero ({:.4T}).", + HeatRecRateFFlow)); + ShowContinueError(state, format("... Value occurs using a water flow rate of {:.4T} m3/s.", HeatRecVolFlowRate)); ShowContinueErrorTimeStamp(state, "... Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -1504,9 +1526,10 @@ namespace MicroturbineElectricGenerator { if (this->HeatRecMinMassFlowRate > heatRecMdot && heatRecMdot > 0.0) { if (this->HRMinFlowErrorIndex == 0) { ShowWarningError(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "...Heat reclaim water flow rate is below the generators minimum mass flow rate of (" + - General::TrimSigDigits(this->HeatRecMinMassFlowRate, 4) + ")."); - ShowContinueError(state, "...Heat reclaim water mass flow rate = " + General::TrimSigDigits(heatRecMdot, 4) + '.'); + ShowContinueError(state, + format("...Heat reclaim water flow rate is below the generators minimum mass flow rate of ({:.4T}).", + this->HeatRecMinMassFlowRate)); + ShowContinueError(state, format("...Heat reclaim water mass flow rate = {:.4T}.", heatRecMdot)); ShowContinueErrorTimeStamp(state, "...Check inputs for heat recovery water flow rate."); } ShowRecurringWarningErrorAtEnd(state, @@ -1521,9 +1544,10 @@ namespace MicroturbineElectricGenerator { if (heatRecMdot > this->HeatRecMaxMassFlowRate && heatRecMdot > 0.0) { if (this->HRMaxFlowErrorIndex == 0) { ShowWarningError(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "...Heat reclaim water flow rate is above the generators maximum mass flow rate of (" + - General::TrimSigDigits(this->HeatRecMaxMassFlowRate, 4) + ")."); - ShowContinueError(state, "...Heat reclaim water mass flow rate = " + General::TrimSigDigits(heatRecMdot, 4) + '.'); + ShowContinueError(state, + format("...Heat reclaim water flow rate is above the generators maximum mass flow rate of ({:.4T}).", + this->HeatRecMaxMassFlowRate)); + ShowContinueError(state, format("...Heat reclaim water mass flow rate = {:.4T}.", heatRecMdot)); ShowContinueErrorTimeStamp(state, "...Check inputs for heat recovery water flow rate."); } ShowRecurringWarningErrorAtEnd(state, @@ -1553,10 +1577,12 @@ namespace MicroturbineElectricGenerator { if (ExhFlowFTemp <= 0.0) { if (this->ExhFlowFTempErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "...Exhaust Air Flow Rate Modifier (function of temperature) output is less than or equal to zero (" + - General::TrimSigDigits(ExhFlowFTemp, 4) + ")."); - ShowContinueError(state, "...Value occurs using a combustion inlet air temperature of " + - General::TrimSigDigits(CombustionAirInletTemp, 2) + '.'); + ShowContinueError( + state, + format("...Exhaust Air Flow Rate Modifier (function of temperature) output is less than or equal to zero ({:.4T}).", + ExhFlowFTemp)); + ShowContinueError(state, + format("...Value occurs using a combustion inlet air temperature of {:.2T}.", CombustionAirInletTemp)); ShowContinueErrorTimeStamp(state, "...Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, @@ -1579,9 +1605,11 @@ namespace MicroturbineElectricGenerator { if (ExhFlowFPLR <= 0.0) { if (this->ExhFlowFPLRErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "...Exhaust Air Flow Rate Modifier (function of part-load ratio) output is less than or equal to zero (" + - General::TrimSigDigits(ExhFlowFPLR, 4) + ")."); - ShowContinueError(state, "...Value occurs using a part-load ratio of " + General::TrimSigDigits(PLR, 2) + '.'); + ShowContinueError( + state, + format("...Exhaust Air Flow Rate Modifier (function of part-load ratio) output is less than or equal to zero ({:.4T}).", + ExhFlowFPLR)); + ShowContinueError(state, format("...Value occurs using a part-load ratio of {:.2T}.", PLR)); ShowContinueErrorTimeStamp(state, "...Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, "GENERATOR:MICROTURBINE \"" + this->Name + @@ -1618,10 +1646,12 @@ namespace MicroturbineElectricGenerator { if (ExhAirTempFTemp <= 0.0) { if (this->ExhTempFTempErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "...Exhaust Air Temperature Modifier (function of temperature) output is less than or equal to zero (" + - General::TrimSigDigits(ExhAirTempFTemp, 4) + ")."); - ShowContinueError(state, "...Value occurs using a combustion inlet air temperature of " + - General::TrimSigDigits(CombustionAirInletTemp, 2) + '.'); + ShowContinueError( + state, + format("...Exhaust Air Temperature Modifier (function of temperature) output is less than or equal to zero ({:.4T}).", + ExhAirTempFTemp)); + ShowContinueError(state, + format("...Value occurs using a combustion inlet air temperature of {:.2T}.", CombustionAirInletTemp)); ShowContinueErrorTimeStamp(state, "...Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, "GENERATOR:MICROTURBINE \"" + this->Name + @@ -1644,9 +1674,11 @@ namespace MicroturbineElectricGenerator { if (ExhAirTempFPLR <= 0.0) { if (this->ExhTempFPLRErrorIndex == 0) { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); - ShowContinueError(state, "...Exhaust Air Temperature Modifier (function of part-load ratio) output is less than or equal to zero (" + - General::TrimSigDigits(ExhAirTempFPLR, 4) + ")."); - ShowContinueError(state, "...Value occurs using a part-load ratio of " + General::TrimSigDigits(PLR, 2) + '.'); + ShowContinueError( + state, + format("...Exhaust Air Temperature Modifier (function of part-load ratio) output is less than or equal to zero ({:.4T}).", + ExhAirTempFPLR)); + ShowContinueError(state, format("...Value occurs using a part-load ratio of {:.2T}.", PLR)); ShowContinueErrorTimeStamp(state, "...Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, "GENERATOR:MICROTURBINE \"" + this->Name + @@ -1695,8 +1727,8 @@ namespace MicroturbineElectricGenerator { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); ShowContinueError(state, "...The model has calculated the exhaust air temperature to be less than the combustion air inlet temperature."); - ShowContinueError(state, "...Value of exhaust air temperature =" + General::TrimSigDigits(this->ExhaustAirTemperature, 4) + " C."); - ShowContinueError(state, "...Value of combustion air inlet temp =" + General::TrimSigDigits(CombustionAirInletTemp, 4) + " C."); + ShowContinueError(state, format("...Value of exhaust air temperature ={:.4T} C.", this->ExhaustAirTemperature)); + ShowContinueError(state, format("...Value of combustion air inlet temp ={:.4T} C.", CombustionAirInletTemp)); ShowContinueErrorTimeStamp(state, "... Simulation will continue."); } ShowRecurringWarningErrorAtEnd(state, "GENERATOR:MICROTURBINE \"" + this->Name + @@ -1711,10 +1743,10 @@ namespace MicroturbineElectricGenerator { ShowWarningMessage(state, "GENERATOR:MICROTURBINE \"" + this->Name + "\""); ShowContinueError(state, "...The model has calculated the exhaust air humidity ratio to be less than the combustion air inlet humidity ratio."); - ShowContinueError(state, "...Value of exhaust air humidity ratio =" + General::TrimSigDigits(this->ExhaustAirHumRat, 6) + - " kgWater/kgDryAir."); - ShowContinueError(state, "...Value of combustion air inlet humidity ratio =" + General::TrimSigDigits(CombustionAirInletW, 6) + - " kgWater/kgDryAir."); + ShowContinueError(state, + format("...Value of exhaust air humidity ratio ={:.6T} kgWater/kgDryAir.", this->ExhaustAirHumRat)); + ShowContinueError(state, + format("...Value of combustion air inlet humidity ratio ={:.6T} kgWater/kgDryAir.", CombustionAirInletW)); ShowContinueErrorTimeStamp(state, "... Simulation will continue."); } ShowRecurringWarningErrorAtEnd(state, diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index ea742e70352..31f85a7065c 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -95,7 +94,6 @@ #include #include #include -#include #include #include #include @@ -1368,8 +1366,7 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); using DataZoneEquipment::NumOfZoneEquipLists; using DataZoneEquipment::ZoneEquipConfig; using DataZoneEquipment::ZoneEquipList; - using General::RoundSigDigits; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; using namespace OutputReportPredefined; @@ -2262,8 +2259,7 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); using DataZoneEquipment::NumOfZoneEquipLists; using DataZoneEquipment::ZoneEquipConfig; using DataZoneEquipment::ZoneEquipList; - using General::RoundSigDigits; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; using namespace OutputReportPredefined; @@ -2522,10 +2518,10 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); ShowContinueError(state, "... A fixed minimum outside air flow rate and high humidity control have been specified."); ShowContinueError(state, "... The " + cNumericFields(7) + " is less than the ratio of the outside air controllers minimum to maximum outside air flow rate."); - ShowContinueError(state, "... Controller " + cNumericFields(1) + " = " + TrimSigDigits(OAController(OutAirNum).MinOA, 4) + " m3/s."); - ShowContinueError(state, "... Controller " + cNumericFields(2) + " = " + TrimSigDigits(OAController(OutAirNum).MaxOA, 4) + " m3/s."); - ShowContinueError(state, "... Controller minimum to maximum flow ratio = " + TrimSigDigits(OAFlowRatio, 4) + '.'); - ShowContinueError(state, "... " + cNumericFields(7) + " = " + TrimSigDigits(OAController(OutAirNum).HighRHOAFlowRatio, 4) + '.'); + ShowContinueError(state, format("... Controller {} = {:.4T} m3/s.", cNumericFields(1), OAController(OutAirNum).MinOA)); + ShowContinueError(state, format("... Controller {} = {:.4T} m3/s.", cNumericFields(2), OAController(OutAirNum).MaxOA)); + ShowContinueError(state, format("... Controller minimum to maximum flow ratio = {:.4T}.", OAFlowRatio)); + ShowContinueError(state, format("... {} = {:.4T}.", cNumericFields(7), OAController(OutAirNum).HighRHOAFlowRatio)); } } } @@ -2673,7 +2669,6 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); using DataHeatBalance::ZoneList; using Psychrometrics::PsyRhoAirFnPbTdbW; - using General::RoundSigDigits; using namespace OutputReportPredefined; using EMSManager::CheckIfNodeSetPointManagedByEMS; using EMSManager::iTemperatureSetPoint; @@ -2843,8 +2838,10 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); } if ((thisOAController.MaxOA - thisOAController.MinOA) < -SmallAirVolFlow) { ShowSevereError(state, "For Controller:OutdoorAir: " + thisOAController.Name); - ShowContinueError(state, " maximum outdoor air flow rate (" + RoundSigDigits(thisOAController.MaxOA, 4) + - ") < minimum outdoor air flow rate (" + RoundSigDigits(thisOAController.MinOA, 4) + ')'); + ShowContinueError(state, + format(" maximum outdoor air flow rate ({:.4R}) < minimum outdoor air flow rate ({:.4R})", + thisOAController.MaxOA, + thisOAController.MinOA)); ShowContinueError(state, " To set the minimum outside air flow rate use the \"Design (minimum) outdoor air flow rate\" field in the " "Sizing:System object"); ErrorsFound = true; @@ -2855,8 +2852,10 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); if ((thisOAController.MinOA - DesSupplyVolFlowRate) > 0.0001) { ShowWarningError(state, "InitOAController: Minimum Outdoor Air Flow Rate for Controller:OutdoorAir=" + thisOAController.Name + " is greater than Design Supply Air Flow Rate for AirLoopHVAC=" + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name + "."); - ShowContinueError(state, "...Minimum Outdoor Air Flow Rate=" + RoundSigDigits(thisOAController.MinOA, 6) + - " will be reset to loop Design Supply Air Flow Rate=" + RoundSigDigits(DesSupplyVolFlowRate, 6)); + ShowContinueError(state, + format("...Minimum Outdoor Air Flow Rate={:.6R} will be reset to loop Design Supply Air Flow Rate={:.6R}", + thisOAController.MinOA, + DesSupplyVolFlowRate)); thisOAController.MinOA = DesSupplyVolFlowRate; } else if ((thisOAController.MinOA - DesSupplyVolFlowRate) > 0.0) { // If difference is tiny, reset silently @@ -2865,8 +2864,10 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); if ((thisOAController.MaxOA - DesSupplyVolFlowRate) > 0.0001) { ShowWarningError(state, "InitOAController: Maximum Outdoor Air Flow Rate for Controller:OutdoorAir=" + thisOAController.Name + " is greater than Design Supply Air Flow Rate for AirLoopHVAC=" + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name + "."); - ShowContinueError(state, "...Maximum Outdoor Air Flow Rate=" + RoundSigDigits(thisOAController.MaxOA, 6) + - " will be reset to loop Design Supply Air Flow Rate=" + RoundSigDigits(DesSupplyVolFlowRate, 6)); + ShowContinueError(state, + format("...Maximum Outdoor Air Flow Rate={:.6R} will be reset to loop Design Supply Air Flow Rate={:.6R}", + thisOAController.MaxOA, + DesSupplyVolFlowRate)); thisOAController.MaxOA = DesSupplyVolFlowRate; } else if ((thisOAController.MaxOA - DesSupplyVolFlowRate) > 0.0) { // If difference is tiny, reset silently @@ -3556,8 +3557,6 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); // Using/Aliasing using CurveManager::CurveValue; - using DataHeatBalFanSys::ZoneAirHumRat; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -3684,8 +3683,8 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); this->Name + ", Min OA fraction is used."); ShowContinueError(state, "This may be overriding desired ventilation controls. Check inputs for Minimum Outdoor Air Flow Rate, Minimum " "Outdoor Air Schedule Name and Controller:MechanicalVentilation"); - ShowContinueErrorTimeStamp(state, "Minimum OA fraction = " + RoundSigDigits(OutAirMinFrac, 4) + - ", Mech Vent OA fraction = " + RoundSigDigits(MechVentOutsideAirMinFrac, 4)); + ShowContinueErrorTimeStamp( + state, format("Minimum OA fraction = {:.4R}, Mech Vent OA fraction = {:.4R}", OutAirMinFrac, MechVentOutsideAirMinFrac)); } else { ShowRecurringWarningErrorAtEnd(state, "Controller:OutdoorAir=\"" + this->Name + "\": Min OA fraction > Mechanical ventilation OA fraction, continues...", @@ -3866,7 +3865,7 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); using DataHeatBalance::ZoneIntGain; using DataZoneEnergyDemands::ZoneSysEnergyDemand; using DataZoneEquipment::ZoneEquipConfig; - using General::RoundSigDigits; + using Psychrometrics::PsyRhoAirFnPbTdbW; static std::string const RoutineName("CalcMechVentController: "); @@ -4143,11 +4142,12 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); ++this->OAMaxMinLimitErrorCount; if (this->OAMaxMinLimitErrorCount < 2) { ShowSevereError(state, RoutineName + CurrentModuleObject + " = \"" + this->Name + "\"."); - ShowContinueError(state, "For System Outdoor Air Method = ProportionalControlBasedOnDesignOARate, maximum " - "zone outdoor air rate (" + - RoundSigDigits(ZoneOAMax, 4) + - "), is not greater than minimum zone outdoor air rate (" + - RoundSigDigits(ZoneOAMin, 4) + ")."); + ShowContinueError( + state, + format("For System Outdoor Air Method = ProportionalControlBasedOnDesignOARate, maximum zone " + "outdoor air rate ({:.4R}), is not greater than minimum zone outdoor air rate ({:.4R}).", + ZoneOAMax, + ZoneOAMin)); ShowContinueError(state, " The minimum zone outdoor air rate is set to the maximum zone outdoor air rate. " "Simulation continues..."); ShowContinueErrorTimeStamp(state, ""); @@ -4188,12 +4188,13 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); if (this->SystemOAMethod == SOAM_ProportionalControlSchOcc) { if (this->CO2MaxMinLimitErrorCount < 2) { ShowSevereError(state, RoutineName + CurrentModuleObject + " = \"" + this->Name + "\"."); - ShowContinueError(state, "For System Outdoor Air Method = " - "ProportionalControlBasedonOccupancySchedule, maximum target CO2 " - "concentration (" + - RoundSigDigits(ZoneMaxCO2, 2) + - "), is not greater than minimum target CO2 concentration (" + - RoundSigDigits(ZoneMinCO2, 2) + ")."); + ShowContinueError( + state, + format("For System Outdoor Air Method = ProportionalControlBasedonOccupancySchedule, " + "maximum target CO2 concentration ({:.2R}), is not greater than minimum target " + "CO2 concentration ({:.2R}).", + ZoneMaxCO2, + ZoneMinCO2)); ShowContinueError(state, "\"ProportionalControlBasedonOccupancySchedule\" will not be modeled. " "Default \"VentilationRateProcedure\" will be modeled. Simulation " "continues..."); @@ -4210,12 +4211,13 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); if (this->SystemOAMethod == SOAM_ProportionalControlDesOcc) { if (this->CO2MaxMinLimitErrorCount < 2) { ShowSevereError(state, RoutineName + CurrentModuleObject + " = \"" + this->Name + "\"."); - ShowContinueError(state, "For System Outdoor Air Method = " - "ProportionalControlBasedonDesignOccupancy, maximum target CO2 " - "concentration (" + - RoundSigDigits(ZoneMaxCO2, 2) + - "), is not greater than minimum target CO2 concentration (" + - RoundSigDigits(ZoneMinCO2, 2) + ")."); + ShowContinueError( + state, + format("For System Outdoor Air Method = ProportionalControlBasedonDesignOccupancy, " + "maximum target CO2 concentration ({:.2R}), is not greater than minimum target " + "CO2 concentration ({:.2R}).", + ZoneMaxCO2, + ZoneMinCO2)); ShowContinueError(state, "\"ProportionalControlBasedonDesignOccupancy\" will not be modeled. " "Default \"VentilationRateProcedure\" will be modeled. Simulation " "continues..."); @@ -4232,11 +4234,13 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); if (this->SystemOAMethod == SOAM_ProportionalControlDesOARate) { if (this->CO2MaxMinLimitErrorCount < 2) { ShowSevereError(state, RoutineName + CurrentModuleObject + " = \"" + this->Name + "\"."); - ShowContinueError(state, "For System Outdoor Air Method = ProportionalControlBasedOnDesignOARate, " - "maximum target CO2 concentration (" + - RoundSigDigits(ZoneMaxCO2, 2) + - "), is not greater than minimum target CO2 concentration (" + - RoundSigDigits(ZoneMinCO2, 2) + ")."); + ShowContinueError( + state, + format("For System Outdoor Air Method = ProportionalControlBasedOnDesignOARate, maximum " + "target CO2 concentration ({:.2R}), is not greater than minimum target CO2 " + "concentration ({:.2R}).", + ZoneMaxCO2, + ZoneMinCO2)); ShowContinueError(state, "\"ProportionalControlBasedOnDesignOARate\" will not be modeled. Default " "\"VentilationRateProcedure\" will be modeled. Simulation continues..."); ShowContinueErrorTimeStamp(state, ""); @@ -4899,7 +4903,7 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); // Obtains flow rates from the zone or system sizing arrays. // Using/Aliasing - using General::TrimSigDigits; + using HVACHXAssistedCoolingCoil::GetHXCoilType; using HVACHXAssistedCoolingCoil::GetHXDXCoilName; using WaterCoils::SetCoilDesFlow; @@ -4995,10 +4999,10 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); ShowContinueError(state, "... A fixed minimum outdoor air flow rate and high humidity control have been specified."); ShowContinueError(state, "... The High Humidity Outdoor Air Flow Ratio is less than the ratio of the outdoor air controllers " "minimum to maximum outside air flow rate."); - ShowContinueError(state, "... Controller minimum flow rate = " + TrimSigDigits(this->MinOA, 4) + " m3/s."); - ShowContinueError(state, "... Controller maximum flow rate = " + TrimSigDigits(this->MaxOA, 4) + " m3/s."); - ShowContinueError(state, "... Controller minimum to maximum flow ratio = " + TrimSigDigits(OAFlowRatio, 4) + '.'); - ShowContinueError(state, "... High humidity control flow ratio = " + TrimSigDigits(this->HighRHOAFlowRatio, 4) + '.'); + ShowContinueError(state, format("... Controller minimum flow rate = {:.4T} m3/s.", this->MinOA)); + ShowContinueError(state, format("... Controller maximum flow rate = {:.4T} m3/s.", this->MaxOA)); + ShowContinueError(state, format("... Controller minimum to maximum flow ratio = {:.4T}.", OAFlowRatio)); + ShowContinueError(state, format("... High humidity control flow ratio = {:.4T}.", this->HighRHOAFlowRatio)); } } } @@ -5508,7 +5512,6 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); // na // Using/Aliasing - using General::TrimSigDigits; // Return value int ReliefNodeNumber; // Relief Node Number @@ -5534,8 +5537,8 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); } if (OAMixerNum > NumOAMixers) { - ShowFatalError(state, "GetOAMixerReliefNodeNumber: Requested Mixer #=" + TrimSigDigits(OAMixerNum) + - ", which is > number of OA Mixers=" + TrimSigDigits(NumOAMixers)); + ShowFatalError(state, + format("GetOAMixerReliefNodeNumber: Requested Mixer #={}, which is > number of OA Mixers={}", OAMixerNum, NumOAMixers)); } ReliefNodeNumber = OAMixer(OAMixerNum).RelNode; diff --git a/src/EnergyPlus/MixerComponent.cc b/src/EnergyPlus/MixerComponent.cc index b129035101e..8500f322cd9 100644 --- a/src/EnergyPlus/MixerComponent.cc +++ b/src/EnergyPlus/MixerComponent.cc @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -143,9 +142,6 @@ namespace MixerComponent { // It is called from the SimAirLoopComponent // at the system time step. - // Using/Aliasing - using General::TrimSigDigits; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int MixerNum; // The Mixer that you are currently loading input into //////////// hoisted into namespace //////////////////////////////////////////////// @@ -170,13 +166,16 @@ namespace MixerComponent { } else { MixerNum = CompIndex; if (MixerNum > NumMixers || MixerNum < 1) { - ShowFatalError(state, "SimAirLoopMixer: Invalid CompIndex passed=" + TrimSigDigits(MixerNum) + - ", Number of Mixers=" + TrimSigDigits(NumMixers) + ", Mixer name=" + CompName); + ShowFatalError( + state, format("SimAirLoopMixer: Invalid CompIndex passed={}, Number of Mixers={}, Mixer name={}", MixerNum, NumMixers, CompName)); } if (CheckEquipName(MixerNum)) { if (CompName != MixerCond(MixerNum).MixerName) { - ShowFatalError(state, "SimAirLoopMixer: Invalid CompIndex passed=" + TrimSigDigits(MixerNum) + ", Mixer name=" + CompName + - ", stored Mixer Name for that index=" + MixerCond(MixerNum).MixerName); + ShowFatalError(state, + format("SimAirLoopMixer: Invalid CompIndex passed={}, Mixer name={}, stored Mixer Name for that index={}", + MixerNum, + CompName, + MixerCond(MixerNum).MixerName)); } CheckEquipName(MixerNum) = false; } @@ -213,7 +212,6 @@ namespace MixerComponent { // Uses the status flags to trigger events. // Using/Aliasing - using General::TrimSigDigits; using NodeInputManager::GetOnlySingleNode; // SUBROUTINE PARAMETER DEFINITIONS: @@ -327,7 +325,7 @@ namespace MixerComponent { ShowSevereError(state, CurrentModuleObject + " = " + MixerCond(MixerNum).MixerName + " specifies an inlet node name the same as the outlet node."); ShowContinueError(state, ".." + cAlphaFields(2) + " = " + NodeID(NodeNum)); - ShowContinueError(state, "..Inlet Node #" + TrimSigDigits(InNodeNum1) + " is duplicate."); + ShowContinueError(state, format("..Inlet Node #{} is duplicate.", InNodeNum1)); ErrorsFound = true; } for (InNodeNum1 = 1; InNodeNum1 <= MixerCond(MixerNum).NumInletNodes; ++InNodeNum1) { @@ -335,8 +333,8 @@ namespace MixerComponent { if (MixerCond(MixerNum).InletNode(InNodeNum1) != MixerCond(MixerNum).InletNode(InNodeNum2)) continue; ShowSevereError(state, CurrentModuleObject + " = " + MixerCond(MixerNum).MixerName + " specifies duplicate inlet nodes in its inlet node list."); - ShowContinueError(state, "..Inlet Node #" + TrimSigDigits(InNodeNum1) + " Name=" + NodeID(InNodeNum1)); - ShowContinueError(state, "..Inlet Node #" + TrimSigDigits(InNodeNum2) + " is duplicate."); + ShowContinueError(state, format("..Inlet Node #{} Name={}", InNodeNum1, NodeID(InNodeNum1))); + ShowContinueError(state, format("..Inlet Node #{} is duplicate.", InNodeNum2)); ErrorsFound = true; } } diff --git a/src/EnergyPlus/NodeInputManager.cc b/src/EnergyPlus/NodeInputManager.cc index 2593256d157..828586cab09 100644 --- a/src/EnergyPlus/NodeInputManager.cc +++ b/src/EnergyPlus/NodeInputManager.cc @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -82,13 +81,6 @@ namespace NodeInputManager { // To provide utilities for reading and assigning indices for the // nodes in the HVAC loops. - // METHODOLOGY EMPLOYED: - - // REFERENCES: - - // OTHER NOTES: - - using General::TrimSigDigits; using namespace DataLoopNode; using namespace BranchNodeConnections; @@ -218,7 +210,7 @@ namespace NodeInputManager { if (NodeFluidType != NodeType_Air && NodeFluidType != NodeType_Water && NodeFluidType != NodeType_Electric && NodeFluidType != NodeType_Steam && NodeFluidType != NodeType_Unknown) { ShowSevereError(state, RoutineName + NodeObjectType + "=\"" + NodeObjectName + "\", invalid fluid type."); - ShowContinueError(state, "..Invalid FluidType=" + std::to_string(NodeFluidType)); + ShowContinueError(state, format("..Invalid FluidType={}", NodeFluidType)); ErrorsFound = true; ShowFatalError(state, "Preceding issue causes termination."); } @@ -260,7 +252,7 @@ namespace NodeInputManager { if (NodeConnectionType >= 1 && NodeConnectionType <= NumValidConnectionTypes) { ConnectionType = ValidConnectionTypes(NodeConnectionType); } else { - ConnectionType = TrimSigDigits(NodeConnectionType) + "-unknown"; + ConnectionType = format("{}-unknown", NodeConnectionType); } // If requested, assign NodeFluidStream to the first node and increment the fluid stream number // for each remaining node in the list @@ -632,7 +624,7 @@ namespace NodeInputManager { NodeLists(NCount).NodeNumbers(Loop1) = AssignNodeNumber(state, NodeLists(NCount).NodeNames(Loop1), NodeType_Unknown, localErrorsFound); if (UtilityRoutines::SameString(NodeLists(NCount).NodeNames(Loop1), NodeLists(NCount).Name)) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + cAlphas(1) + "\", invalid node name in list."); - ShowContinueError(state, "... Node " + TrimSigDigits(Loop1) + " Name=\"" + cAlphas(Loop1 + 1) + "\", duplicates NodeList Name."); + ShowContinueError(state, format("... Node {} Name=\"{}\", duplicates NodeList Name.", Loop1, cAlphas(Loop1 + 1))); localErrorsFound = true; } } @@ -645,9 +637,12 @@ namespace NodeInputManager { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + cAlphas(1) + "\" has duplicate nodes:"); flagError = false; } - ShowContinueError(state, "...list item=" + TrimSigDigits(Loop1) + ", \"" + NodeID(NodeLists(NCount).NodeNumbers(Loop1)) + - "\", duplicate list item=" + TrimSigDigits(Loop2) + ", \"" + NodeID(NodeLists(NCount).NodeNumbers(Loop2)) + - "\"."); + ShowContinueError(state, + format("...list item={}, \"{}\", duplicate list item={}, \"{}\".", + Loop1, + NodeID(NodeLists(NCount).NodeNumbers(Loop1)), + Loop2, + NodeID(NodeLists(NCount).NodeNumbers(Loop2)))); localErrorsFound = true; } } @@ -659,8 +654,7 @@ namespace NodeInputManager { if (Loop == Loop1) continue; // within a nodelist have already checked to see if node name duplicates nodelist name if (!UtilityRoutines::SameString(NodeLists(Loop).NodeNames(Loop2), NodeLists(Loop1).Name)) continue; ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + NodeLists(Loop1).Name + "\", invalid node name in list."); - ShowContinueError(state, "... Node " + TrimSigDigits(Loop2) + " Name=\"" + NodeLists(Loop).NodeNames(Loop2) + - "\", duplicates NodeList Name."); + ShowContinueError(state, format("... Node {} Name=\"{}\", duplicates NodeList Name.", Loop2, NodeLists(Loop).NodeNames(Loop2))); ShowContinueError(state, "... NodeList=\"" + NodeLists(Loop1).Name + "\", is duplicated."); ShowContinueError(state, "... Items in NodeLists must not be the name of another NodeList."); localErrorsFound = true; @@ -719,7 +713,7 @@ namespace NodeInputManager { if (NodeFluidType != NodeType_Air && NodeFluidType != NodeType_Water && NodeFluidType != NodeType_Electric && NodeFluidType != NodeType_Steam && NodeFluidType != NodeType_Unknown) { - ShowSevereError(state, "AssignNodeNumber: Invalid FluidType=" + std::to_string(NodeFluidType)); + ShowSevereError(state, format("AssignNodeNumber: Invalid FluidType={}", NodeFluidType)); ErrorsFound = true; ShowFatalError(state, "AssignNodeNumber: Preceding issue causes termination."); } @@ -869,7 +863,7 @@ namespace NodeInputManager { if (NodeConnectionType >= 1 && NodeConnectionType <= NumValidConnectionTypes) { ConnectionType = ValidConnectionTypes(NodeConnectionType); } else { - ConnectionType = TrimSigDigits(NodeConnectionType) + "-unknown"; + ConnectionType = format("{}-unknown", NodeConnectionType); } // CALL RegisterNodeConnection(NodeNums(1),NodeID(NodeNums(1)),NodeObjectType,NodeObjectName, & // ConnectionType,NodeFluidStream,ObjectIsParent,errFlag) @@ -1118,7 +1112,6 @@ namespace NodeInputManager { using FluidProperties::GetSatEnthalpyRefrig; using FluidProperties::GetSpecificHeatGlycol; using FluidProperties::NumOfGlycols; - using General::RoundSigDigits; using OutputProcessor::NumOfReqVariables; using OutputProcessor::ReqReportVariables; using OutputProcessor::ReqRepVars; diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 38955182dc9..fc64b9c1c3e 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -55,7 +55,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -64,11 +63,8 @@ #include #include #include -#include -#include #include #include -#include #include #include #include @@ -89,7 +85,6 @@ #include #include #include -#include #include #include #include @@ -129,7 +124,6 @@ namespace OutdoorAirUnit { using namespace ScheduleManager; using namespace Psychrometrics; using namespace FluidProperties; - using General::TrimSigDigits; // component types addressed by this module std::string const cMO_OutdoorAirUnit("ZoneHVAC:OutdoorAirUnit"); @@ -237,7 +231,6 @@ namespace OutdoorAirUnit { // Standard EnergyPlus methodology. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int OAUnitNum; // index of outdoor air unit being simulated @@ -259,13 +252,19 @@ namespace OutdoorAirUnit { } else { OAUnitNum = CompIndex; if (OAUnitNum > NumOfOAUnits || OAUnitNum < 1) { - ShowFatalError(state, "SimOutdoorAirUnit: Invalid CompIndex passed=" + TrimSigDigits(OAUnitNum) + - ", Number of Units=" + TrimSigDigits(NumOfOAUnits) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimOutdoorAirUnit: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + OAUnitNum, + NumOfOAUnits, + CompName)); } if (CheckEquipName(OAUnitNum)) { if (CompName != OutAirUnit(OAUnitNum).Name) { - ShowFatalError(state, "SimOutdoorAirUnit: Invalid CompIndex passed=" + TrimSigDigits(OAUnitNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + OutAirUnit(OAUnitNum).Name); + ShowFatalError(state, + format("SimOutdoorAirUnit: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + OAUnitNum, + CompName, + OutAirUnit(OAUnitNum).Name)); } CheckEquipName(OAUnitNum) = false; } @@ -323,7 +322,6 @@ namespace OutdoorAirUnit { using SteamCoils::GetSteamCoilIndex; using WaterCoils::CheckWaterCoilSchedule; using namespace DataLoopNode; - using namespace DataSurfaceLists; using OutAirNodeManager::CheckAndAddAirNodeNumber; using WaterCoils::GetCoilWaterInletNode; using WaterCoils::GetWaterCoilIndex; @@ -551,8 +549,7 @@ namespace OutdoorAirUnit { if (NumArray(2) != NumArray(1)) { ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFields(1) + " and " + cNumericFields(2) + " are not equal. This may cause unbalanced flow."); - ShowContinueError(state, cNumericFields(1) + "=" + General::RoundSigDigits(NumArray(1), 3) + " and " + cNumericFields(2) + "=" + - General::RoundSigDigits(NumArray(2), 3)); + ShowContinueError(state, format("{}={:.3R}= and {}{:.3R}", cNumericFields(1), NumArray(1), cNumericFields(2), NumArray(2))); } } // A8 @@ -1463,7 +1460,7 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; using DataPlant::TypeOf_CoilWaterSimpleHeating; using Fans::GetFanDesignVolumeFlowRate; - using General::RoundSigDigits; + using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; using PlantUtilities::MyPlantSizingIndex; using SteamCoils::SimulateSteamCoilComponents; @@ -1544,9 +1541,8 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); OutAirVolFlowDes); ShowMessage(state, "SizeOutdoorAirUnit: Potential issue with equipment sizing for ZoneHVAC:OutdoorAirUnit " + OutAirUnit(OAUnitNum).Name); - ShowContinueError(state, "User-Specified Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Outdoor Air Flow Rate of {:.5R} [m3/s]", OutAirVolFlowUser)); + ShowContinueError(state, format("differs from Design Size Outdoor Air Flow Rate of {:.5R} [m3/s]", OutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1588,9 +1584,8 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); ExtAirVolFlowDes); ShowMessage(state, "SizeOutdoorAirUnit: Potential issue with equipment sizing for ZoneHVAC:OutdoorAirUnit " + OutAirUnit(OAUnitNum).Name); - ShowContinueError(state, "User-Specified Exhaust Air Flow Rate of " + RoundSigDigits(ExtAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Exhaust Air Flow Rate of " + RoundSigDigits(ExtAirVolFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Exhaust Air Flow Rate of {:.5R} [m3/s]", ExtAirVolFlowUser)); + ShowContinueError(state, format("differs from Design Size Exhaust Air Flow Rate of {:.5R} [m3/s]", ExtAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1713,7 +1708,6 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); // USE STATEMENTS: // Using/Aliasing - using namespace DataZoneEnergyDemands; using DataEnvironment::CurMnDy; using DataEnvironment::EnvironmentName; using DataEnvironment::OutBaroPress; @@ -1885,8 +1879,9 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); ShowContinueError(state, "Air mass balance is required by other outdoor air units: Fan:ZoneExhaust, ZoneMixing, ZoneCrossMixing, or " "other air flow control inputs."); ShowContinueErrorTimeStamp(state, - "The outdoor mass flow rate = " + General::RoundSigDigits(OutAirUnit(OAUnitNum).OutAirMassFlow, 3) + - " and the exhaust mass flow rate = " + General::RoundSigDigits(OutAirUnit(OAUnitNum).ExtAirMassFlow, 3) + "."); + format("The outdoor mass flow rate = {:.3R} and the exhaust mass flow rate = {:.3R}.", + OutAirUnit(OAUnitNum).OutAirMassFlow, + OutAirUnit(OAUnitNum).ExtAirMassFlow)); OutAirUnit(OAUnitNum).FlowError = true; } } @@ -2135,7 +2130,6 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); // USE STATEMENTS: // Using/Aliasing - using namespace DataZoneEnergyDemands; using DataEnvironment::CurMnDy; using DataEnvironment::EnvironmentName; using DataEnvironment::OutBaroPress; @@ -2145,7 +2139,7 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); using DataHVACGlobals::SmallLoad; using DataLoopNode::Node; using DesiccantDehumidifiers::SimDesiccantDehumidifier; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using HeatRecovery::SimHeatRecovery; using HVACDXHeatPumpSystem::SimDXHeatPumpSystem; diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index c92829ced9b..ae7798689b3 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4144,8 +4144,7 @@ namespace OutputProcessor { break; default: if (sqlite) { - std::string str("Illegal reportingInterval passed to WriteTimeStampFormatData: " + - fmt::to_string(static_cast(reportingInterval))); + std::string str(format("Illegal reportingInterval passed to WriteTimeStampFormatData: {}", static_cast(reportingInterval))); sqlite->sqliteWriteMessage(str); } break; @@ -5459,7 +5458,6 @@ void SetupOutputVariable(EnergyPlusData &state, // Using/Aliasing using namespace OutputProcessor; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CV; @@ -5701,7 +5699,6 @@ void SetupOutputVariable(EnergyPlusData &state, // Using/Aliasing using namespace OutputProcessor; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CV; @@ -6986,7 +6983,6 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, // Using/Aliasing using namespace OutputProcessor; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7050,7 +7046,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, EnergyMeters(WhichMeter).TSAccRptNum, indexGroupKey, indexGroup, - TrimSigDigits(EnergyMeters(WhichMeter).TSAccRptNum), + fmt::to_string(EnergyMeters(WhichMeter).TSAccRptNum), EnergyMeters(WhichMeter).Name, EnergyMeters(WhichMeter).Units, true, @@ -7104,7 +7100,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, EnergyMeters(WhichMeter).HRAccRptNum, indexGroupKey, indexGroup, - TrimSigDigits(EnergyMeters(WhichMeter).HRAccRptNum), + fmt::to_string(EnergyMeters(WhichMeter).HRAccRptNum), EnergyMeters(WhichMeter).Name, EnergyMeters(WhichMeter).Units, true, @@ -7158,7 +7154,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, EnergyMeters(WhichMeter).DYAccRptNum, indexGroupKey, indexGroup, - TrimSigDigits(EnergyMeters(WhichMeter).DYAccRptNum), + fmt::to_string(EnergyMeters(WhichMeter).DYAccRptNum), EnergyMeters(WhichMeter).Name, EnergyMeters(WhichMeter).Units, true, @@ -7212,7 +7208,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, EnergyMeters(WhichMeter).MNAccRptNum, indexGroupKey, indexGroup, - TrimSigDigits(EnergyMeters(WhichMeter).MNAccRptNum), + fmt::to_string(EnergyMeters(WhichMeter).MNAccRptNum), EnergyMeters(WhichMeter).Name, EnergyMeters(WhichMeter).Units, true, @@ -7266,7 +7262,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, EnergyMeters(WhichMeter).YRAccRptNum, indexGroupKey, indexGroup, - TrimSigDigits(EnergyMeters(WhichMeter).YRAccRptNum), + fmt::to_string(EnergyMeters(WhichMeter).YRAccRptNum), EnergyMeters(WhichMeter).Name, EnergyMeters(WhichMeter).Units, true, @@ -7320,7 +7316,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, EnergyMeters(WhichMeter).SMAccRptNum, indexGroupKey, indexGroup, - TrimSigDigits(EnergyMeters(WhichMeter).SMAccRptNum), + fmt::to_string(EnergyMeters(WhichMeter).SMAccRptNum), EnergyMeters(WhichMeter).Name, EnergyMeters(WhichMeter).Units, true, @@ -7712,11 +7708,10 @@ Real64 GetInternalVariableValue(EnergyPlusData &state, } else if (varType == 1) { // Integer if (keyVarIndex > NumOfIVariable) { ShowFatalError(state, "GetInternalVariableValue: Integer variable passed index beyond range of array."); - ShowContinueError(state, "Index = " + General::TrimSigDigits(keyVarIndex) + - " Number of integer variables = " + General::TrimSigDigits(NumOfIVariable)); + ShowContinueError(state, format("Index = {} Number of integer variables = {}", keyVarIndex, NumOfIVariable)); } if (keyVarIndex < 1) { - ShowFatalError(state, "GetInternalVariableValue: Integer variable passed index <1. Index = " + General::TrimSigDigits(keyVarIndex)); + ShowFatalError(state, format("GetInternalVariableValue: Integer variable passed index <1. Index = {}", keyVarIndex)); } // must use %Which, %Value is always zero if variable is not a requested report variable @@ -7724,11 +7719,10 @@ Real64 GetInternalVariableValue(EnergyPlusData &state, } else if (varType == 2) { // real if (keyVarIndex > NumOfRVariable) { ShowFatalError(state, "GetInternalVariableValue: Real variable passed index beyond range of array."); - ShowContinueError(state, "Index = " + General::TrimSigDigits(keyVarIndex) + - " Number of real variables = " + General::TrimSigDigits(NumOfRVariable)); + ShowContinueError(state, format("Index = {} Number of real variables = {}", keyVarIndex, NumOfRVariable)); } if (keyVarIndex < 1) { - ShowFatalError(state, "GetInternalVariableValue: Integer variable passed index <1. Index = " + General::TrimSigDigits(keyVarIndex)); + ShowFatalError(state, format("GetInternalVariableValue: Integer variable passed index <1. Index = {}", keyVarIndex)); } // must use %Which, %Value is always zero if variable is not a requested report variable diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 65adc2bcd6d..ac28537986d 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -122,7 +122,6 @@ #include #include #include -#include #include #include #include @@ -1946,7 +1945,7 @@ namespace OutputReportTabular { using DataStringGlobals::CharComma; using DataStringGlobals::CharSpace; using DataStringGlobals::CharTab; - using General::RoundSigDigits; + using OutputProcessor::EndUseCategory; using OutputProcessor::MaxNumSubcategories; using OutputReportPredefined::numReportName; @@ -2228,8 +2227,10 @@ namespace OutputReportTabular { } } if (!nameFound) { - ShowSevereError(state, CurrentModuleObject + " Field[" + RoundSigDigits(iReport) + "]=\"" + AlphArray(iReport) + - "\", invalid report name -- will not be reported."); + ShowSevereError( + state, + format( + "{} Field[{}]=\"{}\", invalid report name -- will not be reported.", CurrentModuleObject, iReport, AlphArray(iReport))); // ErrorsFound=.TRUE. } } @@ -2497,7 +2498,6 @@ namespace OutputReportTabular { // Using/Aliasing using namespace DataOutputs; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2581,14 +2581,17 @@ namespace OutputReportTabular { namedMonthly(63).title = "HeatEmissionsReportMonthly"; if (numNamedMonthly != NumMonthlyReports) { - ShowFatalError(state, "InitializePredefinedMonthlyTitles: Number of Monthly Reports in OutputReportTabular=[" + RoundSigDigits(numNamedMonthly) + - "] does not match number in DataOutputs=[" + RoundSigDigits(NumMonthlyReports) + "]."); + ShowFatalError(state, + format("InitializePredefinedMonthlyTitles: Number of Monthly Reports in OutputReportTabular=[{}] does not match number in " + "DataOutputs=[{}].", + numNamedMonthly, + NumMonthlyReports)); } else { for (xcount = 1; xcount <= numNamedMonthly; ++xcount) { if (!UtilityRoutines::SameString(MonthlyNamedReports(xcount), namedMonthly(xcount).title)) { ShowSevereError(state, "InitializePredefinedMonthlyTitles: Monthly Report Titles in OutputReportTabular do not match titles in DataOutput."); - ShowContinueError(state, "first mismatch at ORT [" + RoundSigDigits(numNamedMonthly) + "] =\"" + namedMonthly(xcount).title + "\"."); + ShowContinueError(state, format("first mismatch at ORT [{}] =\"{}\".", numNamedMonthly, namedMonthly(xcount).title)); ShowContinueError(state, "same location in DO =\"" + MonthlyNamedReports(xcount) + "\"."); ShowFatalError(state, "Preceding condition causes termination."); } @@ -6412,7 +6415,7 @@ namespace OutputReportTabular { using DataOutputs::iTotalAutoCalculatableFields; using DataOutputs::iTotalAutoSizableFields; using DataOutputs::iTotalFieldsWithDefaults; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleName; using ScheduleManager::ScheduleAverageHoursPerWeek; @@ -7301,7 +7304,7 @@ namespace OutputReportTabular { tableBody(1, 1) = "less than"; tableBody(1, 2) = RealToStr(curIntervalStart, numIntervalDigits); for (nCol = 1; nCol <= curIntervalCount; ++nCol) { - columnHead(nCol + 1) = std::to_string(nCol) + " [hr]"; + columnHead(nCol + 1) = format("{} [hr]", nCol); // beginning of interval tableBody(nCol + 1, 1) = RealToStr(curIntervalStart + (nCol - 1) * curIntervalSize, numIntervalDigits) + "<="; // end of interval @@ -7581,26 +7584,29 @@ namespace OutputReportTabular { collapsedTotal(13) = gatherTotalsBEPS(7); // water if (state.dataGlobal->createPerfLog) { - UtilityRoutines::appendPerfLog(state, "Electricity ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(1), 3)); - UtilityRoutines::appendPerfLog(state, "Natural Gas ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(2), 3)); - UtilityRoutines::appendPerfLog(state, "Gasoline ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(3), 3)); - UtilityRoutines::appendPerfLog(state, "Diesel ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(4), 3)); - UtilityRoutines::appendPerfLog(state, "Coal ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(5), 3)); - UtilityRoutines::appendPerfLog(state, "Fuel Oil No 1 ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(6), 3)); - UtilityRoutines::appendPerfLog(state, "Fuel Oil No 2 ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(7), 3)); - UtilityRoutines::appendPerfLog(state, "Propane ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(8), 3)); - UtilityRoutines::appendPerfLog(state, "Other Fuel 1 ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(9), 3)); - UtilityRoutines::appendPerfLog(state, "Other Fuel 2 ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(10), 3)); - UtilityRoutines::appendPerfLog(state, "District Cooling ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(11), 3)); - UtilityRoutines::appendPerfLog(state, "District Heating ABUPS Total [J]", General::RoundSigDigits(collapsedTotal(12), 3)); - UtilityRoutines::appendPerfLog(state, "Water ABUPS Total [m3]", General::RoundSigDigits(collapsedTotal(13), 3)); - UtilityRoutines::appendPerfLog(state, "Values Gathered Over [hours]", General::RoundSigDigits(gatherElapsedTimeBEPS, 2)); - UtilityRoutines::appendPerfLog(state, "Facility Any Zone Oscillating Temperatures Time [hours]", - General::RoundSigDigits(state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillate, 2)); - UtilityRoutines::appendPerfLog(state, "Facility Any Zone Oscillating Temperatures During Occupancy Time [hours]", - General::RoundSigDigits(state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateDuringOccupancy, 2)); - UtilityRoutines::appendPerfLog(state, "Facility Any Zone Oscillating Temperatures in Deadband Time [hours]", - General::RoundSigDigits(state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateInDeadband, 2)); + UtilityRoutines::appendPerfLog(state, "Electricity ABUPS Total [J]", format("{:.3R}", collapsedTotal(1))); + UtilityRoutines::appendPerfLog(state, "Natural Gas ABUPS Total [J]", format("{:.3R}", collapsedTotal(2))); + UtilityRoutines::appendPerfLog(state, "Gasoline ABUPS Total [J]", format("{:.3R}", collapsedTotal(3))); + UtilityRoutines::appendPerfLog(state, "Diesel ABUPS Total [J]", format("{:.3R}", collapsedTotal(4))); + UtilityRoutines::appendPerfLog(state, "Coal ABUPS Total [J]", format("{:.3R}", collapsedTotal(5))); + UtilityRoutines::appendPerfLog(state, "Fuel Oil No 1 ABUPS Total [J]", format("{:.3R}", collapsedTotal(6))); + UtilityRoutines::appendPerfLog(state, "Fuel Oil No 2 ABUPS Total [J]", format("{:.3R}", collapsedTotal(7))); + UtilityRoutines::appendPerfLog(state, "Propane ABUPS Total [J]", format("{:.3R}", collapsedTotal(8))); + UtilityRoutines::appendPerfLog(state, "Other Fuel 1 ABUPS Total [J]", format("{:.3R}", collapsedTotal(9))); + UtilityRoutines::appendPerfLog(state, "Other Fuel 2 ABUPS Total [J]", format("{:.3R}", collapsedTotal(10))); + UtilityRoutines::appendPerfLog(state, "District Cooling ABUPS Total [J]", format("{:.3R}", collapsedTotal(11))); + UtilityRoutines::appendPerfLog(state, "District Heating ABUPS Total [J]", format("{:.3R}", collapsedTotal(12))); + UtilityRoutines::appendPerfLog(state, "Water ABUPS Total [m3]", format("{:.3R}", collapsedTotal(13))); + UtilityRoutines::appendPerfLog(state, "Values Gathered Over [hours]", format("{:.2R}", gatherElapsedTimeBEPS)); + UtilityRoutines::appendPerfLog(state, + "Facility Any Zone Oscillating Temperatures Time [hours]", + format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillate)); + UtilityRoutines::appendPerfLog(state, + "Facility Any Zone Oscillating Temperatures During Occupancy Time [hours]", + format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateDuringOccupancy)); + UtilityRoutines::appendPerfLog(state, + "Facility Any Zone Oscillating Temperatures in Deadband Time [hours]", + format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateInDeadband)); } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { @@ -10189,7 +10195,7 @@ namespace OutputReportTabular { columnWidth = {7, 30, 16, 10, 16, 16}; // array assignment - for all columns for (item = 1; item <= state.dataCostEstimateManager->NumLineItems; ++item) { - tableBody(1, item) = std::to_string(state.dataCostEstimateManager->CostLineItem(item).LineNumber); + tableBody(1, item) = fmt::to_string(state.dataCostEstimateManager->CostLineItem(item).LineNumber); tableBody(2, item) = state.dataCostEstimateManager->CostLineItem(item).LineName; if (unitsStyle == unitsStyleInchPound) { LookupSItoIP(state, state.dataCostEstimateManager->CostLineItem(item).Units, unitConvIndex, IPunitName); @@ -10282,7 +10288,7 @@ namespace OutputReportTabular { using DataSurfaces::Surface; using DataSurfaces::SurfaceClass; using DataSurfaces::TotSurfaces; - using General::RoundSigDigits; + using General::SafeDivide; using ScheduleManager::GetScheduleName; using ScheduleManager::ScheduleAverageHoursPerWeek; @@ -10482,7 +10488,7 @@ namespace OutputReportTabular { tableBody(1, 8) = RealToStr(BuildingAzimuth, 2); // north axis angle tableBody(1, 9) = RealToStr(BuildingRotationAppendixG, 2); // Rotation for Appendix G tableBody(1, 10) = RealToStr(gatherElapsedTimeBEPS, 2); // hours simulated - // tableBody(9,1) = TRIM(std::to_string(numTableEntry)) !number of table entries for predefined tables + // tableBody(9,1) = TRIM(fmt::to_string(numTableEntry)) !number of table entries for predefined tables WriteSubtitle("General"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); @@ -10865,8 +10871,10 @@ namespace OutputReportTabular { if (pdiff > 0.019) { ShowWarningError(state, "WriteVeriSumTable: InputVerificationsAndResultsSummary: Wall area based on [>=60,<=120] degrees (tilt) as walls"); - ShowContinueError(state, "differs ~" + RoundSigDigits(pdiff * 100.0, 1) + - "% from user entered Wall class surfaces. Degree calculation based on ASHRAE 90.1 wall definitions."); + ShowContinueError( + state, + format("differs ~{:.1R}% from user entered Wall class surfaces. Degree calculation based on ASHRAE 90.1 wall definitions.", + pdiff * 100.0)); // CALL ShowContinueError(state, 'Calculated based on degrees=['// & // TRIM(ADJUSTL(RealToStr((wallAreaN + wallAreaS + wallAreaE + wallAreaW),3)))// & // '] m2, Calculated from user entered Wall class surfaces=['// & @@ -12085,7 +12093,7 @@ namespace OutputReportTabular { ++rowNum; if (rowNum > countOfMatchingLines) break; // should never happen since same test as original could std::vector dataFields = splitCommaString(bodyLine); - rowHead(rowNum) = std::to_string(rowNum); + rowHead(rowNum) = fmt::to_string(rowNum); for (int iCol = 1; iCol <= numCols && iCol < int(dataFields.size()); ++iCol) { if (unitsStyle == unitsStyleInchPound || unitsStyle == unitsStyleJtoKWH) { if (isNumber(dataFields[iCol]) && colUnitConv(iCol) > 0) { // if it is a number that has a conversion @@ -13654,9 +13662,10 @@ namespace OutputReportTabular { if (isCooling) { // Time of Peak Load if ((size_t)desDaySelected <= state.dataWeatherManager->DesDayInput.size()) { - compLoad.peakDateHrMin = General::TrimSigDigits(state.dataWeatherManager->DesDayInput(desDaySelected).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(desDaySelected).DayOfMonth) + " " + - coilSelectionReportObj->getTimeText(state, timeOfMax); + compLoad.peakDateHrMin = format("{}/{} {}", + state.dataWeatherManager->DesDayInput(desDaySelected).Month, + state.dataWeatherManager->DesDayInput(desDaySelected).DayOfMonth, + coilSelectionReportObj->getTimeText(state, timeOfMax)); } else { compLoad.peakDateHrMin = CoolPeakDateHrMin(zoneIndex); } @@ -13707,9 +13716,10 @@ namespace OutputReportTabular { } else { // Time of Peak Load if ((size_t)desDaySelected <= state.dataWeatherManager->DesDayInput.size()) { - compLoad.peakDateHrMin = General::TrimSigDigits(state.dataWeatherManager->DesDayInput(desDaySelected).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(desDaySelected).DayOfMonth) + " " + - coilSelectionReportObj->getTimeText(state, timeOfMax); + compLoad.peakDateHrMin = format("{}/{} {}", + state.dataWeatherManager->DesDayInput(desDaySelected).Month, + state.dataWeatherManager->DesDayInput(desDaySelected).DayOfMonth, + coilSelectionReportObj->getTimeText(state, timeOfMax)); } else { compLoad.peakDateHrMin = HeatPeakDateHrMin(zoneIndex); } @@ -14365,7 +14375,7 @@ namespace OutputReportTabular { columnHead(1) = "Zone Name"; for (int zi = 1; zi <= maxRow; ++zi) { - rowHead(zi) = std::to_string(zi); + rowHead(zi) = fmt::to_string(zi); if (curCompLoad.zoneIndices(zi) > 0) { tableBody(1, zi) = Zone(curCompLoad.zoneIndices(zi)).Name; } diff --git a/src/EnergyPlus/OutputReports.cc b/src/EnergyPlus/OutputReports.cc index 401814b8f99..0a3c7cedc0b 100644 --- a/src/EnergyPlus/OutputReports.cc +++ b/src/EnergyPlus/OutputReports.cc @@ -227,7 +227,6 @@ void LinesOut(EnergyPlusData &state, std::string const &option) // Using/Aliasing using namespace DataHeatBalance; using namespace DataSurfaces; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -508,7 +507,6 @@ void DXFOut(EnergyPlusData &state, using DataDaylighting::TotIllumMaps; using DataStringGlobals::VerString; using namespace DXFEarClipping; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -841,7 +839,7 @@ void DXFOut(EnergyPlusData &state, for (int mapnum = 1; mapnum <= TotIllumMaps; ++mapnum) { if (IllumMapCalc(mapnum).Zone != zones) continue; for (int refpt = 1; refpt <= IllumMapCalc(mapnum).TotalMapRefPoints; ++refpt) { - print(dxffile, Format_710, Zone(zones).Name + ":MapRefPt:" + TrimSigDigits(refpt)); + print(dxffile, Format_710, format("{}:MapRefPt:{}", Zone(zones).Name, refpt)); print(dxffile, Format_709, normalizeName(Zone(zones).Name), @@ -885,7 +883,6 @@ void DXFOutLines(EnergyPlusData &state, std::string const &ColorScheme) using namespace DataSurfaceColors; using DataDaylighting::ZoneDaylight; using DataStringGlobals::VerString; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -949,7 +946,7 @@ void DXFOutLines(EnergyPlusData &state, std::string const &ColorScheme) print(dxffile, Format_710, "Building Shading:" + Surface(surf).Name); } ++surfcount; - ShadeType += "_" + fmt::to_string(surfcount); + ShadeType += format("_{}", surfcount); Real64 minz = 99999.0; for (int vert = 1; vert <= Surface(surf).Sides; ++vert) { minz = min(minz, Surface(surf).Vertex(vert).z); @@ -997,7 +994,7 @@ void DXFOutLines(EnergyPlusData &state, std::string const &ColorScheme) ++surfcount; print(dxffile, Format_710, Surface(surf).ZoneName + ':' + Surface(surf).Name); - TempZoneName += "_" + fmt::to_string(surfcount); + TempZoneName += format("_{}", surfcount); Real64 minz = 99999.0; for (int vert = 1; vert <= Surface(surf).Sides; ++vert) { minz = min(minz, Surface(surf).Vertex(vert).z); @@ -1039,7 +1036,7 @@ void DXFOutLines(EnergyPlusData &state, std::string const &ColorScheme) ++surfcount; print(dxffile, Format_710, Surface(surf).ZoneName + ':' + Surface(surf).Name); - TempZoneName += "_" + fmt::to_string(surfcount); + TempZoneName += format("_{}", surfcount); Real64 minz = 99999.0; for (int vert = 1; vert <= Surface(surf).Sides; ++vert) { minz = min(minz, Surface(surf).Vertex(vert).z); @@ -1097,7 +1094,6 @@ void DXFOutWireFrame(EnergyPlusData &state, std::string const &ColorScheme) using namespace DataSurfaceColors; using DataDaylighting::ZoneDaylight; using DataStringGlobals::VerString; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1161,7 +1157,7 @@ void DXFOutWireFrame(EnergyPlusData &state, std::string const &ColorScheme) print(dxffile, Format_710, "Building Shading:" + Surface(surf).Name); } ++surfcount; - ShadeType += "_" + fmt::to_string(surfcount); + ShadeType += format("_{}", surfcount); Real64 minz = 99999.0; for (int vert = 1; vert <= Surface(surf).Sides; ++vert) { minz = min(minz, Surface(surf).Vertex(vert).z); @@ -1265,8 +1261,6 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices // Using/Aliasing using namespace DataHeatBalance; using namespace DataSurfaces; - using General::RoundSigDigits; - using General::TrimSigDigits; using ScheduleManager::GetScheduleMaxValue; using ScheduleManager::GetScheduleMinValue; using ScheduleManager::GetScheduleName; @@ -1381,44 +1375,44 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices if (RptType == 10) { if (Surface(surf).SchedShadowSurfIndex > 0) { ScheduleName = GetScheduleName(state, Surface(surf).SchedShadowSurfIndex); - cSchedMin = RoundSigDigits(GetScheduleMinValue(state, Surface(surf).SchedShadowSurfIndex), 2); - cSchedMax = RoundSigDigits(GetScheduleMaxValue(state, Surface(surf).SchedShadowSurfIndex), 2); + cSchedMin = format("{:.2R}", GetScheduleMinValue(state, Surface(surf).SchedShadowSurfIndex)); + cSchedMax = format("{:.2R}", GetScheduleMaxValue(state, Surface(surf).SchedShadowSurfIndex)); } else { ScheduleName = ""; cSchedMin = "0.0"; cSchedMax = "0.0"; } - *eiostream << ScheduleName << "," << cSchedMin << "," << cSchedMax << "," << ' ' << "," << RoundSigDigits(Surface(surf).Area, 2) - << "," << RoundSigDigits(Surface(surf).GrossArea, 2) << "," << RoundSigDigits(Surface(surf).NetAreaShadowCalc, 2) << "," - << RoundSigDigits(Surface(surf).Azimuth, 2) << "," << RoundSigDigits(Surface(surf).Tilt, 2) << "," - << RoundSigDigits(Surface(surf).Width, 2) << "," << RoundSigDigits(Surface(surf).Height, 2) << ","; - *eiostream << ",,,,,,,,,," << TrimSigDigits(Surface(surf).Sides) << '\n'; + *eiostream << ScheduleName << "," << cSchedMin << "," << cSchedMax << "," << ' ' << "," << format("{:.2R}", Surface(surf).Area) << "," + << format("{:.2R}", Surface(surf).GrossArea) << "," << format("{:.2R}", Surface(surf).NetAreaShadowCalc) << "," + << format("{:.2R}", Surface(surf).Azimuth) << "," << format("{:.2R}", Surface(surf).Tilt) << "," + << format("{:.2R}", Surface(surf).Width) << "," << format("{:.2R}", Surface(surf).Height) << ","; + *eiostream << ",,,,,,,,,," << fmt::to_string(Surface(surf).Sides) << '\n'; } else if (RptType == 1) { - *eiostream << TrimSigDigits(Surface(surf).Sides) << ","; + *eiostream << fmt::to_string(Surface(surf).Sides) << ","; } else { if (Surface(surf).SchedShadowSurfIndex > 0) { ScheduleName = GetScheduleName(state, Surface(surf).SchedShadowSurfIndex); - cSchedMin = RoundSigDigits(GetScheduleMinValue(state, Surface(surf).SchedShadowSurfIndex), 2); - cSchedMax = RoundSigDigits(GetScheduleMaxValue(state, Surface(surf).SchedShadowSurfIndex), 2); + cSchedMin = format("{:.2R}", GetScheduleMinValue(state, Surface(surf).SchedShadowSurfIndex)); + cSchedMax = format("{:.2R}", GetScheduleMaxValue(state, Surface(surf).SchedShadowSurfIndex)); } else { ScheduleName = ""; cSchedMin = "0.0"; cSchedMax = "0.0"; } - *eiostream << ScheduleName << "," << cSchedMin << "," << cSchedMax << "," << ' ' << "," << RoundSigDigits(Surface(surf).Area, 2) - << "," << RoundSigDigits(Surface(surf).GrossArea, 2) << "," << RoundSigDigits(Surface(surf).NetAreaShadowCalc, 2) << "," - << RoundSigDigits(Surface(surf).Azimuth, 2) << "," << RoundSigDigits(Surface(surf).Tilt, 2) << "," - << RoundSigDigits(Surface(surf).Width, 2) << "," << RoundSigDigits(Surface(surf).Height, 2) << ","; - *eiostream << ",,,,,,,,,," << TrimSigDigits(Surface(surf).Sides) << ","; + *eiostream << ScheduleName << "," << cSchedMin << "," << cSchedMax << "," << ' ' << "," << format("{:.2R}", Surface(surf).Area) << "," + << format("{:.2R}", Surface(surf).GrossArea) << "," << format("{:.2R}", Surface(surf).NetAreaShadowCalc) << "," + << format("{:.2R}", Surface(surf).Azimuth) << "," << format("{:.2R}", Surface(surf).Tilt) << "," + << format("{:.2R}", Surface(surf).Width) << "," << format("{:.2R}", Surface(surf).Height) << ","; + *eiostream << ",,,,,,,,,," << fmt::to_string(Surface(surf).Sides) << ","; } if (RptType == 10) continue; for (vert = 1; vert <= Surface(surf).Sides; ++vert) { if (vert != Surface(surf).Sides) { - *eiostream << RoundSigDigits(Surface(surf).Vertex(vert).x, 2) << "," << RoundSigDigits(Surface(surf).Vertex(vert).y, 2) << "," - << RoundSigDigits(Surface(surf).Vertex(vert).z, 2) << ","; + *eiostream << format("{:.2R}", Surface(surf).Vertex(vert).x) << "," << format("{:.2R}", Surface(surf).Vertex(vert).y) << "," + << format("{:.2R}", Surface(surf).Vertex(vert).z) << ","; } else { - *eiostream << RoundSigDigits(Surface(surf).Vertex(vert).x, 2) << "," << RoundSigDigits(Surface(surf).Vertex(vert).y, 2) << "," - << RoundSigDigits(Surface(surf).Vertex(vert).z, 2) << '\n'; + *eiostream << format("{:.2R}", Surface(surf).Vertex(vert).x) << "," << format("{:.2R}", Surface(surf).Vertex(vert).y) << "," + << format("{:.2R}", Surface(surf).Vertex(vert).z) << '\n'; } } // This shouldn't happen with shading surface -- always have vertices @@ -1509,7 +1503,7 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices } } if (cNominalUwithConvCoeffs == "") { - cNominalUwithConvCoeffs = RoundSigDigits(NominalUwithConvCoeffs, 3); + cNominalUwithConvCoeffs = format("{:.3R}", NominalUwithConvCoeffs); } else { cNominalUwithConvCoeffs = "[invalid]"; } @@ -1522,7 +1516,7 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices SolarDiffusing = "No"; } } else { - cNominalU = RoundSigDigits(NominalU(Surface(surf).Construction), 3); + cNominalU = format("{:.3R}", NominalU(Surface(surf).Construction)); } } else { cNominalUwithConvCoeffs = "**"; @@ -1531,10 +1525,10 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices } *eiostream << ConstructionName << "," << cNominalU << "," << cNominalUwithConvCoeffs << "," << SolarDiffusing << "," - << RoundSigDigits(Surface(surf).Area, 2) << "," << RoundSigDigits(Surface(surf).GrossArea, 2) << "," - << RoundSigDigits(Surface(surf).NetAreaShadowCalc, 2) << "," << RoundSigDigits(Surface(surf).Azimuth, 2) << "," - << RoundSigDigits(Surface(surf).Tilt, 2) << "," << RoundSigDigits(Surface(surf).Width, 2) << "," - << RoundSigDigits(Surface(surf).Height, 2) << "," << RoundSigDigits(Surface(surf).Reveal, 2) << ","; + << format("{:.2R}", Surface(surf).Area) << "," << format("{:.2R}", Surface(surf).GrossArea) << "," + << format("{:.2R}", Surface(surf).NetAreaShadowCalc) << "," << format("{:.2R}", Surface(surf).Azimuth) << "," + << format("{:.2R}", Surface(surf).Tilt) << "," << format("{:.2R}", Surface(surf).Width) << "," + << format("{:.2R}", Surface(surf).Height) << "," << format("{:.2R}", Surface(surf).Reveal) << ","; if (Surface(surf).IntConvCoeff > 0) { { auto const SELECT_CASE_var(UserIntConvectionCoeffs(Surface(surf).IntConvCoeff).OverrideType); @@ -1613,20 +1607,20 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices << ","; } if (RptType == 10) { - *eiostream << RoundSigDigits(Surface(surf).ViewFactorGround, 2) << "," << RoundSigDigits(Surface(surf).ViewFactorSky, 2) << "," - << RoundSigDigits(Surface(surf).ViewFactorGroundIR, 2) << "," << RoundSigDigits(Surface(surf).ViewFactorSkyIR, 2) - << "," << TrimSigDigits(Surface(surf).Sides) << '\n'; + *eiostream << format("{:.2R}", Surface(surf).ViewFactorGround) << "," << format("{:.2R}", Surface(surf).ViewFactorSky) << "," + << format("{:.2R}", Surface(surf).ViewFactorGroundIR) << "," << format("{:.2R}", Surface(surf).ViewFactorSkyIR) << "," + << fmt::to_string(Surface(surf).Sides) << '\n'; } else { - *eiostream << RoundSigDigits(Surface(surf).ViewFactorGround, 2) << "," << RoundSigDigits(Surface(surf).ViewFactorSky, 2) << "," - << RoundSigDigits(Surface(surf).ViewFactorGroundIR, 2) << "," << RoundSigDigits(Surface(surf).ViewFactorSkyIR, 2) - << "," << TrimSigDigits(Surface(surf).Sides) << ","; + *eiostream << format("{:.2R}", Surface(surf).ViewFactorGround) << "," << format("{:.2R}", Surface(surf).ViewFactorSky) << "," + << format("{:.2R}", Surface(surf).ViewFactorGroundIR) << "," << format("{:.2R}", Surface(surf).ViewFactorSkyIR) << "," + << fmt::to_string(Surface(surf).Sides) << ","; for (vert = 1; vert <= Surface(surf).Sides; ++vert) { if (vert != Surface(surf).Sides) { - *eiostream << RoundSigDigits(Surface(surf).Vertex(vert).x, 2) << "," << RoundSigDigits(Surface(surf).Vertex(vert).y, 2) - << "," << RoundSigDigits(Surface(surf).Vertex(vert).z, 2) << ","; + *eiostream << format("{:.2R}", Surface(surf).Vertex(vert).x) << "," << format("{:.2R}", Surface(surf).Vertex(vert).y) + << "," << format("{:.2R}", Surface(surf).Vertex(vert).z) << ","; } else { - *eiostream << RoundSigDigits(Surface(surf).Vertex(vert).x, 2) << "," << RoundSigDigits(Surface(surf).Vertex(vert).y, 2) - << "," << RoundSigDigits(Surface(surf).Vertex(vert).z, 2) << '\n'; + *eiostream << format("{:.2R}", Surface(surf).Vertex(vert).x) << "," << format("{:.2R}", Surface(surf).Vertex(vert).y) + << "," << format("{:.2R}", Surface(surf).Vertex(vert).z) << '\n'; } } if (Surface(surf).Sides == 0) *eiostream << '\n'; @@ -1659,10 +1653,10 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices } *eiostream << "Frame/Divider Surface," << FrameDivider(fd).Name << "," << "Frame," << Surface(surf).Name << "," << AlgoName << ","; - *eiostream << ",N/A,N/A,," << RoundSigDigits(SurfWinFrameArea(surf), 2) << "," - << RoundSigDigits(SurfWinFrameArea(surf) / Surface(surf).Multiplier, 2) << ",*" + *eiostream << ",N/A,N/A,," << format("{:.2R}", SurfWinFrameArea(surf)) << "," + << format("{:.2R}", SurfWinFrameArea(surf) / Surface(surf).Multiplier) << ",*" << ",N/A" - << ",N/A," << RoundSigDigits(FrameDivider(fd).FrameWidth, 2) << ",N/A" << '\n'; + << ",N/A," << format("{:.2R}", FrameDivider(fd).FrameWidth) << ",N/A" << '\n'; } if (FrameDivider(fd).DividerWidth > 0.0) { if (FrameDivider(fd).DividerType == DividedLite) { @@ -1672,10 +1666,10 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices *eiostream << "Frame/Divider Surface," << FrameDivider(fd).Name << "," << "Divider:Suspended," << Surface(surf).Name << ",,"; } - *eiostream << ",N/A,N/A,," << RoundSigDigits(SurfWinDividerArea(surf), 2) << "," - << RoundSigDigits(SurfWinDividerArea(surf) / Surface(surf).Multiplier, 2) << ",*" + *eiostream << ",N/A,N/A,," << format("{:.2R}", SurfWinDividerArea(surf)) << "," + << format("{:.2R}", SurfWinDividerArea(surf) / Surface(surf).Multiplier) << ",*" << ",N/A" - << ",N/A," << RoundSigDigits(FrameDivider(fd).DividerWidth, 2) << ",N/A" << '\n'; + << ",N/A," << format("{:.2R}", FrameDivider(fd).DividerWidth) << ",N/A" << '\n'; } } } else { // RptType=1 Vertices only @@ -1710,14 +1704,14 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices } *eiostream << "HeatTransfer Surface," << Surface(surf).Name << "," << cSurfaceClass(Surface(surf).Class) << "," << BaseSurfName << "," << AlgoName << ","; - *eiostream << TrimSigDigits(Surface(surf).Sides) << ","; + *eiostream << fmt::to_string(Surface(surf).Sides) << ","; for (vert = 1; vert <= Surface(surf).Sides; ++vert) { if (vert != Surface(surf).Sides) { - *eiostream << RoundSigDigits(Surface(surf).Vertex(vert).x, 2) << "," << RoundSigDigits(Surface(surf).Vertex(vert).y, 2) << "," - << RoundSigDigits(Surface(surf).Vertex(vert).z, 2) << ","; + *eiostream << format("{:.2R}", Surface(surf).Vertex(vert).x) << "," << format("{:.2R}", Surface(surf).Vertex(vert).y) << "," + << format("{:.2R}", Surface(surf).Vertex(vert).z) << ","; } else { - *eiostream << RoundSigDigits(Surface(surf).Vertex(vert).x, 2) << "," << RoundSigDigits(Surface(surf).Vertex(vert).y, 2) << "," - << RoundSigDigits(Surface(surf).Vertex(vert).z, 2) << '\n'; + *eiostream << format("{:.2R}", Surface(surf).Vertex(vert).x) << "," << format("{:.2R}", Surface(surf).Vertex(vert).y) << "," + << format("{:.2R}", Surface(surf).Vertex(vert).z) << '\n'; } } if (Surface(surf).Sides == 0) *eiostream << '\n'; diff --git a/src/EnergyPlus/OutsideEnergySources.cc b/src/EnergyPlus/OutsideEnergySources.cc index 8710c566608..7a6591ae9ed 100644 --- a/src/EnergyPlus/OutsideEnergySources.cc +++ b/src/EnergyPlus/OutsideEnergySources.cc @@ -451,9 +451,8 @@ namespace OutsideEnergySources { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(NomCapDes - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeDistrict" + typeName + ": Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(NomCapDes, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", NomCapDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } diff --git a/src/EnergyPlus/PVWatts.cc b/src/EnergyPlus/PVWatts.cc index 934d9a44564..007df403170 100644 --- a/src/EnergyPlus/PVWatts.cc +++ b/src/EnergyPlus/PVWatts.cc @@ -86,7 +86,7 @@ namespace PVWatts { : m_lastCellTemperature(20.0), m_lastPlaneOfArrayIrradiance(0.0), m_cellTemperature(20.0), m_planeOfArrayIrradiance(0.0), m_outputDCPower(1000.0) { - using General::RoundSigDigits; + bool errorsFound(false); if (name.empty()) { @@ -147,7 +147,7 @@ namespace PVWatts { } if (systemLosses > 1.0 || systemLosses < 0.0) { - ShowSevereError(state, "PVWatts: Invalid system loss value " + RoundSigDigits(systemLosses, 2)); + ShowSevereError(state, format("PVWatts: Invalid system loss value {:.2R}", systemLosses)); errorsFound = true; } m_systemLosses = systemLosses; @@ -156,17 +156,17 @@ namespace PVWatts { if (m_geometryType == GeometryType::TILT_AZIMUTH) { if (tilt < 0 || tilt > 90) { - ShowSevereError(state, "PVWatts: Invalid tilt: " + RoundSigDigits(tilt, 2)); + ShowSevereError(state, format("PVWatts: Invalid tilt: {:.2R}", tilt)); errorsFound = true; } m_tilt = tilt; if (azimuth < 0 || azimuth >= 360) { - ShowSevereError(state, "PVWatts: Invalid azimuth: " + RoundSigDigits(azimuth, 2)); + ShowSevereError(state, format("PVWatts: Invalid azimuth: {:.2R}", azimuth)); } m_azimuth = azimuth; } else if (m_geometryType == GeometryType::SURFACE) { if (surfaceNum == 0 || surfaceNum > DataSurfaces::Surface.size()) { - ShowSevereError(state, "PVWatts: SurfaceNum not in Surfaces: " + std::to_string(surfaceNum)); + ShowSevereError(state, format("PVWatts: SurfaceNum not in Surfaces: {}", surfaceNum)); errorsFound = true; } else { m_surfaceNum = surfaceNum; @@ -179,7 +179,7 @@ namespace PVWatts { } if (groundCoverageRatio > 1.0 || groundCoverageRatio < 0.0) { - ShowSevereError(state, "PVWatts: Invalid ground coverage ratio: " + RoundSigDigits(groundCoverageRatio, 2)); + ShowSevereError(state, format("PVWatts: Invalid ground coverage ratio: {:.2R}", groundCoverageRatio)); errorsFound = true; } m_groundCoverageRatio = groundCoverageRatio; @@ -460,8 +460,6 @@ namespace PVWatts { PVWattsGenerator::powerout(EnergyPlusData &state, Real64 &shad_beam, Real64 shad_diff, Real64 dni, Real64 alb, Real64 wspd, Real64 tdry, IrradianceOutput &irr_st) { - using General::RoundSigDigits; - const Real64 &gcr = m_groundCoverageRatio; Real64 poa, tpoa, pvt, dc; @@ -501,14 +499,14 @@ namespace PVWatts { if (Fskydiff >= 0 && Fskydiff <= 1) irr_st.iskydiff *= Fskydiff; else - ShowWarningError(state, "PVWatts: sky diffuse reduction factor invalid: fskydiff=" + RoundSigDigits(Fskydiff, 7) + - ", stilt=" + RoundSigDigits(irr_st.stilt, 7)); + ShowWarningError( + state, format("PVWatts: sky diffuse reduction factor invalid: fskydiff={:.7R}, stilt={:.7R}", Fskydiff, irr_st.stilt)); if (Fgnddiff >= 0 && Fgnddiff <= 1) irr_st.ignddiff *= Fgnddiff; else - ShowWarningError(state, "PVWatts: gnd diffuse reduction factor invalid: fgnddiff=" + RoundSigDigits(Fgnddiff, 7) + - ", stilt=" + RoundSigDigits(irr_st.stilt, 7)); + ShowWarningError( + state, format("PVWatts: gnd diffuse reduction factor invalid: fgnddiff={:.7R}, stilt={:.7R}", Fgnddiff, irr_st.stilt)); } } diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index ef6656abd0a..3f215a926d2 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -260,7 +260,7 @@ namespace PackagedTerminalHeatPump { // Manages the simulation of a packaged terminal heat pump. Called from SimZoneEquipment. // Using/Aliasing - using General::TrimSigDigits; + using namespace DataZoneEnergyDemands; using DataHeatBalFanSys::TempControlType; using DataZoneEquipment::PkgTermACAirToAir_Num; @@ -304,13 +304,19 @@ namespace PackagedTerminalHeatPump { } } if (PTUnitNum > NumPTUs || PTUnitNum < 1) { - ShowFatalError(state, "SimPackagedTerminalUnit: Invalid CompIndex passed=" + TrimSigDigits(PTUnitNum) + - ", Number of Units=" + TrimSigDigits(NumPTUs) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimPackagedTerminalUnit: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + PTUnitNum, + NumPTUs, + CompName)); } if (CheckEquipName(PTUnitNum)) { if (CompName != PTUnit(PTUnitNum).Name) { - ShowFatalError(state, "SimPackagedTerminalUnit: Invalid CompIndex passed=" + TrimSigDigits(PTUnitNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + PTUnit(PTUnitNum).Name); + ShowFatalError(state, + format("SimPackagedTerminalUnit: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + PTUnitNum, + CompName, + PTUnit(PTUnitNum).Name)); } CheckEquipName(PTUnitNum) = false; } @@ -562,8 +568,7 @@ namespace PackagedTerminalHeatPump { using Fans::GetFanOutletNode; using Fans::GetFanType; using Fans::GetFanVolFlow; - using General::RoundSigDigits; - using General::TrimSigDigits; + using MixedAir::GetOAMixerNodeNumbers; auto &GetDXCoilInletNode(DXCoils::GetCoilInletNode); auto &GetDXCoilOutletNode(DXCoils::GetCoilOutletNode); @@ -789,28 +794,28 @@ namespace PackagedTerminalHeatPump { } PTUnit(PTUnitNum).MaxCoolAirVolFlow = Numbers(1); if (PTUnit(PTUnitNum).MaxCoolAirVolFlow <= 0 && PTUnit(PTUnitNum).MaxCoolAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(1) + " = " + TrimSigDigits(Numbers(1), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(1), Numbers(1))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } PTUnit(PTUnitNum).MaxHeatAirVolFlow = Numbers(2); if (PTUnit(PTUnitNum).MaxHeatAirVolFlow <= 0 && PTUnit(PTUnitNum).MaxHeatAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(2) + " = " + TrimSigDigits(Numbers(2), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(2), Numbers(2))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow = Numbers(3); if (PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow < 0 && PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(3) + " = " + TrimSigDigits(Numbers(3), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(3), Numbers(3))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } PTUnit(PTUnitNum).CoolOutAirVolFlow = Numbers(4); if (PTUnit(PTUnitNum).CoolOutAirVolFlow < 0 && PTUnit(PTUnitNum).CoolOutAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(4) + " = " + TrimSigDigits(Numbers(4), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(4), Numbers(4))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } @@ -825,7 +830,7 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).HeatOutAirVolFlow = Numbers(5); if (PTUnit(PTUnitNum).HeatOutAirVolFlow < 0 && PTUnit(PTUnitNum).HeatOutAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(5) + " = " + TrimSigDigits(Numbers(5), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(5), Numbers(5))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } @@ -840,7 +845,7 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).NoCoolHeatOutAirVolFlow = Numbers(6); if (PTUnit(PTUnitNum).NoCoolHeatOutAirVolFlow < 0 && PTUnit(PTUnitNum).NoCoolHeatOutAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(6) + " = " + TrimSigDigits(Numbers(6), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(6), Numbers(6))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } @@ -883,8 +888,10 @@ namespace PackagedTerminalHeatPump { if (FanVolFlow < max(PTUnit(PTUnitNum).MaxCoolAirVolFlow, PTUnit(PTUnitNum).MaxHeatAirVolFlow, PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow)) { ShowSevereError(state, CurrentModuleObject + "=\"" + PTUnit(PTUnitNum).Name + "\", invalid air flow rate"); - ShowContinueError(state, "air flow rate = " + TrimSigDigits(FanVolFlow, 7) + " in fan object " + PTUnit(PTUnitNum).FanName + - " is less than the maximum PTHP supply air flow rate."); + ShowContinueError(state, + format("air flow rate = {:.7T} in fan object {} is less than the maximum PTHP supply air flow rate.", + FanVolFlow, + PTUnit(PTUnitNum).FanName)); ShowContinueError(state, " The fan flow rate must be greater than the PTHP maximum supply air flow rate."); ErrorsFound = true; } @@ -1113,7 +1120,7 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).MaxOATSupHeat = Numbers(10); if (PTUnit(PTUnitNum).MaxOATSupHeat > 21.0) { ShowWarningError(state, CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name + ": " + cNumericFields(10) + " should be <= to 21."); - ShowContinueError(state, "..." + cNumericFields(10) + " = " + TrimSigDigits(Numbers(10), 1)); + ShowContinueError(state, format("...{} = {:.1T}", cNumericFields(10), Numbers(10))); } if (UtilityRoutines::SameString(Alphas(15), "BlowThrough")) PTUnit(PTUnitNum).FanPlace = BlowThru; @@ -1395,10 +1402,11 @@ namespace PackagedTerminalHeatPump { } // if ( PTUnit( PTUnitNum ).MaxOATSupHeat > 21.0 ) { - // ShowWarningError(state, CurrentModuleObject + " = " + PTUnit( PTUnitNum ).Name + ": " + cNumericFields( 11 ) + " + // ShowWarningError(state, CurrentModuleObject + " = " + PTUnit( PTUnitNum ).Name + ": " + cNumericFields( 11 ) + + //" // should be //<= to 21." - //); ShowContinueError(state, "..." + cNumericFields( 11 ) + " = " + TrimSigDigits( Numbers( 11 ), 1 ) ); + //); ShowContinueError(state, format("...{} = {:.1T}", cNumericFields( 11 ), Numbers( 11 )) ); // } // set air flow control mode, UseCompressorOnFlow = operate at last cooling or heating air flow requested when compressor is off @@ -1492,7 +1500,7 @@ namespace PackagedTerminalHeatPump { // MaxNoCoolHeatAirVolFlow should be greater than 0 if (PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow == 0) { - ShowWarningError(state, CurrentModuleObject + " illegal " + cNumericFields(3) + " = " + TrimSigDigits(Numbers(3), 3)); + ShowWarningError(state, format("{} illegal {} = {:.3T}", CurrentModuleObject, cNumericFields(3), Numbers(3))); ShowContinueError(state, "... when " + cAlphaFields(19) + " = " + Alphas(19) + " the minimum operating air flow rate should be autosized or > 0."); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); @@ -1682,28 +1690,28 @@ namespace PackagedTerminalHeatPump { } PTUnit(PTUnitNum).MaxCoolAirVolFlow = Numbers(1); if (PTUnit(PTUnitNum).MaxCoolAirVolFlow <= 0 && PTUnit(PTUnitNum).MaxCoolAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(1) + " = " + TrimSigDigits(Numbers(1), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(1), Numbers(1))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } PTUnit(PTUnitNum).MaxHeatAirVolFlow = Numbers(2); if (PTUnit(PTUnitNum).MaxHeatAirVolFlow <= 0 && PTUnit(PTUnitNum).MaxHeatAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(2) + " = " + TrimSigDigits(Numbers(2), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(2), Numbers(2))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow = Numbers(3); if (PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow < 0 && PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(3) + " = " + TrimSigDigits(Numbers(3), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(3), Numbers(3))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } PTUnit(PTUnitNum).CoolOutAirVolFlow = Numbers(4); if (PTUnit(PTUnitNum).CoolOutAirVolFlow < 0 && PTUnit(PTUnitNum).CoolOutAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(4) + " = " + TrimSigDigits(Numbers(4), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(4), Numbers(4))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } @@ -1718,7 +1726,7 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).HeatOutAirVolFlow = Numbers(5); if (PTUnit(PTUnitNum).HeatOutAirVolFlow < 0 && PTUnit(PTUnitNum).HeatOutAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(5) + " = " + TrimSigDigits(Numbers(5), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(5), Numbers(5))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } @@ -1733,7 +1741,7 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).NoCoolHeatOutAirVolFlow = Numbers(6); if (PTUnit(PTUnitNum).NoCoolHeatOutAirVolFlow < 0 && PTUnit(PTUnitNum).NoCoolHeatOutAirVolFlow != AutoSize) { - ShowSevereError(state, CurrentModuleObject + " illegal " + cNumericFields(6) + " = " + TrimSigDigits(Numbers(6), 7)); + ShowSevereError(state, format("{} illegal {} = {:.7T}", CurrentModuleObject, cNumericFields(6), Numbers(6))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; } @@ -1783,8 +1791,11 @@ namespace PackagedTerminalHeatPump { if (FanVolFlow != AutoSize) { if (FanVolFlow < max(PTUnit(PTUnitNum).MaxCoolAirVolFlow, PTUnit(PTUnitNum).MaxHeatAirVolFlow, PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow)) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(FanVolFlow, 7) + " in fan object " + - PTUnit(PTUnitNum).FanName + " is less than the maximum PTHP supply air flow rate."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the maximum PTHP supply air flow rate.", + CurrentModuleObject, + FanVolFlow, + PTUnit(PTUnitNum).FanName)); ShowContinueError(state, " The fan flow rate must be greater than the PTHP maximum supply air flow rate."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); ErrorsFound = true; @@ -2298,7 +2309,7 @@ namespace PackagedTerminalHeatPump { // MaxNoCoolHeatAirVolFlow should be greater than 0 if (PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow == 0) { - ShowWarningError(state, CurrentModuleObject + " illegal " + cNumericFields(3) + " = " + TrimSigDigits(Numbers(3), 3)); + ShowWarningError(state, format("{} illegal {} = {:.3T}", CurrentModuleObject, cNumericFields(3), Numbers(3))); ShowContinueError(state, "... when " + cAlphaFields(17) + " = " + Alphas(17) + " the minimum operating air flow rate should be autosized or > 0."); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); @@ -3143,13 +3154,17 @@ namespace PackagedTerminalHeatPump { if (PTUnit(PTUnitNum).ActualFanVolFlowRate > FanVolFlow) { ShowContinueError(state, "...occurs in " + CurrentModuleObject + " = " + Alphas(1)); ShowContinueError(state, "... has a Design Fan Flow Rate > Max Fan Volume Flow Rate, should be <=."); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(PTUnit(PTUnitNum).ActualFanVolFlowRate, 2) + "... Fan [" + - PTUnit(PTUnitNum).FanType + ':' + PTUnit(PTUnitNum).FanName + "] Max Value=" + RoundSigDigits(FanVolFlow, 2)); + ShowContinueError(state, + format("... Entered value={:.2R}... Fan [{}:{}] Max Value={:.2R}", + PTUnit(PTUnitNum).ActualFanVolFlowRate, + PTUnit(PTUnitNum).FanType, + PTUnit(PTUnitNum).FanName, + FanVolFlow)); } if (PTUnit(PTUnitNum).ActualFanVolFlowRate <= 0.0) { ShowContinueError(state, "...occurs in " + CurrentModuleObject + " = " + Alphas(1)); ShowContinueError(state, "... has a Design Fan Flow Rate <= 0.0, it must be >0.0"); - ShowContinueError(state, "... Entered value=" + RoundSigDigits(PTUnit(PTUnitNum).ActualFanVolFlowRate, 2)); + ShowContinueError(state, format("... Entered value={:.2R}", PTUnit(PTUnitNum).ActualFanVolFlowRate)); ErrorsFound = true; } } @@ -3157,21 +3172,21 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).MaxCoolAirVolFlow = Numbers(1); if (PTUnit(PTUnitNum).MaxCoolAirVolFlow <= 0 && PTUnit(PTUnitNum).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + PTUnit(PTUnitNum).Name + "\""); - ShowContinueError(state, " illegal value " + cNumericFields(1) + " = " + TrimSigDigits(Numbers(1), 7)); + ShowContinueError(state, format(" illegal value {} = {:.7T}", cNumericFields(1), Numbers(1))); ErrorsFound = true; } PTUnit(PTUnitNum).MaxHeatAirVolFlow = Numbers(2); if (PTUnit(PTUnitNum).MaxHeatAirVolFlow <= 0 && PTUnit(PTUnitNum).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + PTUnit(PTUnitNum).Name + "\""); - ShowContinueError(state, " illegal " + cNumericFields(2) + " = " + TrimSigDigits(Numbers(2), 7)); + ShowContinueError(state, format(" illegal {} = {:.7T}", cNumericFields(2), Numbers(2))); ErrorsFound = true; } PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow = Numbers(3); if (PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow < 0 && PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + PTUnit(PTUnitNum).Name + "\""); - ShowContinueError(state, " illegal " + cNumericFields(3) + " = " + TrimSigDigits(Numbers(3), 7)); + ShowContinueError(state, format(" illegal {} = {:.7T}", cNumericFields(3), Numbers(3))); ErrorsFound = true; } @@ -3186,7 +3201,7 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).CoolOutAirVolFlow = Numbers(4); if (PTUnit(PTUnitNum).CoolOutAirVolFlow < 0 && PTUnit(PTUnitNum).CoolOutAirVolFlow != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + PTUnit(PTUnitNum).Name + "\""); - ShowContinueError(state, " illegal " + cNumericFields(4) + " = " + TrimSigDigits(Numbers(4), 7)); + ShowContinueError(state, format(" illegal {} = {:.7T}", cNumericFields(4), Numbers(4))); ErrorsFound = true; } @@ -3195,15 +3210,15 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + PTUnit(PTUnitNum).Name + "\""); ShowContinueError(state, ".." + cNumericFields(4) + " cannot be greater than " + cNumericFields(1)); - ShowContinueError(state, ".." + cNumericFields(1) + " = " + TrimSigDigits(Numbers(1), 7)); - ShowContinueError(state, ".." + cNumericFields(4) + " = " + TrimSigDigits(Numbers(4), 7)); + ShowContinueError(state, format("..{} = {:.7T}", cNumericFields(1), Numbers(1))); + ShowContinueError(state, format("..{} = {:.7T}", cNumericFields(4), Numbers(4))); ErrorsFound = true; } PTUnit(PTUnitNum).HeatOutAirVolFlow = Numbers(5); if (PTUnit(PTUnitNum).HeatOutAirVolFlow < 0 && PTUnit(PTUnitNum).HeatOutAirVolFlow != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + PTUnit(PTUnitNum).Name + "\""); - ShowContinueError(state, " illegal " + cNumericFields(5) + " = " + TrimSigDigits(Numbers(5), 7)); + ShowContinueError(state, format(" illegal {} = {:.7T}", cNumericFields(5), Numbers(5))); ErrorsFound = true; } @@ -3212,15 +3227,15 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + PTUnit(PTUnitNum).Name + "\""); ShowContinueError(state, ".." + cNumericFields(5) + " cannot be greater than " + cNumericFields(2)); - ShowContinueError(state, ".." + cNumericFields(2) + " = " + TrimSigDigits(Numbers(2), 7)); - ShowContinueError(state, ".." + cNumericFields(5) + " = " + TrimSigDigits(Numbers(5), 7)); + ShowContinueError(state, format("..{} = {:.7T}", cNumericFields(2), Numbers(2))); + ShowContinueError(state, format("..{} = {:.7T}", cNumericFields(5), Numbers(5))); ErrorsFound = true; } PTUnit(PTUnitNum).NoCoolHeatOutAirVolFlow = Numbers(6); if (PTUnit(PTUnitNum).NoCoolHeatOutAirVolFlow < 0 && PTUnit(PTUnitNum).NoCoolHeatOutAirVolFlow != AutoSize) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + PTUnit(PTUnitNum).Name + "\""); - ShowContinueError(state, " illegal " + cNumericFields(6) + " = " + TrimSigDigits(Numbers(6), 7)); + ShowContinueError(state, format(" illegal {} = {:.7T}", cNumericFields(6), Numbers(6))); ErrorsFound = true; } } else { @@ -3774,7 +3789,7 @@ namespace PackagedTerminalHeatPump { using Fans::GetFanVolFlow; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; - using General::TrimSigDigits; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; @@ -4177,9 +4192,12 @@ namespace PackagedTerminalHeatPump { if (PTUnit(PTUnitNum).FanVolFlow != AutoSize) { // Check fan versus system supply air flow rates if (PTUnit(PTUnitNum).FanVolFlow + 1e-10 < PTUnit(PTUnitNum).CoolVolumeFlowRate(NumOfSpeedCooling)) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(PTUnit(PTUnitNum).FanVolFlow, 7) + - " in fan object is less than the MSHP system air flow rate when cooling is required (" + - TrimSigDigits(PTUnit(PTUnitNum).CoolVolumeFlowRate(NumOfSpeedCooling), 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object is less than the MSHP system air flow rate when cooling " + "is required ({:.7T}).", + CurrentModuleObject, + PTUnit(PTUnitNum).FanVolFlow, + PTUnit(PTUnitNum).CoolVolumeFlowRate(NumOfSpeedCooling))); ShowContinueError(state, " The MSHP system flow rate when cooling is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); @@ -4187,9 +4205,10 @@ namespace PackagedTerminalHeatPump { // Check flow rates in other speeds and ensure flow rates are not above the max flow rate for (i = NumOfSpeedCooling - 1; i >= 1; --i) { if (PTUnit(PTUnitNum).CoolVolumeFlowRate(i) > PTUnit(PTUnitNum).CoolVolumeFlowRate(i + 1)) { - ShowContinueError(state, " The MSHP system flow rate when cooling is required is reset to the flow rate at higher speed and " - "the simulation continues at Speed" + - TrimSigDigits(i) + '.'); + ShowContinueError(state, + format(" The MSHP system flow rate when cooling is required is reset to the flow rate at higher " + "speed and the simulation continues at Speed{}.", + i)); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); PTUnit(PTUnitNum).CoolVolumeFlowRate(i) = PTUnit(PTUnitNum).CoolVolumeFlowRate(i + 1); } @@ -4198,18 +4217,22 @@ namespace PackagedTerminalHeatPump { if (PTUnit(PTUnitNum).NumOfSpeedHeating > 0) { if (PTUnit(PTUnitNum).FanVolFlow + 1e-10 < PTUnit(PTUnitNum).HeatVolumeFlowRate(NumOfSpeedHeating)) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(PTUnit(PTUnitNum).FanVolFlow, 7) + - " in fan object is less than the MSHP system air flow rate when heating is required (" + - TrimSigDigits(PTUnit(PTUnitNum).HeatVolumeFlowRate(NumOfSpeedHeating), 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object is less than the MSHP system air flow rate when " + "heating is required ({:.7T}).", + CurrentModuleObject, + PTUnit(PTUnitNum).FanVolFlow, + PTUnit(PTUnitNum).HeatVolumeFlowRate(NumOfSpeedHeating))); ShowContinueError(state, " The MSHP system flow rate when heating is required is reset to the fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); PTUnit(PTUnitNum).HeatVolumeFlowRate(NumOfSpeedHeating) = PTUnit(PTUnitNum).FanVolFlow; for (i = NumOfSpeedHeating - 1; i >= 1; --i) { if (PTUnit(PTUnitNum).HeatVolumeFlowRate(i) > PTUnit(PTUnitNum).HeatVolumeFlowRate(i + 1)) { - ShowContinueError(state, " The MSHP system flow rate when heating is required is reset to the flow rate at higher speed " - "and the simulation continues at Speed" + - TrimSigDigits(i) + '.'); + ShowContinueError(state, + format(" The MSHP system flow rate when heating is required is reset to the flow rate at " + "higher speed and the simulation continues at Speed{}.", + i)); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " system = " + PTUnit(PTUnitNum).Name); PTUnit(PTUnitNum).HeatVolumeFlowRate(i) = PTUnit(PTUnitNum).HeatVolumeFlowRate(i + 1); } @@ -4218,9 +4241,12 @@ namespace PackagedTerminalHeatPump { } if (PTUnit(PTUnitNum).FanVolFlow < PTUnit(PTUnitNum).IdleVolumeAirRate && PTUnit(PTUnitNum).IdleVolumeAirRate != 0.0) { - ShowWarningError(state, CurrentModuleObject + " - air flow rate = " + TrimSigDigits(PTUnit(PTUnitNum).FanVolFlow, 7) + - " in fan object is less than the MSHP system air flow rate when no heating or cooling is needed (" + - TrimSigDigits(PTUnit(PTUnitNum).IdleVolumeAirRate, 7) + ")."); + ShowWarningError(state, + format("{} - air flow rate = {:.7T} in fan object is less than the MSHP system air flow rate when no " + "heating or cooling is needed ({:.7T}).", + CurrentModuleObject, + PTUnit(PTUnitNum).FanVolFlow, + PTUnit(PTUnitNum).IdleVolumeAirRate)); ShowContinueError(state, " The MSHP system flow rate when no heating or cooling is needed is reset to the fan flow rate and the " "simulation continues."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + PTUnit(PTUnitNum).Name); @@ -4809,7 +4835,7 @@ namespace PackagedTerminalHeatPump { using DataZoneEquipment::PkgTermACAirToAir_Num; using DataZoneEquipment::PkgTermHPAirToAir_Num; using DataZoneEquipment::PkgTermHPWaterToAir_Num; - using General::RoundSigDigits; + using VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed; using VariableSpeedCoils::SimVariableSpeedCoils; using WaterCoils::SetCoilDesFlow; @@ -5280,10 +5306,12 @@ namespace PackagedTerminalHeatPump { if ((std::abs(CoolOutAirVolFlowDes - CoolOutAirVolFlowUser) / CoolOutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePTUnit: Potential issue with equipment sizing for " + PTUnit(PTUnitNum).UnitType + ' ' + PTUnit(PTUnitNum).Name); - ShowContinueError(state, "User-Specified Outdoor Air Flow Rate During Cooling Operation of " + - RoundSigDigits(CoolOutAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Outdoor Air Flow Rate During Cooling Operation of " + - RoundSigDigits(CoolOutAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Outdoor Air Flow Rate During Cooling Operation of {:.5R} [m3/s]", CoolOutAirVolFlowUser)); + ShowContinueError(state, + format("differs from Design Size Outdoor Air Flow Rate During Cooling Operation of {:.5R} [m3/s]", + CoolOutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -5331,10 +5359,12 @@ namespace PackagedTerminalHeatPump { if ((std::abs(HeatOutAirVolFlowDes - HeatOutAirVolFlowUser) / HeatOutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePTUnit: Potential issue with equipment sizing for " + PTUnit(PTUnitNum).UnitType + ' ' + PTUnit(PTUnitNum).Name); - ShowContinueError(state, "User-Specified Outdoor Air Flow Rate During Heating Operation of " + - RoundSigDigits(HeatOutAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Outdoor Air Flow Rate During Heating Operation of " + - RoundSigDigits(HeatOutAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Outdoor Air Flow Rate During Heating Operation of {:.5R} [m3/s]", HeatOutAirVolFlowUser)); + ShowContinueError(state, + format("differs from Design Size Outdoor Air Flow Rate During Heating Operation of {:.5R} [m3/s]", + HeatOutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -5383,10 +5413,13 @@ namespace PackagedTerminalHeatPump { AutoVsHardSizingThreshold) { ShowMessage(state, "SizePTUnit: Potential issue with equipment sizing for " + PTUnit(PTUnitNum).UnitType + ' ' + PTUnit(PTUnitNum).Name); - ShowContinueError(state, "User-Specified Outdoor Air Flow Rate When No Cooling or Heating is Needed of " + - RoundSigDigits(NoCoolHeatOutAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Outdoor Air Flow Rate When No Cooling or Heating is Needed of " + - RoundSigDigits(NoCoolHeatOutAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Outdoor Air Flow Rate When No Cooling or Heating is Needed of {:.5R} [m3/s]", + NoCoolHeatOutAirVolFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Outdoor Air Flow Rate When No Cooling or Heating is Needed of {:.5R} [m3/s]", + NoCoolHeatOutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -5431,10 +5464,13 @@ namespace PackagedTerminalHeatPump { if (std::abs(MaxSATSupHeatDes - MaxSATSupHeatUser) > (4.0 * AutoVsHardSizingDeltaTempThreshold)) { ShowMessage(state, "SizePTUnit: Potential issue with equipment sizing for " + PTUnit(PTUnitNum).UnitType + ' ' + PTUnit(PTUnitNum).Name); - ShowContinueError(state, "User-Specified Maximum Supply Air Temperature from Supplemental Heater of " + - RoundSigDigits(MaxSATSupHeatUser, 2) + " [C]"); - ShowContinueError(state, "differs from Design Size Maximum Supply Air Temperature from Supplemental Heater of " + - RoundSigDigits(MaxSATSupHeatDes, 2) + " [C]"); + ShowContinueError(state, + format("User-Specified Maximum Supply Air Temperature from Supplemental Heater of {:.2R} [C]", + MaxSATSupHeatUser)); + ShowContinueError( + state, + format("differs from Design Size Maximum Supply Air Temperature from Supplemental Heater of {:.2R} [C]", + MaxSATSupHeatDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -5501,8 +5537,9 @@ namespace PackagedTerminalHeatPump { ShowContinueError(state, " For SingleZoneVAV control the No Load Supply Air Flow Rate must be less than both the cooling and heating supply " "air flow rates."); PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow = min(PTUnit(PTUnitNum).MaxCoolAirVolFlow, PTUnit(PTUnitNum).MaxHeatAirVolFlow) - 0.01; - ShowContinueError(state, " The SingleZoneVAV control No Load Supply Air Flow Rate is reset to " + - RoundSigDigits(PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow, 5) + " and the simulation continues."); + ShowContinueError(state, + format(" The SingleZoneVAV control No Load Supply Air Flow Rate is reset to {:.5R} and the simulation continues.", + PTUnit(PTUnitNum).MaxNoCoolHeatAirVolFlow)); } } @@ -5543,9 +5580,8 @@ namespace PackagedTerminalHeatPump { // Using/Aliasing using DataEnvironment::OutDryBulbTemp; - using General::RoundSigDigits; using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyCpAirFnW; @@ -5849,7 +5885,7 @@ namespace PackagedTerminalHeatPump { using DataEnvironment::OutDryBulbTemp; using DataZoneEquipment::ZoneEquipConfig; using DXCoils::SimDXCoil; - using General::RoundSigDigits; + using General::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; @@ -6306,12 +6342,13 @@ namespace PackagedTerminalHeatPump { ShowWarningMessage(state, "CalcPTUnit: Hot water coil control failed for " + PTUnit(PTUnitNum).UnitType + "=\"" + PTUnit(PTUnitNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(SolveMaxIter) + - "] exceeded in calculating hot water mass flow rate"); + ShowContinueError( + state, format(" Iteration limit [{}] exceeded in calculating hot water mass flow rate", SolveMaxIter)); } - ShowRecurringWarningErrorAtEnd(state, "CalcPTUnit: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + PTUnit(PTUnitNum).UnitType + "=\"" + - PTUnit(PTUnitNum).Name, + ShowRecurringWarningErrorAtEnd(state, format("CalcPTUnit: Hot water coil control failed (iteration limit [{}]) for {}=\"{}", + SolveMaxIter, + PTUnit(PTUnitNum).UnitType, + PTUnit(PTUnitNum).Name), PTUnit(PTUnitNum).HotWaterCoilMaxIterIndex); } else if (SolFlag == -2) { if (PTUnit(PTUnitNum).HotWaterCoilMaxIterIndex2 == 0) { @@ -6319,8 +6356,8 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).UnitType + "=\"" + PTUnit(PTUnitNum).Name + "\""); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad hot water maximum flow rate limits"); - ShowContinueError(state, "...Given minimum water flow rate=" + RoundSigDigits(MinWaterFlow, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum water flow rate=" + RoundSigDigits(MaxHotWaterFlow, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum water flow rate={:.3R} kg/s", MinWaterFlow)); + ShowContinueError(state, format("...Given maximum water flow rate={:.3R} kg/s", MaxHotWaterFlow)); } ShowRecurringWarningErrorAtEnd(state, "CalcPTUnit: Hot water coil control failed (flow limits) for " + PTUnit(PTUnitNum).UnitType + "=\"" + PTUnit(PTUnitNum).Name + "\"", @@ -7408,9 +7445,9 @@ namespace PackagedTerminalHeatPump { // Using/Aliasing using DataEnvironment::OutDryBulbTemp; using DataZoneEnergyDemands::CurDeadBandOrSetback; - using General::RoundSigDigits; + using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyCpAirFnW; @@ -7617,7 +7654,7 @@ namespace PackagedTerminalHeatPump { if (ErrCountCyc == 0) { ++ErrCountCyc; ShowWarningError(state, "Iteration limit exceeded calculating VS WSHP unit cycling ratio, for unit=" + PTUnit(PTUnitNum).Name); - ShowContinueErrorTimeStamp(state, "Cycling ratio returned=" + RoundSigDigits(PartLoadFrac, 2)); + ShowContinueErrorTimeStamp(state, format("Cycling ratio returned={:.2R}", PartLoadFrac)); } else { ++ErrCountCyc; ShowRecurringWarningErrorAtEnd(state, @@ -7699,8 +7736,7 @@ namespace PackagedTerminalHeatPump { if (ErrCountVar == 0) { ++ErrCountVar; ShowWarningError(state, "Iteration limit exceeded calculating VS WSHP unit speed ratio, for unit=" + PTUnit(PTUnitNum).Name); - ShowContinueErrorTimeStamp(state, "Speed ratio returned=[" + RoundSigDigits(SpeedRatio, 2) + - "], Speed number =" + RoundSigDigits(SpeedNum)); + ShowContinueErrorTimeStamp(state, format("Speed ratio returned=[{:.2R}], Speed number ={}", SpeedRatio, SpeedNum)); } else { ++ErrCountVar; ShowRecurringWarningErrorAtEnd(state, PTUnit(PTUnitNum).Name + @@ -8088,7 +8124,7 @@ namespace PackagedTerminalHeatPump { using DataEnvironment::OutDryBulbTemp; using DataZoneEquipment::ZoneEquipConfig; using DXCoils::SimDXCoil; - using General::RoundSigDigits; + using General::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; @@ -8450,12 +8486,14 @@ namespace PackagedTerminalHeatPump { ShowWarningMessage(state, "RoutineName//Hot water coil control failed for " + PTUnit(PTUnitNum).UnitType + "=\"" + PTUnit(PTUnitNum).Name + "\""); // Autodesk:Bug? Meant RoutineName + "Hot water... ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, " Iteration limit [" + RoundSigDigits(SolveMaxIter) + - "] exceeded in calculating hot water mass flow rate"); + ShowContinueError( + state, format(" Iteration limit [{}] exceeded in calculating hot water mass flow rate", SolveMaxIter)); } ShowRecurringWarningErrorAtEnd(state, - "RoutineName//Hot water coil control failed (iteration limit [" + RoundSigDigits(SolveMaxIter) + "]) for " + - PTUnit(PTUnitNum).UnitType + "=\"" + PTUnit(PTUnitNum).Name, + format("RoutineName//Hot water coil control failed (iteration limit [{}]) for {}=\"{}", + SolveMaxIter, + PTUnit(PTUnitNum).UnitType, + PTUnit(PTUnitNum).Name), PTUnit(PTUnitNum).HotWaterCoilMaxIterIndex); // Autodesk:Bug? Meant RoutineName + "Hot water... } else if (SolFlag == -2) { if (PTUnit(PTUnitNum).HotWaterCoilMaxIterIndex2 == 0) { @@ -8464,8 +8502,8 @@ namespace PackagedTerminalHeatPump { "\""); // Autodesk:Bug? Meant RoutineName + "Hot water... ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "...Bad hot water maximum flow rate limits"); - ShowContinueError(state, "...Given minimum water flow rate=" + RoundSigDigits(MinWaterFlow, 3) + " kg/s"); - ShowContinueError(state, "...Given maximum water flow rate=" + RoundSigDigits(MaxHotWaterFlow, 3) + " kg/s"); + ShowContinueError(state, format("...Given minimum water flow rate={:.3R} kg/s", MinWaterFlow)); + ShowContinueError(state, format("...Given maximum water flow rate={:.3R} kg/s", MaxHotWaterFlow)); } ShowRecurringWarningErrorAtEnd(state, "RoutineName//Hot water coil control failed (flow limits) for " + PTUnit(PTUnitNum).UnitType + "=\"" + PTUnit(PTUnitNum).Name + "\"", @@ -8741,7 +8779,6 @@ namespace PackagedTerminalHeatPump { // Using/Aliasing using DataZoneEnergyDemands::CurDeadBandOrSetback; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: diff --git a/src/EnergyPlus/PackagedThermalStorageCoil.cc b/src/EnergyPlus/PackagedThermalStorageCoil.cc index 0dd8bac922f..dd78b993002 100644 --- a/src/EnergyPlus/PackagedThermalStorageCoil.cc +++ b/src/EnergyPlus/PackagedThermalStorageCoil.cc @@ -194,7 +194,6 @@ namespace PackagedThermalStorageCoil { // // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int TESCoilNum; @@ -213,13 +212,19 @@ namespace PackagedThermalStorageCoil { } else { TESCoilNum = CompIndex; if (TESCoilNum > NumTESCoils || TESCoilNum < 1) { - ShowFatalError(state, "SimTESCoil: Invalid CompIndex passed=" + TrimSigDigits(TESCoilNum) + - ", Number of Thermal Energy Storage Cooling Coil Coils=" + TrimSigDigits(NumTESCoils) + ", Coil name=" + CompName); + ShowFatalError(state, + format("SimTESCoil: Invalid CompIndex passed={}, Number of Thermal Energy Storage Cooling Coil Coils={}, Coil name={}", + TESCoilNum, + NumTESCoils, + CompName)); } if (CheckEquipName(TESCoilNum)) { if (!CompName.empty() && CompName != TESCoil(TESCoilNum).Name) { - ShowFatalError(state, "SimTESCoil: Invalid CompIndex passed=" + TrimSigDigits(TESCoilNum) + ", Coil name=" + CompName + - ", stored Coil Name for that index=" + TESCoil(TESCoilNum).Name); + ShowFatalError(state, + format("SimTESCoil: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + TESCoilNum, + CompName, + TESCoil(TESCoilNum).Name)); } CheckEquipName(TESCoilNum) = false; } @@ -1840,7 +1845,7 @@ namespace PackagedThermalStorageCoil { // Using/Aliasing using DataPlant::PlantLoop; using DataPlant::TypeOf_PackagedTESCoolingCoil; - using General::RoundSigDigits; + using PlantUtilities::ScanPlantLoopsForObject; using ScheduleManager::GetCurrentScheduleValue; @@ -1987,7 +1992,7 @@ namespace PackagedThermalStorageCoil { if (TESCoil(TESCoilNum).ControlModeErrorIndex == 0) { ShowSevereMessage(state, "InitTESCoil: Invalid control schedule value for operating mode"); ShowContinueError(state, "Occurs for Coil:Cooling:DX:SingleSpeed:ThermalStorage name = " + TESCoil(TESCoilNum).Name); - ShowContinueError(state, "Value returned from schedule =" + RoundSigDigits(tmpSchedValue, 8)); + ShowContinueError(state, format("Value returned from schedule ={:.8R}", tmpSchedValue)); ShowContinueError(state, "Operating mode will be set to Off, and the simulation continues"); } ShowRecurringSevereErrorAtEnd(state, "InitTESCoil: Invalid control schedule value for TES operating mode, set to Off", @@ -2050,7 +2055,7 @@ namespace PackagedThermalStorageCoil { if (TESCoil(TESCoilNum).ControlModeErrorIndex == 0) { ShowSevereMessage(state, "InitTESCoil: Invalid control value for operating mode"); ShowContinueError(state, "Occurs for Coil:Cooling:DX:SingleSpeed:ThermalStorage name = " + TESCoil(TESCoilNum).Name); - ShowContinueError(state, "Value returned from EMS =" + RoundSigDigits(TESCoil(TESCoilNum).EMSControlModeValue, 8)); + ShowContinueError(state, format("Value returned from EMS ={:.8R}", TESCoil(TESCoilNum).EMSControlModeValue)); ShowContinueError(state, "Operating mode will be set to Off, and the simulation continues"); } ShowRecurringSevereErrorAtEnd(state, "InitTESCoil: Invalid control schedule value for TES operating mode, set to Off", @@ -4116,7 +4121,7 @@ namespace PackagedThermalStorageCoil { // na // Using/Aliasing - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; @@ -4197,8 +4202,8 @@ namespace PackagedThermalStorageCoil { ++SensPLRIter; ShowWarningError(state, SystemType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + CoilName); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", ReqOutput / FullOutput)); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -4218,7 +4223,7 @@ namespace PackagedThermalStorageCoil { SystemType + " - DX unit sensible part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + CoilName); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -4264,8 +4269,8 @@ namespace PackagedThermalStorageCoil { ++LatPLRIter; ShowWarningError(state, SystemType + " - Iteration limit exceeded calculating DX unit latent part-load ratio for unit = " + CoilName); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", ReqOutput / FullOutput)); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -4290,7 +4295,7 @@ namespace PackagedThermalStorageCoil { SystemType + " - DX unit latent part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + CoilName); - ShowContinueError(state, "Estimated part-load ratio = " + RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index cf9103aa8f7..2c09f513acc 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -271,8 +271,9 @@ namespace PhotovoltaicThermalCollectors { ShowWarningError(state, "Suspected input problem with " + DataIPShortCuts::cAlphaFieldNames(2) + " = " + DataIPShortCuts::cAlphaArgs(2)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Surface used for solar collector faces down"); - ShowContinueError(state, "Surface tilt angle (degrees from ground outward normal) = " + - General::RoundSigDigits(DataSurfaces::Surface(PVT(Item).SurfNum).Tilt, 2)); + ShowContinueError( + state, + format("Surface tilt angle (degrees from ground outward normal) = {:.2R}", DataSurfaces::Surface(PVT(Item).SurfNum).Tilt)); } } // check surface @@ -715,9 +716,8 @@ namespace PhotovoltaicThermalCollectors { if ((std::abs(DesignVolFlowRateDes - DesignVolFlowRateUser) / DesignVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeSolarCollector: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Flow Rate of " + General::RoundSigDigits(DesignVolFlowRateUser, 5) + " [W]"); - ShowContinueError(state, "differs from Design Size Design Flow Rate of " + General::RoundSigDigits(DesignVolFlowRateDes, 5) + - " [W]"); + ShowContinueError(state, format("User-Specified Design Flow Rate of {:.5R} [W]", DesignVolFlowRateUser)); + ShowContinueError(state, format("differs from Design Size Design Flow Rate of {:.5R} [W]", DesignVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -779,10 +779,8 @@ namespace PhotovoltaicThermalCollectors { if ((std::abs(DesignVolFlowRateDes - DesignVolFlowRateUser) / DesignVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeSolarCollector: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Flow Rate of " + General::RoundSigDigits(DesignVolFlowRateUser, 5) + - " [W]"); - ShowContinueError(state, "differs from Design Size Design Flow Rate of " + - General::RoundSigDigits(DesignVolFlowRateDes, 5) + " [W]"); + ShowContinueError(state, format("User-Specified Design Flow Rate of {:.5R} [W]", DesignVolFlowRateUser)); + ShowContinueError(state, format("differs from Design Size Design Flow Rate of {:.5R} [W]", DesignVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index 528ad428096..fff4ebffd8a 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -157,7 +157,6 @@ namespace Photovoltaics { // in this module. provides common entry point for all the models // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int PVnum; // index of unit in PV array for Equivalent one-diode model @@ -177,13 +176,20 @@ namespace Photovoltaics { } else { PVnum = GeneratorIndex; if (PVnum > NumPVs || PVnum < 1) { - ShowFatalError(state, "SimPhotovoltaicGenerator: Invalid GeneratorIndex passed=" + TrimSigDigits(PVnum) + - ", Number of PVs=" + TrimSigDigits(NumPVs) + ", Generator name=" + GeneratorName); + ShowFatalError(state, + format("SimPhotovoltaicGenerator: Invalid GeneratorIndex passed={}, Number of PVs={}, Generator name={}", + PVnum, + NumPVs, + GeneratorName)); } if (CheckEquipName(PVnum)) { if (GeneratorName != PVarray(PVnum).Name) { - ShowFatalError(state, "SimPhotovoltaicGenerator: Invalid GeneratorIndex passed=" + TrimSigDigits(PVnum) + - ", Generator name=" + GeneratorName + ", stored PV Name for that index=" + PVarray(PVnum).Name); + ShowFatalError( + state, + format("SimPhotovoltaicGenerator: Invalid GeneratorIndex passed={}, Generator name={}, stored PV Name for that index={}", + PVnum, + GeneratorName, + PVarray(PVnum).Name)); } CheckEquipName(PVnum) = false; } @@ -293,7 +299,7 @@ namespace Photovoltaics { using namespace DataIPShortCuts; using DataSurfaces::Surface; using namespace DataHeatBalance; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using TranspiredCollector::GetTranspiredCollectorIndex; @@ -374,7 +380,7 @@ namespace Photovoltaics { ShowWarningError(state, "Suspected input problem with " + cAlphaFieldNames(2) + " = " + cAlphaArgs(2)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + " = " + cAlphaArgs(1)); ShowContinueError(state, "Surface used for solar collector faces down"); - ShowContinueError(state, "Surface tilt angle (degrees from ground outward normal) = " + RoundSigDigits(Surface(SurfNum).Tilt, 2)); + ShowContinueError(state, format("Surface tilt angle (degrees from ground outward normal) = {:.2R}", Surface(SurfNum).Tilt)); } } @@ -1714,7 +1720,6 @@ namespace Photovoltaics { // na // Using/Aliasing - using General::RoundSigDigits; // Return value Real64 FUN(0.0); @@ -1740,8 +1745,8 @@ namespace Photovoltaics { ShowSevereError(state, "EquivalentOneDiode Photovoltaic model failed to find maximum power point"); ShowContinueError(state, "Numerical solver failed trying to take exponential of too large a number"); ShowContinueError(state, "Check input data in " + cPVEquiv1DiodePerfObjectName); - ShowContinueError(state, "VV (voltage) = " + RoundSigDigits(VV, 5)); - ShowContinueError(state, "II (current) = " + RoundSigDigits(II, 5)); + ShowContinueError(state, format("VV (voltage) = {:.5R}", VV)); + ShowContinueError(state, format("II (current) = {:.5R}", II)); ShowFatalError(state, "FUN: EnergyPlus terminates because of numerical problem in EquivalentOne-Diode PV model"); } @@ -1768,7 +1773,6 @@ namespace Photovoltaics { // na // Using/Aliasing - using General::RoundSigDigits; // Return value Real64 FI(0.0); @@ -1793,8 +1797,8 @@ namespace Photovoltaics { ShowSevereError(state, "EquivalentOneDiode Photovoltaic model failed to find maximum power point"); ShowContinueError(state, "Numerical solver failed trying to take exponential of too large a number"); ShowContinueError(state, "Check input data in " + cPVEquiv1DiodePerfObjectName); - ShowContinueError(state, "VV (voltage) = " + RoundSigDigits(VV, 5)); - ShowContinueError(state, "II (current) = " + RoundSigDigits(II, 5)); + ShowContinueError(state, format("VV (voltage) = {:.5R}", VV)); + ShowContinueError(state, format("II (current) = {:.5R}", II)); ShowFatalError(state, "FI: EnergyPlus terminates because of numerical problem in EquivalentOne-Diode PV model"); } @@ -1821,7 +1825,6 @@ namespace Photovoltaics { // na // Using/Aliasing - using General::RoundSigDigits; // Return value Real64 FV(0.0); @@ -1847,8 +1850,8 @@ namespace Photovoltaics { ShowSevereError(state, "EquivalentOneDiode Photovoltaic model failed to find maximum power point"); ShowContinueError(state, "Numerical solver failed trying to take exponential of too large a number"); ShowContinueError(state, "Check input data in " + cPVEquiv1DiodePerfObjectName); - ShowContinueError(state, "VV (voltage) = " + RoundSigDigits(VV, 5)); - ShowContinueError(state, "II (current) = " + RoundSigDigits(II, 5)); + ShowContinueError(state, format("VV (voltage) = {:.5R}", VV)); + ShowContinueError(state, format("II (current) = {:.5R}", II)); ShowFatalError(state, "FI: EnergyPlus terminates because of numerical problem in EquivalentOne-Diode PV model"); } diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index ed2f954fa78..cb24c7aa0c8 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -258,7 +258,7 @@ namespace PipeHeatTransfer { using DataHeatBalance::Zone; using namespace DataIPShortCuts; // Data for field names, blank numerics using BranchNodeConnections::TestCompSet; - using General::RoundSigDigits; + using NodeInputManager::GetOnlySingleNode; using namespace DataLoopNode; using OutAirNodeManager::CheckOutAirNodeNumber; @@ -397,7 +397,7 @@ namespace PipeHeatTransfer { // dimensions PipeHT(Item).PipeID = rNumericArgs(1); if (rNumericArgs(1) <= 0.0) { // not really necessary because idd field has "minimum> 0" - ShowSevereError(state, "GetPipesHeatTransfer: invalid " + cNumericFieldNames(1) + " of " + RoundSigDigits(rNumericArgs(1), 4)); + ShowSevereError(state, format("GetPipesHeatTransfer: invalid {} of {:.4R}", cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, cNumericFieldNames(1) + " must be > 0.0"); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); @@ -406,7 +406,7 @@ namespace PipeHeatTransfer { PipeHT(Item).Length = rNumericArgs(2); if (rNumericArgs(2) <= 0.0) { // not really necessary because idd field has "minimum> 0" - ShowSevereError(state, "GetPipesHeatTransfer: invalid " + cNumericFieldNames(2) + " of " + RoundSigDigits(rNumericArgs(2), 4)); + ShowSevereError(state, format("GetPipesHeatTransfer: invalid {} of {:.4R}", cNumericFieldNames(2), rNumericArgs(2))); ShowContinueError(state, cNumericFieldNames(2) + " must be > 0.0"); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; @@ -502,7 +502,7 @@ namespace PipeHeatTransfer { // dimensions PipeHT(Item).PipeID = rNumericArgs(1); if (rNumericArgs(1) <= 0.0) { // not really necessary because idd field has "minimum> 0" - ShowSevereError(state, "Invalid " + cNumericFieldNames(1) + " of " + RoundSigDigits(rNumericArgs(1), 4)); + ShowSevereError(state, format("Invalid {} of {:.4R}", cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, cNumericFieldNames(1) + " must be > 0.0"); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; @@ -510,7 +510,7 @@ namespace PipeHeatTransfer { PipeHT(Item).Length = rNumericArgs(2); if (rNumericArgs(2) <= 0.0) { // not really necessary because idd field has "minimum> 0" - ShowSevereError(state, "Invalid " + cNumericFieldNames(2) + " of " + RoundSigDigits(rNumericArgs(2), 4)); + ShowSevereError(state, format("Invalid {} of {:.4R}", cNumericFieldNames(2), rNumericArgs(2))); ShowContinueError(state, cNumericFieldNames(2) + " must be > 0.0"); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; @@ -594,7 +594,7 @@ namespace PipeHeatTransfer { // dimensions PipeHT(Item).PipeID = rNumericArgs(1); if (rNumericArgs(1) <= 0.0) { // not really necessary because idd field has "minimum> 0" - ShowSevereError(state, "Invalid " + cNumericFieldNames(1) + " of " + RoundSigDigits(rNumericArgs(1), 4)); + ShowSevereError(state, format("Invalid {} of {:.4R}", cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, cNumericFieldNames(1) + " must be > 0.0"); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; @@ -602,7 +602,7 @@ namespace PipeHeatTransfer { PipeHT(Item).Length = rNumericArgs(2); if (rNumericArgs(2) <= 0.0) { // not really necessary because idd field has "minimum> 0" - ShowSevereError(state, "Invalid " + cNumericFieldNames(2) + " of " + RoundSigDigits(rNumericArgs(2), 4)); + ShowSevereError(state, format("Invalid {} of {:.4R}", cNumericFieldNames(2), rNumericArgs(2))); ShowContinueError(state, cNumericFieldNames(2) + " must be > 0.0"); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; @@ -749,7 +749,6 @@ namespace PipeHeatTransfer { // na // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -816,8 +815,9 @@ namespace PipeHeatTransfer { this->InsulationOD = this->PipeOD + 2.0 * this->InsulationThickness; } else { - ShowSevereError(state, PipeType + ": invalid " + FieldName + "=\"" + ConstructionName + "\", too many layers=[" + TrimSigDigits(TotalLayers) + - "], only 1 or 2 allowed."); + ShowSevereError( + state, + format("{}: invalid {}=\"{}\", too many layers=[{}], only 1 or 2 allowed.", PipeType, FieldName, ConstructionName, TotalLayers)); ErrorsFound = true; } } diff --git a/src/EnergyPlus/Plant/Loop.cc b/src/EnergyPlus/Plant/Loop.cc index 532d4263ab2..5032e644ac6 100644 --- a/src/EnergyPlus/Plant/Loop.cc +++ b/src/EnergyPlus/Plant/Loop.cc @@ -244,7 +244,7 @@ namespace EnergyPlus::DataPlant { using DataLoopNode::Node; using DataLoopNode::NodeID; using DataPlant::SupplySide; - using General::RoundSigDigits; + ; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int LoopInlet; // plant loop inlet node num. @@ -261,12 +261,8 @@ namespace EnergyPlus::DataPlant { ShowWarningError(state, "PlantSupplySide: PlantLoop=\"" + this->Name + "\", Error (CheckLoopExitNode) -- Mass Flow Rate Calculation. Outlet and Inlet differ by more than tolerance."); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Loop inlet node=" + NodeID(LoopInlet) + ", flowrate=" + - RoundSigDigits(Node(LoopInlet).MassFlowRate, 4) + - " kg/s"); - ShowContinueError(state, "Loop outlet node=" + NodeID(LoopOutlet) + ", flowrate=" + - RoundSigDigits(Node(LoopOutlet).MassFlowRate, 4) + - " kg/s"); + ShowContinueError(state, format("Loop inlet node={}, flowrate={:.4R} kg/s", NodeID(LoopInlet), Node(LoopInlet).MassFlowRate)); + ShowContinueError(state, format("Loop outlet node={}, flowrate={:.4R} kg/s", NodeID(LoopOutlet), Node(LoopOutlet).MassFlowRate)); ShowContinueError(state, "This loop might be helped by a bypass."); } ShowRecurringWarningErrorAtEnd(state, "PlantSupplySide: PlantLoop=\"" + this->Name + diff --git a/src/EnergyPlus/Plant/LoopSide.cc b/src/EnergyPlus/Plant/LoopSide.cc index d09aaf70dbd..da5a775a4f6 100644 --- a/src/EnergyPlus/Plant/LoopSide.cc +++ b/src/EnergyPlus/Plant/LoopSide.cc @@ -757,13 +757,11 @@ namespace DataPlant { "For example, if using SetpointManager:Scheduled:DualSetpoint, then check that the low setpoint is " "below the high setpoint."); ShowContinueError(state, "Occurs in PlantLoop=" + thisPlantLoop.Name); - ShowContinueError(state, - "LoadToHeatingSetPoint=" + General::RoundSigDigits(LoadToHeatingSetPoint, 3) + - ", LoadToCoolingSetPoint=" + General::RoundSigDigits(LoadToCoolingSetPoint, 3)); - ShowContinueError(state, "Loop Heating Low Setpoint=" + - General::RoundSigDigits(LoopSetPointTemperatureLo, 2)); - ShowContinueError(state, "Loop Cooling High Setpoint=" + - General::RoundSigDigits(LoopSetPointTemperatureHi, 2)); + ShowContinueError( + state, + format("LoadToHeatingSetPoint={:.3R}, LoadToCoolingSetPoint={:.3R}", LoadToHeatingSetPoint, LoadToCoolingSetPoint)); + ShowContinueError(state, format("Loop Heating Low Setpoint={:.2R}", LoopSetPointTemperatureLo)); + ShowContinueError(state, format("Loop Cooling High Setpoint={:.2R}", LoopSetPointTemperatureHi)); ShowFatalError(state, "Program terminates due to above conditions."); } @@ -779,13 +777,11 @@ namespace DataPlant { "DualSetPointWithDeadBand: Unanticipated combination of heating and cooling loads - report to EnergyPlus " "Development Team"); ShowContinueError(state, "occurs in PlantLoop=" + thisPlantLoop.Name); - ShowContinueError(state, - "LoadToHeatingSetPoint=" + General::RoundSigDigits(LoadToHeatingSetPoint, 3) + - ", LoadToCoolingSetPoint=" + General::RoundSigDigits(LoadToCoolingSetPoint, 3)); - ShowContinueError(state, "Loop Heating Setpoint=" + - General::RoundSigDigits(LoopSetPointTemperatureLo, 2)); - ShowContinueError(state, "Loop Cooling Setpoint=" + - General::RoundSigDigits(LoopSetPointTemperatureHi, 2)); + ShowContinueError( + state, + format("LoadToHeatingSetPoint={:.3R}, LoadToCoolingSetPoint={:.3R}", LoadToHeatingSetPoint, LoadToCoolingSetPoint)); + ShowContinueError(state, format("Loop Heating Setpoint={:.2R}", LoopSetPointTemperatureLo)); + ShowContinueError(state, format("Loop Cooling Setpoint={:.2R}", LoopSetPointTemperatureHi)); ShowFatalError(state, "Program terminates due to above conditions."); } } else { @@ -1314,7 +1310,6 @@ namespace DataPlant { using DataLoopNode::Node; using DataPlant::TypeOf_PumpBankVariableSpeed; using DataPlant::TypeOf_PumpVariableSpeed; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static Array1D_string const LoopSideName(2, {"Demand", "Supply"}); @@ -1670,10 +1665,9 @@ namespace DataPlant { // Call fatal diagnostic error. !The math should work out! ShowSevereError(state, "ResolveParallelFlows: Dev note, failed to redistribute restricted flow"); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Loop side flow = " + RoundSigDigits(ThisLoopSideFlow, 8) + " (kg/s)"); - ShowContinueError(state, "Flow Remaining = " + RoundSigDigits(FlowRemaining, 8) + " (kg/s)"); - ShowContinueError(state, "Parallel Branch requests = " + RoundSigDigits(TotParallelBranchFlowReq, 8) + - " (kg/s)"); + ShowContinueError(state, format("Loop side flow = {:.8R} (kg/s)", ThisLoopSideFlow)); + ShowContinueError(state, format("Flow Remaining = {:.8R} (kg/s)", FlowRemaining)); + ShowContinueError(state, format("Parallel Branch requests = {:.8R} (kg/s)", TotParallelBranchFlowReq)); } // 2) ! Reset the flow on the Mixer outlet branch diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index b690c21e7e2..724c34447dc 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -80,7 +80,6 @@ #include #include #include -#include #include #include #include @@ -319,7 +318,7 @@ namespace EnergyPlus { using DataSizing::AutoSize; using FluidProperties::CheckFluidPropertyName; using FluidProperties::FindGlycol; - using General::RoundSigDigits; + ; using SystemAvailabilityManager::GetPlantAvailabilityManager; // SUBROUTINE PARAMETER DEFINITIONS: @@ -2098,7 +2097,7 @@ namespace EnergyPlus { using EMSManager::iTemperatureMaxSetPoint; using EMSManager::iTemperatureMinSetPoint; using EMSManager::iTemperatureSetPoint; - using General::RoundSigDigits; + ; using PlantUtilities::SetAllFlowLocks; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -3002,7 +3001,7 @@ namespace EnergyPlus { // Using/Aliasing using namespace DataSizing; using FluidProperties::GetDensityGlycol; - using General::RoundSigDigits; + ; // Locals bool localInitLoopEquip(true); @@ -3133,9 +3132,10 @@ namespace EnergyPlus { } else { PlantLoop(LoopNum).MaxVolFlowRate = 0.0; if (PlantFinalSizesOkayToReport) { - ShowWarningError(state, "SizePlantLoop: Calculated Plant Sizing Design Volume Flow Rate=[" + - RoundSigDigits(PlantSizData(PlantSizNum).DesVolFlowRate, 2) + - "] is too small. Set to 0.0"); + ShowWarningError( + state, + format("SizePlantLoop: Calculated Plant Sizing Design Volume Flow Rate=[{:.2R}] is too small. Set to 0.0", + PlantSizData(PlantSizNum).DesVolFlowRate)); ShowContinueError(state, "..occurs for PlantLoop=" + PlantLoop(LoopNum).Name); } } @@ -3241,7 +3241,7 @@ namespace EnergyPlus { using namespace DataSizing; using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; - using General::RoundSigDigits; + ; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("ResizePlantLoop"); @@ -3296,9 +3296,10 @@ namespace EnergyPlus { } else { PlantLoop(LoopNum).MaxVolFlowRate = 0.0; if (PlantFinalSizesOkayToReport) { - ShowWarningError(state, "SizePlantLoop: Calculated Plant Sizing Design Volume Flow Rate=[" + - RoundSigDigits(PlantSizData(PlantSizNum).DesVolFlowRate, 2) + - "] is too small. Set to 0.0"); + ShowWarningError( + state, + format("SizePlantLoop: Calculated Plant Sizing Design Volume Flow Rate=[{:.2R}] is too small. Set to 0.0", + PlantSizData(PlantSizNum).DesVolFlowRate)); ShowContinueError(state, "..occurs for PlantLoop=" + PlantLoop(LoopNum).Name); } } diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index d30b70c7814..88007dee506 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -315,10 +315,11 @@ namespace PlantCentralGSHP { DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerHeaterPerformanceElectricEIR: Potential issue with equipment sizing for " + this->ChillerHeater(NumChillerHeater).Name); - ShowContinueError(state, "User-Specified Reference Chilled Water Flow Rate of " + - General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Reference Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Reference Chilled Water Flow Rate of {:.5R} [m3/s]", EvapVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Reference Chilled Water Flow Rate of {:.5R} [m3/s]", + tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -408,9 +409,8 @@ namespace PlantCentralGSHP { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerHeaterPerformanceElectricEIR: Potential issue with equipment sizing for " + this->ChillerHeater(NumChillerHeater).Name); - ShowContinueError(state, "User-Specified Reference Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Reference Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Reference Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Reference Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -495,10 +495,12 @@ namespace PlantCentralGSHP { DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerHeaterPerformanceElectricEIR: Potential issue with equipment sizing for " + this->ChillerHeater(NumChillerHeater).Name); - ShowContinueError(state, "User-Specified Reference Condenser Water Flow Rate of " + - General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Reference Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Reference Condenser Water Flow Rate of {:.5R} [m3/s]", CondVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Reference Condenser Water Flow Rate of {:.5R} [m3/s]", + tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -905,161 +907,184 @@ namespace PlantCentralGSHP { for (int ChillerHeaterNum = 1; ChillerHeaterNum <= this->ChillerHeaterNums; ++ChillerHeaterNum) { - SetupOutputVariable(state, "Chiller Heater Operation Mode Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Operation Mode Unit {}", ChillerHeaterNum), OutputProcessor::Unit::None, this->ChillerHeater(ChillerHeaterNum).Report.CurrentMode, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Part Load Ratio Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Part Load Ratio Unit {}", ChillerHeaterNum), OutputProcessor::Unit::None, this->ChillerHeater(ChillerHeaterNum).Report.ChillerPartLoadRatio, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Cycling Ratio Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Cycling Ratio Unit {}", ChillerHeaterNum), OutputProcessor::Unit::None, this->ChillerHeater(ChillerHeaterNum).Report.ChillerCyclingRatio, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Cooling Electricity Rate Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Cooling Electricity Rate Unit {}", ChillerHeaterNum), OutputProcessor::Unit::W, this->ChillerHeater(ChillerHeaterNum).Report.CoolingPower, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Heating Electricity Rate Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Heating Electricity Rate Unit {}", ChillerHeaterNum), OutputProcessor::Unit::W, this->ChillerHeater(ChillerHeaterNum).Report.HeatingPower, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Cooling Electricity Energy Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Cooling Electricity Energy Unit {}", ChillerHeaterNum), OutputProcessor::Unit::J, this->ChillerHeater(ChillerHeaterNum).Report.CoolingEnergy, "System", "Sum", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Heating Electricity Energy Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Heating Electricity Energy Unit {}", ChillerHeaterNum), OutputProcessor::Unit::J, this->ChillerHeater(ChillerHeaterNum).Report.HeatingEnergy, "System", "Sum", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Cooling Rate Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Cooling Rate Unit {}", ChillerHeaterNum), OutputProcessor::Unit::W, this->ChillerHeater(ChillerHeaterNum).Report.QEvap, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Cooling Energy Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Cooling Energy Unit {}", ChillerHeaterNum), OutputProcessor::Unit::J, this->ChillerHeater(ChillerHeaterNum).Report.EvapEnergy, "System", "Sum", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater False Load Heat Transfer Rate Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater False Load Heat Transfer Rate Unit {}", ChillerHeaterNum), OutputProcessor::Unit::W, this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoadRate, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater False Load Heat Transfer Energy Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater False Load Heat Transfer Energy Unit {}", ChillerHeaterNum), OutputProcessor::Unit::J, this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoad, "System", "Sum", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Evaporator Inlet Temperature Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Evaporator Inlet Temperature Unit {}", ChillerHeaterNum), OutputProcessor::Unit::C, this->ChillerHeater(ChillerHeaterNum).Report.EvapInletTemp, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Evaporator Outlet Temperature Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Evaporator Outlet Temperature Unit {}", ChillerHeaterNum), OutputProcessor::Unit::C, this->ChillerHeater(ChillerHeaterNum).Report.EvapOutletTemp, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Evaporator Mass Flow Rate Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Evaporator Mass Flow Rate Unit {}", ChillerHeaterNum), OutputProcessor::Unit::kg_s, this->ChillerHeater(ChillerHeaterNum).Report.Evapmdot, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Condenser Heat Transfer Rate Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Condenser Heat Transfer Rate Unit {}", ChillerHeaterNum), OutputProcessor::Unit::W, this->ChillerHeater(ChillerHeaterNum).Report.QCond, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Condenser Heat Transfer Energy Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Condenser Heat Transfer Energy Unit {}", ChillerHeaterNum), OutputProcessor::Unit::J, this->ChillerHeater(ChillerHeaterNum).Report.CondEnergy, "System", "Sum", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater COP Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater COP Unit {}", ChillerHeaterNum), OutputProcessor::Unit::W_W, this->ChillerHeater(ChillerHeaterNum).Report.ActualCOP, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Capacity Temperature Modifier Multiplier Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Capacity Temperature Modifier Multiplier Unit {}", ChillerHeaterNum), OutputProcessor::Unit::None, this->ChillerHeater(ChillerHeaterNum).Report.ChillerCapFT, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater EIR Temperature Modifier Multiplier Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater EIR Temperature Modifier Multiplier Unit {}", ChillerHeaterNum), OutputProcessor::Unit::None, this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFT, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater EIR Part Load Modifier Multiplier Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater EIR Part Load Modifier Multiplier Unit {}", ChillerHeaterNum), OutputProcessor::Unit::None, this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFPLR, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Condenser Inlet Temperature Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Condenser Inlet Temperature Unit {}", ChillerHeaterNum), OutputProcessor::Unit::C, this->ChillerHeater(ChillerHeaterNum).Report.CondInletTemp, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Condenser Outlet Temperature Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Condenser Outlet Temperature Unit {}", ChillerHeaterNum), OutputProcessor::Unit::C, this->ChillerHeater(ChillerHeaterNum).Report.CondOutletTemp, "System", "Average", this->ChillerHeater(ChillerHeaterNum).Name); - SetupOutputVariable(state, "Chiller Heater Condenser Mass Flow Rate Unit " + General::TrimSigDigits(ChillerHeaterNum) + "", + SetupOutputVariable(state, + format("Chiller Heater Condenser Mass Flow Rate Unit {}", ChillerHeaterNum), OutputProcessor::Unit::kg_s, this->ChillerHeater(ChillerHeaterNum).Report.Condmdot, "System", @@ -1204,15 +1229,13 @@ namespace PlantCentralGSHP { } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Entered in " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowContinueError(state, format("Entered in {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); CHErrorsFound = true; } ChillerHeater(ChillerHeaterNum).RefCOPCooling = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Entered in " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); + ShowContinueError(state, format("Entered in {}={:.2R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); CHErrorsFound = true; } @@ -1224,16 +1247,14 @@ namespace PlantCentralGSHP { ChillerHeater(ChillerHeaterNum).ClgHtgToCoolingCapRatio = DataIPShortCuts::rNumericArgs(6); if (DataIPShortCuts::rNumericArgs(6) == 0.0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Entered in " + DataIPShortCuts::cNumericFieldNames(6) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(6), 2)); + ShowContinueError(state, format("Entered in {}={:.2R}", DataIPShortCuts::cNumericFieldNames(6), DataIPShortCuts::rNumericArgs(6))); CHErrorsFound = true; } ChillerHeater(ChillerHeaterNum).ClgHtgtoCogPowerRatio = DataIPShortCuts::rNumericArgs(7); if (DataIPShortCuts::rNumericArgs(7) == 0.0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Entered in " + DataIPShortCuts::cNumericFieldNames(7) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(7), 2)); + ShowContinueError(state, format("Entered in {}={:.2R}", DataIPShortCuts::cNumericFieldNames(7), DataIPShortCuts::rNumericArgs(7))); CHErrorsFound = true; } @@ -1269,7 +1290,7 @@ namespace PlantCentralGSHP { if (ChillerHeater(ChillerHeaterNum).OpenMotorEff < 0.0 || ChillerHeater(ChillerHeaterNum).OpenMotorEff > 1.0) { ShowSevereError(state, "GetCurveInput: For " + DataIPShortCuts::cCurrentModuleObject + ": " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(14) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(14), 3)); + ShowContinueError(state, format("{} = {:.3R}", DataIPShortCuts::cNumericFieldNames(14), DataIPShortCuts::rNumericArgs(14))); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(14) + " must be greater than or equal to zero"); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(14) + " must be less than or equal to one"); CHErrorsFound = true; @@ -1284,7 +1305,7 @@ namespace PlantCentralGSHP { ShowWarningError(state, "Capacity ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } } @@ -1296,7 +1317,7 @@ namespace PlantCentralGSHP { ShowWarningError(state, "Energy input ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } } @@ -1307,7 +1328,7 @@ namespace PlantCentralGSHP { ShowWarningError(state, "Energy input ratio as a function of part-load ratio curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } } @@ -1339,7 +1360,7 @@ namespace PlantCentralGSHP { ShowWarningError(state, "Capacity ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } } @@ -1351,7 +1372,7 @@ namespace PlantCentralGSHP { ShowWarningError(state, "Energy input ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } } @@ -1362,7 +1383,7 @@ namespace PlantCentralGSHP { ShowWarningError(state, "Energy input ratio as a function of part-load ratio curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at reference conditions = {:.3T}", CurveVal)); } } @@ -1799,8 +1820,7 @@ namespace PlantCentralGSHP { if (CompNum > this->NumOfComp) { ShowSevereError(state, "CalcChillerModel: ChillerHeater=\"" + this->Name + "\", calculated component number too big."); - ShowContinueError(state, "Max number of components=[" + General::RoundSigDigits(this->NumOfComp) + "], indicated component number=[" + - General::RoundSigDigits(CompNum) + "]."); + ShowContinueError(state, format("Max number of components=[{}], indicated component number=[{}].", this->NumOfComp, CompNum)); ShowFatalError(state, "Program terminates due to preceding condition."); } @@ -1890,8 +1910,9 @@ namespace PlantCentralGSHP { CondTempforCurve = CondOutletTemp; } else { ShowWarningError(state, "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\":"); - ShowContinueError(state, "Chiller condenser temperature for curve fit are not decided, defalt value= cond_leaving (" + - General::RoundSigDigits(ChillerCapFT, 3) + ")."); + ShowContinueError( + state, + format("Chiller condenser temperature for curve fit are not decided, defalt value= cond_leaving ({:.3R}).", ChillerCapFT)); CondTempforCurve = CondOutletTemp; } @@ -1913,11 +1934,13 @@ namespace PlantCentralGSHP { if (this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError < 1 && !state.dataGlobal->WarmupFlag) { ++this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError; ShowWarningError(state, "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\":"); - ShowContinueError(state, " ChillerHeater Capacity as a Function of Temperature curve output is negative (" + - General::RoundSigDigits(ChillerCapFT, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an Evaporator Outlet Temp of " + - General::RoundSigDigits(EvapOutletTempSetPoint, 1) + " and a Condenser Inlet Temp of " + - General::RoundSigDigits(CondInletTemp, 1) + '.'); + ShowContinueError( + state, format(" ChillerHeater Capacity as a Function of Temperature curve output is negative ({:.3R}).", ChillerCapFT)); + ShowContinueError( + state, + format(" Negative value occurs using an Evaporator Outlet Temp of {:.1R} and a Condenser Inlet Temp of {:.1R}.", + EvapOutletTempSetPoint, + CondInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } else if (!state.dataGlobal->WarmupFlag) { ++this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError; @@ -2274,9 +2297,10 @@ namespace PlantCentralGSHP { if (this->ChillerHeater(ChillerHeaterNum).ChillerEIRRefTempErrorIndex == 0) { ShowSevereMessage(state, "CalcChillerHeaterModel: ChillerHeaterPerformance:Electric:EIR=\"" + this->ChillerHeater(ChillerHeaterNum).Name + "\", DeltaTemp < 0"); - ShowContinueError(state, " Reference Simultaneous Cooling-Heating Mode Leaving Condenser Water Temperature [" + - General::RoundSigDigits(CondOutletTemp, 1) + ']'); - ShowContinueError(state, "is below condenser inlet temperature of [" + General::RoundSigDigits(CondInletTemp, 1) + "]."); + ShowContinueError( + state, + format(" Reference Simultaneous Cooling-Heating Mode Leaving Condenser Water Temperature [{:.1R}]", CondOutletTemp)); + ShowContinueError(state, format("is below condenser inlet temperature of [{:.1R}].", CondInletTemp)); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, " Reset reference temperature to one greater than the inlet temperature "); } @@ -2389,8 +2413,9 @@ namespace PlantCentralGSHP { CondTempforCurve = this->ChillerHeater(ChillerHeaterNum).TempRefCondOutClgHtg; //! CondOutletTemp } else { ShowWarningError(state, "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\":"); - ShowContinueError(state, "Chiller condensor temperature for curve fit are not decided, defalt value= cond_leaving (" + - General::RoundSigDigits(ChillerCapFT, 3) + ")."); + ShowContinueError(state, + format("Chiller condensor temperature for curve fit are not decided, defalt value= cond_leaving ({:.3R}).", + ChillerCapFT)); CondTempforCurve = DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; } @@ -2410,11 +2435,14 @@ namespace PlantCentralGSHP { if (this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError < 1 && !state.dataGlobal->WarmupFlag) { ++this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError; ShowWarningError(state, "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\":"); - ShowContinueError(state, " ChillerHeater Capacity as a Function of Temperature curve output is negative (" + - General::RoundSigDigits(ChillerCapFT, 3) + ")."); - ShowContinueError(state, " Negative value occurs using an Evaporator Outlet Temp of " + - General::RoundSigDigits(EvapOutletTempSetPoint, 1) + " and a Condenser Inlet Temp of " + - General::RoundSigDigits(CondInletTemp, 1) + '.'); + ShowContinueError( + state, + format(" ChillerHeater Capacity as a Function of Temperature curve output is negative ({:.3R}).", ChillerCapFT)); + ShowContinueError( + state, + format(" Negative value occurs using an Evaporator Outlet Temp of {:.1R} and a Condenser Inlet Temp of {:.1R}.", + EvapOutletTempSetPoint, + CondInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } else if (!state.dataGlobal->WarmupFlag) { ++this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError; diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index 93410da386a..7485cb00c06 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -230,15 +230,13 @@ namespace PlantChillers { thisChiller.NomCapWasAutoSized = true; } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } thisChiller.COP = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 3)); + ShowSevereError(state, format("Invalid {}={:.3R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } @@ -471,8 +469,8 @@ namespace PlantChillers { if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { if (thisChiller.CondVolFlowRate <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(10) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(10), 6)); + ShowSevereError(state, + format("Invalid {}={:.6R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); ShowSevereError(state, "Condenser fluid flow rate must be specified for Heat Reclaim applications."); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; @@ -1083,9 +1081,8 @@ namespace PlantChillers { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - this->NomCap) / this->NomCap) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectric: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(this->NomCap, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", this->NomCap)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1137,10 +1134,11 @@ namespace PlantChillers { if ((std::abs(tmpEvapVolFlowRate - this->EvapVolFlowRate) / this->EvapVolFlowRate) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectric: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Chilled Water Flow Rate of " + - General::RoundSigDigits(this->EvapVolFlowRate, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Chilled Water Flow Rate of {:.5R} [m3/s]", this->EvapVolFlowRate)); + ShowContinueError( + state, + format("differs from Design Size Design Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1205,10 +1203,11 @@ namespace PlantChillers { if ((std::abs(tmpCondVolFlowRate - this->CondVolFlowRate) / this->CondVolFlowRate) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectric: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Condenser Water Flow Rate of " + - General::RoundSigDigits(this->CondVolFlowRate, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Condenser Water Flow Rate of {:.5R} [m3/s]", this->CondVolFlowRate)); + ShowContinueError( + state, + format("differs from Design Size Design Condenser Water Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1266,10 +1265,12 @@ namespace PlantChillers { if ((std::abs(tmpHeatRecVolFlowRate - this->DesignHeatRecVolFlowRate) / this->DesignHeatRecVolFlowRate) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerElectric: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Heat Recovery Fluid Flow Rate of " + - General::RoundSigDigits(this->DesignHeatRecVolFlowRate, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Heat Recovery Fluid Flow Rate of " + - General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Design Heat Recovery Fluid Flow Rate of {:.5R} [m3/s]", + this->DesignHeatRecVolFlowRate)); + ShowContinueError(state, + format("differs from Design Size Design Heat Recovery Fluid Flow Rate of {:.5R} [m3/s]", + tmpHeatRecVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1845,9 +1846,9 @@ namespace PlantChillers { if (condInletTemp > 70.0) { ShowSevereError(state, "CalcElectricChillerModel: Condenser loop inlet temperatures over 70.0 C for ElectricChiller=" + this->Name); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Condenser loop water temperatures are too high at" + General::RoundSigDigits(condInletTemp, 2)); + ShowContinueError(state, format("Condenser loop water temperatures are too high at{:.2R}", condInletTemp)); ShowContinueError(state, "Check input for condenser plant loop, especially cooling tower"); - ShowContinueError(state, "Evaporator inlet temperature: " + General::RoundSigDigits(DataLoopNode::Node(this->EvapInletNodeNum).Temp, 2)); + ShowContinueError(state, format("Evaporator inlet temperature: {:.2R}", DataLoopNode::Node(this->EvapInletNodeNum).Temp)); ShowFatalError(state, "Program Terminates due to previous error condition"); } @@ -1857,8 +1858,8 @@ namespace PlantChillers { ShowSevereError(state, "CalcElectricChillerModel: Capacity ratio below zero for ElectricChiller=" + this->Name); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "Check input for Capacity Ratio Curve"); - ShowContinueError(state, "Condenser inlet temperature: " + General::RoundSigDigits(condInletTemp, 2)); - ShowContinueError(state, "Evaporator inlet temperature: " + General::RoundSigDigits(DataLoopNode::Node(this->EvapInletNodeNum).Temp, 2)); + ShowContinueError(state, format("Condenser inlet temperature: {:.2R}", condInletTemp)); + ShowContinueError(state, format("Evaporator inlet temperature: {:.2R}", DataLoopNode::Node(this->EvapInletNodeNum).Temp)); ShowFatalError(state, "Program Terminates due to previous error condition"); } } @@ -2132,16 +2133,14 @@ namespace PlantChillers { thisChiller.NomCapWasAutoSized = true; } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } thisChiller.COP = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } @@ -2426,8 +2425,8 @@ namespace PlantChillers { if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { if (thisChiller.CondVolFlowRate <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(10) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(10), 6)); + ShowSevereError(state, + format("Invalid {}={:.6R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); ShowSevereError(state, "Condenser fluid flow rate must be specified for Heat Reclaim applications."); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; @@ -2982,9 +2981,8 @@ namespace PlantChillers { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - this->NomCap) / this->NomCap) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerEngineDriven: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(this->NomCap, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", this->NomCap)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3034,10 +3032,11 @@ namespace PlantChillers { if ((std::abs(tmpEvapVolFlowRate - this->EvapVolFlowRate) / this->EvapVolFlowRate) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerEngineDriven: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Chilled Water Flow Rate of " + - General::RoundSigDigits(this->EvapVolFlowRate, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Chilled Water Flow Rate of {:.5R} [m3/s]", this->EvapVolFlowRate)); + ShowContinueError( + state, + format("differs from Design Size Design Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3102,10 +3101,11 @@ namespace PlantChillers { if ((std::abs(tmpCondVolFlowRate - this->CondVolFlowRate) / this->CondVolFlowRate) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerEngineDriven: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Condenser Water Flow Rate of " + - General::RoundSigDigits(this->CondVolFlowRate, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Condenser Water Flow Rate of {:.5R} [m3/s]", this->CondVolFlowRate)); + ShowContinueError( + state, + format("differs from Design Size Design Condenser Water Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3170,10 +3170,12 @@ namespace PlantChillers { if ((std::abs(tmpHeatRecVolFlowRate - DesignHeatRecVolFlowRateUser) / DesignHeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeEngineDrivenChiller: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Heat Recovery Fluid Flow Rate of " + - General::RoundSigDigits(DesignHeatRecVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Heat Recovery Fluid Flow Rate of " + - General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Design Heat Recovery Fluid Flow Rate of {:.5R} [m3/s]", DesignHeatRecVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Design Heat Recovery Fluid Flow Rate of {:.5R} [m3/s]", + tmpHeatRecVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3817,9 +3819,9 @@ namespace PlantChillers { if (this->CondInletTemp > 70.0) { ShowSevereError(state, "CalcEngineDrivenChillerModel: Condenser loop inlet temperatures > 70.0 C for EngineDrivenChiller=" + this->Name); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Condenser loop water temperatures are too high at" + General::RoundSigDigits(this->CondInletTemp, 2)); + ShowContinueError(state, format("Condenser loop water temperatures are too high at{:.2R}", this->CondInletTemp)); ShowContinueError(state, "Check input for condenser plant loop, especially cooling tower"); - ShowContinueError(state, "Evaporator inlet temperature: " + General::RoundSigDigits(DataLoopNode::Node(this->EvapInletNodeNum).Temp, 2)); + ShowContinueError(state, format("Evaporator inlet temperature: {:.2R}", DataLoopNode::Node(this->EvapInletNodeNum).Temp)); ShowFatalError(state, "Program Terminates due to previous error condition"); } @@ -3829,8 +3831,8 @@ namespace PlantChillers { ShowSevereError(state, "CalcEngineDrivenChillerModel: Capacity ratio below zero for EngineDrivenChiller=" + this->Name); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "Check input for Capacity Ratio Curve"); - ShowContinueError(state, "Condenser inlet temperature: " + General::RoundSigDigits(this->CondInletTemp, 2)); - ShowContinueError(state, "Evaporator inlet temperature: " + General::RoundSigDigits(DataLoopNode::Node(this->EvapInletNodeNum).Temp, 2)); + ShowContinueError(state, format("Condenser inlet temperature: {:.2R}", this->CondInletTemp)); + ShowContinueError(state, format("Evaporator inlet temperature: {:.2R}", DataLoopNode::Node(this->EvapInletNodeNum).Temp)); ShowFatalError(state, "Program Terminates due to previous error condition"); } } @@ -4066,16 +4068,14 @@ namespace PlantChillers { thisChiller.NomCapWasAutoSized = true; } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } thisChiller.COP = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } @@ -4307,8 +4307,8 @@ namespace PlantChillers { if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { if (thisChiller.CondVolFlowRate <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(10) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(10), 6)); + ShowSevereError(state, + format("Invalid {}={:.6R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); ShowSevereError(state, "Condenser fluid flow rate must be specified for Heat Reclaim applications."); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; @@ -4848,9 +4848,8 @@ namespace PlantChillers { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - this->NomCap) / this->NomCap) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeGTChiller: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(this->NomCap, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", this->NomCap)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -4902,10 +4901,11 @@ namespace PlantChillers { if ((std::abs(tmpEvapVolFlowRate - this->EvapVolFlowRate) / this->EvapVolFlowRate) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeGTChiller: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Chilled Water Flow Rate of " + - General::RoundSigDigits(this->EvapVolFlowRate, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Chilled Water Flow Rate of {:.5R} [m3/s]", this->EvapVolFlowRate)); + ShowContinueError( + state, + format("differs from Design Size Design Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -4971,10 +4971,11 @@ namespace PlantChillers { if ((std::abs(tmpCondVolFlowRate - this->CondVolFlowRate) / this->CondVolFlowRate) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeGTChiller: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Condenser Water Flow Rate of " + - General::RoundSigDigits(this->CondVolFlowRate, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Condenser Water Flow Rate of {:.5R} [m3/s]", this->CondVolFlowRate)); + ShowContinueError( + state, + format("differs from Design Size Design Condenser Water Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -5026,10 +5027,9 @@ namespace PlantChillers { if ((std::abs(GTEngineCapacityDes - this->GTEngineCapacity) / this->GTEngineCapacity) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeGTChiller: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Gas Turbine Engine Capacity of " + General::RoundSigDigits(this->GTEngineCapacity, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Gas Turbine Engine Capacity of " + - General::RoundSigDigits(GTEngineCapacityDes, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Gas Turbine Engine Capacity of {:.2R} [W]", this->GTEngineCapacity)); + ShowContinueError(state, + format("differs from Design Size Gas Turbine Engine Capacity of {:.2R} [W]", GTEngineCapacityDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -5077,10 +5077,12 @@ namespace PlantChillers { if ((std::abs(tmpHeatRecVolFlowRate - DesignHeatRecVolFlowRateUser) / DesignHeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeGasTurbineChiller: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Heat Recovery Fluid Flow Rate of " + - General::RoundSigDigits(DesignHeatRecVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Heat Recovery Fluid Flow Rate of " + - General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, + format("User-Specified Design Heat Recovery Fluid Flow Rate of {:.5R} [m3/s]", DesignHeatRecVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Design Heat Recovery Fluid Flow Rate of {:.5R} [m3/s]", + tmpHeatRecVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -5724,9 +5726,9 @@ namespace PlantChillers { if (condInletTemp > 70.0) { ShowSevereError(state, "CalcGTChillerModel: Condenser loop inlet temperatures over 70.0 C for GTChiller=" + this->Name); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Condenser loop water temperatures are too high at" + General::RoundSigDigits(condInletTemp, 2)); + ShowContinueError(state, format("Condenser loop water temperatures are too high at{:.2R}", condInletTemp)); ShowContinueError(state, "Check input for condenser plant loop, especially cooling tower"); - ShowContinueError(state, "Evaporator inlet temperature: " + General::RoundSigDigits(DataLoopNode::Node(this->EvapInletNodeNum).Temp, 2)); + ShowContinueError(state, format("Evaporator inlet temperature: {:.2R}", DataLoopNode::Node(this->EvapInletNodeNum).Temp)); ShowFatalError(state, "Program Terminates due to previous error condition"); } @@ -5736,8 +5738,8 @@ namespace PlantChillers { ShowSevereError(state, "CalcGTChillerModel: Capacity ratio below zero for GTChiller=" + this->Name); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "Check input for Capacity Ratio Curve"); - ShowContinueError(state, "Condenser inlet temperature: " + General::RoundSigDigits(condInletTemp, 2)); - ShowContinueError(state, "Evaporator inlet temperature: " + General::RoundSigDigits(DataLoopNode::Node(this->EvapInletNodeNum).Temp, 2)); + ShowContinueError(state, format("Condenser inlet temperature: {:.2R}", condInletTemp)); + ShowContinueError(state, format("Evaporator inlet temperature: {:.2R}", DataLoopNode::Node(this->EvapInletNodeNum).Temp)); ShowFatalError(state, "Program Terminates due to previous error condition"); } } @@ -5923,15 +5925,13 @@ namespace PlantChillers { thisChiller.NomCapWasAutoSized = true; } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } thisChiller.COP = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ErrorsFound = true; } @@ -6502,9 +6502,8 @@ namespace PlantChillers { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerConstantCOP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", NomCapUser)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpNomCap)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -6556,10 +6555,11 @@ namespace PlantChillers { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerConstantCOP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Chilled Water Flow Rate of " + - General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Design Chilled Water Flow Rate of {:.5R} [m3/s]", EvapVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Chilled Water Flow Rate of {:.5R} [m3/s]", tmpEvapVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -6619,10 +6619,11 @@ namespace PlantChillers { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizeChillerConstantCOP: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Condenser Water Flow Rate of " + - General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Design Condenser Water Flow Rate of {:.5R} [m3/s]", CondVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Design Condenser Water Flow Rate of {:.5R} [m3/s]", tmpCondVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -7125,9 +7126,9 @@ namespace PlantChillers { if (CondInletTemp > 70.0) { ShowSevereError(state, "CalcConstCOPChillerModel: Condenser loop inlet temperatures over 70.0 C for ConstCOPChiller=" + this->Name); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Condenser loop water temperatures are too high at" + General::RoundSigDigits(CondInletTemp, 2)); + ShowContinueError(state, format("Condenser loop water temperatures are too high at{:.2R}", CondInletTemp)); ShowContinueError(state, "Check input for condenser plant loop, especially cooling tower"); - ShowContinueError(state, "Evaporator inlet temperature: " + General::RoundSigDigits(DataLoopNode::Node(this->EvapInletNodeNum).Temp, 2)); + ShowContinueError(state, format("Evaporator inlet temperature: {:.2R}", DataLoopNode::Node(this->EvapInletNodeNum).Temp)); ShowFatalError(state, "Program Terminates due to previous error condition"); } diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.cc b/src/EnergyPlus/PlantComponentTemperatureSources.cc index 608facecc54..d514a463d7c 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -333,10 +333,9 @@ namespace PlantComponentTemperatureSources { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpVolFlowRate - DesVolFlowRateUser) / DesVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "SizePlantComponentTemperatureSource: Potential issue with equipment sizing for " + this->Name); - ShowContinueError(state, "User-Specified Design Fluid Flow Rate of " + General::RoundSigDigits(DesVolFlowRateUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Design Fluid Flow Rate of " + - General::RoundSigDigits(tmpVolFlowRate, 5) + " [m3/s]"); + ShowContinueError(state, format("User-Specified Design Fluid Flow Rate of {:.5R} [m3/s]", DesVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Design Fluid Flow Rate of {:.5R} [m3/s]", tmpVolFlowRate)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 863747ac057..4aba49c7483 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -185,7 +185,6 @@ namespace PlantCondLoopOperation { using DataEnvironment::OutDryBulbTemp; using DataEnvironment::OutRelHum; using DataEnvironment::OutWetBulbTemp; // Current outdoor relative humidity [%] - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -795,7 +794,6 @@ CurrentModuleObject, PlantOpSchemeName); // PlantEquipmentOperation:Uncontrolled // Using/Aliasing - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: int const Plant(1); // Used to identify whether the current loop is Plant @@ -924,10 +922,13 @@ CurrentModuleObject, PlantOpSchemeName); ShowWarningError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", detected overlapping ranges in " + CurrentModuleObject + " = \"" + PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); - ShowContinueError(state, "Range # " + RoundSigDigits(InnerListNum) + - " Lower limit = " + RoundSigDigits(InnerListNumLowerLimit, 1) + " lies within the Range # " + - RoundSigDigits(ListNum) + " (" + RoundSigDigits(OuterListNumLowerLimit, 1) + " to " + - RoundSigDigits(OuterListNumUpperLimit, 1) + ")."); + ShowContinueError(state, + format("Range # {} Lower limit = {:.1R} lies within the Range # {} ({:.1R} to {:.1R}).", + InnerListNum, + InnerListNumLowerLimit, + ListNum, + OuterListNumLowerLimit, + OuterListNumUpperLimit)); ShowContinueError(state, "Check that input for load range limit values do not overlap, and the simulation continues..."); } // Check if inner list has an upper limit that is between an outer's lower and upper limit @@ -935,10 +936,13 @@ CurrentModuleObject, PlantOpSchemeName); ShowWarningError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", detected overlapping ranges in " + CurrentModuleObject + " = \"" + PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); - ShowContinueError(state, "Range # " + RoundSigDigits(InnerListNum) + - " Upper limit = " + RoundSigDigits(InnerListNumUpperLimit, 1) + " lies within Range # " + - RoundSigDigits(ListNum) + " (" + RoundSigDigits(OuterListNumLowerLimit, 1) + " to " + - RoundSigDigits(OuterListNumUpperLimit, 1) + ")."); + ShowContinueError(state, + format("Range # {} Upper limit = {:.1R} lies within Range # {} ({:.1R} to {:.1R}).", + InnerListNum, + InnerListNumUpperLimit, + ListNum, + OuterListNumLowerLimit, + OuterListNumUpperLimit)); ShowContinueError(state, "Check that input for load range limit values do not overlap, and the simulation continues..."); } } @@ -1443,9 +1447,10 @@ CurrentModuleObject, PlantOpSchemeName); // call error...Demand node must be component inlet node for autosizing } } - BaseSizer::reportSizerOutput(state, CurrentModuleObject, + BaseSizer::reportSizerOutput(state, + CurrentModuleObject, PlantLoop(LoopNum).OpScheme(SchemeNum).Name, - "Design Water Flow Rate [m3/s] Equipment # " + std::to_string(Num), + format("Design Water Flow Rate [m3/s] Equipment # {}", Num), CompFlowRate); } diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index f1d7e1e0e1d..045a9dd5dcf 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -2159,8 +2159,8 @@ namespace PlantHeatExchangerFluidToFluid { ++this->DmdSideModulatSolvNoConvergeErrorCount; ShowWarningError(state, ComponentClassName + " named " + this->Name + " - Iteration Limit exceeded calculating demand side loop flow rate"); - ShowContinueError(state, "Simulation continues with calculated demand side mass flow rate = " + - General::RoundSigDigits(DmdSideMdot, 7)); + ShowContinueError(state, + format("Simulation continues with calculated demand side mass flow rate = {:.7R}", DmdSideMdot)); } ShowRecurringWarningErrorAtEnd(state, ComponentClassName + " named " + this->Name + " - Iteration Limit exceeded calculating demand side loop flow rate continues.", @@ -2176,8 +2176,8 @@ namespace PlantHeatExchangerFluidToFluid { ++this->DmdSideModulatSolvFailErrorCount; ShowWarningError(state, ComponentClassName + " named " + this->Name + " - Solver failed to calculate demand side loop flow rate"); - ShowContinueError(state, "Simulation continues with estimated demand side mass flow rate = " + - General::RoundSigDigits(DmdSideMdot, 7)); + ShowContinueError(state, + format("Simulation continues with estimated demand side mass flow rate = {:.7R}", DmdSideMdot)); } ShowRecurringWarningErrorAtEnd(state, ComponentClassName + " named " + this->Name + " - Solver failed to calculate demand side loop flow rate continues.", @@ -2232,8 +2232,8 @@ namespace PlantHeatExchangerFluidToFluid { ++this->DmdSideModulatSolvNoConvergeErrorCount; ShowWarningError(state, ComponentClassName + " named " + this->Name + " - Iteration Limit exceeded calculating demand side loop flow rate"); - ShowContinueError(state, "Simulation continues with calculated demand side mass flow rate = " + - General::RoundSigDigits(DmdSideMdot, 7)); + ShowContinueError(state, + format("Simulation continues with calculated demand side mass flow rate = {:.7R}", DmdSideMdot)); } ShowRecurringWarningErrorAtEnd(state, ComponentClassName + " named " + this->Name + " - Iteration Limit exceeded calculating demand side loop flow rate continues.", @@ -2249,8 +2249,8 @@ namespace PlantHeatExchangerFluidToFluid { ++this->DmdSideModulatSolvFailErrorCount; ShowWarningError(state, ComponentClassName + " named " + this->Name + " - Solver failed to calculate demand side loop flow rate"); - ShowContinueError(state, "Simulation continues with estimated demand side mass flow rate = " + - General::RoundSigDigits(DmdSideMdot, 7)); + ShowContinueError(state, + format("Simulation continues with estimated demand side mass flow rate = {:.7R}", DmdSideMdot)); } ShowRecurringWarningErrorAtEnd(state, ComponentClassName + " named " + this->Name + " - Solver failed to calculate demand side loop flow rate continues.", diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index c41df9d2369..610d74985e8 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -641,9 +641,8 @@ namespace EIRPlantLoopHeatPumps { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(tmpCapacity - hardSizedCapacity) / hardSizedCapacity) > DataSizing::AutoVsHardSizingThreshold) { ShowWarningMessage(state, "EIRPlantLoopHeatPump::size(): Potential issue with equipment sizing for " + this->name); - ShowContinueError(state, "User-Specified Nominal Capacity of " + General::RoundSigDigits(hardSizedCapacity, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpCapacity, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Nominal Capacity of {:.2R} [W]", hardSizedCapacity)); + ShowContinueError(state, format("differs from Design Size Nominal Capacity of {:.2R} [W]", tmpCapacity)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -681,10 +680,10 @@ namespace EIRPlantLoopHeatPumps { if ((std::abs(tmpLoadVolFlow - hardSizedLoadSideFlow) / hardSizedLoadSideFlow) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "EIRPlantLoopHeatPump::size(): Potential issue with equipment sizing for " + this->name); - ShowContinueError(state, "User-Specified Load Side Volume Flow Rate of " + - General::RoundSigDigits(hardSizedLoadSideFlow, 2) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Load Side Volume Flow Rate of " + - General::RoundSigDigits(tmpLoadVolFlow, 2) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Load Side Volume Flow Rate of {:.2R} [m3/s]", hardSizedLoadSideFlow)); + ShowContinueError(state, + format("differs from Design Size Load Side Volume Flow Rate of {:.2R} [m3/s]", tmpLoadVolFlow)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -819,10 +818,9 @@ namespace EIRPlantLoopHeatPumps { if ((std::abs(tmpSourceVolFlow - hardSizedSourceSideFlow) / hardSizedSourceSideFlow) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage(state, "EIRPlantLoopHeatPump::size(): Potential issue with equipment sizing for " + this->name); - ShowContinueError(state, "User-Specified Source Side Volume Flow Rate of " + - General::RoundSigDigits(hardSizedSourceSideFlow, 2) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Source Side Volume Flow Rate of " + - General::RoundSigDigits(tmpSourceVolFlow, 2) + " [m3/s]"); + ShowContinueError(state, format("User-Specified Source Side Volume Flow Rate of {:.2R} [m3/s]", hardSizedSourceSideFlow)); + ShowContinueError(state, + format("differs from Design Size Source Side Volume Flow Rate of {:.2R} [m3/s]", tmpSourceVolFlow)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -898,8 +896,10 @@ namespace EIRPlantLoopHeatPumps { // protected by the input processor to be >0.0 // fatal out just in case errorsFound = true; // LCOV_EXCL_LINE - ShowSevereError(state, "Invalid condenser flow rate for EIR PLHP (name=" // LCOV_EXCL_LINE - + this->name + "; entered value: " + std::to_string(this->sourceSideDesignVolFlowRate)); // LCOV_EXCL_LINE + ShowSevereError(state, + format("Invalid condenser flow rate for EIR PLHP (name={}; entered value: {}", + this->name, + this->sourceSideDesignVolFlowRate)); // LCOV_EXCL_LINE } else { // can't imagine how it would ever get to this point // just assume it's the same as the load side if we don't have any sizing information diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index 36172cf3d5a..fdfc5d7b3cc 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -491,9 +491,10 @@ namespace EnergyPlus { ShowSevereError(state, "PipingSystems::" + RoutineName + ": A pipe was outside of the domain extents after performing corrections for basement or burial depth."); ShowContinueError(state, "Pipe segment name:" + thisSegment->Name); - ShowContinueError(state, "Corrected pipe location: ( x,y )=( " + - General::TrimSigDigits(thisSegment->PipeLocation.X, 2) + ',' + - General::TrimSigDigits(thisSegment->PipeLocation.Y, 2) + " )"); + ShowContinueError(state, + format("Corrected pipe location: ( x,y )=( {:.2T},{:.2T} )", + thisSegment->PipeLocation.X, + thisSegment->PipeLocation.Y)); } } // segment loop } // circuit loop @@ -1673,8 +1674,10 @@ namespace EnergyPlus { // Issue a severe if Inner >= Outer diameter if (thisCircuit.PipeSize.InnerDia >= thisCircuit.PipeSize.OuterDia) { ShowSevereError(state, RoutineName + ": " + ObjName_HorizTrench + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\" has invalid pipe diameters."); - ShowContinueError(state, "Outer diameter [" + General::TrimSigDigits(thisCircuit.PipeSize.OuterDia, 3) - + "] must be greater than inner diameter [" + General::TrimSigDigits(thisCircuit.PipeSize.InnerDia, 3) + "]."); + ShowContinueError(state, + format("Outer diameter [{:.3T}] must be greater than inner diameter [{:.3T}].", + thisCircuit.PipeSize.OuterDia, + thisCircuit.PipeSize.InnerDia)); ErrorsFound = true; } @@ -1943,8 +1946,7 @@ namespace EnergyPlus { for (int ThisCircuitPipeSegmentCounter = 1; ThisCircuitPipeSegmentCounter <= NumPipeSegments; ++ThisCircuitPipeSegmentCounter) { Segment segment; - segment.Name = "HorizontalTrenchCircuit" + std::to_string(HorizontalGHXCtr) + "Segment" + - std::to_string(ThisCircuitPipeSegmentCounter); + segment.Name = format("HorizontalTrenchCircuit{}Segment{}", HorizontalGHXCtr, ThisCircuitPipeSegmentCounter); segment.IsActuallyPartOfAHorizontalTrench = true; segment.PipeLocation = PointF(ThisCircuitPipeSegmentCounter * thisInterPipeSpacing, thisBurialDepth); @@ -2281,8 +2283,10 @@ namespace EnergyPlus { // MODIFIED na // RE-ENGINEERED na - ShowSevereError(state, RoutineName + ':' + ObjectName + "=\"" + InstanceName + "\", invalid " + FieldName + "=\"" + - General::TrimSigDigits(FieldEntry, 3) + "\", Condition: " + Condition); + ShowSevereError( + state, + format( + "{}:{}=\"{}\", invalid {}=\"{:.3T}\", Condition: {}", RoutineName, ObjectName, InstanceName, FieldName, FieldEntry, Condition)); ErrorsFound = true; } diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index 7bf1d65f34f..6dab0dd1141 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -62,7 +62,6 @@ #include #include #include -#include #include #include @@ -273,7 +272,7 @@ namespace PlantUtilities { if (!DataLoopNode::Node(InletNode).plantNodeErrorMsgIssued) { ShowSevereError(state, "SetComponentFlowRate: check component model implementation for component with inlet node named=" + DataLoopNode::NodeID(InletNode)); - ShowContinueError(state, "Inlet node MassFlowRatMax = " + General::RoundSigDigits(DataLoopNode::Node(InletNode).MassFlowRateMax, 8)); + ShowContinueError(state, format("Inlet node MassFlowRatMax = {:.8R}", DataLoopNode::Node(InletNode).MassFlowRateMax)); DataLoopNode::Node(InletNode).plantNodeErrorMsgIssued = true; } } @@ -479,13 +478,14 @@ namespace PlantUtilities { if ((CompFlow - a_node.MassFlowRateMaxAvail > DataBranchAirLoopPlant::MassFlowTolerance) || (a_node.MassFlowRateMinAvail - CompFlow > DataBranchAirLoopPlant::MassFlowTolerance)) { ShowSevereError(state, "SetActuatedBranchFlowRate: Flow rate is out of range"); // DEBUG error...should never get here ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "Component flow rate [kg/s] = " + General::RoundSigDigits(CompFlow, 8)); - ShowContinueError(state, "Node maximum flow rate available [kg/s] = " + General::RoundSigDigits(a_node.MassFlowRateMaxAvail, 8)); - ShowContinueError(state, "Node minimum flow rate available [kg/s] = " + General::RoundSigDigits(a_node.MassFlowRateMinAvail, 8)); + ShowContinueError(state, format("Component flow rate [kg/s] = {:.8R}", CompFlow)); + ShowContinueError(state, format("Node maximum flow rate available [kg/s] = {:.8R}", a_node.MassFlowRateMaxAvail)); + ShowContinueError(state, format("Node minimum flow rate available [kg/s] = {:.8R}", a_node.MassFlowRateMinAvail)); } } else { - ShowFatalError(state, "SetActuatedBranchFlowRate: Flowlock out of range, value=" + - General::RoundSigDigits(loop_side.FlowLock)); // DEBUG error...should never get here LCOV_EXCL_LINE + ShowFatalError(state, + format("SetActuatedBranchFlowRate: Flowlock out of range, value={}", + loop_side.FlowLock)); // DEBUG error...should never get here LCOV_EXCL_LINE } Real64 const a_node_MasFlowRate(a_node.MassFlowRate); @@ -630,7 +630,6 @@ namespace PlantUtilities { using DataPlant::DemandSide; using DataPlant::PlantLoop; using DataPlant::SupplySide; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int MixerOutletNode; @@ -656,10 +655,10 @@ namespace PlantUtilities { ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "PlantLoop name= " + PlantLoop(LoopNum).Name); ShowContinueError(state, "Plant Connector:Mixer name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Name); - ShowContinueError(state, "Mixer outlet mass flow rate= " + RoundSigDigits(Node(MixerOutletNode).MassFlowRate, 6) + " {kg/s}"); + ShowContinueError(state, format("Mixer outlet mass flow rate= {:.6R} {{kg/s}}", Node(MixerOutletNode).MassFlowRate)); ShowContinueError(state, "Plant Connector:Splitter name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.Name); - ShowContinueError(state, "Splitter inlet mass flow rate= " + RoundSigDigits(Node(SplitterInletNode).MassFlowRate, 6) + " {kg/s}"); - ShowContinueError(state, "Difference in two mass flow rates= " + RoundSigDigits(AbsDifference, 6) + " {kg/s}"); + ShowContinueError(state, format("Splitter inlet mass flow rate= {:.6R} {{kg/s}}", Node(SplitterInletNode).MassFlowRate)); + ShowContinueError(state, format("Difference in two mass flow rates= {:.6R} {{kg/s}}", AbsDifference)); } ShowRecurringSevereErrorAtEnd(state, "Plant Flows (Loop=" + PlantLoop(LoopNum).Name + ") splitter inlet flow not match mixer outlet flow", @@ -674,10 +673,10 @@ namespace PlantUtilities { ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "PlantLoop name= " + PlantLoop(LoopNum).Name); ShowContinueError(state, "Plant Connector:Mixer name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Name); - ShowContinueError(state, "Mixer outlet mass flow rate= " + RoundSigDigits(Node(MixerOutletNode).MassFlowRate, 6) + " {kg/s}"); + ShowContinueError(state, format("Mixer outlet mass flow rate= {:.6R} {{kg/s}}", Node(MixerOutletNode).MassFlowRate)); ShowContinueError(state, "Plant Connector:Splitter name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.Name); - ShowContinueError(state, "Splitter inlet mass flow rate= " + RoundSigDigits(Node(SplitterInletNode).MassFlowRate, 6) + " {kg/s}"); - ShowContinueError(state, "Difference in two mass flow rates= " + RoundSigDigits(AbsDifference, 6) + " {kg/s}"); + ShowContinueError(state, format("Splitter inlet mass flow rate= {:.6R} {{kg/s}}", Node(SplitterInletNode).MassFlowRate)); + ShowContinueError(state, format("Difference in two mass flow rates= {:.6R} {{kg/s}}", AbsDifference)); ShowFatalError(state, "CheckPlantMixerSplitterConsistency: Simulation terminated because of problems in plant flow resolver"); } } @@ -702,10 +701,10 @@ namespace PlantUtilities { ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "PlantLoop name= " + PlantLoop(LoopNum).Name); ShowContinueError(state, "Plant Connector:Mixer name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Name); - ShowContinueError(state, "Sum of Branch outlet mass flow rates= " + RoundSigDigits(SumOutletFlow, 6) + " {kg/s}"); + ShowContinueError(state, format("Sum of Branch outlet mass flow rates= {:.6R} {{kg/s}}", SumOutletFlow)); ShowContinueError(state, "Plant Connector:Splitter name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.Name); - ShowContinueError(state, "Splitter inlet mass flow rate= " + RoundSigDigits(Node(SplitterInletNode).MassFlowRate, 6) + " {kg/s}"); - ShowContinueError(state, "Difference in two mass flow rates= " + RoundSigDigits(AbsDifference, 6) + " {kg/s}"); + ShowContinueError(state, format("Splitter inlet mass flow rate= {:.6R} {{kg/s}}", Node(SplitterInletNode).MassFlowRate)); + ShowContinueError(state, format("Difference in two mass flow rates= {:.6R} {{kg/s}}", AbsDifference)); } ShowRecurringSevereErrorAtEnd(state, "Plant Flows (Loop=" + PlantLoop(LoopNum).Name + ") splitter inlet flow does not match branch outlet flows", @@ -747,7 +746,6 @@ namespace PlantUtilities { using DataPlant::DemandSide; using DataPlant::PlantLoop; using DataPlant::SupplySide; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -816,8 +814,8 @@ namespace PlantUtilities { DemandSupply = "Unknown"; } ShowContinueError(state, "PlantLoop Name (" + DemandSupply + "Side)= " + PlantLoop(LoopNum).Name); - ShowContinueError(state, "PlantLoop Setpoint Temperature=" + RoundSigDigits(Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint, 1) + - " {C}"); + ShowContinueError(state, + format("PlantLoop Setpoint Temperature={:.1R} {{C}}", Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint)); if (PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt) { ShowContinueError(state, "PlantLoop Inlet Node (SupplySide) has a Setpoint."); } else { @@ -838,25 +836,33 @@ namespace PlantUtilities { } else { ShowContinueError(state, "PlantLoop Outlet Node (DemandSide) does not have a Setpoint."); } - ShowContinueError(state, "PlantLoop Outlet Node (" + DemandSupply + "Side) \"" + NodeID(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut) + - "\" has temperature=" + RoundSigDigits(Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp, 1) + " {C}"); - ShowContinueError(state, "PlantLoop Inlet Node (" + DemandSupply + "Side) \"" + NodeID(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn) + - "\" has temperature=" + RoundSigDigits(Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn).Temp, 1) + " {C}"); - ShowContinueError(state, "PlantLoop Minimum Temperature=" + RoundSigDigits(PlantLoop(LoopNum).MinTemp, 1) + " {C}"); - ShowContinueError(state, "PlantLoop Maximum Temperature=" + RoundSigDigits(PlantLoop(LoopNum).MaxTemp, 1) + " {C}"); - ShowContinueError(state, "PlantLoop Flow Request (SupplySide)=" + RoundSigDigits(PlantLoop(LoopNum).LoopSide(SupplySide).FlowRequest, 1) + - " {kg/s}"); - ShowContinueError(state, "PlantLoop Flow Request (DemandSide)=" + RoundSigDigits(PlantLoop(LoopNum).LoopSide(DemandSide).FlowRequest, 1) + - " {kg/s}"); - ShowContinueError(state, "PlantLoop Node (" + DemandSupply + "Side) \"" + NodeID(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut) + - "\" has mass flow rate =" + RoundSigDigits(Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).MassFlowRate, 1) + - " {kg/s}"); - ShowContinueError(state, "PlantLoop PumpHeat (SupplySide)=" + RoundSigDigits(PlantLoop(LoopNum).LoopSide(SupplySide).TotalPumpHeat, 1) + " {W}"); - ShowContinueError(state, "PlantLoop PumpHeat (DemandSide)=" + RoundSigDigits(PlantLoop(LoopNum).LoopSide(DemandSide).TotalPumpHeat, 1) + " {W}"); - ShowContinueError(state, "PlantLoop Cooling Demand=" + RoundSigDigits(PlantLoop(LoopNum).CoolingDemand, 1) + " {W}"); - ShowContinueError(state, "PlantLoop Heating Demand=" + RoundSigDigits(PlantLoop(LoopNum).HeatingDemand, 1) + " {W}"); - ShowContinueError(state, "PlantLoop Demand not Dispatched=" + RoundSigDigits(PlantLoop(LoopNum).DemandNotDispatched, 1) + " {W}"); - ShowContinueError(state, "PlantLoop Unmet Demand=" + RoundSigDigits(PlantLoop(LoopNum).UnmetDemand, 1) + " {W}"); + ShowContinueError(state, + format("PlantLoop Outlet Node ({}Side) \"{}\" has temperature={:.1R} {{C}}", + DemandSupply, + NodeID(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut), + Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp)); + ShowContinueError(state, + format("PlantLoop Inlet Node ({}Side) \"{}\" has temperature={:.1R} {{C}}", + DemandSupply, + NodeID(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn), + Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn).Temp)); + ShowContinueError(state, format("PlantLoop Minimum Temperature={:.1R} {{C}}", PlantLoop(LoopNum).MinTemp)); + ShowContinueError(state, format("PlantLoop Maximum Temperature={:.1R} {{C}}", PlantLoop(LoopNum).MaxTemp)); + ShowContinueError(state, + format("PlantLoop Flow Request (SupplySide)={:.1R} {{kg/s}}", PlantLoop(LoopNum).LoopSide(SupplySide).FlowRequest)); + ShowContinueError(state, + format("PlantLoop Flow Request (DemandSide)={:.1R} {{kg/s}}", PlantLoop(LoopNum).LoopSide(DemandSide).FlowRequest)); + ShowContinueError(state, + format("PlantLoop Node ({}Side) \"{}\" has mass flow rate ={:.1R} {{kg/s}}", + DemandSupply, + NodeID(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut), + Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).MassFlowRate)); + ShowContinueError(state, format("PlantLoop PumpHeat (SupplySide)={:.1R} {{W}}", PlantLoop(LoopNum).LoopSide(SupplySide).TotalPumpHeat)); + ShowContinueError(state, format("PlantLoop PumpHeat (DemandSide)={:.1R} {{W}}", PlantLoop(LoopNum).LoopSide(DemandSide).TotalPumpHeat)); + ShowContinueError(state, format("PlantLoop Cooling Demand={:.1R} {{W}}", PlantLoop(LoopNum).CoolingDemand)); + ShowContinueError(state, format("PlantLoop Heating Demand={:.1R} {{W}}", PlantLoop(LoopNum).HeatingDemand)); + ShowContinueError(state, format("PlantLoop Demand not Dispatched={:.1R} {{W}}", PlantLoop(LoopNum).DemandNotDispatched)); + ShowContinueError(state, format("PlantLoop Unmet Demand={:.1R} {{W}}", PlantLoop(LoopNum).UnmetDemand)); LoopCapacity = 0.0; DispatchedCapacity = 0.0; @@ -875,13 +881,13 @@ namespace PlantUtilities { LoopSupplySideDispatchedCapacity = DispatchedCapacity - LoopDemandSideDispatchedCapacity; } } - ShowContinueError(state, "PlantLoop Capacity=" + RoundSigDigits(LoopCapacity, 1) + " {W}"); - ShowContinueError(state, "PlantLoop Capacity (SupplySide)=" + RoundSigDigits(LoopSupplySideCapacity, 1) + " {W}"); - ShowContinueError(state, "PlantLoop Capacity (DemandSide)=" + RoundSigDigits(LoopDemandSideCapacity, 1) + " {W}"); + ShowContinueError(state, format("PlantLoop Capacity={:.1R} {{W}}", LoopCapacity)); + ShowContinueError(state, format("PlantLoop Capacity (SupplySide)={:.1R} {{W}}", LoopSupplySideCapacity)); + ShowContinueError(state, format("PlantLoop Capacity (DemandSide)={:.1R} {{W}}", LoopDemandSideCapacity)); ShowContinueError(state, "PlantLoop Operation Scheme=" + PlantLoop(LoopNum).OperationScheme); - ShowContinueError(state, "PlantLoop Operation Dispatched Load = " + RoundSigDigits(DispatchedCapacity, 1) + " {W}"); - ShowContinueError(state, "PlantLoop Operation Dispatched Load (SupplySide)= " + RoundSigDigits(LoopSupplySideDispatchedCapacity, 1) + " {W}"); - ShowContinueError(state, "PlantLoop Operation Dispatched Load (DemandSide)= " + RoundSigDigits(LoopDemandSideDispatchedCapacity, 1) + " {W}"); + ShowContinueError(state, format("PlantLoop Operation Dispatched Load = {:.1R} {{W}}", DispatchedCapacity)); + ShowContinueError(state, format("PlantLoop Operation Dispatched Load (SupplySide)= {:.1R} {{W}}", LoopSupplySideDispatchedCapacity)); + ShowContinueError(state, format("PlantLoop Operation Dispatched Load (DemandSide)= {:.1R} {{W}}", LoopDemandSideDispatchedCapacity)); ShowContinueError(state, "Branches on the Loop."); ShowBranchesOnLoop(state, LoopNum); ShowContinueError(state, "*************************"); @@ -1368,7 +1374,6 @@ namespace PlantUtilities { // Using/Aliasing using namespace DataPlant; - using General::RoundSigDigits; // Object Data PlantCallingOrderInfoStruct RecordToMoveInPlantCallingOrderInfo; @@ -1753,7 +1758,6 @@ namespace PlantUtilities { // Using/Aliasing using BranchInputManager::AuditBranches; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int LoopCtr; @@ -1843,8 +1847,8 @@ namespace PlantUtilities { } errFlag = true; } else { - ShowSevereError(state, "ScanPlantLoopsForObject: Invalid CompType passed [" + RoundSigDigits(CompType) + "], Name=" + CompName); - ShowContinueError(state, "Valid CompTypes are in the range [1 - " + RoundSigDigits(DataPlant::NumSimPlantEquipTypes) + "]."); + ShowSevereError(state, format("ScanPlantLoopsForObject: Invalid CompType passed [{}], Name={}", CompType, CompName)); + ShowContinueError(state, format("Valid CompTypes are in the range [1 - {}].", DataPlant::NumSimPlantEquipTypes)); ShowFatalError(state, "Previous error causes program termination"); } } @@ -1876,26 +1880,6 @@ namespace PlantUtilities { // METHODOLOGY EMPLOYED: // Loop thru plant data structure and find matching node. - // REFERENCES: - // na - - // Using/Aliasing - using General::RoundSigDigits; - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int LoopCtr; int LoopSideCtr; int BranchCtr; @@ -1949,7 +1933,7 @@ namespace PlantUtilities { } else { ShowContinueError(state, "during sizing: called by " + CallerName); } - if (outFoundCount > 0) ShowContinueError(state, "Node was found as outlet node (for component) " + RoundSigDigits(outFoundCount) + " time(s)."); + if (outFoundCount > 0) ShowContinueError(state, format("Node was found as outlet node (for component) {} time(s).", outFoundCount)); ShowContinueError(state, "Possible error in Branch inputs. For more information, look for other error messages related to this node name."); // fatal? } diff --git a/src/EnergyPlus/PlantValves.cc b/src/EnergyPlus/PlantValves.cc index 07a347ffee8..8cc8f635648 100644 --- a/src/EnergyPlus/PlantValves.cc +++ b/src/EnergyPlus/PlantValves.cc @@ -85,7 +85,6 @@ namespace PlantValves { // Collect "valve" type models for Plant loops using namespace DataLoopNode; - using General::TrimSigDigits; // MODULE VARIABLE DECLARATIONS: int NumTemperingValves; diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index a74762fa299..f41d96266a4 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -138,7 +138,7 @@ namespace PluginManagement { } #endif - void PluginManager::setupOutputVariables(EnergyPlusData &state) + void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) { #if LINK_WITH_PYTHON == 1 // with the PythonPlugin:Variables all set in memory, we can now set them up as outputs as needed @@ -651,7 +651,7 @@ namespace PluginManagement { } #endif - void PluginInstance::reportPythonError(EnergyPlusData &state) + void PluginInstance::reportPythonError([[maybe_unused]] EnergyPlusData &state) { #if LINK_WITH_PYTHON == 1 PyObject *exc_type = nullptr; @@ -724,7 +724,7 @@ namespace PluginManagement { #endif } - void PluginInstance::setup(EnergyPlusData &state) + void PluginInstance::setup([[maybe_unused]] EnergyPlusData &state) { #if LINK_WITH_PYTHON == 1 // this first section is really all about just ultimately getting a full Python class instance @@ -1093,7 +1093,7 @@ namespace PluginManagement { } } #else - void PluginManager::addToPythonPath(EnergyPlusData &state, [[maybe_unused]] const std::string &path, [[maybe_unused]] bool userDefinedPath) + void PluginManager::addToPythonPath([[maybe_unused]] EnergyPlusData &state, const std::string &EP_UNUSED(path), bool EP_UNUSED(userDefinedPath)) { } #endif @@ -1134,9 +1134,9 @@ namespace PluginManagement { } } #else - int PluginManager::getGlobalVariableHandle(EnergyPlusData &state, - [[maybe_unused]] const std::string &name, - [[maybe_unused]] bool const suppress_warning) + int PluginManager::getGlobalVariableHandle([[maybe_unused]] EnergyPlusData &state, + const std::string &EP_UNUSED(name), + bool const EP_UNUSED(suppress_warning)) { return -1; } @@ -1278,7 +1278,7 @@ namespace PluginManagement { } #endif - void PluginManager::updatePluginValues(EnergyPlusData &state) + void PluginManager::updatePluginValues([[maybe_unused]] EnergyPlusData &state) { #if LINK_WITH_PYTHON == 1 for (auto &trend : trends) { @@ -1299,14 +1299,14 @@ namespace PluginManagement { try { return PluginManagement::globalVariableValues[handle]; // TODO: This won't be caught as an exception I think } catch (...) { - EnergyPlus::ShowSevereError(state, "Tried to access plugin global variable value at index " + std::to_string(handle)); - EnergyPlus::ShowContinueError(state, "Available handles range from 0 to " + std::to_string(PluginManagement::globalVariableValues.size() - 1)); + EnergyPlus::ShowSevereError(state, format("Tried to access plugin global variable value at index {}", handle)); + EnergyPlus::ShowContinueError(state, format("Available handles range from 0 to {}", PluginManagement::globalVariableValues.size() - 1)); EnergyPlus::ShowFatalError(state, "Plugin global variable problem causes program termination"); } return 0.0; } #else - Real64 PluginManager::getGlobalVariableValue(EnergyPlusData &state, [[maybe_unused]] int handle) + Real64 PluginManager::getGlobalVariableValue([[maybe_unused]] EnergyPlusData &state, int EP_UNUSED(handle)) { return 0.0; } @@ -1322,13 +1322,13 @@ namespace PluginManagement { try { PluginManagement::globalVariableValues[handle] = value; // TODO: This won't be caught as an exception I think } catch (...) { - EnergyPlus::ShowSevereError(state, "Tried to set plugin global variable value at index " + std::to_string(handle)); - EnergyPlus::ShowContinueError(state, "Available handles range from 0 to " + std::to_string(PluginManagement::globalVariableValues.size() - 1)); + EnergyPlus::ShowSevereError(state, format("Tried to set plugin global variable value at index {}", handle)); + EnergyPlus::ShowContinueError(state, format("Available handles range from 0 to {}", PluginManagement::globalVariableValues.size() - 1)); EnergyPlus::ShowFatalError(state, "Plugin global variable problem causes program termination"); } } #else - void PluginManager::setGlobalVariableValue(EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] Real64 value) + void PluginManager::setGlobalVariableValue([[maybe_unused]] EnergyPlusData &state, int EP_UNUSED(handle), Real64 EP_UNUSED(value)) { } #endif @@ -1384,7 +1384,7 @@ namespace PluginManagement { return numTotalThings > 0; } #else - bool PluginManager::anyUnexpectedPluginObjects(EnergyPlusData &state) + bool PluginManager::anyUnexpectedPluginObjects([[maybe_unused]] EnergyPlusData &state) { return false; } diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index 183dc6241fb..a4c12f0d648 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -266,15 +266,13 @@ namespace PondGroundHeatExchanger { PondGHE(Item).Depth = DataIPShortCuts::rNumericArgs(1); PondGHE(Item).Area = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(1) <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; } if (DataIPShortCuts::rNumericArgs(2) <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; @@ -285,24 +283,25 @@ namespace PondGroundHeatExchanger { PondGHE(Item).TubeOutDiameter = DataIPShortCuts::rNumericArgs(4); if (DataIPShortCuts::rNumericArgs(3) <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(3) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(3), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(3), DataIPShortCuts::rNumericArgs(3))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; } if (DataIPShortCuts::rNumericArgs(4) <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(4) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(4), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(4), DataIPShortCuts::rNumericArgs(4))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; } if (DataIPShortCuts::rNumericArgs(3) > DataIPShortCuts::rNumericArgs(4)) { // error ShowSevereError(state, "For " + DataIPShortCuts::cCurrentModuleObject + ": " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(3) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(3), 2) + - "] > " + DataIPShortCuts::cNumericFieldNames(4) + " [" + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(4), 2) + ']'); + ShowContinueError(state, + format("{} [{:.2R}] > {} [{:.2R}]", + DataIPShortCuts::cNumericFieldNames(3), + DataIPShortCuts::rNumericArgs(3), + DataIPShortCuts::cNumericFieldNames(4), + DataIPShortCuts::rNumericArgs(4))); ErrorsFound = true; } @@ -311,15 +310,13 @@ namespace PondGroundHeatExchanger { PondGHE(Item).GrndConductivity = DataIPShortCuts::rNumericArgs(6); if (DataIPShortCuts::rNumericArgs(5) <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(5) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(5), 4)); + ShowSevereError(state, format("Invalid {}={:.4R}", DataIPShortCuts::cNumericFieldNames(5), DataIPShortCuts::rNumericArgs(5))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; } if (DataIPShortCuts::rNumericArgs(6) <= 0.0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(6) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(6), 4)); + ShowSevereError(state, format("Invalid {}={:.4R}", DataIPShortCuts::cNumericFieldNames(6), DataIPShortCuts::rNumericArgs(6))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; @@ -329,16 +326,14 @@ namespace PondGroundHeatExchanger { PondGHE(Item).NumCircuits = DataIPShortCuts::rNumericArgs(7); if (DataIPShortCuts::rNumericArgs(7) <= 0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(7) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(7), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(7), DataIPShortCuts::rNumericArgs(7))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; } PondGHE(Item).CircuitLength = DataIPShortCuts::rNumericArgs(8); if (DataIPShortCuts::rNumericArgs(8) <= 0) { - ShowSevereError(state, "Invalid " + DataIPShortCuts::cNumericFieldNames(8) + '=' + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(8), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", DataIPShortCuts::cNumericFieldNames(8), DataIPShortCuts::rNumericArgs(8))); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; @@ -353,8 +348,7 @@ namespace PondGroundHeatExchanger { if (!DataEnvironment::GroundTemp_DeepObjInput) { ShowWarningError(state, "GetPondGroundHeatExchanger: No \"Site:GroundTemperature:Deep\" were input."); - ShowContinueError(state, "Defaults, constant throughout the year of (" + General::RoundSigDigits(DataEnvironment::GroundTemp_Deep, 1) + - ") will be used."); + ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", DataEnvironment::GroundTemp_Deep)); } } @@ -829,8 +823,10 @@ namespace PondGroundHeatExchanger { if (PondTemperature < 0.0) { ++this->ConsecutiveFrozen; if (this->FrozenErrIndex == 0) { - ShowWarningMessage(state, "GroundHeatExchanger:Pond=\"" + this->Name + "\", is frozen; Pond model not valid. Calculated Pond Temperature=[" + - General::RoundSigDigits(PondTemperature, 2) + "] C"); + ShowWarningMessage(state, + format("GroundHeatExchanger:Pond=\"{}\", is frozen; Pond model not valid. Calculated Pond Temperature=[{:.2R}] C", + this->Name, + PondTemperature)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, "GroundHeatExchanger:Pond=\"" + this->Name + "\", is frozen", diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 10361c60bc5..57481e3507b 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -192,7 +192,6 @@ namespace PoweredInductionUnits { // Using/Aliasing using DataSizing::TermUnitPIU; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int PIUNum; // index of powered induction unit being simulated @@ -215,13 +214,16 @@ namespace PoweredInductionUnits { } else { PIUNum = CompIndex; if (PIUNum > NumPIUs || PIUNum < 1) { - ShowFatalError(state, "SimPIU: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + ", Number of PIU Units=" + TrimSigDigits(NumPIUs) + - ", PIU Unit name=" + CompName); + ShowFatalError(state, + format("SimPIU: Invalid CompIndex passed={}, Number of PIU Units={}, PIU Unit name={}", CompIndex, NumPIUs, CompName)); } if (CheckEquipName(PIUNum)) { if (CompName != PIU(PIUNum).Name) { - ShowFatalError(state, "SimPIU: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + ", PIU Unit name=" + CompName + - ", stored PIU Unit Name for that index=" + PIU(PIUNum).Name); + ShowFatalError(state, + format("SimPIU: Invalid CompIndex passed={}, PIU Unit name={}, stored PIU Unit Name for that index={}", + CompIndex, + CompName, + PIU(PIUNum).Name)); } CheckEquipName(PIUNum) = false; } @@ -1001,7 +1003,7 @@ namespace PoweredInductionUnits { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1097,9 +1099,9 @@ namespace PoweredInductionUnits { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(MaxPriAirVolFlowDes - MaxPriAirVolFlowUser) / MaxPriAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePIU: Potential issue with equipment sizing for " + PIU(PIUNum).UnitType + ' ' + PIU(PIUNum).Name); - ShowContinueError(state, "User-Specified Primary Air Flow Rate of " + RoundSigDigits(MaxPriAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Primary Air Flow Rate of " + RoundSigDigits(MaxPriAirVolFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Primary Air Flow Rate of {:.5R} [m3/s]", MaxPriAirVolFlowUser)); + ShowContinueError(state, + format("differs from Design Size Primary Air Flow Rate of {:.5R} [m3/s]", MaxPriAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1142,9 +1144,9 @@ namespace PoweredInductionUnits { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(MaxTotAirVolFlowDes - MaxTotAirVolFlowUser) / MaxTotAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePIU: Potential issue with equipment sizing for " + PIU(PIUNum).UnitType + ' ' + PIU(PIUNum).Name); - ShowContinueError(state, "User-Specified Maximum Air Flow Rate of " + RoundSigDigits(MaxTotAirVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Air Flow Rate of " + RoundSigDigits(MaxTotAirVolFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Air Flow Rate of {:.5R} [m3/s]", MaxTotAirVolFlowUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Air Flow Rate of {:.5R} [m3/s]", MaxTotAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1189,10 +1191,10 @@ namespace PoweredInductionUnits { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(MaxSecAirVolFlowDes - MaxSecAirVolFlowUser) / MaxSecAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePIU: Potential issue with equipment sizing for " + PIU(PIUNum).UnitType + ' ' + PIU(PIUNum).Name); - ShowContinueError(state, "User-Specified Maximum Secondary Air Flow Rate of " + RoundSigDigits(MaxSecAirVolFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Secondary Air Flow Rate of " + - RoundSigDigits(MaxSecAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Secondary Air Flow Rate of {:.5R} [m3/s]", MaxSecAirVolFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Secondary Air Flow Rate of {:.5R} [m3/s]", MaxSecAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1235,9 +1237,9 @@ namespace PoweredInductionUnits { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(MinPriAirFlowFracDes - MinPriAirFlowFracUser) / MinPriAirFlowFracUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePIU: Potential issue with equipment sizing for " + PIU(PIUNum).UnitType + ' ' + PIU(PIUNum).Name); - ShowContinueError(state, "User-Specified Minimum Primary Air Flow Fraction of " + RoundSigDigits(MinPriAirFlowFracUser, 1)); - ShowContinueError(state, "differs from Design Size Minimum Primary Air Flow Fraction of " + - RoundSigDigits(MinPriAirFlowFracDes, 1)); + ShowContinueError(state, format("User-Specified Minimum Primary Air Flow Fraction of {:.1R}", MinPriAirFlowFracUser)); + ShowContinueError( + state, format("differs from Design Size Minimum Primary Air Flow Fraction of {:.1R}", MinPriAirFlowFracDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1287,8 +1289,8 @@ namespace PoweredInductionUnits { if (state.dataGlobal->DisplayExtraWarnings) { if ((std::abs(FanOnFlowFracDes - FanOnFlowFracUser) / FanOnFlowFracUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePIU: Potential issue with equipment sizing for " + PIU(PIUNum).UnitType + ' ' + PIU(PIUNum).Name); - ShowContinueError(state, "User-Specified Fan On Flow Fraction of " + RoundSigDigits(FanOnFlowFracUser, 1)); - ShowContinueError(state, "differs from Design Size Fan On Flow Fraction of " + RoundSigDigits(FanOnFlowFracDes, 1)); + ShowContinueError(state, format("User-Specified Fan On Flow Fraction of {:.1R}", FanOnFlowFracUser)); + ShowContinueError(state, format("differs from Design Size Fan On Flow Fraction of {:.1R}", FanOnFlowFracDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1375,10 +1377,11 @@ namespace PoweredInductionUnits { if ((std::abs(MaxVolHotWaterFlowDes - MaxVolHotWaterFlowUser) / MaxVolHotWaterFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePIU: Potential issue with equipment sizing for " + PIU(PIUNum).UnitType + ' ' + PIU(PIUNum).Name); - ShowContinueError(state, "User-Specified Maximum Reheat Water Flow Rate of " + - RoundSigDigits(MaxVolHotWaterFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Reheat Water Flow Rate of " + - RoundSigDigits(MaxVolHotWaterFlowDes, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Maximum Reheat Water Flow Rate of {:.5R} [m3/s]", MaxVolHotWaterFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Maximum Reheat Water Flow Rate of {:.5R} [m3/s]", MaxVolHotWaterFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1453,10 +1456,10 @@ namespace PoweredInductionUnits { if ((std::abs(MaxVolHotSteamFlowDes - MaxVolHotSteamFlowUser) / MaxVolHotSteamFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePIU: Potential issue with equipment sizing for " + PIU(PIUNum).UnitType + ' ' + PIU(PIUNum).Name); - ShowContinueError(state, "User-Specified Maximum Reheat Steam Flow of " + RoundSigDigits(MaxVolHotSteamFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Reheat Steam Flow of " + - RoundSigDigits(MaxVolHotSteamFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Reheat Steam Flow of {:.5R} [m3/s]", MaxVolHotSteamFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Reheat Steam Flow of {:.5R} [m3/s]", MaxVolHotSteamFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index bf3f82c6ea2..b86bef5255d 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -45,6 +45,9 @@ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. +// C++ Headers +#include + // ObjexxFCL Headers #include @@ -101,7 +104,7 @@ namespace Psychrometrics { // Use Statements for other routines #ifdef EP_psych_errors - using General::TrimSigDigits; + #endif // Data @@ -329,7 +332,6 @@ namespace Psychrometrics { // na // Using/Aliasing - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -374,11 +376,10 @@ namespace Psychrometrics { ) { // Using/Aliasing - using General::RoundSigDigits; if (rhoair < 0.0) { - ShowSevereError(state, "PsyRhoAirFnPbTdbW: RhoAir (Density of Air) is calculated <= 0 [" + RoundSigDigits(rhoair, 5) + "]."); - ShowContinueError(state, "pb =[" + RoundSigDigits(pb, 2) + "], tdb=[" + RoundSigDigits(tdb, 2) + "], w=[" + RoundSigDigits(dw, 7) + "]."); + ShowSevereError(state, format("PsyRhoAirFnPbTdbW: RhoAir (Density of Air) is calculated <= 0 [{:.5R}].", rhoair)); + ShowContinueError(state, format("pb =[{:.2R}], tdb=[{:.2R}], w=[{:.7R}].", pb, tdb, dw)); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); } else { @@ -399,8 +400,7 @@ namespace Psychrometrics { if (RHValue > 1.01) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyRhFnTdbRhovLBnd0C) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(Tdb, 2) + " Rhovapor= " + TrimSigDigits(Rhovapor, 3) + - " Calculated Relative Humidity [%]= " + TrimSigDigits(RHValue * 100.0, 2); + String = format(" Dry-Bulb= {:.2T} Rhovapor= {:.3T} Calculated Relative Humidity [%]= {:.2T}", Tdb, Rhovapor, RHValue * 100.0); ShowWarningMessage(state, "Calculated Relative Humidity out of range (PsyRhFnTdbRhovLBnd0C) "); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -421,8 +421,7 @@ namespace Psychrometrics { } else if (RHValue < -0.05) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyRhFnTdbRhovLBnd0C) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(Tdb, 2) + " Rhovapor= " + TrimSigDigits(Rhovapor, 3) + - " Calculated Relative Humidity [%]= " + TrimSigDigits(RHValue * 100.0, 2); + String = format(" Dry-Bulb= {:.2T} Rhovapor= {:.3T} Calculated Relative Humidity [%]= {:.2T}", Tdb, Rhovapor, RHValue * 100.0); ShowWarningMessage(state, "Calculated Relative Humidity out of range (PsyRhFnTdbRhovLBnd0C) "); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -614,7 +613,7 @@ namespace Psychrometrics { } else { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } - ShowContinueError(state, " Input Temperature=" + TrimSigDigits(TDB, 2)); + ShowContinueError(state, format(" Input Temperature={:.2T}", TDB)); FlagError = true; } ShowRecurringWarningErrorAtEnd(state, @@ -629,8 +628,7 @@ namespace Psychrometrics { if (W <= -0.0001) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyTwbFnTdbWPb2) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(TDB, 2) + " Humidity Ratio= " + TrimSigDigits(W, 3) + - " Pressure= " + TrimSigDigits(Patm, 2); + String = format(" Dry-Bulb= {:.2T} Humidity Ratio= {:.3T} Pressure= {:.2T}", TDB, W, Patm); ShowWarningMessage(state, "Entered Humidity Ratio invalid (PsyTwbFnTdbWPb)"); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -638,7 +636,7 @@ namespace Psychrometrics { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } ShowContinueError(state, String); - String = "Humidity Ratio= " + TrimSigDigits(W, 4); + String = format("Humidity Ratio= {:.4T}", W); ShowContinueError(state, String + " ... Humidity Ratio set to .00001"); } ShowRecurringWarningErrorAtEnd(state, @@ -709,15 +707,15 @@ namespace Psychrometrics { if (iter > itmax) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyTwbFnTdbWPb3) == 0) { - ShowWarningMessage(state, "WetBulb not converged after " + TrimSigDigits(iter) + " iterations(PsyTwbFnTdbWPb)"); + ShowWarningMessage(state, format("WetBulb not converged after {} iterations(PsyTwbFnTdbWPb)", iter)); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); } else { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } - ShowContinueError(state, " Input Temperature = " + TrimSigDigits(TDB, 2)); - ShowContinueError(state, " Input Humidity Ratio= " + TrimSigDigits(W, 6)); - ShowContinueError(state, " Input Pressure = " + TrimSigDigits(Patm, 2)); + ShowContinueError(state, format(" Input Temperature = {:.2T}", TDB)); + ShowContinueError(state, format(" Input Humidity Ratio= {:.6T}", W)); + ShowContinueError(state, format(" Input Pressure = {:.2T}", Patm)); FlagError = true; } ShowRecurringWarningErrorAtEnd(state, "WetBulb not converged after max iterations(PsyTwbFnTdbWPb)", iPsyErrIndex(iPsyTwbFnTdbWPb3)); @@ -730,7 +728,7 @@ namespace Psychrometrics { #ifdef EP_psych_errors if (FlagError) { - ShowContinueError(state, " Resultant Temperature= " + TrimSigDigits(WBT, 2)); + ShowContinueError(state, format(" Resultant Temperature= {:.2T}", WBT)); } #endif @@ -757,7 +755,7 @@ namespace Psychrometrics { if (V <= -0.01) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyVFnTdbWPb) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(TDB, 2) + " Humidity Ratio= " + TrimSigDigits(w, 3) + " Pressure= " + TrimSigDigits(PB, 2); + String = format(" Dry-Bulb= {:.2T} Humidity Ratio= {:.3T} Pressure= {:.2T}", TDB, w, PB); ShowWarningMessage(state, "Calculated Specific Volume out of range (PsyVFnTdbWPb)"); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -765,7 +763,7 @@ namespace Psychrometrics { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } ShowContinueError(state, String); - String = "Calculated Volume= " + TrimSigDigits(V, 3); + String = format("Calculated Volume= {:.3T}", V); ShowContinueError(state, String + " ... Since Calculated Volume < 0.0, it is set to .83"); } ShowRecurringWarningErrorAtEnd(state, @@ -785,7 +783,7 @@ namespace Psychrometrics { if (W < -0.0001) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyWFnTdbH) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(TDB, 2) + " Enthalpy= " + TrimSigDigits(H, 3); + String = format(" Dry-Bulb= {:.2T} Enthalpy= {:.3T}", TDB, H); ShowWarningMessage(state, "Calculated Humidity Ratio invalid (PsyWFnTdbH)"); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -793,7 +791,7 @@ namespace Psychrometrics { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } ShowContinueError(state, String); - String = "Calculated Humidity Ratio= " + TrimSigDigits(W, 4); + String = format("Calculated Humidity Ratio= {:.4T}", W); ShowContinueError(state, String + " ... Humidity Ratio set to .00001"); } ShowRecurringWarningErrorAtEnd(state, "Calculated Humidity Ratio invalid (PsyWFnTdbH)", iPsyErrIndex(iPsyWFnTdbH), W, W, _, "[]", "[]"); @@ -867,7 +865,7 @@ namespace Psychrometrics { } else { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } - ShowContinueError(state, " Input Temperature=" + TrimSigDigits(T, 2)); + ShowContinueError(state, format(" Input Temperature={:.2T}", T)); } ShowRecurringWarningErrorAtEnd(state, "Temperature out of range [-100. to 200.] (PsyPsatFnTemp)", iPsyErrIndex(iPsyPsatFnTemp), T, T, _, "C", "C"); @@ -941,7 +939,7 @@ namespace Psychrometrics { if (TWB > (TDB + 0.01)) { if (ReportErrors && !state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyWFnTdbTwbPb) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(TDB, 2) + " Pressure= " + TrimSigDigits(PB, 2); + String = format(" Dry-Bulb= {:.2T} Pressure= {:.2T}", TDB, PB); ShowWarningMessage(state, "Given Wet Bulb Temperature invalid (PsyWFnTdbTwbPb)"); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -949,7 +947,7 @@ namespace Psychrometrics { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } ShowContinueError(state, String); - String = "Calculated Wet-Bulb= " + TrimSigDigits(TWB, 2); + String = format("Calculated Wet-Bulb= {:.2T}", TWB); ShowContinueError(state, String + " ... Since Dry Bulb < Wet Bulb, Wet Bulb set = to Dry Bulb"); } ShowRecurringWarningErrorAtEnd(state, @@ -971,7 +969,7 @@ namespace Psychrometrics { if (W < 0.0) { if (ReportErrors && !state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyWFnTdbTwbPb2) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(TDB, 2) + " Wet-Bulb= " + TrimSigDigits(TWB, 2) + " Pressure= " + TrimSigDigits(PB, 2); + String = format(" Dry-Bulb= {:.2T} Wet-Bulb= {:.2T} Pressure= {:.2T}", TDB, TWB, PB); ShowWarningMessage(state, "Calculated Humidity Ratio Invalid (PsyWFnTdbTwbPb)"); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -979,7 +977,7 @@ namespace Psychrometrics { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } ShowContinueError(state, String); - String = "Calculated Humidity Ratio= " + TrimSigDigits(W, 4) + ", will recalculate Humidity Ratio"; + String = format("Calculated Humidity Ratio= {:.4T}, will recalculate Humidity Ratio", W); ShowContinueError(state, String + " using Relative Humidity .01% (and Dry-Bulb and Pressure as shown)"); } ShowRecurringWarningErrorAtEnd(state, @@ -1007,10 +1005,9 @@ namespace Psychrometrics { } else { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } - String = " Dry-bulb=" + TrimSigDigits(TDB, 2) + " Wet-Bulb (WB)= " + TrimSigDigits(TWB, 2) + - " Pressure= " + TrimSigDigits(PB, 2) + " Humidity Ratio=" + TrimSigDigits(W, 3); + String = format(" Dry-bulb={:.2T} Wet-Bulb (WB)= {:.2T} Pressure= {:.2T} Humidity Ratio={:.3T}", TDB, TWB, PB, W); ShowContinueError(state, String); - String = " Calculated Dew Point Temperature (DPT)= " + TrimSigDigits(TDP, 2) + "; Since DPT > WB, DPT will be set to WB"; + String = format(" Calculated Dew Point Temperature (DPT)= {:.2T}; Since DPT > WB, DPT will be set to WB", TDP); ShowContinueError(state, String); } ShowRecurringWarningErrorAtEnd(state, @@ -1087,7 +1084,7 @@ namespace Psychrometrics { } else { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } - String = " Enthalpy=" + TrimSigDigits(HH, 5) + " Pressure= " + TrimSigDigits(PB, 2); + String = format(" Enthalpy={:.5T} Pressure= {:.2T}", HH, PB); ShowContinueError(state, String); FlagError = true; } @@ -1140,7 +1137,7 @@ namespace Psychrometrics { #ifdef EP_psych_errors if (FlagError) { - ShowContinueError(state, " Initial Resultant Temperature= " + TrimSigDigits(T, 2)); + ShowContinueError(state, format(" Initial Resultant Temperature= {:.2T}", T)); } #endif if (std::abs(PB - 1.0133e5) / 1.0133e5 > 0.01) { @@ -1174,8 +1171,8 @@ namespace Psychrometrics { } else { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } - String = " Enthalpy=" + TrimSigDigits(HH, 5) + " Pressure= " + TrimSigDigits(PB, 2); - ShowContinueError(state, String + " Last T=" + TrimSigDigits(T, 2)); + String = format(" Enthalpy={:.5T} Pressure= {:.2T}", HH, PB); + ShowContinueError(state, format("{} Last T={:.2T}", String, T)); } #endif } @@ -1195,8 +1192,7 @@ namespace Psychrometrics { if (RHValue > 1.01) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyRhFnTdbRhov) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(Tdb, 2) + " Rhovapor= " + TrimSigDigits(Rhovapor, 3) + - " Calculated Relative Humidity [%]= " + TrimSigDigits(RHValue * 100.0, 2); + String = format(" Dry-Bulb= {:.2T} Rhovapor= {:.3T} Calculated Relative Humidity [%]= {:.2T}", Tdb, Rhovapor, RHValue * 100.0); ShowWarningMessage(state, "Calculated Relative Humidity out of range (PsyRhFnTdbRhov) "); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -1217,8 +1213,7 @@ namespace Psychrometrics { } else if (RHValue < -0.05) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyRhFnTdbRhov) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(Tdb, 2) + " Rhovapor= " + TrimSigDigits(Rhovapor, 3) + - " Calculated Relative Humidity [%]= " + TrimSigDigits(RHValue * 100.0, 2); + String = format(" Dry-Bulb= {:.2T} Rhovapor= {:.3T} Calculated Relative Humidity [%]= {:.2T}", Tdb, Rhovapor, RHValue * 100.0); ShowWarningMessage(state, "Calculated Relative Humidity out of range (PsyRhFnTdbRhov) "); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -1250,8 +1245,7 @@ namespace Psychrometrics { if (RHValue > 1.01) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyRhFnTdbWPb) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(TDB, 2) + " Humidity Ratio= " + TrimSigDigits(W, 3) + - " Calculated Relative Humidity [%]= " + TrimSigDigits(RHValue * 100.0, 2); + String = format(" Dry-Bulb= {:.2T} Humidity Ratio= {:.3T} Calculated Relative Humidity [%]= {:.2T}", TDB, W, RHValue * 100.0); ShowWarningMessage(state, "Calculated Relative Humidity out of range (PsyRhFnTdbWPb) "); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -1272,8 +1266,7 @@ namespace Psychrometrics { } else if (RHValue < -0.05) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyRhFnTdbWPb) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(TDB, 2) + " Humidity Ratio= " + TrimSigDigits(W, 3) + - " Calculated Relative Humidity [%]= " + TrimSigDigits(RHValue * 100.0, 2); + String = format(" Dry-Bulb= {:.2T} Humidity Ratio= {:.3T} Calculated Relative Humidity [%]= {:.2T}", TDB, W, RHValue * 100.0); ShowWarningMessage(state, "Calculated Relative Humidity out of range (PsyRhFnTdbWPb) "); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -1305,7 +1298,7 @@ namespace Psychrometrics { { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyWFnTdpPb) == 0) { - String = " Dew-Point= " + TrimSigDigits(TDP, 2) + " Barometric Pressure= " + TrimSigDigits(PB, 2); + String = format(" Dew-Point= {:.2T} Barometric Pressure= {:.2T}", TDP, PB); ShowWarningMessage(state, "Calculated partial vapor pressure is greater than the barometric pressure, so that calculated humidity ratio is invalid (PsyWFnTdpPb)."); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -1313,8 +1306,7 @@ namespace Psychrometrics { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } ShowContinueError(state, String); - String = "Instead, calculated Humidity Ratio at " + TrimSigDigits(TDP - DeltaT, 1) + " (" + TrimSigDigits(DeltaT) + - " degree less) = " + TrimSigDigits(W, 4); + String = format("Instead, calculated Humidity Ratio at {:.1T} ({} degree less) = {:.4T}", TDP - DeltaT, static_cast(DeltaT), W); ShowContinueError(state, String + " will be used. Simulation continues."); } ShowRecurringWarningErrorAtEnd(state, "Entered Humidity Ratio invalid (PsyWFnTdpPb)", iPsyErrIndex(iPsyWFnTdpPb), W, W, _, "[]", "[]"); @@ -1333,8 +1325,7 @@ namespace Psychrometrics { if (W <= -0.0001) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyWFnTdbRhPb) == 0) { - String = " Dry-Bulb= " + TrimSigDigits(TDB, 2) + " Relative Humidity [%]= " + TrimSigDigits(RH * 100.0, 2) + - " Pressure= " + TrimSigDigits(PB, 2); + String = format(" Dry-Bulb= {:.2T} Relative Humidity [%]= {:.2T} Pressure= {:.2T}", TDB, RH * 100.0, PB); ShowWarningMessage(state, "Calculated Humidity Ratio is invalid (PsyWFnTdbRhPb)"); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); @@ -1342,7 +1333,7 @@ namespace Psychrometrics { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } ShowContinueError(state, String); - String = "Calculated Humidity Ratio= " + TrimSigDigits(W, 4); + String = format("Calculated Humidity Ratio= {:.4T}", W); ShowContinueError(state, String + " ... Humidity Ratio set to .00001"); } ShowRecurringWarningErrorAtEnd(state, @@ -1423,7 +1414,7 @@ namespace Psychrometrics { } else { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } - ShowContinueError(state, " Input Pressure= " + TrimSigDigits(Press, 2)); + ShowContinueError(state, format(" Input Pressure= {:.2T}", Press)); FlagError = true; } ShowRecurringWarningErrorAtEnd(state, "Pressure out of range (PsyTsatFnPb)", iPsyErrIndex(iPsyTsatFnPb), Press, Press, _, "Pa", "Pa"); @@ -1495,13 +1486,13 @@ namespace Psychrometrics { if (iter > itmax) { if (!state.dataGlobal->WarmupFlag) { if (iPsyErrIndex(iPsyTsatFnPb2) == 0) { - ShowWarningMessage(state, "Saturation Temperature not converged after " + TrimSigDigits(iter) + " iterations (PsyTsatFnPb)"); + ShowWarningMessage(state, format("Saturation Temperature not converged after {} iterations (PsyTsatFnPb)", iter)); if (!CalledFrom.empty()) { ShowContinueErrorTimeStamp(state, " Routine=" + CalledFrom + ','); } else { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } - ShowContinueError(state, " Input Pressure= " + TrimSigDigits(Press, 2)); + ShowContinueError(state, format(" Input Pressure= {:.2T}", Press)); FlagError = true; } ShowRecurringWarningErrorAtEnd(state, @@ -1515,7 +1506,7 @@ namespace Psychrometrics { #ifdef EP_psych_errors if (FlagError) { - ShowContinueError(state, " Resultant Temperature= " + TrimSigDigits(Temp, 2)); + ShowContinueError(state, format(" Resultant Temperature= {:.2T}", Temp)); } #endif diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 728e5dc7fac..f1bff5da6c4 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -210,7 +210,6 @@ namespace Pumps { // Using/Aliasing using DataPlant::FlowPumpQuery; using DataPlant::PlantLoop; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -239,12 +238,15 @@ namespace Pumps { PumpNum = PumpIndex; if (PumpEquip(PumpNum).CheckEquipName) { if (PumpNum > NumPumps || PumpNum < 1) { - ShowFatalError(state, "ManagePumps: Invalid PumpIndex passed=" + TrimSigDigits(PumpNum) + - ", Number of Pumps=" + TrimSigDigits(NumPumps) + ", Pump name=" + PumpName); + ShowFatalError(state, + format("ManagePumps: Invalid PumpIndex passed={}, Number of Pumps={}, Pump name={}", PumpNum, NumPumps, PumpName)); } if (PumpName != PumpEquip(PumpNum).Name) { - ShowFatalError(state, "ManagePumps: Invalid PumpIndex passed=" + TrimSigDigits(PumpNum) + ", Pump name=" + PumpName + - ", stored Pump Name for that index=" + PumpEquip(PumpNum).Name); + ShowFatalError(state, + format("ManagePumps: Invalid PumpIndex passed={}, Pump name={}, stored Pump Name for that index={}", + PumpNum, + PumpName, + PumpEquip(PumpNum).Name)); } PumpEquip(PumpNum).CheckEquipName = false; } @@ -440,8 +442,11 @@ namespace Pumps { // Check that the minimum isn't greater than the maximum ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + PumpEquip(PumpNum).Name + "\", Invalid '" + cNumericFieldNames(10) + "'"); - ShowContinueError(state, "Entered Value=[" + General::TrimSigDigits(PumpEquip(PumpNum).MinVolFlowRate, 5) + "] is above the " + - cNumericFieldNames(1) + "=[" + General::TrimSigDigits(PumpEquip(PumpNum).NomVolFlowRate, 5) + "]."); + ShowContinueError(state, + format("Entered Value=[{:.5T}] is above the {}=[{:.5T}].", + PumpEquip(PumpNum).MinVolFlowRate, + cNumericFieldNames(1), + PumpEquip(PumpNum).NomVolFlowRate)); ShowContinueError(state, "Reseting value of '" + cNumericFieldNames(10) + "' to the value of '" + cNumericFieldNames(1) + "'."); // Set min to roughly max, but not quite, otherwise it can't turn on, ever PumpEquip(PumpNum).MinVolFlowRate = 0.99 * PumpEquip(PumpNum).NomVolFlowRate; @@ -1293,7 +1298,7 @@ namespace Pumps { using DataPlant::PlantReSizingCompleted; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; - using General::RoundSigDigits; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; @@ -1381,29 +1386,50 @@ namespace Pumps { TotalEffic = PumpEquip(PumpNum).NomVolFlowRate * PumpEquip(PumpNum).NomPumpHead / PumpEquip(PumpNum).NomPowerUse; PumpEquip(PumpNum).PumpEffic = TotalEffic / PumpEquip(PumpNum).MotorEffic; if (PumpEquip(PumpNum).PumpEffic < 0.50) { - ShowWarningError(state, "Check input. Calculated Pump Efficiency=" + RoundSigDigits(PumpEquip(PumpNum).PumpEffic * 100.0, 2) + - "% which is less than 50%, for pump=" + PumpEquip(PumpNum).Name); - ShowContinueError(state, "Calculated Pump_Efficiency % =Total_Efficiency % [" + RoundSigDigits(TotalEffic * 100.0, 1) + - "] / Motor_Efficiency % [" + RoundSigDigits(PumpEquip(PumpNum).MotorEffic * 100.0, 1) + ']'); - ShowContinueError(state, "Total_Efficiency % =(Rated_Volume_Flow_Rate [" + RoundSigDigits(PumpEquip(PumpNum).NomVolFlowRate, 1) + - "] * Rated_Pump_Head [" + RoundSigDigits(PumpEquip(PumpNum).NomPumpHead, 1) + "] / Rated_Power_Use [" + - RoundSigDigits(PumpEquip(PumpNum).NomPowerUse, 1) + "]) * 100."); + ShowWarningError(state, + format("Check input. Calculated Pump Efficiency={:.2R}% which is less than 50%, for pump={}", + PumpEquip(PumpNum).PumpEffic * 100.0, + PumpEquip(PumpNum).Name)); + ShowContinueError(state, + format("Calculated Pump_Efficiency % =Total_Efficiency % [{:.1R}] / Motor_Efficiency % [{:.1R}]", + TotalEffic * 100.0, + PumpEquip(PumpNum).MotorEffic * 100.0)); + ShowContinueError( + state, + format("Total_Efficiency % =(Rated_Volume_Flow_Rate [{:.1R}] * Rated_Pump_Head [{:.1R}] / Rated_Power_Use [{:.1R}]) * 100.", + PumpEquip(PumpNum).NomVolFlowRate, + PumpEquip(PumpNum).NomPumpHead, + PumpEquip(PumpNum).NomPowerUse)); } else if ((PumpEquip(PumpNum).PumpEffic > 0.95) && (PumpEquip(PumpNum).PumpEffic <= 1.0)) { - ShowWarningError(state, "Check input. Calculated Pump Efficiency=" + RoundSigDigits(PumpEquip(PumpNum).PumpEffic * 100.0, 2) + - "% is approaching 100%, for pump=" + PumpEquip(PumpNum).Name); - ShowContinueError(state, "Calculated Pump_Efficiency % =Total_Efficiency % [" + RoundSigDigits(TotalEffic * 100.0, 1) + - "] / Motor_Efficiency % [" + RoundSigDigits(PumpEquip(PumpNum).MotorEffic * 100.0, 1) + ']'); - ShowContinueError(state, "Total_Efficiency % =(Rated_Volume_Flow_Rate [" + RoundSigDigits(PumpEquip(PumpNum).NomVolFlowRate, 1) + - "] * Rated_Pump_Head [" + RoundSigDigits(PumpEquip(PumpNum).NomPumpHead, 1) + "] / Rated_Power_Use [" + - RoundSigDigits(PumpEquip(PumpNum).NomPowerUse, 1) + "]) * 100."); + ShowWarningError(state, + format("Check input. Calculated Pump Efficiency={:.2R}% is approaching 100%, for pump={}", + PumpEquip(PumpNum).PumpEffic * 100.0, + PumpEquip(PumpNum).Name)); + ShowContinueError(state, + format("Calculated Pump_Efficiency % =Total_Efficiency % [{:.1R}] / Motor_Efficiency % [{:.1R}]", + TotalEffic * 100.0, + PumpEquip(PumpNum).MotorEffic * 100.0)); + ShowContinueError( + state, + format("Total_Efficiency % =(Rated_Volume_Flow_Rate [{:.1R}] * Rated_Pump_Head [{:.1R}] / Rated_Power_Use [{:.1R}]) * 100.", + PumpEquip(PumpNum).NomVolFlowRate, + PumpEquip(PumpNum).NomPumpHead, + PumpEquip(PumpNum).NomPowerUse)); } else if (PumpEquip(PumpNum).PumpEffic > 1.0) { - ShowSevereError(state, "Check input. Calculated Pump Efficiency=" + RoundSigDigits(PumpEquip(PumpNum).PumpEffic * 100.0, 3) + - "% which is bigger than 100%, for pump=" + PumpEquip(PumpNum).Name); - ShowContinueError(state, "Calculated Pump_Efficiency % =Total_Efficiency % [" + RoundSigDigits(TotalEffic * 100.0, 1) + - "] / Motor_Efficiency % [" + RoundSigDigits(PumpEquip(PumpNum).MotorEffic * 100.0, 1) + ']'); - ShowContinueError(state, "Total_Efficiency % =(Rated_Volume_Flow_Rate [" + RoundSigDigits(PumpEquip(PumpNum).NomVolFlowRate, 1) + - "] * Rated_Pump_Head [" + RoundSigDigits(PumpEquip(PumpNum).NomPumpHead, 1) + "] / Rated_Power_Use [" + - RoundSigDigits(PumpEquip(PumpNum).NomPowerUse, 1) + "]) * 100."); + ShowSevereError(state, + format("Check input. Calculated Pump Efficiency={:.3R}% which is bigger than 100%, for pump={}", + PumpEquip(PumpNum).PumpEffic * 100.0, + PumpEquip(PumpNum).Name)); + ShowContinueError(state, + format("Calculated Pump_Efficiency % =Total_Efficiency % [{:.1R}] / Motor_Efficiency % [{:.1R}]", + TotalEffic * 100.0, + PumpEquip(PumpNum).MotorEffic * 100.0)); + ShowContinueError( + state, + format("Total_Efficiency % =(Rated_Volume_Flow_Rate [{:.1R}] * Rated_Pump_Head [{:.1R}] / Rated_Power_Use [{:.1R}]) * 100.", + PumpEquip(PumpNum).NomVolFlowRate, + PumpEquip(PumpNum).NomPumpHead, + PumpEquip(PumpNum).NomPowerUse)); ShowFatalError(state, "Errors found in Pump input"); } } else { @@ -1740,7 +1766,7 @@ namespace Pumps { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::SetComponentFlowRate; using ScheduleManager::GetCurrentScheduleValue; @@ -1919,8 +1945,7 @@ namespace Pumps { ShowWarningMessage(state, RoutineName + " Calculated Pump Power < 0, Type=" + cPumpTypes(PumpType) + ", Name=\"" + PumpEquip(PumpNum).Name + "\"."); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "...PartLoadRatio=[" + RoundSigDigits(PartLoadRatio, 4) + - "], Fraction Full Load Power=" + RoundSigDigits(FracFullLoadPower, 4) + ']'); + ShowContinueError(state, format("...PartLoadRatio=[{:.4R}], Fraction Full Load Power={:.4R}]", PartLoadRatio, FracFullLoadPower)); ShowContinueError(state, "...Power is set to 0 for continuing the simulation."); ShowContinueError(state, "...Pump coefficients should be checked for producing this negative value."); } @@ -2014,7 +2039,6 @@ namespace Pumps { using DataSizing::PlantSizData; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2123,8 +2147,9 @@ namespace Pumps { } else { if (PlantFinalSizesOkayToReport) { PumpEquip(PumpNum).NomVolFlowRate = 0.0; - ShowWarningError(state, "SizePump: Calculated Pump Nominal Volume Flow Rate=[" + - RoundSigDigits(PlantSizData(PlantSizNum).DesVolFlowRate, 2) + "] is too small. Set to 0.0"); + ShowWarningError(state, + format("SizePump: Calculated Pump Nominal Volume Flow Rate=[{:.2R}] is too small. Set to 0.0", + PlantSizData(PlantSizNum).DesVolFlowRate)); ShowContinueError(state, "..occurs for Pump=" + PumpEquip(PumpNum).Name); } } @@ -2384,7 +2409,7 @@ namespace Pumps { using DataPlant::Press_FlowCorrection; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantPressureSystem::ResolveLoopFlowVsPressure; using PlantUtilities::SetComponentFlowRate; using ScheduleManager::GetCurrentScheduleValue; diff --git a/src/EnergyPlus/PurchasedAirManager.cc b/src/EnergyPlus/PurchasedAirManager.cc index 6b58815637e..c4d36facf40 100644 --- a/src/EnergyPlus/PurchasedAirManager.cc +++ b/src/EnergyPlus/PurchasedAirManager.cc @@ -225,7 +225,6 @@ namespace PurchasedAirManager { // at the system time step. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -248,13 +247,19 @@ namespace PurchasedAirManager { } else { PurchAirNum = CompIndex; if (PurchAirNum > NumPurchAir || PurchAirNum < 1) { - ShowFatalError(state, "SimPurchasedAir: Invalid CompIndex passed=" + TrimSigDigits(PurchAirNum) + - ", Number of Units=" + TrimSigDigits(NumPurchAir) + ", Entered Unit name=" + PurchAirName); + ShowFatalError(state, + format("SimPurchasedAir: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + PurchAirNum, + NumPurchAir, + PurchAirName)); } if (CheckEquipName(PurchAirNum)) { if (PurchAirName != PurchAir(PurchAirNum).Name) { - ShowFatalError(state, "SimPurchasedAir: Invalid CompIndex passed=" + TrimSigDigits(PurchAirNum) + ", Unit name=" + PurchAirName + - ", stored Unit Name for that index=" + PurchAir(PurchAirNum).Name); + ShowFatalError(state, + format("SimPurchasedAir: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + PurchAirNum, + PurchAirName, + PurchAir(PurchAirNum).Name)); } CheckEquipName(PurchAirNum) = false; } @@ -1118,7 +1123,7 @@ namespace PurchasedAirManager { using DataZoneEquipment::ZoneEquipConfig; using DataZoneEquipment::ZoneEquipInputsFilled; using General::FindNumberInList; - using General::RoundSigDigits; + using ZonePlenum::GetReturnPlenumIndex; using ZonePlenum::GetReturnPlenumName; @@ -1294,10 +1299,11 @@ namespace PurchasedAirManager { if (PurchAir(PurchAirNum).CoolErrIndex == 0) { ShowSevereError(state, "InitPurchasedAir: For " + PurchAir(PurchAirNum).cObjectName + " = " + PurchAir(PurchAirNum).Name + " serving Zone " + Zone(ActualZoneNum).Name); - ShowContinueError(state, "..the minimum supply air temperature for cooling [" + - RoundSigDigits(PurchAir(PurchAirNum).MinCoolSuppAirTemp, 2) + - "] is greater than the zone cooling mean air temperature (MAT) setpoint [" + - RoundSigDigits(ZoneThermostatSetPointHi(ActualZoneNum), 2) + "]."); + ShowContinueError(state, + format("..the minimum supply air temperature for cooling [{:.2R}] is greater than the zone cooling mean air " + "temperature (MAT) setpoint [{:.2R}].", + PurchAir(PurchAirNum).MinCoolSuppAirTemp, + ZoneThermostatSetPointHi(ActualZoneNum))); ShowContinueError(state, "..For operative and comfort thermostat controls, the MAT setpoint is computed."); ShowContinueError(state, "..This error may indicate that the mean radiant temperature or another comfort factor is too warm."); ShowContinueError(state, "Unit availability is nominally ON and Cooling availability is nominally ON."); @@ -1336,10 +1342,11 @@ namespace PurchasedAirManager { if (PurchAir(PurchAirNum).HeatErrIndex == 0) { ShowSevereMessage(state, "InitPurchasedAir: For " + PurchAir(PurchAirNum).cObjectName + " = " + PurchAir(PurchAirNum).Name + " serving Zone " + Zone(ActualZoneNum).Name); - ShowContinueError(state, "..the maximum supply air temperature for heating [" + - RoundSigDigits(PurchAir(PurchAirNum).MaxHeatSuppAirTemp, 2) + - "] is less than the zone mean air temperature heating setpoint [" + - RoundSigDigits(ZoneThermostatSetPointLo(ActualZoneNum), 2) + "]."); + ShowContinueError(state, + format("..the maximum supply air temperature for heating [{:.2R}] is less than the zone mean air temperature " + "heating setpoint [{:.2R}].", + PurchAir(PurchAirNum).MaxHeatSuppAirTemp, + ZoneThermostatSetPointLo(ActualZoneNum))); ShowContinueError(state, "..For operative and comfort thermostat controls, the MAT setpoint is computed."); ShowContinueError(state, "..This error may indicate that the mean radiant temperature or another comfort factor is too cold."); ShowContinueError(state, "Unit availability is nominally ON and Heating availability is nominally ON."); @@ -1386,7 +1393,7 @@ namespace PurchasedAirManager { using DataHVACGlobals::CoolingCapacitySizing; using DataHVACGlobals::HeatingAirflowSizing; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; + using Psychrometrics::CPCW; using Psychrometrics::CPHW; using Psychrometrics::PsyCpAirFnW; @@ -1585,10 +1592,11 @@ namespace PurchasedAirManager { if ((std::abs(MaxHeatSensCapDes - MaxHeatSensCapUser) / MaxHeatSensCapUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePurchasedAir: Potential issue with equipment sizing for " + PurchAir(PurchAirNum).cObjectName + ' ' + PurchAir(PurchAirNum).Name); - ShowContinueError(state, "...User-Specified Maximum Sensible Heating Capacity of " + - RoundSigDigits(MaxHeatSensCapUser, 2) + " [W]"); - ShowContinueError(state, "...differs from Design Size Maximum Sensible Heating Capacity of " + - RoundSigDigits(MaxHeatSensCapDes, 2) + " [W]"); + ShowContinueError( + state, format("...User-Specified Maximum Sensible Heating Capacity of {:.2R} [W]", MaxHeatSensCapUser)); + ShowContinueError( + state, + format("...differs from Design Size Maximum Sensible Heating Capacity of {:.2R} [W]", MaxHeatSensCapDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1746,10 +1754,10 @@ namespace PurchasedAirManager { if ((std::abs(MaxCoolTotCapDes - MaxCoolTotCapUser) / MaxCoolTotCapUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePurchasedAir: Potential issue with equipment sizing for " + PurchAir(PurchAirNum).cObjectName + ' ' + PurchAir(PurchAirNum).Name); - ShowContinueError(state, "User-Specified Maximum Total Cooling Capacity of " + RoundSigDigits(MaxCoolTotCapUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Maximum Total Cooling Capacity of " + - RoundSigDigits(MaxCoolTotCapDes, 2) + " [W]"); + ShowContinueError(state, + format("User-Specified Maximum Total Cooling Capacity of {:.2R} [W]", MaxCoolTotCapUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Total Cooling Capacity of {:.2R} [W]", MaxCoolTotCapDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1846,10 +1854,10 @@ namespace PurchasedAirManager { if ((std::abs(MaxHeatSensCapDes - MaxHeatSensCapUser) / MaxHeatSensCapUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePurchasedAir: Potential issue with equipment sizing for " + PurchAir(PurchAirNum).cObjectName + ' ' + PurchAir(PurchAirNum).Name); - ShowContinueError(state, "...User-Specified Maximum Sensible Heating Capacity of " + RoundSigDigits(MaxHeatSensCapUser, 2) + - " [W]"); - ShowContinueError(state, "...differs from Design Size Maximum Sensible Heating Capacity of " + - RoundSigDigits(MaxHeatSensCapDes, 2) + " [W]"); + ShowContinueError(state, + format("...User-Specified Maximum Sensible Heating Capacity of {:.2R} [W]", MaxHeatSensCapUser)); + ShowContinueError( + state, format("...differs from Design Size Maximum Sensible Heating Capacity of {:.2R} [W]", MaxHeatSensCapDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1944,10 +1952,9 @@ namespace PurchasedAirManager { if ((std::abs(MaxCoolTotCapDes - MaxCoolTotCapUser) / MaxCoolTotCapUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizePurchasedAir: Potential issue with equipment sizing for " + PurchAir(PurchAirNum).cObjectName + ' ' + PurchAir(PurchAirNum).Name); - ShowContinueError(state, "User-Specified Maximum Total Cooling Capacity of " + RoundSigDigits(MaxCoolTotCapUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Maximum Total Cooling Capacity of " + - RoundSigDigits(MaxCoolTotCapDes, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Maximum Total Cooling Capacity of {:.2R} [W]", MaxCoolTotCapUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Total Cooling Capacity of {:.2R} [W]", MaxCoolTotCapDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2007,7 +2014,6 @@ namespace PurchasedAirManager { using DataZoneEnergyDemands::ZoneSysMoistureDemand; using DataZoneEquipment::PurchasedAir_Num; using DataZoneEquipment::ZoneEquipConfig; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2160,10 +2166,14 @@ namespace PurchasedAirManager { OAVolFlowRate = OAMassFlowRate / StdRhoAir; if (PurchAir(PurchAirNum).OAFlowMaxCoolOutputError < 1) { ++PurchAir(PurchAirNum).OAFlowMaxCoolOutputError; - ShowWarningError(state, PurchAir(PurchAirNum).cObjectName + " \"" + PurchAir(PurchAirNum).Name + - "\" Requested outdoor air flow rate = " + TrimSigDigits(OAVolFlowRate, 5) + " [m3/s] exceeds limit."); - ShowContinueError(state, " Will be reduced to the Maximum Cooling Air Flow Rate = " + - TrimSigDigits(PurchAir(PurchAirNum).MaxCoolVolFlowRate, 5) + " [m3/s]"); + ShowWarningError(state, + format("{} \"{}\" Requested outdoor air flow rate = {:.5T} [m3/s] exceeds limit.", + PurchAir(PurchAirNum).cObjectName, + PurchAir(PurchAirNum).Name, + OAVolFlowRate)); + ShowContinueError(state, + format(" Will be reduced to the Maximum Cooling Air Flow Rate = {:.5T} [m3/s]", + PurchAir(PurchAirNum).MaxCoolVolFlowRate)); ShowContinueErrorTimeStamp(state, ""); } else { ShowRecurringWarningErrorAtEnd(state, @@ -2434,10 +2444,14 @@ namespace PurchasedAirManager { OAVolFlowRate = OAMassFlowRate / StdRhoAir; if (PurchAir(PurchAirNum).OAFlowMaxHeatOutputError < 1) { ++PurchAir(PurchAirNum).OAFlowMaxHeatOutputError; - ShowWarningError(state, PurchAir(PurchAirNum).cObjectName + " \"" + PurchAir(PurchAirNum).Name + - "\" Requested outdoor air flow rate = " + TrimSigDigits(OAVolFlowRate, 5) + " [m3/s] exceeds limit."); - ShowContinueError(state, " Will be reduced to the Maximum Heating Air Flow Rate = " + - TrimSigDigits(PurchAir(PurchAirNum).MaxHeatVolFlowRate, 5) + " [m3/s]"); + ShowWarningError(state, + format("{} \"{}\" Requested outdoor air flow rate = {:.5T} [m3/s] exceeds limit.", + PurchAir(PurchAirNum).cObjectName, + PurchAir(PurchAirNum).Name, + OAVolFlowRate)); + ShowContinueError(state, + format(" Will be reduced to the Maximum Heating Air Flow Rate = {:.5T} [m3/s]", + PurchAir(PurchAirNum).MaxHeatVolFlowRate)); ShowContinueErrorTimeStamp(state, ""); } else { ShowRecurringWarningErrorAtEnd(state, @@ -2669,9 +2683,12 @@ namespace PurchasedAirManager { if (DeltaHumRat > SmallDeltaHumRat) { if (PurchAir(PurchAirNum).SaturationOutputError < 1) { ++PurchAir(PurchAirNum).SaturationOutputError; - ShowWarningError(state, PurchAir(PurchAirNum).cObjectName + " \"" + PurchAir(PurchAirNum).Name + - "\" Supply humidity ratio = " + TrimSigDigits(SupplyHumRatOrig, 5) + " exceeds saturation limit " + - TrimSigDigits(SupplyHumRatSat, 5) + " [kgWater/kgDryAir]"); + ShowWarningError(state, + format("{} \"{}\" Supply humidity ratio = {:.5T} exceeds saturation limit {:.5T} [kgWater/kgDryAir]", + PurchAir(PurchAirNum).cObjectName, + PurchAir(PurchAirNum).Name, + SupplyHumRatOrig, + SupplyHumRatSat)); ShowContinueError(state, " Simulation continuing . . . "); ShowContinueErrorTimeStamp(state, ""); } else { diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index 3afe14ae4a3..659da06e909 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -1105,7 +1105,7 @@ namespace RefrigeratedCase { if (RefrigCase(CaseNum).Height <= 0.0 && RefrigCase(CaseNum).AntiSweatControlType == ASHeatBalance) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + RefrigCase(CaseNum).Name + "\", " + cNumericFieldNames(NumNum) + " must be greater than 0 when " + cAlphaFieldNames(7) + " is Heat Balance Method."); - ShowContinueError(state, "..given " + cNumericFieldNames(NumNum) + " was: " + General::RoundSigDigits(RefrigCase(CaseNum).Height, 3)); + ShowContinueError(state, format("..given {} was: {:.3R}", cNumericFieldNames(NumNum), RefrigCase(CaseNum).Height)); ErrorsFound = true; } @@ -4093,11 +4093,14 @@ namespace RefrigeratedCase { Real64 NominalSecondaryCapacity = FlowMassRated * CpBrineRated * Secondary(SecondaryNum).TRangeDifRated; Real64 TestDelta = (NominalSecondaryCapacity - Secondary(SecondaryNum).CoolingLoadRated) / NominalSecondaryCapacity; if (std::abs(TestDelta) > 0.2) { - ShowWarningError(state, CurrentModuleObject + "=\"" + Secondary(SecondaryNum).Name + - " You may wish to check the system definition. Based upon the design flow rate and range " - "temperature difference, The nominal secondary loop heat exchanger capacity is, " + - General::RoundSigDigits(NominalSecondaryCapacity, 0) + " but the specified design capacity is, " + - General::RoundSigDigits(Secondary(SecondaryNum).CoolingLoadRated, 0)); + ShowWarningError(state, + format("{}=\"{} You may wish to check the system definition. Based upon the design flow rate and " + "range temperature difference, The nominal secondary loop heat exchanger capacity is, " + "{:.0R} but the specified design capacity is, {:.0R}", + CurrentModuleObject, + Secondary(SecondaryNum).Name, + NominalSecondaryCapacity, + Secondary(SecondaryNum).CoolingLoadRated)); } } else if (!lNumericBlanks(1)) { Secondary(SecondaryNum).CoolingLoadRated = Numbers(1); @@ -4122,9 +4125,12 @@ namespace RefrigeratedCase { (FlowMassRated * CpBrineRated * (TBrineInRated - Secondary(SecondaryNum).TEvapDesign)); Secondary(SecondaryNum).TBrineInRated = TBrineInRated; if (Secondary(SecondaryNum).HeatExchangeEta > 0.99) { - ShowWarningError(state, CurrentModuleObject + "=\"" + Secondary(SecondaryNum).Name + - " You may wish to check the system definition. The heat exchanger effectiveness is, " + - General::RoundSigDigits(Secondary(SecondaryNum).HeatExchangeEta, 2)); + ShowWarningError( + state, + format("{}=\"{} You may wish to check the system definition. The heat exchanger effectiveness is, {:.2R}", + CurrentModuleObject, + Secondary(SecondaryNum).Name, + Secondary(SecondaryNum).HeatExchangeEta)); Secondary(SecondaryNum).HeatExchangeEta = 0.99; } } else { @@ -4174,11 +4180,16 @@ namespace RefrigeratedCase { DensityPhaseChange * DeltaHPhaseChange * PumpTotRatedFlowVol / Secondary(SecondaryNum).CoolingLoadRated; Real64 DiffCircRates = (CalcCircRate - Secondary(SecondaryNum).CircRate) / Secondary(SecondaryNum).CircRate; if (std::abs(DiffCircRates) > 0.3) { - ShowWarningError(state, CurrentModuleObject + "=\"" + Secondary(SecondaryNum).Name + ' ' + cNumericFieldNames(7) + - " Produces a circulating rate of " + General::RoundSigDigits(CalcCircRate, 2) + - " ; A circulating rate of " + General::RoundSigDigits(Secondary(SecondaryNum).CircRate, 2) + - " would need a " + cNumericFieldNames(7) + " of " + General::RoundSigDigits(CalcTotFlowVol, 2) + - " m3/s"); + ShowWarningError(state, + format("{}=\"{} {} Produces a circulating rate of {:.2R} ; A circulating rate of {:.2R} would need " + "a {} of {:.2R} m3/s", + CurrentModuleObject, + Secondary(SecondaryNum).Name, + cNumericFieldNames(7), + CalcCircRate, + Secondary(SecondaryNum).CircRate, + cNumericFieldNames(7), + CalcTotFlowVol)); } // warning check on pump flow rate vs circ rate input } // blank pump flow rate SecondaryFlowVolRated = PumpTotRatedFlowVol; @@ -4271,9 +4282,13 @@ namespace RefrigeratedCase { if ((0.5 <= Numbers(NumNum)) && (1.0 >= Numbers(NumNum))) { Secondary(SecondaryNum).PumpPowerToHeat = Numbers(NumNum); } else { - ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + Secondary(SecondaryNum).Name + "\" " + - cNumericFieldNames(NumNum) + " must be between 0.5 and 1.0. Default value of : " + - General::RoundSigDigits(PumpMotorEfficiency, 3) + " will be used"); + ShowWarningError(state, + format("{}{}=\"{}\" {} must be between 0.5 and 1.0. Default value of : {:.3R} will be used", + RoutineName, + CurrentModuleObject, + Secondary(SecondaryNum).Name, + cNumericFieldNames(NumNum), + PumpMotorEfficiency)); } // range of pump moter heat to fluid } // blank input for pumppowertoheat @@ -4381,10 +4396,13 @@ namespace RefrigeratedCase { if (Secondary(SecondaryNum).FluidType == SecFluidTypeAlwaysLiquid) { if (TBrineOutRated > (Secondary(SecondaryNum).TMinNeeded + 0.5)) { ShowWarningError(state, - CurrentModuleObject + "=\"" + Secondary(SecondaryNum).Name + - " The design brine temperature to the refrigeration loads: " + General::RoundSigDigits(TBrineOutRated, 1) + " ;"); - ShowContinueError(state, " is greater than the design inlet temperature for at least one of the cases or walkins: " + - General::RoundSigDigits(Secondary(SecondaryNum).TMinNeeded, 1)); + format("{}=\"{} The design brine temperature to the refrigeration loads: {:.1R} ;", + CurrentModuleObject, + Secondary(SecondaryNum).Name, + TBrineOutRated)); + ShowContinueError(state, + format(" is greater than the design inlet temperature for at least one of the cases or walkins: {:.1R}", + Secondary(SecondaryNum).TMinNeeded)); ShowContinueError(state, " Compare your Approach and Evaporating Temperature to the design inlet temperatures needed for the loads."); // ErrorsFound = .TRUE. @@ -4395,11 +4413,13 @@ namespace RefrigeratedCase { Real64 DeltaCap1 = std::abs((Secondary(SecondaryNum).CoolingLoadRated - CapacityAtMaxVolFlow) / Secondary(SecondaryNum).CoolingLoadRated); if (DeltaCap1 > (0.3)) { // diff between chiller rating and capacity at max flow > 30% - ShowWarningError(state, CurrentModuleObject + "=\"" + Secondary(SecondaryNum).Name + - "\" You may wish to check the system sizing. The nominal secondary loop heat exchanger capacity is " + - General::RoundSigDigits(Secondary(SecondaryNum).CoolingLoadRated, 0) + - " But the capacity based upon the maximum flow rate is " + - General::RoundSigDigits(CapacityAtMaxVolFlow, 0)); + ShowWarningError(state, + format("{}=\"{}\" You may wish to check the system sizing. The nominal secondary loop heat exchanger " + "capacity is {:.0R} But the capacity based upon the maximum flow rate is {:.0R}", + CurrentModuleObject, + Secondary(SecondaryNum).Name, + Secondary(SecondaryNum).CoolingLoadRated, + CapacityAtMaxVolFlow)); } // DeltaCap1 > .3 } else { // Fluid type phase change !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ if (lNumericBlanks(1)) { // Chiller/evaporator capacity was not specified @@ -4426,18 +4446,24 @@ namespace RefrigeratedCase { Real64 DeltaCap2 = std::abs((Secondary(SecondaryNum).CoolingLoadRated - NominalSecondaryRefLoad) / Secondary(SecondaryNum).CoolingLoadRated); if (DeltaCap2 > (0.3)) { // diff between chiller rating and sum of nominal loads > 30% - ShowWarningError(state, CurrentModuleObject + "=\"" + Secondary(SecondaryNum).Name + - "\" You may wish to check the system sizing. Total nominal refrigerating load is " + - General::RoundSigDigits(NominalSecondaryRefLoad, 0) + - " (Including cases, walk-ins, and pump heat). The nominal secondary loop heat exchanger capacity is " + - General::RoundSigDigits(Secondary(SecondaryNum).CoolingLoadRated, 0)); + ShowWarningError( + state, + format("{}=\"{}\" You may wish to check the system sizing. Total nominal refrigerating load is {:.0R} (Including cases, " + "walk-ins, and pump heat). The nominal secondary loop heat exchanger capacity is {:.0R}", + CurrentModuleObject, + Secondary(SecondaryNum).Name, + NominalSecondaryRefLoad, + Secondary(SecondaryNum).CoolingLoadRated)); } // compare rated xt xchanger brine flow to the total rated pump flow if (SecondaryFlowVolRated > (1.1 * PumpTotRatedFlowVol)) { - ShowWarningError(state, CurrentModuleObject + "=\"" + Secondary(SecondaryNum).Name + - "\" You may wish to check the pump sizing. Total nominal brine flow is " + - General::RoundSigDigits(SecondaryFlowVolRated, 0) + " m3/s, but the total nominal pump flow rate is: " + - General::RoundSigDigits(PumpTotRatedFlowVol, 0) + " m3/s. "); + ShowWarningError(state, + format("{}=\"{}\" You may wish to check the pump sizing. Total nominal brine flow is {:.0R} m3/s, but the " + "total nominal pump flow rate is: {:.0R} m3/s. ", + CurrentModuleObject, + Secondary(SecondaryNum).Name, + SecondaryFlowVolRated, + PumpTotRatedFlowVol)); } } // Secondary Loops @@ -5307,8 +5333,10 @@ namespace RefrigeratedCase { System(RefrigSysNum).IntercoolerEffectiveness = Numbers(4); if (System(RefrigSysNum).IntercoolerEffectiveness < 0.0 || System(RefrigSysNum).IntercoolerEffectiveness > 1.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + System(RefrigSysNum).Name + "\", The specified value for the"); - ShowContinueError(state, cNumericFieldNames(4) + " = " + General::RoundSigDigits(System(RefrigSysNum).IntercoolerEffectiveness, 2) + - " is invalid. This value must be"); + ShowContinueError(state, + format("{} = {:.2R} is invalid. This value must be", + cNumericFieldNames(4), + System(RefrigSysNum).IntercoolerEffectiveness)); ShowContinueError(state, "between 0.0 and 1.0. The default value of 0.8 will be used."); System(RefrigSysNum).IntercoolerEffectiveness = 0.8; } @@ -5421,19 +5449,25 @@ namespace RefrigeratedCase { if (System(RefrigSysNum).SystemRejectHeatToZone) NominalCondCap *= 2.0; if (System(RefrigSysNum).NumStages == 1) { // Single-stage system if ((NominalTotalCompCap < (0.7 * NominalTotalCoolingCap)) || (NominalCondCap < (1.3 * NominalTotalCoolingCap))) { - ShowWarningError(state, CurrentModuleObject + "=\"" + System(RefrigSysNum).Name + - "\", You may wish to check the system sizing. Total nominal cooling capacity is " + - General::RoundSigDigits(NominalTotalCoolingCap, 0) + "W. Condenser capacity is " + - General::RoundSigDigits(NominalCondCap, 0) + "W. Nominal compressor capacity is " + - General::RoundSigDigits(NominalTotalCompCap, 0) + "W."); + ShowWarningError(state, + format("{}=\"{}\", You may wish to check the system sizing. Total nominal cooling capacity is {:.0R}W. " + "Condenser capacity is {:.0R}W. Nominal compressor capacity is {:.0R}W.", + CurrentModuleObject, + System(RefrigSysNum).Name, + NominalTotalCoolingCap, + NominalCondCap, + NominalTotalCompCap)); } } else if (System(RefrigSysNum).NumStages == 2) { // Two-stage system if ((NominalTotalHiStageCompCap < (0.7 * NominalTotalCoolingCap)) || (NominalCondCap < (1.3 * NominalTotalCoolingCap))) { - ShowWarningError(state, CurrentModuleObject + "=\"" + System(RefrigSysNum).Name + - "\", You may wish to check the system sizing. Total nominal cooling capacity is " + - General::RoundSigDigits(NominalTotalCoolingCap, 0) + "W. Condenser capacity is " + - General::RoundSigDigits(NominalCondCap, 0) + "W. Nominal compressor capacity is " + - General::RoundSigDigits(NominalTotalCompCap, 0) + "W."); + ShowWarningError(state, + format("{}=\"{}\", You may wish to check the system sizing. Total nominal cooling capacity is {:.0R}W. " + "Condenser capacity is {:.0R}W. Nominal compressor capacity is {:.0R}W.", + CurrentModuleObject, + System(RefrigSysNum).Name, + NominalTotalCoolingCap, + NominalCondCap, + NominalTotalCompCap)); } } // NumStages @@ -5981,21 +6015,28 @@ namespace RefrigeratedCase { TransSystem(TransRefrigSysNum).TReceiver = FluidProperties::GetSatTemperatureRefrig(state, TransSystem(TransRefrigSysNum).RefrigerantName, TransSystem(TransRefrigSysNum).PReceiver, RefrigIndex, RoutineNameNoColon); if (TransSystem(TransRefrigSysNum).TReceiver > GasCooler(TransSystem(TransRefrigSysNum).GasCoolerNum(NumGasCoolers)).MinCondTemp) { - ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + TransSystem(TransRefrigSysNum).Name + - ": The receiver temperature (" + General::RoundSigDigits(TransSystem(TransRefrigSysNum).TReceiver, 2) + - "C) is greater than the minimum condensing temperature specified for subcritical operation (" + - General::RoundSigDigits(GasCooler(TransSystem(TransRefrigSysNum).GasCoolerNum(NumGasCoolers)).MinCondTemp, 2) + - "C)."); + ShowWarningError(state, + format("{}{}=\"{}: The receiver temperature ({:.2R}C) is greater than the minimum condensing temperature " + "specified for subcritical operation ({:.2R}C).", + RoutineName, + CurrentModuleObject, + TransSystem(TransRefrigSysNum).Name, + TransSystem(TransRefrigSysNum).TReceiver, + GasCooler(TransSystem(TransRefrigSysNum).GasCoolerNum(NumGasCoolers)).MinCondTemp)); ShowContinueError(state, " The minimum condensing temperature will be set at 5C greater than the receiver temperature."); GasCooler(TransSystem(TransRefrigSysNum).GasCoolerNum(NumGasCoolers)).MinCondTemp = TransSystem(TransRefrigSysNum).TReceiver + 5.0; } if (NominalTotalCompCapLP > 0.0) { if (TransSystem(TransRefrigSysNum).TReceiver <= TransSystem(TransRefrigSysNum).TEvapDesignLT) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + TransSystem(TransRefrigSysNum).Name + - ": The receiver temperature (" + General::RoundSigDigits(TransSystem(TransRefrigSysNum).TReceiver, 2) + - "C) is less than the design evaporator temperature for the low temperature loads (" + - General::RoundSigDigits(TransSystem(TransRefrigSysNum).TEvapDesignLT, 2) + "C)."); + ShowSevereError(state, + format("{}{}=\"{}: The receiver temperature ({:.2R}C) is less than the design evaporator temperature for the " + "low temperature loads ({:.2R}C).", + RoutineName, + CurrentModuleObject, + TransSystem(TransRefrigSysNum).Name, + TransSystem(TransRefrigSysNum).TReceiver, + TransSystem(TransRefrigSysNum).TEvapDesignLT)); ShowContinueError(state, " Ensure that the receiver temperature is sufficiently greater than the design evaporator temperature for " "the low temperature loads."); ShowContinueError(state, @@ -6005,10 +6046,14 @@ namespace RefrigeratedCase { } if (NominalTotalCompCapHP > 0.0) { if (TransSystem(TransRefrigSysNum).TReceiver <= TransSystem(TransRefrigSysNum).TEvapDesignMT) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + TransSystem(TransRefrigSysNum).Name + - ": The receiver temperature (" + General::RoundSigDigits(TransSystem(TransRefrigSysNum).TReceiver, 2) + - "C) is less than the design evaporator temperature for the medium temperature loads (" + - General::RoundSigDigits(TransSystem(TransRefrigSysNum).TEvapDesignMT, 2) + "C)."); + ShowSevereError(state, + format("{}{}=\"{}: The receiver temperature ({:.2R}C) is less than the design evaporator temperature for the " + "medium temperature loads ({:.2R}C).", + RoutineName, + CurrentModuleObject, + TransSystem(TransRefrigSysNum).Name, + TransSystem(TransRefrigSysNum).TReceiver, + TransSystem(TransRefrigSysNum).TEvapDesignMT)); ShowContinueError(state, " Ensure that the receiver temperature is sufficiently greater than the design evaporator temperature for " "the medium temperature loads."); ShowContinueError(state, @@ -6103,9 +6148,12 @@ namespace RefrigeratedCase { if ((NominalTotalCompCap < (0.7 * NominalTotalCoolingCap)) || (NominalCondCap < (1.3 * NominalTotalCoolingCap))) { ShowWarningError(state, CurrentModuleObject + "=\"" + TransSystem(TransRefrigSysNum).Name + "\", You may wish to check the system sizing."); - ShowContinueError(state, "Total nominal cooling capacity is " + General::RoundSigDigits(NominalTotalCoolingCap, 0) + - "W. Condenser capacity is " + General::RoundSigDigits(NominalCondCap, 0) + - "W. Nominal compressor capacity is " + General::RoundSigDigits(NominalTotalCompCap, 0) + "W."); + ShowContinueError( + state, + format("Total nominal cooling capacity is {:.0R}W. Condenser capacity is {:.0R}W. Nominal compressor capacity is {:.0R}W.", + NominalTotalCoolingCap, + NominalCondCap, + NominalTotalCompCap)); } } // Transcritical refrigeration systems @@ -6164,8 +6212,8 @@ namespace RefrigeratedCase { if ((NumUnusedRefrigCases > 0) && (!state.dataGlobal->DisplayExtraWarnings)) { // write to error file, // summary number of unused cases given if DataGlobals::DisplayExtraWarnings option not selected - ShowWarningError(state, "Refrigeration:Case -> " + General::RoundSigDigits(NumUnusedRefrigCases) + - " unused refrigerated case(s) found during input processing."); + ShowWarningError(state, + format("Refrigeration:Case -> {} unused refrigerated case(s) found during input processing.", NumUnusedRefrigCases)); ShowContinueError(state, " These refrigerated cases are in the input file but are not connected to a "); ShowContinueError(state, " Refrigeration:CompressorRack, Refrigeration:System, or Refrigeration:SecondarySystem object."); ShowContinueError(state, " These unused refrigeration cases will not be simulated."); @@ -6197,8 +6245,9 @@ namespace RefrigeratedCase { if ((NumUnusedCompressors > 0) && (!state.dataGlobal->DisplayExtraWarnings)) { // write to error file, // summary number of unused compressors given if DataGlobals::DisplayExtraWarnings option not selected - ShowWarningError(state, "Refrigeration:Compressor -> " + General::RoundSigDigits(NumUnusedCompressors) + - " unused refrigeration compressor(s) found during input processing."); + ShowWarningError( + state, + format("Refrigeration:Compressor -> {} unused refrigeration compressor(s) found during input processing.", NumUnusedCompressors)); ShowContinueError(state, " Those refrigeration compressors are in the input file but are not connected to a Refrigeration:System object."); ShowContinueError(state, " These unused refrigeration compressors will not be simulated."); ShowContinueError(state, " Use Output:Diagnostics,DisplayUnusedObjects; to see them. "); @@ -6229,8 +6278,10 @@ namespace RefrigeratedCase { if ((NumUnusedWalkIns > 0) && (!state.dataGlobal->DisplayExtraWarnings)) { // write to error file, // summary number of unused walkins given if DataGlobals::DisplayExtraWarnings option not selected - ShowWarningError(state, RoutineName + "Refrigeration:WalkIn -> " + General::RoundSigDigits(NumUnusedWalkIns) + - " unused refrigeration WalkIns found during input processing."); + ShowWarningError(state, + format("{}Refrigeration:WalkIn -> {} unused refrigeration WalkIns found during input processing.", + RoutineName, + NumUnusedWalkIns)); ShowContinueError(state, " Those refrigeration WalkIns are in the input file but are not connected to a "); ShowContinueError(state, " Refrigeration:CompressorRack, Refrigeration:System or Refrigeration:SecondarySystem object."); ShowContinueError(state, " These unused refrigeration WalkIns will not be simulated."); @@ -6262,8 +6313,10 @@ namespace RefrigeratedCase { if ((NumUnusedCoils > 0) && (!state.dataGlobal->DisplayExtraWarnings)) { // write to error file, // summary number of unused air chillers given if DataGlobals::DisplayExtraWarnings option not selected - ShowWarningError(state, RoutineName + "Refrigeration:AirChiller -> " + General::RoundSigDigits(NumUnusedCoils) + - " unused refrigeration air chillers found during input processing."); + ShowWarningError(state, + format("{}Refrigeration:AirChiller -> {} unused refrigeration air chillers found during input processing.", + RoutineName, + NumUnusedCoils)); ShowContinueError(state, " Those refrigeration air chillers are in the input file but are not connected to a "); ShowContinueError(state, " Refrigeration:CompressorRack, Refrigeration:System or Refrigeration:SecondarySystem object."); ShowContinueError(state, " These unused refrigeration air chillers will not be simulated."); @@ -6295,8 +6348,10 @@ namespace RefrigeratedCase { if ((NumUnusedSecondarys > 0) && (!state.dataGlobal->DisplayExtraWarnings)) { // write to error file, // summary number of unused secondaries given if DataGlobals::DisplayExtraWarnings option not selected - ShowWarningError(state, RoutineName + "Refrigeration:Secondary -> " + General::RoundSigDigits(NumUnusedSecondarys) + - " unused refrigeration Secondary Loops found during input processing."); + ShowWarningError(state, + format("{}Refrigeration:Secondary -> {} unused refrigeration Secondary Loops found during input processing.", + RoutineName, + NumUnusedSecondarys)); ShowContinueError(state, " Those refrigeration Secondary Loops are in the input file but are not connected to a refrigeration system."); ShowContinueError(state, " These unused refrigeration secondaries will not be simulated."); ShowContinueError(state, " Use Output:Diagnostics,DisplayUnusedObjects; to see them. "); @@ -6326,8 +6381,10 @@ namespace RefrigeratedCase { if ((NumUnusedCondensers > 0) && (!state.dataGlobal->DisplayExtraWarnings)) { // write to error file, // summary number of unused condensers given if DataGlobals::DisplayExtraWarnings option not selected - ShowWarningError(state, RoutineName + "Refrigeration condenser -> " + General::RoundSigDigits(NumUnusedCondensers) + - " unused refrigeration condensers found during input processing."); + ShowWarningError(state, + format("{}Refrigeration condenser -> {} unused refrigeration condensers found during input processing.", + RoutineName, + NumUnusedCondensers)); ShowContinueError(state, " Those refrigeration condensers are in the input file but are not connected to a refrigeration system."); ShowContinueError(state, " These unused refrigeration condensers will not be simulated."); ShowContinueError(state, " Use Output:Diagnostics,DisplayUnusedObjects; to see them. "); @@ -6355,8 +6412,10 @@ namespace RefrigeratedCase { if ((NumUnusedGasCoolers > 0) && (!state.dataGlobal->DisplayExtraWarnings)) { // write to error file, // summary number of unused gas coolers given if DataGlobals::DisplayExtraWarnings option not selected - ShowWarningError(state, RoutineName + "Refrigeration gas cooler -> " + General::RoundSigDigits(NumUnusedGasCoolers) + - " unused refrigeration gas cooler(s) found during input processing."); + ShowWarningError(state, + format("{}Refrigeration gas cooler -> {} unused refrigeration gas cooler(s) found during input processing.", + RoutineName, + NumUnusedGasCoolers)); ShowContinueError(state, " These refrigeration gas coolers are in the input file but are not connected to a refrigeration system."); ShowContinueError(state, " These unused refrigeration gas coolers will not be simulated."); ShowContinueError(state, " Use Output:Diagnostics,DisplayUnusedObjects; to see them. "); @@ -11260,7 +11319,7 @@ namespace RefrigeratedCase { if (NumIter < 2) continue; if ((this->RefMassFlowReceiverBypass == 0.0) || (MassFlowStart == 0.0)) { ShowSevereError(state, "Refrigeration:TranscriticalSystem: " + this->Name + " showing zero refrigerant flow through receiver bypass."); - ShowContinueError(state, "Receiver Bypass Flow = " + General::RoundSigDigits(this->RefMassFlowReceiverBypass, 6)); + ShowContinueError(state, format("Receiver Bypass Flow = {:.6R}", this->RefMassFlowReceiverBypass)); ShowContinueError(state, "Check input file to ensure that refrigeration loads on this system are not zero."); } else { ErrorMassFlow = std::abs(MassFlowStart - this->RefMassFlowReceiverBypass) / MassFlowStart; @@ -14269,13 +14328,19 @@ namespace RefrigeratedCase { } else { // airchllersetpointer passed in call to subroutine not ==0 ChillerSetID = AirChillerSetPtr; if (ChillerSetID > DataHeatBalance::NumRefrigChillerSets || ChillerSetID < 1) { - ShowFatalError(state, "SimAirChillerSet: Invalid AirChillerSetPtr passed=" + General::TrimSigDigits(ChillerSetID) + ", Number of Units=" + - General::TrimSigDigits(DataHeatBalance::NumRefrigChillerSets) + ", Entered Unit name=" + AirChillerSetName); + ShowFatalError(state, + format("SimAirChillerSet: Invalid AirChillerSetPtr passed={}, Number of Units={}, Entered Unit name={}", + ChillerSetID, + DataHeatBalance::NumRefrigChillerSets, + AirChillerSetName)); } // ChillerSetID makes no sense if (CheckChillerSetName(ChillerSetID)) { if (AirChillerSetName != AirChillerSet(ChillerSetID).Name) { - ShowFatalError(state, "SimAirChillerSet: Invalid AirChillerSetPtr passed=" + General::TrimSigDigits(ChillerSetID) + - ", Unit name=" + AirChillerSetName + ", stored Unit Name for that index=" + AirChillerSet(ChillerSetID).Name); + ShowFatalError(state, + format("SimAirChillerSet: Invalid AirChillerSetPtr passed={}, Unit name={}, stored Unit Name for that index={}", + ChillerSetID, + AirChillerSetName, + AirChillerSet(ChillerSetID).Name)); } // name not equal correct name CheckChillerSetName(ChillerSetID) = false; } // CheckChillerSetName logical test diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index cf095990332..d1f455c35e4 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -1138,6 +1137,14 @@ void ReportCoilSelection::setCoilLvgAirHumRat(EnergyPlusData &state, c->coilDesLvgHumRat = lvgAirHumRat; } +std::string PeakHrMinString(EnergyPlusData &state, const int designDay, const int timeStepAtPeak) +{ + return fmt::format("{}/{} {}", + state.dataWeatherManager->DesDayInput(designDay).Month, + state.dataWeatherManager->DesDayInput(designDay).DayOfMonth, + ReportCoilSelection::getTimeText(state, timeStepAtPeak)); +} + void ReportCoilSelection::setCoilCoolingCapacity( EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil @@ -1168,6 +1175,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->zoneEqNum = curZoneEqNum; // if ( c->zoneEqNum > 0 ) doZoneEqSetup( index ); c->oASysNum = curOASysNum; + if (curSysNum > 0 && c->zoneEqNum == 0 && allocated(DataSizing::FinalSysSizing) && allocated(DataSizing::SysSizPeakDDNum)) { // These next blocks does not always work with SizingPeriod:WeatherFileDays or SizingPeriod:WeatherFileConditionType, protect against hard @@ -1176,26 +1184,26 @@ void ReportCoilSelection::setCoilCoolingCapacity( DataSizing::SysSizPeakDDNum(curSysNum).SensCoolPeakDD <= DataEnvironment::TotDesDays) { c->desDayNameAtSensPeak = state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(curSysNum).SensCoolPeakDD).Title; c->coilSensePeakHrMin = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(curSysNum).SensCoolPeakDD).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(curSysNum).SensCoolPeakDD).DayOfMonth) + " " + - getTimeText(state, DataSizing::SysSizPeakDDNum(curSysNum).TimeStepAtSensCoolPk(DataSizing::SysSizPeakDDNum(curSysNum).SensCoolPeakDD)); + PeakHrMinString(state, + DataSizing::SysSizPeakDDNum(curSysNum).SensCoolPeakDD, + DataSizing::SysSizPeakDDNum(curSysNum).TimeStepAtSensCoolPk(DataSizing::SysSizPeakDDNum(curSysNum).SensCoolPeakDD)); } if (DataSizing::SysSizPeakDDNum(curSysNum).TotCoolPeakDD > 0 && DataSizing::SysSizPeakDDNum(curSysNum).TotCoolPeakDD <= DataEnvironment::TotDesDays) { c->desDayNameAtTotalPeak = state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(curSysNum).TotCoolPeakDD).Title; c->coilTotalPeakHrMin = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(curSysNum).TotCoolPeakDD).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(curSysNum).TotCoolPeakDD).DayOfMonth) + " " + - getTimeText(state, DataSizing::SysSizPeakDDNum(curSysNum).TimeStepAtTotCoolPk(DataSizing::SysSizPeakDDNum(curSysNum).TotCoolPeakDD)); + PeakHrMinString(state, + DataSizing::SysSizPeakDDNum(curSysNum).TotCoolPeakDD, + DataSizing::SysSizPeakDDNum(curSysNum).TimeStepAtTotCoolPk(DataSizing::SysSizPeakDDNum(curSysNum).TotCoolPeakDD)); } if (DataSizing::SysSizPeakDDNum(curSysNum).CoolFlowPeakDD > 0 && DataSizing::SysSizPeakDDNum(curSysNum).CoolFlowPeakDD <= DataEnvironment::TotDesDays) { c->desDayNameAtAirFlowPeak = state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(curSysNum).CoolFlowPeakDD).Title; c->airPeakHrMin = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(curSysNum).CoolFlowPeakDD).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(curSysNum).CoolFlowPeakDD).DayOfMonth) + " " + - getTimeText(state, DataSizing::SysSizPeakDDNum(curSysNum).TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(curSysNum).CoolFlowPeakDD)); + PeakHrMinString(state, + DataSizing::SysSizPeakDDNum(curSysNum).CoolFlowPeakDD, + DataSizing::SysSizPeakDDNum(curSysNum).TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(curSysNum).CoolFlowPeakDD)); } if (DataSizing::FinalSysSizing(curSysNum).CoolingPeakLoadType == DataSizing::TotalCoolingLoad) { @@ -1337,13 +1345,10 @@ void ReportCoilSelection::setCoilCoolingCapacity( Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, DataEnvironment::StdBaroPress) * 100.0; // convert to percentage if (DataSizing::FinalZoneSizing(curZoneEqNum).CoolDDNum > 0 && DataSizing::FinalZoneSizing(curZoneEqNum).CoolDDNum <= DataEnvironment::TotDesDays) { - c->coilSensePeakHrMin = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalZoneSizing(curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalZoneSizing(curZoneEqNum).CoolDDNum).DayOfMonth) + " " + - getTimeText(state, DataSizing::FinalZoneSizing(curZoneEqNum).TimeStepNumAtCoolMax); - c->airPeakHrMin = General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalZoneSizing(curZoneEqNum).CoolDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalZoneSizing(curZoneEqNum).CoolDDNum).DayOfMonth) + - " " + getTimeText(state, DataSizing::FinalZoneSizing(curZoneEqNum).TimeStepNumAtCoolMax); + c->coilSensePeakHrMin = PeakHrMinString( + state, DataSizing::FinalZoneSizing(curZoneEqNum).CoolDDNum, DataSizing::FinalZoneSizing(curZoneEqNum).TimeStepNumAtCoolMax); + c->airPeakHrMin = PeakHrMinString( + state, DataSizing::FinalZoneSizing(curZoneEqNum).CoolDDNum, DataSizing::FinalZoneSizing(curZoneEqNum).TimeStepNumAtCoolMax); } c->rmSensibleAtPeak = DataSizing::FinalZoneSizing(curZoneEqNum).DesCoolLoad; @@ -1509,12 +1514,12 @@ void ReportCoilSelection::setCoilHeatingCapacity( } if (DataSizing::FinalSysSizing(curSysNum).HeatDDNum > 0 && DataSizing::FinalSysSizing(curSysNum).HeatDDNum <= DataEnvironment::TotDesDays) { - c->coilSensePeakHrMin = General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalSysSizing(curSysNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalSysSizing(curSysNum).HeatDDNum).DayOfMonth) + - " " + getTimeText(state, DataSizing::FinalSysSizing(curSysNum).SysHeatCoilTimeStepPk); - c->airPeakHrMin = General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalSysSizing(curSysNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalSysSizing(curSysNum).HeatDDNum).DayOfMonth) + " " + - getTimeText(state, DataSizing::FinalSysSizing(curSysNum).SysHeatAirTimeStepPk); + c->coilSensePeakHrMin = + PeakHrMinString(state, DataSizing::FinalSysSizing(curSysNum).HeatDDNum, DataSizing::FinalSysSizing(curSysNum).SysHeatCoilTimeStepPk); + + c->airPeakHrMin = + PeakHrMinString(state, DataSizing::FinalSysSizing(curSysNum).HeatDDNum, DataSizing::FinalSysSizing(curSysNum).SysHeatAirTimeStepPk); + c->desDayNameAtAirFlowPeak = state.dataWeatherManager->DesDayInput(DataSizing::FinalSysSizing(curSysNum).HeatDDNum).Title; } @@ -1564,13 +1569,10 @@ void ReportCoilSelection::setCoilHeatingCapacity( Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, DataEnvironment::StdBaroPress) * 100.0; // convert to percentage if (DataSizing::FinalZoneSizing(curZoneEqNum).HeatDDNum > 0 && DataSizing::FinalZoneSizing(curZoneEqNum).HeatDDNum <= DataEnvironment::TotDesDays) { - c->coilSensePeakHrMin = - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalZoneSizing(curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalZoneSizing(curZoneEqNum).HeatDDNum).DayOfMonth) + " " + - getTimeText(state, DataSizing::FinalZoneSizing(curZoneEqNum).TimeStepNumAtHeatMax); - c->airPeakHrMin = General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalZoneSizing(curZoneEqNum).HeatDDNum).Month) + "/" + - General::TrimSigDigits(state.dataWeatherManager->DesDayInput(DataSizing::FinalZoneSizing(curZoneEqNum).HeatDDNum).DayOfMonth) + - " " + getTimeText(state, DataSizing::FinalZoneSizing(curZoneEqNum).TimeStepNumAtHeatMax); + c->coilSensePeakHrMin = PeakHrMinString( + state, DataSizing::FinalZoneSizing(curZoneEqNum).HeatDDNum, DataSizing::FinalZoneSizing(curZoneEqNum).TimeStepNumAtHeatMax); + c->airPeakHrMin = PeakHrMinString( + state, DataSizing::FinalZoneSizing(curZoneEqNum).HeatDDNum, DataSizing::FinalZoneSizing(curZoneEqNum).TimeStepNumAtHeatMax); } c->desDayNameAtAirFlowPeak = DataSizing::FinalZoneSizing(curZoneEqNum).HeatDesDay; diff --git a/src/EnergyPlus/ReportCoilSelection.hh b/src/EnergyPlus/ReportCoilSelection.hh index fd7f4b28e7e..4a448d3a5b5 100644 --- a/src/EnergyPlus/ReportCoilSelection.hh +++ b/src/EnergyPlus/ReportCoilSelection.hh @@ -409,7 +409,7 @@ public: // methods DataAirSystems::fanModelTypeEnum const &fanEnumType, int const &fanIndex); - std::string getTimeText(EnergyPlusData &state, int const timeStepAtPeak); + static std::string getTimeText(EnergyPlusData &state, int const timeStepAtPeak); bool isCompTypeFan(std::string const &compType // string component type, input object class name ); diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index af49aba0d57..71dd9c6c046 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -274,7 +274,7 @@ namespace RoomAirModelAirflowNetwork { using DataLoopNode::NumOfNodes; using DataZoneEquipment::ZoneEquipConfig; using DataZoneEquipment::ZoneEquipList; - using General::RoundSigDigits; + using InternalHeatGains::SumInternalLatentGainsByTypes; using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -505,7 +505,7 @@ namespace RoomAirModelAirflowNetwork { ShowContinueError(state, "Entered in " + ZoneEquipList(LoopZone).EquipName(I) + " defined in RoomAir:Node:AirflowNetwork:HVACEquipment"); ShowContinueError(state, "The Fraction of supply fraction values across all the roomair nodes in a zone needs to sum to 1.0."); - ShowContinueError(state, "The sum of fractions entered = " + RoundSigDigits(SupplyFrac(I), 3)); + ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SupplyFrac(I))); ErrorsFound = true; } if (std::abs(ReturnFrac(I) - 1.0) > 0.001) { @@ -513,7 +513,7 @@ namespace RoomAirModelAirflowNetwork { ShowContinueError(state, "Entered in " + ZoneEquipList(LoopZone).EquipName(I) + " defined in RoomAir:Node:AirflowNetwork:HVACEquipment"); ShowContinueError(state, "The Fraction of return fraction values across all the roomair nodes in a zone needs to sum to 1.0."); - ShowContinueError(state, "The sum of fractions entered = " + RoundSigDigits(ReturnFrac(I), 3)); + ShowContinueError(state, format("The sum of fractions entered = {:.3R}", ReturnFrac(I))); ErrorsFound = true; } } diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 91700029704..0b9b1b925e0 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -109,7 +109,6 @@ namespace RoomAirModelManager { // Using/Aliasing using namespace DataRoomAirModel; - using General::RoundSigDigits; // Data // MODULE PARAMETER DEFINITIONS @@ -322,7 +321,7 @@ namespace RoomAirModelManager { using DataSurfaces::Surface; using DataZoneEquipment::EquipConfiguration; using DataZoneEquipment::ZoneEquipConfig; - using General::RoundSigDigits; + using RoomAirModelUserTempPattern::FigureNDheightInZone; using ScheduleManager::GetScheduleIndex; @@ -612,15 +611,18 @@ namespace RoomAirModelManager { } if (TotalRoomAirPatternTooLow > 0) { - ShowWarningError(state, "GetUserDefinedPatternData: RoomAirModelUserTempPattern: " + RoundSigDigits(TotalRoomAirPatternTooLow) + - " problem(s) in non-dimensional height calculations, too low surface height(s) in relation to floor height of zone(s)."); + ShowWarningError(state, + format("GetUserDefinedPatternData: RoomAirModelUserTempPattern: {} problem(s) in non-dimensional height calculations, " + "too low surface height(s) in relation to floor height of zone(s).", + TotalRoomAirPatternTooLow)); ShowContinueError(state, "...Use OutputDiagnostics,DisplayExtraWarnings; to see details."); TotalWarningErrors += TotalRoomAirPatternTooLow; } if (TotalRoomAirPatternTooHigh > 0) { ShowWarningError(state, - "GetUserDefinedPatternData: RoomAirModelUserTempPattern: " + RoundSigDigits(TotalRoomAirPatternTooHigh) + - " problem(s) in non-dimensional height calculations, too high surface height(s) in relation to ceiling height of zone(s)."); + format("GetUserDefinedPatternData: RoomAirModelUserTempPattern: {} problem(s) in non-dimensional height calculations, " + "too high surface height(s) in relation to ceiling height of zone(s).", + TotalRoomAirPatternTooHigh)); ShowContinueError(state, "...Use OutputDiagnostics,DisplayExtraWarnings; to see details."); TotalWarningErrors += TotalRoomAirPatternTooHigh; } @@ -1060,7 +1062,6 @@ namespace RoomAirModelManager { using DataSurfaces::Surface; using DataHeatBalance::People; using DataHeatBalance::TotPeople; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int IOStat; @@ -1183,8 +1184,10 @@ namespace RoomAirModelManager { AirModel(ThisZone).AirModelType = RoomAirModel_Mixing; ShowWarningError(state, "Problem with " + cCurrentModuleObject + " = " + cAlphaArgs(1)); ShowWarningError(state, "Roomair model will not be applied for Zone=" + cAlphaArgs(1) + '.'); - ShowContinueError(state, "AirflowNetwrok:Multizone:Surface crack object must have an air flow coefficient = 0.5, value was=" + - RoundSigDigits(AirflowNetwork::MultizoneSurfaceCrackData(TypeNum).FlowExpo, 2)); + ShowContinueError( + state, + format("AirflowNetwrok:Multizone:Surface crack object must have an air flow coefficient = 0.5, value was={:.2R}", + AirflowNetwork::MultizoneSurfaceCrackData(TypeNum).FlowExpo)); } } } @@ -1398,7 +1401,6 @@ namespace RoomAirModelManager { using DataHVACGlobals::NumZoneHVACTerminalTypes; using DataHVACGlobals::ZoneHVACTerminalTypes; using DataSurfaces::Surface; - using General::RoundSigDigits; using InternalHeatGains::GetInternalGainDeviceIndex; using ScheduleManager::GetScheduleIndex; @@ -1630,8 +1632,9 @@ namespace RoomAirModelManager { state, cCurrentModuleObject, Loop, cAlphaArgs, NumAlphas, rNumericArgs, NumNumbers, status, _, _, cAlphaFieldNames, cNumericFieldNames); if (mod((NumAlphas + NumNumbers - 1), 3) != 0) { ShowSevereError(state, "GetRoomAirflowNetworkData: For " + cCurrentModuleObject + ": " + cAlphaArgs(1)); - ShowContinueError(state, "Extensible field set are not evenly divisable by 3. Number of data entries = " + - RoundSigDigits(NumAlphas + NumNumbers - 1)); + ShowContinueError(state, + "Extensible field set are not evenly divisable by 3. Number of data entries = " + + fmt::to_string(NumAlphas + NumNumbers - 1)); ErrorsFound = true; break; } @@ -1701,8 +1704,9 @@ namespace RoomAirModelManager { state, cCurrentModuleObject, Loop, cAlphaArgs, NumAlphas, rNumericArgs, NumNumbers, status, _, _, cAlphaFieldNames, cNumericFieldNames); if (mod((NumAlphas + NumNumbers - 1), 4) != 0) { ShowSevereError(state, "GetRoomAirflowNetworkData: For " + cCurrentModuleObject + ": " + cAlphaArgs(1)); - ShowContinueError(state, "Extensible field set are not evenly divisable by 4. Number of data entries = " + - RoundSigDigits(NumAlphas + NumNumbers - 1)); + ShowContinueError(state, + "Extensible field set are not evenly divisable by 4. Number of data entries = " + + fmt::to_string(NumAlphas + NumNumbers - 1)); ErrorsFound = true; break; } @@ -1792,7 +1796,7 @@ namespace RoomAirModelManager { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, zone volume fractions do not sum to 1.0"); ShowContinueError(state, "Entered in RoomAir:Node:AirflowNetwork with Zone Name = " + Zone(ZoneNum).Name); ShowContinueError(state, "The Fraction of Zone Air Volume values across all the nodes needs to sum to 1.0."); - ShowContinueError(state, "The sum of fractions entered = " + RoundSigDigits(SumFraction, 3)); + ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SumFraction)); ErrorsFound = true; } // Check internal gain fraction @@ -1818,7 +1822,7 @@ namespace RoomAirModelManager { ShowContinueError(state, "Entered in RoomAir:Node:AirflowNetwork with Zone Name = " + Zone(ZoneNum).Name + ", Intrnal gain name = " + Name); ShowContinueError(state, "The Fraction of internal gain across all the nodes needs to sum to 1.0."); - ShowContinueError(state, "The sum of fractions entered = " + RoundSigDigits(SumFraction, 3)); + ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SumFraction)); ErrorsFound = true; } } @@ -2084,9 +2088,9 @@ namespace RoomAirModelManager { if (std::abs((Z2Zone - Z1Zone) - Zone(ZNum).CeilingHeight) > CeilingHeightDiffMax) { ShowWarningError(state, "RoomAirManager: Inconsistent ceiling heights in Zone: " + Zone(ZNum).Name); - ShowContinueError(state, "Lowest height=[" + RoundSigDigits(Z1Zone, 3) + "]."); - ShowContinueError(state, "Highest height=[" + RoundSigDigits(Z2Zone, 3) + "]."); - ShowContinueError(state, "Ceiling height=[" + RoundSigDigits(Zone(ZNum).CeilingHeight, 3) + "]."); + ShowContinueError(state, format("Lowest height=[{:.3R}].", Z1Zone)); + ShowContinueError(state, format("Highest height=[{:.3R}].", Z2Zone)); + ShowContinueError(state, format("Ceiling height=[{:.3R}].", Zone(ZNum).CeilingHeight)); } } // Zones diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index 47d2b0d0434..733341c1c15 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -349,7 +349,7 @@ namespace RoomAirModelUserTempPattern { if (CurPatrnID == 0) { // throw error here ? way to test schedules before getting to this point? - ShowFatalError(state, "User defined room air pattern index not found: " + std::to_string(CurntPatternKey)); + ShowFatalError(state, format("User defined room air pattern index not found: {}", CurntPatternKey)); return; } @@ -833,7 +833,6 @@ namespace RoomAirModelUserTempPattern { using DataHeatBalance::Zone; using DataSurfaces::Surface; using DataVectorTypes::Vector; - using General::RoundSigDigits; // Return value Real64 FigureNDheightInZone; @@ -914,8 +913,8 @@ namespace RoomAirModelUserTempPattern { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "RoomAirModelUserTempPattern: Problem in non-dimensional height calculation"); ShowContinueError(state, "too low surface: " + Surface(thisHBsurf).Name + " in zone: " + Zone(thisZone).Name); - ShowContinueError(state, "**** Average floor height of zone is: " + RoundSigDigits(ZoneZorig, 3)); - ShowContinueError(state, "**** Surface minimum height is: " + RoundSigDigits(SurfMinZ, 3)); + ShowContinueError(state, format("**** Average floor height of zone is: {:.3R}", ZoneZorig)); + ShowContinueError(state, format("**** Surface minimum height is: {:.3R}", SurfMinZ)); } else { ++TotalRoomAirPatternTooLow; } @@ -925,8 +924,8 @@ namespace RoomAirModelUserTempPattern { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "RoomAirModelUserTempPattern: Problem in non-dimensional height calculation"); ShowContinueError(state, " too high surface: " + Surface(thisHBsurf).Name + " in zone: " + Zone(thisZone).Name); - ShowContinueError(state, "**** Average Ceiling height of zone is: " + RoundSigDigits((ZoneZorig + ZoneCeilHeight), 3)); - ShowContinueError(state, "**** Surface Maximum height is: " + RoundSigDigits(SurfMaxZ, 3)); + ShowContinueError(state, format("**** Average Ceiling height of zone is: {:.3R}", (ZoneZorig + ZoneCeilHeight))); + ShowContinueError(state, format("**** Surface Maximum height is: {:.3R}", SurfMaxZ)); } else { ++TotalRoomAirPatternTooHigh; } diff --git a/src/EnergyPlus/RootFinder.cc b/src/EnergyPlus/RootFinder.cc index 86dc82d9d23..6412f438fb0 100644 --- a/src/EnergyPlus/RootFinder.cc +++ b/src/EnergyPlus/RootFinder.cc @@ -52,7 +52,6 @@ #include // EnergyPlus Headers -#include #include #include #include @@ -175,7 +174,6 @@ namespace RootFinder { // Use statements for data only modules // Using/Aliasing using namespace DataRootFinder; - using General::TrimSigDigits; // Data // MODULE PARAMETER DEFINITIONS @@ -243,8 +241,8 @@ namespace RootFinder { // Load assumed action for underlying function F(X) if (SlopeType != iSlopeIncreasing && SlopeType != iSlopeDecreasing) { ShowSevereError(state, "SetupRootFinder: Invalid function slope specification. Valid choices are:"); - ShowContinueError(state, "SetupRootFinder: iSlopeIncreasing=" + TrimSigDigits(iSlopeIncreasing)); - ShowContinueError(state, "SetupRootFinder: iSlopeDecreasing=" + TrimSigDigits(iSlopeDecreasing)); + ShowContinueError(state, format("SetupRootFinder: iSlopeIncreasing={}", iSlopeIncreasing)); + ShowContinueError(state, format("SetupRootFinder: iSlopeDecreasing={}", iSlopeDecreasing)); ShowFatalError(state, "SetupRootFinder: Preceding error causes program termination."); } RootFinderData.Controls.SlopeType = SlopeType; @@ -253,10 +251,10 @@ namespace RootFinder { if (MethodType != iMethodBisection && MethodType != iMethodFalsePosition && MethodType != iMethodSecant && MethodType != iMethodBrent) { ShowSevereError(state, "SetupRootFinder: Invalid solution method specification. Valid choices are:"); - ShowContinueError(state, "SetupRootFinder: iMethodBisection=" + TrimSigDigits(iMethodBisection)); - ShowContinueError(state, "SetupRootFinder: iMethodFalsePosition=" + TrimSigDigits(iMethodFalsePosition)); - ShowContinueError(state, "SetupRootFinder: iMethodSecant=" + TrimSigDigits(iMethodSecant)); - ShowContinueError(state, "SetupRootFinder: iMethodBrent=" + TrimSigDigits(iMethodBrent)); + ShowContinueError(state, format("SetupRootFinder: iMethodBisection={}", iMethodBisection)); + ShowContinueError(state, format("SetupRootFinder: iMethodFalsePosition={}", iMethodFalsePosition)); + ShowContinueError(state, format("SetupRootFinder: iMethodSecant={}", iMethodSecant)); + ShowContinueError(state, format("SetupRootFinder: iMethodBrent={}", iMethodBrent)); ShowFatalError(state, "SetupRootFinder: Preceding error causes program termination."); } RootFinderData.Controls.MethodType = MethodType; @@ -416,8 +414,8 @@ namespace RootFinder { if (XMax == 0.0) { XMinReset = XMax; } else { - ShowFatalError(state, "InitializeRootFinder: Invalid min/max bounds XMin=" + TrimSigDigits(XMin, 6) + - " must be smaller than XMax=" + TrimSigDigits(XMax, 6)); + ShowFatalError(state, + format("InitializeRootFinder: Invalid min/max bounds XMin={:.6T} must be smaller than XMax={:.6T}", XMin, XMax)); } } @@ -758,8 +756,8 @@ namespace RootFinder { } else { // Should never happen ShowSevereError(state, "CheckInternalConsistency: Invalid function slope specification. Valid choices are:"); - ShowContinueError(state, "CheckInternalConsistency: iSlopeIncreasing=" + TrimSigDigits(iSlopeIncreasing)); - ShowContinueError(state, "CheckInternalConsistency: iSlopeDecreasing=" + TrimSigDigits(iSlopeDecreasing)); + ShowContinueError(state, format("CheckInternalConsistency: iSlopeIncreasing={}", iSlopeIncreasing)); + ShowContinueError(state, format("CheckInternalConsistency: iSlopeDecreasing={}", iSlopeDecreasing)); ShowFatalError(state, "CheckInternalConsistency: Preceding error causes program termination."); } } @@ -793,8 +791,8 @@ namespace RootFinder { } else { // Should never happen ShowSevereError(state, "CheckInternalConsistency: Invalid function slope specification. Valid choices are:"); - ShowContinueError(state, "CheckInternalConsistency: iSlopeIncreasing=" + TrimSigDigits(iSlopeIncreasing)); - ShowContinueError(state, "CheckInternalConsistency: iSlopeDecreasing=" + TrimSigDigits(iSlopeDecreasing)); + ShowContinueError(state, format("CheckInternalConsistency: iSlopeIncreasing={}", iSlopeIncreasing)); + ShowContinueError(state, format("CheckInternalConsistency: iSlopeDecreasing={}", iSlopeDecreasing)); ShowFatalError(state, "CheckInternalConsistency: Preceding error causes program termination."); } } @@ -819,8 +817,8 @@ namespace RootFinder { } else { // Should never happen ShowSevereError(state, "CheckInternalConsistency: Invalid function slope specification. Valid choices are:"); - ShowContinueError(state, "CheckInternalConsistency: iSlopeIncreasing=" + TrimSigDigits(iSlopeIncreasing)); - ShowContinueError(state, "CheckInternalConsistency: iSlopeDecreasing=" + TrimSigDigits(iSlopeDecreasing)); + ShowContinueError(state, format("CheckInternalConsistency: iSlopeIncreasing={}", iSlopeIncreasing)); + ShowContinueError(state, format("CheckInternalConsistency: iSlopeDecreasing={}", iSlopeDecreasing)); ShowFatalError(state, "CheckInternalConsistency: Preceding error causes program termination."); } } @@ -1078,8 +1076,8 @@ namespace RootFinder { } else { // Should never happen ShowSevereError(state, "CheckSlope: Invalid function slope specification. Valid choices are:"); - ShowContinueError(state, "CheckSlope: iSlopeIncreasing=" + TrimSigDigits(iSlopeIncreasing)); - ShowContinueError(state, "CheckSlope: iSlopeDecreasing=" + TrimSigDigits(iSlopeDecreasing)); + ShowContinueError(state, format("CheckSlope: iSlopeIncreasing={}", iSlopeIncreasing)); + ShowContinueError(state, format("CheckSlope: iSlopeDecreasing={}", iSlopeDecreasing)); ShowFatalError(state, "CheckSlope: Preceding error causes program termination."); } } @@ -1222,8 +1220,8 @@ namespace RootFinder { } else { // Should never happen ShowSevereError(state, "CheckMinConstraint: Invalid function slope specification. Valid choices are:"); - ShowContinueError(state, "CheckMinConstraint: iSlopeIncreasing=" + TrimSigDigits(iSlopeIncreasing)); - ShowContinueError(state, "CheckMinConstraint: iSlopeDecreasing=" + TrimSigDigits(iSlopeDecreasing)); + ShowContinueError(state, format("CheckMinConstraint: iSlopeIncreasing={}", iSlopeIncreasing)); + ShowContinueError(state, format("CheckMinConstraint: iSlopeDecreasing={}", iSlopeDecreasing)); ShowFatalError(state, "CheckMinConstraint: Preceding error causes program termination."); } } @@ -1296,8 +1294,8 @@ namespace RootFinder { } else { // Should never happen ShowSevereError(state, "CheckMaxConstraint: Invalid function slope specification. Valid choices are:"); - ShowContinueError(state, "CheckMaxConstraint: iSlopeIncreasing=" + TrimSigDigits(iSlopeIncreasing)); - ShowContinueError(state, "CheckMaxConstraint: iSlopeDecreasing=" + TrimSigDigits(iSlopeDecreasing)); + ShowContinueError(state, format("CheckMaxConstraint: iSlopeIncreasing={}", iSlopeIncreasing)); + ShowContinueError(state, format("CheckMaxConstraint: iSlopeDecreasing={}", iSlopeDecreasing)); ShowFatalError(state, "CheckMaxConstraint: Preceding error causes program termination."); } } @@ -1551,9 +1549,10 @@ namespace RootFinder { } else { // Should never happen if CheckLowerUpperBracket() is called before ShowSevereError(state, "UpdateBracket: Current iterate is smaller than the lower bracket."); - ShowContinueError(state, "UpdateBracket: X=" + TrimSigDigits(X, 15) + ", Y=" + TrimSigDigits(Y, 15)); - ShowContinueError(state, "UpdateBracket: XLower=" + TrimSigDigits(RootFinderData.LowerPoint.X, 15) + - ", YLower=" + TrimSigDigits(RootFinderData.LowerPoint.Y, 15)); + ShowContinueError(state, format("UpdateBracket: X={:.15T}, Y={:.15T}", X, Y)); + ShowContinueError( + state, + format("UpdateBracket: XLower={:.15T}, YLower={:.15T}", RootFinderData.LowerPoint.X, RootFinderData.LowerPoint.Y)); ShowFatalError(state, "UpdateBracket: Preceding error causes program termination."); } } @@ -1577,9 +1576,10 @@ namespace RootFinder { } else { // Should never happen if CheckLowerUpperBracket() is called before ShowSevereError(state, "UpdateBracket: Current iterate is greater than the upper bracket."); - ShowContinueError(state, "UpdateBracket: X=" + TrimSigDigits(X, 15) + ", Y=" + TrimSigDigits(Y, 15)); - ShowContinueError(state, "UpdateBracket: XUpper=" + TrimSigDigits(RootFinderData.UpperPoint.X, 15) + - ", YUpper=" + TrimSigDigits(RootFinderData.UpperPoint.Y, 15)); + ShowContinueError(state, format("UpdateBracket: X={:.15T}, Y={:.15T}", X, Y)); + ShowContinueError( + state, + format("UpdateBracket: XUpper={:.15T}, YUpper={:.15T}", RootFinderData.UpperPoint.X, RootFinderData.UpperPoint.Y)); ShowFatalError(state, "UpdateBracket: Preceding error causes program termination."); } } @@ -1606,9 +1606,10 @@ namespace RootFinder { } else { // Should never happen if CheckLowerUpperBracket() is called before ShowSevereError(state, "UpdateBracket: Current iterate is smaller than the lower bracket."); - ShowContinueError(state, "UpdateBracket: X=" + TrimSigDigits(X, 15) + ", Y=" + TrimSigDigits(Y, 15)); - ShowContinueError(state, "UpdateBracket: XLower=" + TrimSigDigits(RootFinderData.LowerPoint.X, 15) + - ", YLower=" + TrimSigDigits(RootFinderData.LowerPoint.Y, 15)); + ShowContinueError(state, format("UpdateBracket: X={:.15T}, Y={:.15T}", X, Y)); + ShowContinueError( + state, + format("UpdateBracket: XLower={:.15T}, YLower={:.15T}", RootFinderData.LowerPoint.X, RootFinderData.LowerPoint.Y)); ShowFatalError(state, "UpdateBracket: Preceding error causes program termination."); } } @@ -1632,9 +1633,10 @@ namespace RootFinder { } else { // Should never happen if CheckLowerUpperBracket() is called before ShowSevereError(state, "UpdateBracket: Current iterate is greater than the upper bracket."); - ShowContinueError(state, "UpdateBracket: X=" + TrimSigDigits(X, 15) + ", Y=" + TrimSigDigits(Y, 15)); - ShowContinueError(state, "UpdateBracket: XUpper=" + TrimSigDigits(RootFinderData.UpperPoint.X, 15) + - ", YUpper=" + TrimSigDigits(RootFinderData.UpperPoint.Y, 15)); + ShowContinueError(state, format("UpdateBracket: X={:.15T}, Y={:.15T}", X, Y)); + ShowContinueError( + state, + format("UpdateBracket: XUpper={:.15T}, YUpper={:.15T}", RootFinderData.UpperPoint.X, RootFinderData.UpperPoint.Y)); ShowFatalError(state, "UpdateBracket: Preceding error causes program termination."); } } @@ -1643,8 +1645,8 @@ namespace RootFinder { } else { // Should never happen ShowSevereError(state, "UpdateBracket: Invalid function slope specification. Valid choices are:"); - ShowContinueError(state, "UpdateBracket: iSlopeIncreasing=" + TrimSigDigits(iSlopeIncreasing)); - ShowContinueError(state, "UpdateBracket: iSlopeDecreasing=" + TrimSigDigits(iSlopeDecreasing)); + ShowContinueError(state, format("UpdateBracket: iSlopeIncreasing={}", iSlopeIncreasing)); + ShowContinueError(state, format("UpdateBracket: iSlopeDecreasing={}", iSlopeDecreasing)); ShowFatalError(state, "UpdateBracket: Preceding error causes program termination."); } } @@ -1997,10 +1999,10 @@ namespace RootFinder { RootFinderData.XCandidate = BrentMethod(RootFinderData); } else { ShowSevereError(state, "AdvanceRootFinder: Invalid solution method specification. Valid choices are:"); - ShowContinueError(state, "AdvanceRootFinder: iMethodBisection=" + TrimSigDigits(iMethodBisection)); - ShowContinueError(state, "AdvanceRootFinder: iMethodFalsePosition=" + TrimSigDigits(iMethodFalsePosition)); - ShowContinueError(state, "AdvanceRootFinder: iMethodSecant=" + TrimSigDigits(iMethodSecant)); - ShowContinueError(state, "AdvanceRootFinder: iMethodBrent=" + TrimSigDigits(iMethodBrent)); + ShowContinueError(state, format("AdvanceRootFinder: iMethodBisection={}", iMethodBisection)); + ShowContinueError(state, format("AdvanceRootFinder: iMethodFalsePosition={}", iMethodFalsePosition)); + ShowContinueError(state, format("AdvanceRootFinder: iMethodSecant={}", iMethodSecant)); + ShowContinueError(state, format("AdvanceRootFinder: iMethodBrent={}", iMethodBrent)); ShowFatalError(state, "AdvanceRootFinder: Preceding error causes program termination."); } } @@ -2557,7 +2559,6 @@ namespace RootFinder { // na // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index ad79f514cbf..65363f93310 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -777,7 +777,7 @@ namespace RuntimeLanguageProcessor { if (NestedIfDepth == 1) { AddError(StackNum, 0, "Missing an ENDIF instruction needed to terminate an earlier IF instruction."); } else if (NestedIfDepth > 1) { - AddError(StackNum, 0, "Missing " + fmt::to_string(NestedIfDepth) + " ENDIF instructions needed to terminate earlier IF instructions."); + AddError(StackNum, 0, format("Missing {} ENDIF instructions needed to terminate earlier IF instructions.", NestedIfDepth)); } // ALLOCATE(DummyError(ErlStack(StackNum)%NumErrors)) @@ -875,7 +875,7 @@ namespace RuntimeLanguageProcessor { ErrorNum = ErlStack(StackNum).NumErrors; if (LineNum > 0) { - ErlStack(StackNum).Error(ErrorNum) = "Line " + fmt::to_string(LineNum) + ": " + Error + " \"" + ErlStack(StackNum).Line(LineNum) + "\""; + ErlStack(StackNum).Error(ErrorNum) = format("Line {}: {} \"{}\"", LineNum, Error, ErlStack(StackNum).Line(LineNum)); } else { ErlStack(StackNum).Error(ErrorNum) = Error; } @@ -1822,8 +1822,6 @@ namespace RuntimeLanguageProcessor { // Using/Aliasing using namespace Psychrometrics; using CurveManager::CurveValue; - using General::RoundSigDigits; - using General::TrimSigDigits; // Return value ErlValueType ReturnValue; @@ -1992,8 +1990,10 @@ namespace RuntimeLanguageProcessor { if (std::isnan(TestValue)) { // throw Error ReturnValue.Type = ValueError; - ReturnValue.Error = "EvaluateExpression: Attempted to raise to power with incompatible numbers: " + - TrimSigDigits(Operand(1).Number, 6) + " raised to " + TrimSigDigits(Operand(2).Number, 6); + ReturnValue.Error = + format("EvaluateExpression: Attempted to raise to power with incompatible numbers: {:.6T} raised to {:.6T}", + Operand(1).Number, + Operand(2).Number); if (!state.dataGlobal->DoingSizing && !state.dataGlobal->KickOffSimulation && !EMSManager::FinishProcessingUserInput) { seriousErrorFound = true; } @@ -2040,8 +2040,8 @@ namespace RuntimeLanguageProcessor { ReturnValue = SetErlValueNumber(0.0); } else { // throw Error - ReturnValue.Error = "EvaluateExpression: Attempted to calculate exponential value of too large a number: " + - TrimSigDigits(Operand(1).Number, 4); + ReturnValue.Error = format("EvaluateExpression: Attempted to calculate exponential value of too large a number: {:.4T}", + Operand(1).Number); ReturnValue.Type = ValueError; if (!state.dataGlobal->DoingSizing && !state.dataGlobal->KickOffSimulation && !EMSManager::FinishProcessingUserInput) { seriousErrorFound = true; @@ -2053,8 +2053,7 @@ namespace RuntimeLanguageProcessor { } else { // throw error, ReturnValue.Type = ValueError; - ReturnValue.Error = - "EvaluateExpression: Natural Log of zero or less! ln of value = " + TrimSigDigits(Operand(1).Number, 4); + ReturnValue.Error = format("EvaluateExpression: Natural Log of zero or less! ln of value = {:.4T}", Operand(1).Number); if (!state.dataGlobal->DoingSizing && !state.dataGlobal->KickOffSimulation && !EMSManager::FinishProcessingUserInput) { seriousErrorFound = true; } @@ -2238,16 +2237,16 @@ namespace RuntimeLanguageProcessor { ShowSevereError(state, "EMS user program found serious problem and is halting simulation"); ShowContinueErrorTimeStamp(state, ""); - ShowFatalError(state, "EMS user program halted simulation with error code = " + TrimSigDigits(Operand(1).Number, 2)); + ShowFatalError(state, format("EMS user program halted simulation with error code = {:.2T}", Operand(1).Number)); ReturnValue = SetErlValueNumber(Operand(1).Number); // returns back the error code } else if (SELECT_CASE_var == FuncSevereWarnEp) { - ShowSevereError(state, "EMS user program issued severe warning with error code = " + TrimSigDigits(Operand(1).Number, 2)); + ShowSevereError(state, format("EMS user program issued severe warning with error code = {:.2T}", Operand(1).Number)); ShowContinueErrorTimeStamp(state, ""); ReturnValue = SetErlValueNumber(Operand(1).Number); // returns back the error code } else if (SELECT_CASE_var == FuncWarnEp) { - ShowWarningError(state, "EMS user program issued warning with error code = " + TrimSigDigits(Operand(1).Number, 2)); + ShowWarningError(state, format("EMS user program issued warning with error code = {:.2T}", Operand(1).Number)); ShowContinueErrorTimeStamp(state, ""); ReturnValue = SetErlValueNumber(Operand(1).Number); // returns back the error code } else if (SELECT_CASE_var == FuncTrendValue) { @@ -2551,9 +2550,10 @@ namespace RuntimeLanguageProcessor { ReturnVal = SetErlValueNumber(TodayTomorrowWeatherSource(iTimeStep, iHour)); } else { ReturnVal.Type = DataRuntimeLanguage::ValueError; - ReturnVal.Error = DataRuntimeLanguage::PossibleOperators(FunctionCode).Symbol + - " function called with invalid arguments: Hour=" + General::RoundSigDigits(Operand1, 1) + - ", Timestep=" + General::RoundSigDigits(Operand2, 1); + ReturnVal.Error = format("{} function called with invalid arguments: Hour={:.1R}, Timestep={:.1R}", + DataRuntimeLanguage::PossibleOperators(FunctionCode).Symbol, + Operand1, + Operand2); } } @@ -2571,9 +2571,10 @@ namespace RuntimeLanguageProcessor { } } else { ReturnVal.Type = DataRuntimeLanguage::ValueError; - ReturnVal.Error = DataRuntimeLanguage::PossibleOperators(FunctionCode).Symbol + - " function called with invalid arguments: Hour=" + General::RoundSigDigits(Operand1, 1) + - ", Timestep=" + General::RoundSigDigits(Operand2, 1); + ReturnVal.Error = format("{} function called with invalid arguments: Hour={:.1R}, Timestep={:.1R}", + DataRuntimeLanguage::PossibleOperators(FunctionCode).Symbol, + Operand1, + Operand2); } } @@ -2621,7 +2622,6 @@ namespace RuntimeLanguageProcessor { // Using/Aliasing using CurveManager::GetCurveIndex; - using General::TrimSigDigits; // Locals // SUBROUTINE PARAMETER DEFINITIONS: @@ -3115,7 +3115,7 @@ namespace RuntimeLanguageProcessor { } } else { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid field."); - ShowContinueError(state, "Invalid " + cNumericFieldNames(1) + '=' + TrimSigDigits(rNumericArgs(1), 2)); + ShowContinueError(state, format("Invalid {}={:.2T}", cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, "must be greater than zero"); ErrorsFound = true; } @@ -3777,7 +3777,6 @@ namespace RuntimeLanguageProcessor { // na // Using/Aliasing - using General::TrimSigDigits; // Return value std::string String; @@ -3794,7 +3793,7 @@ namespace RuntimeLanguageProcessor { if (Value.Number == 0.0) { String = "0.0"; } else { - String = TrimSigDigits(Value.Number, 6); //(String) + String = format("{:.6T}", Value.Number); //(String) } } else if (SELECT_CASE_var == ValueString) { diff --git a/src/EnergyPlus/SQLiteProcedures.cc b/src/EnergyPlus/SQLiteProcedures.cc index 31ea928329b..6ff67d0844c 100644 --- a/src/EnergyPlus/SQLiteProcedures.cc +++ b/src/EnergyPlus/SQLiteProcedures.cc @@ -1158,12 +1158,12 @@ void SQLite::initializeTabularDataTable() sqliteExecuteCommand(sql); - sqliteExecuteCommand("INSERT INTO StringTypes VALUES(" + std::to_string(ReportNameId) + ",'ReportName');"); - sqliteExecuteCommand("INSERT INTO StringTypes VALUES(" + std::to_string(ReportForStringId) + ",'ReportForString');"); - sqliteExecuteCommand("INSERT INTO StringTypes VALUES(" + std::to_string(TableNameId) + ",'TableName');"); - sqliteExecuteCommand("INSERT INTO StringTypes VALUES(" + std::to_string(RowNameId) + ",'RowName');"); - sqliteExecuteCommand("INSERT INTO StringTypes VALUES(" + std::to_string(ColumnNameId) + ",'ColumnName');"); - sqliteExecuteCommand("INSERT INTO StringTypes VALUES(" + std::to_string(UnitsId) + ",'Units');"); + sqliteExecuteCommand(format("INSERT INTO StringTypes VALUES({},'ReportName');", ReportNameId)); + sqliteExecuteCommand(format("INSERT INTO StringTypes VALUES({},'ReportForString');", ReportForStringId)); + sqliteExecuteCommand(format("INSERT INTO StringTypes VALUES({},'TableName');", TableNameId)); + sqliteExecuteCommand(format("INSERT INTO StringTypes VALUES({},'RowName');", RowNameId)); + sqliteExecuteCommand(format("INSERT INTO StringTypes VALUES({},'ColumnName');", ColumnNameId)); + sqliteExecuteCommand(format("INSERT INTO StringTypes VALUES({},'Units');", UnitsId)); const std::string sql2 = "CREATE TABLE Strings ( " "StringIndex INTEGER PRIMARY KEY, " diff --git a/src/EnergyPlus/SZVAVModel.cc b/src/EnergyPlus/SZVAVModel.cc index ad4b40ac21c..89e2dfcd597 100644 --- a/src/EnergyPlus/SZVAVModel.cc +++ b/src/EnergyPlus/SZVAVModel.cc @@ -480,9 +480,11 @@ namespace SZVAVModel { if (SZVAVModel.MaxIterIndex == 0) { ShowWarningMessage(state, MessagePrefix + "Coil control failed to converge for " + SZVAVModel.UnitType + ':' + SZVAVModel.Name); ShowContinueError(state, " Iteration limit exceeded in calculating system sensible part-load ratio."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met = " + General::TrimSigDigits(ZoneLoad, 2) + - " (watts), sensible output = " + General::TrimSigDigits(TempSensOutput, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, + format("Sensible load to be met = {:.2T} (watts), sensible output = {:.2T} (watts), and the simulation continues.", + ZoneLoad, + TempSensOutput)); } ShowRecurringWarningErrorAtEnd(state, SZVAVModel.UnitType + " \"" + SZVAVModel.Name + @@ -495,8 +497,7 @@ namespace SZVAVModel { if (SZVAVModel.RegulaFalsiFailedIndex == 0) { ShowWarningMessage(state, MessagePrefix + "Coil control failed for " + SZVAVModel.UnitType + ':' + SZVAVModel.Name); ShowContinueError(state, " sensible part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met = " + General::TrimSigDigits(ZoneLoad, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp(state, format("Sensible load to be met = {:.2T} (watts), and the simulation continues.", ZoneLoad)); } ShowRecurringWarningErrorAtEnd(state, SZVAVModel.UnitType + " \"" + SZVAVModel.Name + "\" - sensible part-load ratio out of range error continues. Sensible load statistics:", @@ -909,9 +910,11 @@ namespace SZVAVModel { if (SZVAVModel.MaxIterIndex == 0) { ShowWarningMessage(state, MessagePrefix + "Coil control failed to converge for " + SZVAVModel.UnitType + ':' + SZVAVModel.Name); ShowContinueError(state, " Iteration limit exceeded in calculating system sensible part-load ratio."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met = " + General::TrimSigDigits(ZoneLoad, 2) + - " (watts), sensible output = " + General::TrimSigDigits(TempSensOutput, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, + format("Sensible load to be met = {:.2T} (watts), sensible output = {:.2T} (watts), and the simulation continues.", + ZoneLoad, + TempSensOutput)); } ShowRecurringWarningErrorAtEnd(state, SZVAVModel.UnitType + " \"" + SZVAVModel.Name + @@ -924,8 +927,7 @@ namespace SZVAVModel { if (SZVAVModel.RegulaFalsiFailedIndex == 0) { ShowWarningMessage(state, MessagePrefix + "Coil control failed for " + SZVAVModel.UnitType + ':' + SZVAVModel.Name); ShowContinueError(state, " sensible part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met = " + General::TrimSigDigits(ZoneLoad, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp(state, format("Sensible load to be met = {:.2T} (watts), and the simulation continues.", ZoneLoad)); } ShowRecurringWarningErrorAtEnd(state, SZVAVModel.UnitType + " \"" + SZVAVModel.Name + "\" - sensible part-load ratio out of range error continues. Sensible load statistics:", @@ -1329,9 +1331,11 @@ namespace SZVAVModel { if (SZVAVModel.MaxIterIndex == 0) { ShowWarningMessage(state, MessagePrefix + "Coil control failed to converge for " + SZVAVModel.UnitType + ':' + SZVAVModel.Name); ShowContinueError(state, " Iteration limit exceeded in calculating system sensible part-load ratio."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met = " + General::TrimSigDigits(ZoneLoad, 2) + - " (watts), sensible output = " + General::TrimSigDigits(TempSensOutput, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, + format("Sensible load to be met = {:.2T} (watts), sensible output = {:.2T} (watts), and the simulation continues.", + ZoneLoad, + TempSensOutput)); } ShowRecurringWarningErrorAtEnd(state, SZVAVModel.UnitType + " \"" + SZVAVModel.Name + @@ -1344,8 +1348,7 @@ namespace SZVAVModel { if (SZVAVModel.RegulaFalsiFailedIndex == 0) { ShowWarningMessage(state, MessagePrefix + "Coil control failed for " + SZVAVModel.UnitType + ':' + SZVAVModel.Name); ShowContinueError(state, " sensible part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met = " + General::TrimSigDigits(ZoneLoad, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp(state, format("Sensible load to be met = {:.2T} (watts), and the simulation continues.", ZoneLoad)); } ShowRecurringWarningErrorAtEnd(state, SZVAVModel.UnitType + " \"" + SZVAVModel.Name + "\" - sensible part-load ratio out of range error continues. Sensible load statistics:", diff --git a/src/EnergyPlus/ScheduleManager.cc b/src/EnergyPlus/ScheduleManager.cc index ff7a48005d9..56d911258a7 100644 --- a/src/EnergyPlus/ScheduleManager.cc +++ b/src/EnergyPlus/ScheduleManager.cc @@ -228,8 +228,6 @@ namespace ScheduleManager { // Using/Aliasing using General::ProcessDateString; - using General::RoundSigDigits; - using General::TrimSigDigits; using DataStringGlobals::CharComma; using DataStringGlobals::CharSemicolon; using DataStringGlobals::CharSpace; @@ -626,8 +624,13 @@ namespace ScheduleManager { if (errFlag) { ++numerrors; columnValue = 0.0; - ShowWarningError(state, RoutineName + ":\"" + ShadingSunlitFracFileName + "\": found error processing column: " + std::to_string(colCnt) + - ", row:" + std::to_string(rowCnt) + " in " + ShadingSunlitFracFileName + "."); + ShowWarningError(state, + format("{}:\"{}\": found error processing column: {}, row:{} in {}.", + RoutineName, + ShadingSunlitFracFileName, + colCnt, + rowCnt, + ShadingSunlitFracFileName)); ShowContinueError(state, "This value is set to 0."); } CSVAllColumnNameAndValues[colCnt - 1](rowCnt - 1) = columnValue; @@ -639,13 +642,14 @@ namespace ScheduleManager { if (rowCnt - 2 != rowLimitCount) { if (rowCnt - 2 < rowLimitCount) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\" " + std::to_string((rowCnt - 2)) + " data values read."); + ShowSevereError(state, format("{}{}=\"{}\" {} data values read.", RoutineName, CurrentModuleObject, Alphas(1), rowCnt - 2)); } else if (rowCnt - 2 > rowLimitCount) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\" too many data values read."); } - ShowContinueError(state, "Number of rows in the shading file must be a full year multiplied by the simulation TimeStep: " + - std::to_string(rowLimitCount) + "."); + ShowContinueError( + state, + format("Number of rows in the shading file must be a full year multiplied by the simulation TimeStep: {}.", rowLimitCount)); ShowFatalError(state, "Program terminates due to previous condition."); } @@ -653,8 +657,9 @@ namespace ScheduleManager { ScheduleFileShadingProcessed = true; if (numerrors > 0) { - ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\" " + RoundSigDigits(numerrors) + - " records had errors - these values are set to 0."); + ShowWarningError( + state, + format("{}{}=\"{}\" {} records had errors - these values are set to 0.", RoutineName, CurrentModuleObject, Alphas(1), numerrors)); } } @@ -757,14 +762,26 @@ namespace ScheduleManager { if (ScheduleType(LoopIndex).Limited) { if (ScheduleType(LoopIndex).Minimum > ScheduleType(LoopIndex).Maximum) { if (ScheduleType(LoopIndex).IsReal) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", " + cNumericFields(1) + " [" + - RoundSigDigits(ScheduleType(LoopIndex).Minimum, 2) + "] > " + cNumericFields(2) + " [" + - RoundSigDigits(ScheduleType(LoopIndex).Maximum, 2) + "]."); + ShowSevereError(state, + format("{}=\"{}\", {} [{:.2R}] > {} [{:.2R}].", + RoutineName, + CurrentModuleObject, + Alphas(1), + cNumericFields(1), + ScheduleType(LoopIndex).Minimum, + cNumericFields(2), + ScheduleType(LoopIndex).Maximum)); ShowContinueError(state, " Other warning/severes about schedule values may appear."); } else { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", " + cNumericFields(1) + " [" + - RoundSigDigits(ScheduleType(LoopIndex).Minimum, 0) + "] > " + cNumericFields(2) + " [" + - RoundSigDigits(ScheduleType(LoopIndex).Maximum, 0) + "]."); + ShowSevereError(state, + format("{}=\"{}\", {} [{:.0R}] > {} [{:.0R}].", + RoutineName, + CurrentModuleObject, + Alphas(1), + cNumericFields(1), + ScheduleType(LoopIndex).Minimum, + cNumericFields(2), + ScheduleType(LoopIndex).Maximum)); ShowContinueError(state, " Other warning/severes about schedule values may appear."); } } @@ -877,7 +894,7 @@ namespace ScheduleManager { // check to see if numfield=0 if (NumFields == 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", Insufficient data entered for a full schedule day."); - ShowContinueError(state, "...Number of interval fields = = [" + RoundSigDigits(NumFields) + "]."); + ShowContinueError(state, format("...Number of interval fields = = [{}].", NumFields)); ErrorsFound = true; } @@ -1000,31 +1017,31 @@ namespace ScheduleManager { // check to see if there are any fields if (Numbers(1) <= 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", Insufficient data entered for a full schedule day."); - ShowContinueError(state, "...Minutes per Item field = [" + RoundSigDigits(int(Numbers(1))) + "]."); + ShowContinueError(state, format("...Minutes per Item field = [{}].", Numbers(1))); ErrorsFound = true; continue; } if (NumNumbers < 25) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", Insufficient data entered for a full schedule day."); - ShowContinueError(state, "...Minutes per Item field = [" + RoundSigDigits(int(Numbers(1))) + "] and only [" + - RoundSigDigits(NumNumbers - 1) + "] to apply to list fields."); + ShowContinueError(state, + format("...Minutes per Item field = [{}] and only [{}] to apply to list fields.", Numbers(1), NumNumbers - 1)); ErrorsFound = true; continue; } MinutesPerItem = int(Numbers(1)); NumExpectedItems = 1440 / MinutesPerItem; if ((NumNumbers - 1) != NumExpectedItems) { - ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", Number of Entered Items=" + - RoundSigDigits(NumNumbers - 1) + " not equal number of expected items=" + RoundSigDigits(NumExpectedItems)); - ShowContinueError(state, "based on " + cNumericFields(1) + " field value=" + RoundSigDigits(MinutesPerItem)); + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", Number of Entered Items=" + + format("{} not equal number of expected items={}", NumNumbers - 1, NumExpectedItems)); + ShowContinueError(state, format("based on {} field value={}", cNumericFields(1), MinutesPerItem)); ErrorsFound = true; continue; } if (mod(60, MinutesPerItem) != 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1)); - ShowContinueError(state, "Requested " + cNumericFields(1) + " field value (" + RoundSigDigits(MinutesPerItem) + - ") not evenly divisible into 60"); + ShowContinueError(state, format("Requested {} field value ({}) not evenly divisible into 60", cNumericFields(1), MinutesPerItem)); ErrorsFound = true; continue; } @@ -1384,7 +1401,7 @@ namespace ScheduleManager { } ++WkCount; ++AddWeekSch; - WeekSchedule(AddWeekSch).Name = Alphas(1) + "_wk_" + fmt::to_string(WkCount); + WeekSchedule(AddWeekSch).Name = format("{}_wk_{}", Alphas(1), WkCount); WeekSchedule(AddWeekSch).Used = true; for (Hr = StartPointer; Hr <= EndPointer; ++Hr) { Schedule(SchNum).WeekSchedulePointer(Hr) = AddWeekSch; @@ -1400,7 +1417,7 @@ namespace ScheduleManager { if (has_prefix(Alphas(NumField), "FOR")) { ++DyCount; ++AddDaySch; - DaySchedule(AddDaySch).Name = Alphas(1) + "_dy_" + fmt::to_string(DyCount); + DaySchedule(AddDaySch).Name = format("{}_dy_{}", Alphas(1), DyCount); DaySchedule(AddDaySch).ScheduleTypePtr = Schedule(SchNum).ScheduleTypePtr; DaySchedule(AddDaySch).Used = true; TheseDays = false; @@ -1663,7 +1680,7 @@ namespace ScheduleManager { if (Numbers(3) != 8760 && Numbers(3) != 8784) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", " + cNumericFields(3) + " must = 8760 or 8784 (for a leap year)"); - ShowContinueError(state, "..Value for field = " + TrimSigDigits(Numbers(3), 0) + ", Schedule not processed."); + ShowContinueError(state, format("..Value for field = {:.0T}, Schedule not processed.", Numbers(3))); ErrorsFound = true; continue; } @@ -1705,8 +1722,7 @@ namespace ScheduleManager { NumExpectedItems = 1440 / MinutesPerItem; if (mod(60, MinutesPerItem) != 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1)); - ShowContinueError(state, "Requested " + cNumericFields(4) + " field value (" + RoundSigDigits(MinutesPerItem) + - ") not evenly divisible into 60"); + ShowContinueError(state, format("Requested {} field value ({}) not evenly divisible into 60", cNumericFields(4), MinutesPerItem)); ErrorsFound = true; continue; } @@ -1851,19 +1867,27 @@ namespace ScheduleManager { // schedule values have been filled into the hourlyFileValues array. if (numerrors > 0) { - ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\" " + RoundSigDigits(numerrors) + - " records had errors - these values are set to 0."); + ShowWarningError(state, + format("{}{}=\"{}\" {} records had errors - these values are set to 0.", + RoutineName, + CurrentModuleObject, + Alphas(1), + numerrors)); ShowContinueError(state, "Use Output:Diagnostics,DisplayExtraWarnings; to see individual records in error."); } if (rowCnt < rowLimitCount) { - ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\" less than " + RoundSigDigits(numHourlyValues) + - " hourly values read from file."); - ShowContinueError(state, "..Number read=" + TrimSigDigits((rowCnt * 60) / MinutesPerItem) + '.'); + ShowWarningError( + state, + format( + "{}{}=\"{}\" less than {} hourly values read from file.", RoutineName, CurrentModuleObject, Alphas(1), numHourlyValues)); + ShowContinueError(state, format("..Number read={}.", (rowCnt * 60) / MinutesPerItem)); } if (rowCnt < rowLimitCount) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\" less than specified hourly values read from file."); - ShowContinueError(state, "..Specified Number of Hourly Values=" + TrimSigDigits(numHourlyValues) + - " Actual number of hourly values included=" + TrimSigDigits((rowCnt * 60) / MinutesPerItem)); + ShowContinueError(state, + format("..Specified Number of Hourly Values={} Actual number of hourly values included={}", + numHourlyValues, + (rowCnt * 60) / MinutesPerItem)); } // process the data into the normal schedule data structures // note -- schedules are ALWAYS 366 days so some special measures have to be done at 29 Feb "day of year" (60) @@ -1875,7 +1899,7 @@ namespace ScheduleManager { ++iDay; ++hDay; if (iDay > 366) break; - ExtraField = RoundSigDigits(iDay); + ExtraField = fmt::to_string(iDay); // increment both since a week schedule is being defined for each day so that a day is valid // no matter what the day type that is used in a design day. ++AddWeekSch; @@ -1965,7 +1989,7 @@ namespace ScheduleManager { if (iDay > 366) { break; } - ExtraField = RoundSigDigits(iDay); + ExtraField = fmt::to_string(iDay); // increment both since a week schedule is being defined for each day so that a day is valid // no matter what the day type that is used in a design day. ++AddWeekSch; @@ -2254,8 +2278,10 @@ namespace ScheduleManager { if (CheckScheduleValueMinMax(state, SchNum, ">=", ScheduleType(NumPointer).Minimum, "<=", ScheduleType(NumPointer).Maximum)) continue; ShowSevereError(state, RoutineName + "Schedule=\"" + Schedule(SchNum).Name + "\" has values outside its Schedule Type (" + ScheduleType(NumPointer).Name + ") range"); - ShowContinueError(state, " Minimum should be >=" + RoundSigDigits(ScheduleType(NumPointer).Minimum, 3) + - " and Maximum should be <=" + RoundSigDigits(ScheduleType(NumPointer).Maximum, 3)); + ShowContinueError(state, + format(" Minimum should be >={:.3R} and Maximum should be <={:.3R}", + ScheduleType(NumPointer).Minimum, + ScheduleType(NumPointer).Maximum)); ErrorsFound = true; } @@ -2327,7 +2353,6 @@ namespace ScheduleManager { // na // Using/Aliasing - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2431,9 +2456,9 @@ namespace ScheduleManager { for (Count = 1; Count <= NumScheduleTypes; ++Count) { if (ScheduleType(Count).Limited) { NoAverageLinear = "Average"; - Num1 = RoundSigDigits(ScheduleType(Count).Minimum, 2); + Num1 = format("{:.2R}", ScheduleType(Count).Minimum); strip(Num1); - Num2 = RoundSigDigits(ScheduleType(Count).Maximum, 2); + Num2 = format("{:.2R}", ScheduleType(Count).Maximum); strip(Num2); if (ScheduleType(Count).IsReal) { YesNo2 = "Yes"; @@ -2469,7 +2494,7 @@ namespace ScheduleManager { } for (Hr = 1; Hr <= 24; ++Hr) { for (TS = 1; TS <= state.dataGlobal->NumOfTimeStepInHour; ++TS) { - RoundTSValue(TS, Hr) = RoundSigDigits(DaySchedule(Count).TSValue(TS, Hr), 2); + RoundTSValue(TS, Hr) = format("{:.2R}", DaySchedule(Count).TSValue(TS, Hr)); } } static constexpr auto SchDFmtdata0("DaySchedule,{},{},{},{}"); @@ -2815,7 +2840,7 @@ namespace ScheduleManager { // FUNCTION LOCAL VARIABLE DECLARATIONS: if (ThisHour > 24) { - ShowFatalError(state, "LookUpScheduleValue called with thisHour=" + fmt::to_string(ThisHour)); + ShowFatalError(state, format("LookUpScheduleValue called with thisHour={}", ThisHour)); } if (ScheduleIndex == -1) { @@ -4845,28 +4870,6 @@ namespace ScheduleManager { // PURPOSE OF THIS SUBROUTINE: // In response to CR7498, report orphan (unused) schedule items. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // Using/Aliasing - using General::RoundSigDigits; - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // na - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool NeedOrphanMessage; bool NeedUseMessage; @@ -4892,7 +4895,7 @@ namespace ScheduleManager { } if (NumCount > 0) { - ShowMessage(state, "There are " + RoundSigDigits(NumCount) + " unused schedules in input."); + ShowMessage(state, fmt::format("There are {} unused schedules in input.", NumCount)); NeedUseMessage = true; } @@ -4915,7 +4918,7 @@ namespace ScheduleManager { } if (NumCount > 0) { - ShowMessage(state, "There are " + RoundSigDigits(NumCount) + " unused week schedules in input."); + ShowMessage(state, fmt::format("There are {} unused week schedules in input.", NumCount)); NeedUseMessage = true; } @@ -4938,7 +4941,7 @@ namespace ScheduleManager { } if (NumCount > 0) { - ShowMessage(state, "There are " + RoundSigDigits(NumCount) + " unused day schedules in input."); + ShowMessage(state, fmt::format("There are {} unused day schedules in input.", NumCount)); NeedUseMessage = true; } diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 9371b307890..165ccf1e3fb 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -583,7 +583,7 @@ namespace SetPointManager { using DataZoneControls::StageZoneLogic; using DataZoneEquipment::GetSystemNodeNumberForZone; using General::FindNumberInList; - using General::RoundSigDigits; + using NodeInputManager::GetNodeNums; using NodeInputManager::GetOnlySingleNode; using ScheduleManager::CheckScheduleValueMinMax; @@ -1076,8 +1076,12 @@ namespace SetPointManager { OutAirSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(3); if (OutAirSetPtMgr(SetPtMgrNum).OutHigh1 < OutAirSetPtMgr(SetPtMgrNum).OutLow1) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid setpoints."); - ShowContinueError(state, "..." + cNumericFieldNames(4) + "=[" + RoundSigDigits(OutAirSetPtMgr(SetPtMgrNum).OutHigh1, 1) + "] is less than " + - cNumericFieldNames(2) + "=[" + RoundSigDigits(OutAirSetPtMgr(SetPtMgrNum).OutLow1, 1) + "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(4), + OutAirSetPtMgr(SetPtMgrNum).OutHigh1, + cNumericFieldNames(2), + OutAirSetPtMgr(SetPtMgrNum).OutLow1)); } // Get optional input: schedule and 2nd reset rule if (NumAlphas == 4 && NumNums == 8) { @@ -1090,9 +1094,12 @@ namespace SetPointManager { OutAirSetPtMgr(SetPtMgrNum).OutHigh2 = rNumericArgs(8); if (OutAirSetPtMgr(SetPtMgrNum).OutHigh2 < OutAirSetPtMgr(SetPtMgrNum).OutLow2) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid setpoints."); - ShowContinueError(state, "..." + cNumericFieldNames(8) + "=[" + RoundSigDigits(OutAirSetPtMgr(SetPtMgrNum).OutHigh2, 1) + - "] is less than " + cNumericFieldNames(6) + "=[" + RoundSigDigits(OutAirSetPtMgr(SetPtMgrNum).OutLow2, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(8), + OutAirSetPtMgr(SetPtMgrNum).OutHigh2, + cNumericFieldNames(6), + OutAirSetPtMgr(SetPtMgrNum).OutLow2)); } } else { OutAirSetPtMgr(SetPtMgrNum).Sched = ""; @@ -1183,9 +1190,12 @@ namespace SetPointManager { SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); if (SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp < SingZoneRhSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + RoundSigDigits(SingZoneRhSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(1), + SingZoneRhSetPtMgr(SetPtMgrNum).MinSetTemp)); } SingZoneRhSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetOnlySingleNode(state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); @@ -1281,9 +1291,12 @@ namespace SetPointManager { SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); if (SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp < SingZoneHtSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + RoundSigDigits(SingZoneHtSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(1), + SingZoneHtSetPtMgr(SetPtMgrNum).MinSetTemp)); } SingZoneHtSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetOnlySingleNode( state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); @@ -1378,9 +1391,12 @@ namespace SetPointManager { SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); if (SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp < SingZoneClSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + RoundSigDigits(SingZoneClSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(1), + SingZoneClSetPtMgr(SetPtMgrNum).MinSetTemp)); } SingZoneClSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetOnlySingleNode(state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); @@ -1809,17 +1825,23 @@ namespace SetPointManager { OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); if (OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp < OAPretreatSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + RoundSigDigits(OAPretreatSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(1), + OAPretreatSetPtMgr(SetPtMgrNum).MinSetTemp)); } OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat = rNumericArgs(3); OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat = rNumericArgs(4); if (OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat < OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(4) + "=[" + RoundSigDigits(OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat, 1) + - "] is less than " + cNumericFieldNames(3) + "=[" + RoundSigDigits(OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(4), + OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat, + cNumericFieldNames(3), + OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat)); } // Because a zero humidity ratio setpoint is a special value indicating "off" or "no load" @@ -1938,9 +1960,12 @@ namespace SetPointManager { WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); if (WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp < WarmestSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + RoundSigDigits(WarmestSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(1), + WarmestSetPtMgr(SetPtMgrNum).MinSetTemp)); } { @@ -2037,9 +2062,12 @@ namespace SetPointManager { ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); if (ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp < ColdestSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + RoundSigDigits(ColdestSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(1), + ColdestSetPtMgr(SetPtMgrNum).MinSetTemp)); } { @@ -2137,15 +2165,18 @@ namespace SetPointManager { WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); if (WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp < WarmestSetPtMgrTempFlow(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + - RoundSigDigits(WarmestSetPtMgrTempFlow(SetPtMgrNum).MinSetTemp, 1) + "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(1), + WarmestSetPtMgrTempFlow(SetPtMgrNum).MinSetTemp)); } WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown = rNumericArgs(3); if (WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown >= 0.8) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(3) + "=[" + RoundSigDigits(WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown, 2) + - "] is greater than 0.8;"); + ShowContinueError( + state, format("...{}=[{:.2R}] is greater than 0.8;", cNumericFieldNames(3), WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown)); ShowContinueError(state, "...typical values for " + cNumericFieldNames(3) + " are less than 0.8."); } { @@ -2304,9 +2335,12 @@ namespace SetPointManager { if (MZAverageCoolingSetPtMgr(SetPtMgrNum).MaxSetTemp < MZAverageCoolingSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(MZAverageCoolingSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + - RoundSigDigits(MZAverageCoolingSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + MZAverageCoolingSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(1), + MZAverageCoolingSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -2384,9 +2418,12 @@ namespace SetPointManager { if (MZAverageHeatingSetPtMgr(SetPtMgrNum).MaxSetTemp < MZAverageHeatingSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(MZAverageHeatingSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + - RoundSigDigits(MZAverageHeatingSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + MZAverageHeatingSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(1), + MZAverageHeatingSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -2464,9 +2501,12 @@ namespace SetPointManager { if (MZAverageMinHumSetPtMgr(SetPtMgrNum).MaxSetHum < MZAverageMinHumSetPtMgr(SetPtMgrNum).MinSetHum) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(MZAverageMinHumSetPtMgr(SetPtMgrNum).MaxSetHum, 3) + - "] is less than " + cNumericFieldNames(1) + "=[" + - RoundSigDigits(MZAverageMinHumSetPtMgr(SetPtMgrNum).MinSetHum, 3) + "]."); + ShowContinueError(state, + format("...{}=[{:.3R}] is less than {}=[{:.3R}].", + cNumericFieldNames(2), + MZAverageMinHumSetPtMgr(SetPtMgrNum).MaxSetHum, + cNumericFieldNames(1), + MZAverageMinHumSetPtMgr(SetPtMgrNum).MinSetHum)); } NodeListError = false; @@ -2545,9 +2585,12 @@ namespace SetPointManager { if (MZAverageMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum < MZAverageMaxHumSetPtMgr(SetPtMgrNum).MinSetHum) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(MZAverageMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum, 3) + - "] is less than " + cNumericFieldNames(1) + "=[" + - RoundSigDigits(MZAverageMaxHumSetPtMgr(SetPtMgrNum).MinSetHum, 3) + "]."); + ShowContinueError(state, + format("...{}=[{:.3R}] is less than {}=[{:.3R}].", + cNumericFieldNames(2), + MZAverageMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum, + cNumericFieldNames(1), + MZAverageMaxHumSetPtMgr(SetPtMgrNum).MinSetHum)); } NodeListError = false; @@ -2626,9 +2669,12 @@ namespace SetPointManager { if (MZMinHumSetPtMgr(SetPtMgrNum).MaxSetHum < MZMinHumSetPtMgr(SetPtMgrNum).MinSetHum) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(MZMinHumSetPtMgr(SetPtMgrNum).MaxSetHum, 3) + - "] is less than " + cNumericFieldNames(1) + "=[" + RoundSigDigits(MZMinHumSetPtMgr(SetPtMgrNum).MinSetHum, 3) + - "]."); + ShowContinueError(state, + format("...{}=[{:.3R}] is less than {}=[{:.3R}].", + cNumericFieldNames(2), + MZMinHumSetPtMgr(SetPtMgrNum).MaxSetHum, + cNumericFieldNames(1), + MZMinHumSetPtMgr(SetPtMgrNum).MinSetHum)); } NodeListError = false; @@ -2707,9 +2753,12 @@ namespace SetPointManager { if (MZMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum < MZMaxHumSetPtMgr(SetPtMgrNum).MinSetHum) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(MZMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum, 3) + - "] is less than " + cNumericFieldNames(1) + "=[" + RoundSigDigits(MZMaxHumSetPtMgr(SetPtMgrNum).MinSetHum, 3) + - "]."); + ShowContinueError(state, + format("...{}=[{:.3R}] is less than {}=[{:.3R}].", + cNumericFieldNames(2), + MZMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum, + cNumericFieldNames(1), + MZMaxHumSetPtMgr(SetPtMgrNum).MinSetHum)); } NodeListError = false; @@ -2811,9 +2860,12 @@ namespace SetPointManager { FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(3); if (FollowOATempSetPtMgr(SetPtMgrNum).MaxSetTemp < FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(FollowOATempSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(3) + "=[" + RoundSigDigits(FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + FollowOATempSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(3), + FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -2918,9 +2970,12 @@ namespace SetPointManager { FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(3); if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).MaxSetTemp < FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(FollowSysNodeTempSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(3) + "=[" + - RoundSigDigits(FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + FollowSysNodeTempSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(3), + FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -3013,7 +3068,7 @@ namespace SetPointManager { if (!GroundTempObjInput) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" requires \"Site:GroundTemperature:BuildingSurface\" in the input."); - ShowContinueError(state, "Defaults, constant throughout the year of (" + RoundSigDigits(GroundTemp, 1) + ") will be used."); + ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTemp)); } NoSurfaceGroundTempObjWarning = false; } @@ -3023,7 +3078,7 @@ namespace SetPointManager { if (!GroundTemp_SurfaceObjInput) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" requires \"Site:GroundTemperature:Shallow\" in the input."); - ShowContinueError(state, "Defaults, constant throughout the year of (" + RoundSigDigits(GroundTemp_Surface, 1) + ") will be used."); + ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTemp_Surface)); } NoShallowGroundTempObjWarning = false; } @@ -3033,7 +3088,7 @@ namespace SetPointManager { if (!GroundTemp_DeepObjInput) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" requires \"Site:GroundTemperature:Deep\" in the input."); - ShowContinueError(state, "Defaults, constant throughout the year of (" + RoundSigDigits(GroundTemp_Deep, 1) + ") will be used."); + ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTemp_Deep)); } NoDeepGroundTempObjWarning = false; } @@ -3043,7 +3098,7 @@ namespace SetPointManager { if (!FCGroundTemps) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" requires \"Site:GroundTemperature:FCfactorMethod\" in the input."); - ShowContinueError(state, "Defaults, constant throughout the year of (" + RoundSigDigits(GroundTempFC, 1) + ") will be used."); + ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTempFC)); } NoFCGroundTempObjWarning = false; } @@ -3060,9 +3115,12 @@ namespace SetPointManager { GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(3); if (GroundTempSetPtMgr(SetPtMgrNum).MaxSetTemp < GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(GroundTempSetPtMgr(SetPtMgrNum).MaxSetTemp, 1) + - "] is less than " + cNumericFieldNames(3) + "=[" + RoundSigDigits(GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp, 1) + - "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + GroundTempSetPtMgr(SetPtMgrNum).MaxSetTemp, + cNumericFieldNames(3), + GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -3169,9 +3227,12 @@ namespace SetPointManager { CondEntSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(7); if (CondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp < CondEntSetPtMgr(SetPtMgrNum).TowerDsnInletAirWetBulb) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(CondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + - RoundSigDigits(CondEntSetPtMgr(SetPtMgrNum).TowerDsnInletAirWetBulb, 1) + "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + CondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp, + cNumericFieldNames(1), + CondEntSetPtMgr(SetPtMgrNum).TowerDsnInletAirWetBulb)); } NodeListError = false; @@ -3330,9 +3391,12 @@ namespace SetPointManager { if (SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp < SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOnTemp) { // throw warning, off must be warmer than on ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + - RoundSigDigits(SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOnTemp, 1) + "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp, + cNumericFieldNames(1), + SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOnTemp)); } SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(2); @@ -3425,9 +3489,12 @@ namespace SetPointManager { if (SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp > SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOnTemp) { // throw warning, off must be cooler than on ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError(state, "..." + cNumericFieldNames(2) + "=[" + RoundSigDigits(SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOnTemp, 1) + - "] is less than " + cNumericFieldNames(1) + "=[" + - RoundSigDigits(SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp, 1) + "]."); + ShowContinueError(state, + format("...{}=[{:.1R}] is less than {}=[{:.1R}].", + cNumericFieldNames(2), + SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOnTemp, + cNumericFieldNames(1), + SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp)); } SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(2); @@ -8961,7 +9028,7 @@ namespace SetPointManager { AllSetPtMgr(NumAllSetPtMgrs).CtrlNodes.allocate(1); AllSetPtMgr(NumAllSetPtMgrs).CtrlNodes(1) = SchTESSetPtMgr(NumSchTESSetPtMgrs).CtrlNodeNum; // Give it a Name just in case it's used for error reporting - AllSetPtMgr(NumAllSetPtMgrs).Name = "Auto generated TES SPM " + General::TrimSigDigits(NumSchTESSetPtMgrs); + AllSetPtMgr(NumAllSetPtMgrs).Name = format("Auto generated TES SPM {}", NumSchTESSetPtMgrs); AllSetPtMgr(NumAllSetPtMgrs).SPMType = iSPMType_TESScheduled; AllSetPtMgr(NumAllSetPtMgrs).CtrlTypeMode = iCtrlVarType_Temp; AllSetPtMgr(NumAllSetPtMgrs).NumCtrlNodes = 1; diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 3c3789bce6a..7e228986b52 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -332,7 +332,7 @@ namespace SimAirServingZones { using BranchInputManager::NumBranchesInBranchList; using BranchInputManager::NumCompsInBranch; using DataConvergParams::AirLoopConvergence; - using General::RoundSigDigits; + using HVACControllers::CheckCoilWaterInletNode; using HVACControllers::GetControllerActuatorNodeNum; using MixedAir::FindOAMixerMatchForOASystem; @@ -709,9 +709,10 @@ namespace SimAirServingZones { } if (NumNodes != state.dataAirLoop->AirToZoneNodeInfo(AirSysNum).NumSupplyNodes) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", node mismatch."); - ShowContinueError(state, "...number of air system exit nodes [" + RoundSigDigits(NumNodes) + - "] must match number of zone equip inlet nodes [" + RoundSigDigits(state.dataAirLoop->AirToZoneNodeInfo(AirSysNum).NumSupplyNodes) + - "]."); + ShowContinueError(state, + format("...number of air system exit nodes [{}] must match number of zone equip inlet nodes [{}].", + NumNodes, + state.dataAirLoop->AirToZoneNodeInfo(AirSysNum).NumSupplyNodes)); ErrorsFound = true; } for (I = 1; I <= state.dataAirLoop->AirToZoneNodeInfo(AirSysNum).NumSupplyNodes; ++I) { @@ -4163,10 +4164,12 @@ namespace SimAirServingZones { } if (state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).DesignVolFlowRate < SmallAirVolFlow) { - ShowSevereError(state, "SizeAirLoopBranches: AirLoopHVAC " + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name + " has air flow less than " + - General::RoundSigDigits(DataHVACGlobals::SmallAirVolFlow, 4) + " m3/s."); - ShowContinueError(state, "Primary air system volumetric flow rate = " + - General::RoundSigDigits(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).DesignVolFlowRate, 4) + " m3/s."); + ShowSevereError(state, + format("SizeAirLoopBranches: AirLoopHVAC {} has air flow less than {:.4R} m3/s.", + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name, + SmallAirVolFlow)); + ShowContinueError(state, + format("Primary air system volumetric flow rate = {:.4R} m3/s.", state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).DesignVolFlowRate)); ShowContinueError(state, "Check flow rate inputs for components in this air loop and,"); ShowContinueError(state, "if autosized, check Sizing:Zone and Sizing:System objects and related inputs."); ShowFatalError(state, "Previous condition causes termination."); diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index a37a72465a8..7c991edadad 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -51,7 +51,6 @@ extern "C" { } // C++ Headers -#include #include #include @@ -245,7 +244,7 @@ namespace SimulationManager { using EMSManager::CheckIfAnyEMS; using EMSManager::ManageEMS; using ExteriorEnergyUse::ManageExteriorEnergyUse; - using General::TrimSigDigits; + using HVACControllers::DumpAirLoopStatistics; using MixedAir::CheckControllerLists; using NodeInputManager::CheckMarkedNodes; @@ -552,7 +551,7 @@ namespace SimulationManager { if (state.dataGlobal->WarmupFlag) { ++NumOfWarmupDays; - cWarmupDay = TrimSigDigits(NumOfWarmupDays); + cWarmupDay = fmt::to_string(NumOfWarmupDays); DisplayString(state, "Warming up {" + cWarmupDay + '}'); } else if (state.dataGlobal->DayOfSim == 1) { if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { @@ -736,7 +735,7 @@ namespace SimulationManager { using DataHVACGlobals::deviationFromSetPtThresholdClg; using DataHVACGlobals::deviationFromSetPtThresholdHtg; using DataHVACGlobals::LimitNumSysSteps; - using General::RoundSigDigits; + using namespace DataIPShortCuts; // SUBROUTINE PARAMETER DEFINITIONS: @@ -938,7 +937,7 @@ namespace SimulationManager { cNumericFieldNames); state.dataGlobal->NumOfTimeStepInHour = Number(1); if (state.dataGlobal->NumOfTimeStepInHour <= 0 || state.dataGlobal->NumOfTimeStepInHour > 60) { - Alphas(1) = RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour); + Alphas(1) = fmt::to_string(state.dataGlobal->NumOfTimeStepInHour); ShowWarningError(state, CurrentModuleObject + ": Requested number (" + Alphas(1) + ") invalid, Defaulted to 4"); state.dataGlobal->NumOfTimeStepInHour = 4; } else if (mod(60, state.dataGlobal->NumOfTimeStepInHour) != 0) { @@ -948,19 +947,24 @@ namespace SimulationManager { MinInt = state.dataGlobal->NumOfTimeStepInHour - Div60(Num); Which = Num; } - ShowWarningError(state, CurrentModuleObject + ": Requested number (" + RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + - ") not evenly divisible into 60, defaulted to nearest (" + RoundSigDigits(Div60(Which)) + ")."); + ShowWarningError(state, + format("{}: Requested number ({}) not evenly divisible into 60, defaulted to nearest ({}).", + CurrentModuleObject, + state.dataGlobal->NumOfTimeStepInHour, + Div60(Which))); state.dataGlobal->NumOfTimeStepInHour = Div60(Which); } if (CondFDAlgo && state.dataGlobal->NumOfTimeStepInHour < 20) { - ShowWarningError(state, CurrentModuleObject + ": Requested number (" + RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + - ") cannot be used when Conduction Finite Difference algorithm is selected."); + ShowWarningError(state, + format("{}: Requested number ({}) cannot be used when Conduction Finite Difference algorithm is selected.", + CurrentModuleObject, + state.dataGlobal->NumOfTimeStepInHour)); ShowContinueError(state, "..." + CurrentModuleObject + " is set to 20."); state.dataGlobal->NumOfTimeStepInHour = 20; } if (state.dataGlobal->NumOfTimeStepInHour < 4 && inputProcessor->getNumObjectsFound(state, "Zone") > 0) { - ShowWarningError(state, CurrentModuleObject + ": Requested number (" + RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + - ") is less than the suggested minimum of 4."); + ShowWarningError( + state, format("{}: Requested number ({}) is less than the suggested minimum of 4.", CurrentModuleObject, state.dataGlobal->NumOfTimeStepInHour)); ShowContinueError(state, "Please see entry for " + CurrentModuleObject + " in Input/Output Reference for discussion of considerations."); } } else if (Num == 0 && inputProcessor->getNumObjectsFound(state, "Zone") > 0 && !CondFDAlgo) { @@ -1003,8 +1007,8 @@ namespace SimulationManager { MinInt = state.dataGlobal->MinutesPerTimeStep; } if (MinInt < 0 || MinInt > 60) { - ShowWarningError(state, CurrentModuleObject + ": Requested " + cNumericFieldNames(1) + " (" + RoundSigDigits(MinInt) + - ") invalid. Set to 1 minute."); + ShowWarningError(state, + format("{}: Requested {} ({}) invalid. Set to 1 minute.", CurrentModuleObject, cNumericFieldNames(1), MinInt)); MinTimeStepSys = 1.0 / 60.0; } else if (MinInt == 0) { // Set to TimeStepZone MinTimeStepSys = state.dataGlobal->TimeStepZone; @@ -1289,14 +1293,17 @@ namespace SimulationManager { bool advancedModeUsed = false; if (fields.find("maxzonetempdiff") != fields.end()) { // not required field, has default value DataConvergParams::MaxZoneTempDiff = fields.at("maxzonetempdiff"); - ShowWarningError(state, "PerformancePrecisionTradeoffs using the Advanced Override Mode, MaxZoneTempDiff set to: " + - RoundSigDigits(DataConvergParams::MaxZoneTempDiff, 4)); + ShowWarningError(state, + format("PerformancePrecisionTradeoffs using the Advanced Override Mode, MaxZoneTempDiff set to: {:.4R}", + DataConvergParams::MaxZoneTempDiff)); advancedModeUsed = true; } if (fields.find("maxalloweddeltemp") != fields.end()) { // not required field, has default value DataHeatBalance::MaxAllowedDelTemp = fields.at("maxalloweddeltemp"); - ShowWarningError(state, "PerformancePrecisionTradeoffs using the Advanced Override Mode, MaxAllowedDelTemp set to: " + - RoundSigDigits(DataHeatBalance::MaxAllowedDelTemp, 4)); + ShowWarningError( + state, + format("PerformancePrecisionTradeoffs using the Advanced Override Mode, MaxAllowedDelTemp set to: {:.4R}", + DataHeatBalance::MaxAllowedDelTemp)); advancedModeUsed = true; } if (advancedModeUsed) { @@ -1374,12 +1381,7 @@ namespace SimulationManager { "Iterations, Maximum Plant Iterations"); MinInt = MinTimeStepSys * 60.0; static constexpr auto Format_733(" System Convergence Limits, {}, {}, {}, {}\n"); - print(state.files.eio, - Format_733, - RoundSigDigits(MinInt), - RoundSigDigits(MaxIter), - RoundSigDigits(MinPlantSubIterations), - RoundSigDigits(MaxPlantSubIterations)); + print(state.files.eio, Format_733, MinInt, MaxIter, MinPlantSubIterations, MaxPlantSubIterations); if (state.dataGlobal->DoZoneSizing) { Alphas(1) = "Yes"; @@ -1439,21 +1441,21 @@ namespace SimulationManager { Alphas(2) = "ScriptF"; } Alphas(3) = overrideModeValue; - Alphas(4) = General::RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour); + Alphas(4) = fmt::to_string(state.dataGlobal->NumOfTimeStepInHour); if (DataHeatBalance::OverrideZoneAirSolutionAlgo) { Alphas(5) = "Yes"; } else { Alphas(5) = "No"; } - Alphas(6) = General::RoundSigDigits(DataHeatBalance::MinNumberOfWarmupDays); + Alphas(6) = fmt::to_string(DataHeatBalance::MinNumberOfWarmupDays); if (DataEnvironment::forceBeginEnvResetSuppress) { Alphas(7) = "Yes"; } else { Alphas(7) = "No"; } - Alphas(8) = General::RoundSigDigits(DataConvergParams::MinTimeStepSys * 60.0, 1); - Alphas(9) = General::RoundSigDigits(DataConvergParams::MaxZoneTempDiff, 3); - Alphas(10) = General::RoundSigDigits(DataHeatBalance::MaxAllowedDelTemp, 4); + Alphas(8) = format("{:.1R}", DataConvergParams::MinTimeStepSys * 60.0); + Alphas(9) = format("{:.3R}", DataConvergParams::MaxZoneTempDiff); + Alphas(10) = format("{:.4R}", DataHeatBalance::MaxAllowedDelTemp); std::string pptHeader = "! , Use Coil Direct Simulation, " "Zone Radiant Exchange Algorithm, Override Mode, Number of Timestep In Hour, " "Force Euler Method, Minimum Number of Warmup Days, Force Suppress All Begin Environment Resets, " @@ -1507,12 +1509,12 @@ namespace SimulationManager { UtilityRoutines::appendPerfLog(state, "Zone Radiant Exchange Algorithm", "ScriptF"); } UtilityRoutines::appendPerfLog(state, "Override Mode", currentOverrideModeValue); - UtilityRoutines::appendPerfLog(state, "Number of Timesteps per Hour", General::RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour)); - UtilityRoutines::appendPerfLog(state, "Minimum Number of Warmup Days", General::RoundSigDigits(DataHeatBalance::MinNumberOfWarmupDays)); + UtilityRoutines::appendPerfLog(state, "Number of Timesteps per Hour", fmt::to_string(state.dataGlobal->NumOfTimeStepInHour)); + UtilityRoutines::appendPerfLog(state, "Minimum Number of Warmup Days", fmt::to_string(DataHeatBalance::MinNumberOfWarmupDays)); UtilityRoutines::appendPerfLog(state, "SuppressAllBeginEnvironmentResets", bool_to_string(DataEnvironment::forceBeginEnvResetSuppress)); - UtilityRoutines::appendPerfLog(state, "Minimum System Timestep", General::RoundSigDigits(DataConvergParams::MinTimeStepSys * 60.0, 1)); - UtilityRoutines::appendPerfLog(state, "MaxZoneTempDiff", General::RoundSigDigits(DataConvergParams::MaxZoneTempDiff, 2)); - UtilityRoutines::appendPerfLog(state, "MaxAllowedDelTemp", General::RoundSigDigits(DataHeatBalance::MaxAllowedDelTemp, 4)); + UtilityRoutines::appendPerfLog(state, "Minimum System Timestep", format("{:.1R}", DataConvergParams::MinTimeStepSys * 60.0)); + UtilityRoutines::appendPerfLog(state, "MaxZoneTempDiff", format("{:.2R}", DataConvergParams::MaxZoneTempDiff)); + UtilityRoutines::appendPerfLog(state, "MaxAllowedDelTemp", format("{:.4R}", DataHeatBalance::MaxAllowedDelTemp)); } std::string bool_to_string(bool logical) @@ -1899,7 +1901,7 @@ namespace SimulationManager { using namespace DataRuntimeLanguage; using DataHeatBalance::CondFDRelaxFactor; using DataHeatBalance::CondFDRelaxFactorInput; - using General::RoundSigDigits; + using namespace DataSystemVariables; // , ONLY: MaxNumberOfThreads,NumberIntRadThreads,iEnvSetThreads using DataSurfaces::MaxVerticesPerSurface; @@ -2008,17 +2010,17 @@ namespace SimulationManager { if (iEnvSetThreads == 0) { cEnvSetThreads = "Not Set"; } else { - cEnvSetThreads = RoundSigDigits(iEnvSetThreads); + cEnvSetThreads = fmt::to_string(iEnvSetThreads); } if (iepEnvSetThreads == 0) { cepEnvSetThreads = "Not Set"; } else { - cepEnvSetThreads = RoundSigDigits(iepEnvSetThreads); + cepEnvSetThreads = fmt::to_string(iepEnvSetThreads); } if (iIDFSetThreads == 0) { cIDFSetThreads = "Not Set"; } else { - cIDFSetThreads = RoundSigDigits(iIDFSetThreads); + cIDFSetThreads = fmt::to_string(iIDFSetThreads); } if (lnumActiveSims) { print(state.files.eio, @@ -2091,7 +2093,7 @@ namespace SimulationManager { using DataEnvironment::EndMonthFlag; using DataEnvironment::EnvironmentName; using ExteriorEnergyUse::ManageExteriorEnergyUse; - using General::TrimSigDigits; + using PlantPipingSystemsManager::CheckIfAnyBasements; using PlantPipingSystemsManager::CheckIfAnySlabs; using PlantPipingSystemsManager::SimulateGroundDomains; @@ -2806,9 +2808,9 @@ namespace SimulationManager { ShowMessage(state, "No node connection errors were found."); } else { if (state.dataBranchNodeConnections->NumNodeConnectionErrors > 1) { - ShowMessage(state, "There were " + std::to_string(state.dataBranchNodeConnections->NumNodeConnectionErrors) + " node connection errors noted."); + ShowMessage(state, format("There were {} node connection errors noted.", state.dataBranchNodeConnections->NumNodeConnectionErrors)); } else { - ShowMessage(state, "There was " + std::to_string(state.dataBranchNodeConnections->NumNodeConnectionErrors) + " node connection error noted."); + ShowMessage(state, format("There was {} node connection error noted.", state.dataBranchNodeConnections->NumNodeConnectionErrors)); } } @@ -2836,7 +2838,7 @@ namespace SimulationManager { // USE STATEMENTS: // na // Using/Aliasing - using General::TrimSigDigits; + using namespace DataBranchNodeConnections; using namespace BranchNodeConnections; diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 32c9a1470c4..ee296130c5e 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -238,7 +238,6 @@ namespace SingleDuct { // at the system time step. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int SysNum; // The Sys that you are currently loading input into @@ -261,13 +260,19 @@ namespace SingleDuct { } else { SysNum = CompIndex; if (SysNum > NumSDAirTerminal || SysNum < 1) { - ShowFatalError(state, "SimulateSingleDuct: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + - ", Number of Systems=" + TrimSigDigits(NumSDAirTerminal) + ", System name=" + CompName); + ShowFatalError(state, + format("SimulateSingleDuct: Invalid CompIndex passed={}, Number of Systems={}, System name={}", + CompIndex, + NumSDAirTerminal, + CompName)); } if (CheckEquipName(SysNum)) { if (CompName != sd_airterminal(SysNum).SysName) { - ShowFatalError(state, "SimulateSingleDuct: Invalid CompIndex passed=" + TrimSigDigits(CompIndex) + ", System name=" + CompName + - ", stored System Name for that index=" + sd_airterminal(SysNum).SysName); + ShowFatalError(state, + format("SimulateSingleDuct: Invalid CompIndex passed={}, System name={}, stored System Name for that index={}", + CompIndex, + CompName, + sd_airterminal(SysNum).SysName)); } CheckEquipName(SysNum) = false; } @@ -2455,9 +2460,9 @@ namespace SingleDuct { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using General::SafeDivide; - using General::TrimSigDigits; + using PlantUtilities::MyPlantSizingIndex; using SteamCoils::GetCoilSteamInletNode; using SteamCoils::GetCoilSteamOutletNode; @@ -2573,9 +2578,9 @@ namespace SingleDuct { if ((std::abs(MaxAirVolFlowRateDes - MaxAirVolFlowRateUser) / MaxAirVolFlowRateUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Maximum Air Flow Rate of " + RoundSigDigits(MaxAirVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Air Flow Rate of " + RoundSigDigits(MaxAirVolFlowRateDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Air Flow Rate of {:.5R} [m3/s]", MaxAirVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Air Flow Rate of {:.5R} [m3/s]", MaxAirVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2622,10 +2627,11 @@ namespace SingleDuct { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Maximum Heating Air Flow Rate of " + RoundSigDigits(MaxHeatAirVolFlowRateUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Heating Air Flow Rate of " + - RoundSigDigits(MaxHeatAirVolFlowRateDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Heating Air Flow Rate of {:.5R} [m3/s]", MaxHeatAirVolFlowRateUser)); + ShowContinueError( + state, + format("differs from Design Size Maximum Heating Air Flow Rate of {:.5R} [m3/s]", MaxHeatAirVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2684,9 +2690,9 @@ namespace SingleDuct { if ((std::abs(MinAirFlowFracDes - MinAirFlowFracUser) / MinAirFlowFracUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Minimum Cooling Air Flow Fraction of " + RoundSigDigits(MinAirFlowFracUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Minimum Cooling Air Flow Fraction of " + RoundSigDigits(MinAirFlowFracDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Minimum Cooling Air Flow Fraction of {:.5R} [m3/s]", MinAirFlowFracUser)); + ShowContinueError(state, + format("differs from Design Size Minimum Cooling Air Flow Fraction of {:.5R} [m3/s]", MinAirFlowFracDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2744,9 +2750,8 @@ namespace SingleDuct { if ((std::abs(FixedMinAirDes - FixedMinAirUser) / FixedMinAirUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Minimum Cooling Air Flow Rate of " + RoundSigDigits(FixedMinAirUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Minimum Cooling Air Flow Rate of " + RoundSigDigits(FixedMinAirDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Minimum Cooling Air Flow Rate of {:.5R} [m3/s]", FixedMinAirUser)); + ShowContinueError(state, format("differs from Design Size Minimum Cooling Air Flow Rate of {:.5R} [m3/s]", FixedMinAirDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2840,10 +2845,11 @@ namespace SingleDuct { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Maximum Flow Fraction during Reheat of " + - RoundSigDigits(MaxAirVolFractionDuringReheatUser, 5) + " []"); - ShowContinueError(state, "differs from Design Size Maximum Flow Fraction during Reheat of " + - RoundSigDigits(MaxAirVolFractionDuringReheatDes, 5) + " []"); + ShowContinueError( + state, format("User-Specified Maximum Flow Fraction during Reheat of {:.5R} []", MaxAirVolFractionDuringReheatUser)); + ShowContinueError( + state, + format("differs from Design Size Maximum Flow Fraction during Reheat of {:.5R} []", MaxAirVolFractionDuringReheatDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2873,10 +2879,12 @@ namespace SingleDuct { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Maximum Flow per Zone Floor Area during Reheat of " + - RoundSigDigits(MaxAirVolFlowRateDuringReheatUser, 5) + " [m3/s-m2]"); - ShowContinueError(state, "differs from Design Size Maximum Flow per Zone Floor Area during Reheat of " + - RoundSigDigits(MaxAirVolFlowRateDuringReheatDes, 5) + " [m3/s-m2]"); + ShowContinueError(state, + format("User-Specified Maximum Flow per Zone Floor Area during Reheat of {:.5R} [m3/s-m2]", + MaxAirVolFlowRateDuringReheatUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Flow per Zone Floor Area during Reheat of {:.5R} [m3/s-m2]", + MaxAirVolFlowRateDuringReheatDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2908,10 +2916,11 @@ namespace SingleDuct { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Maximum Flow Fraction during Reheat of " + - RoundSigDigits(MaxAirVolFractionDuringReheatUser, 5) + " []"); - ShowContinueError(state, "differs from Design Size Maximum Flow Fraction during Reheat of " + - RoundSigDigits(MaxAirVolFractionDuringReheatDes, 5) + " []"); + ShowContinueError( + state, format("User-Specified Maximum Flow Fraction during Reheat of {:.5R} []", MaxAirVolFractionDuringReheatUser)); + ShowContinueError( + state, + format("differs from Design Size Maximum Flow Fraction during Reheat of {:.5R} []", MaxAirVolFractionDuringReheatDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2921,10 +2930,12 @@ namespace SingleDuct { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Maximum Flow per Zone Floor Area during Reheat of " + - RoundSigDigits(MaxAirVolFlowRateDuringReheatUser, 5) + " [m3/s-m2]"); - ShowContinueError(state, "differs from Design Size Maximum Flow per Zone Floor Area during Reheat of " + - RoundSigDigits(MaxAirVolFlowRateDuringReheatDes, 5) + " [m3/s-m2]"); + ShowContinueError(state, + format("User-Specified Maximum Flow per Zone Floor Area during Reheat of {:.5R} [m3/s-m2]", + MaxAirVolFlowRateDuringReheatUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Flow per Zone Floor Area during Reheat of {:.5R} [m3/s-m2]", + MaxAirVolFlowRateDuringReheatDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3111,10 +3122,11 @@ namespace SingleDuct { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Maximum Reheat Water Flow Rate of " + - RoundSigDigits(MaxReheatWaterVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Reheat Water Flow Rate of " + - RoundSigDigits(MaxReheatWaterVolFlowDes, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Maximum Reheat Water Flow Rate of {:.5R} [m3/s]", MaxReheatWaterVolFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Maximum Reheat Water Flow Rate of {:.5R} [m3/s]", MaxReheatWaterVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3194,10 +3206,11 @@ namespace SingleDuct { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeHVACSingleDuct: Potential issue with equipment sizing for " + this->SysType + " = \"" + this->SysName + "\"."); - ShowContinueError(state, "User-Specified Maximum Reheat Steam Flow Rate of " + - RoundSigDigits(MaxReheatSteamVolFlowUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Reheat Steam Flow Rate of " + - RoundSigDigits(MaxReheatSteamVolFlowDes, 5) + " [m3/s]"); + ShowContinueError( + state, format("User-Specified Maximum Reheat Steam Flow Rate of {:.5R} [m3/s]", MaxReheatSteamVolFlowUser)); + ShowContinueError( + state, + format("differs from Design Size Maximum Reheat Steam Flow Rate of {:.5R} [m3/s]", MaxReheatSteamVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3234,10 +3247,13 @@ namespace SingleDuct { "reheat maximum"); ShowContinueError(state, "Air Terminal Unit name = " + this->SysName); ShowContinueError(state, - "Maximum terminal flow during reheat = " + RoundSigDigits(this->MaxAirVolFlowRateDuringReheat, 6) + - " [m3/s] or flow fraction = " + RoundSigDigits((this->MaxAirVolFlowRateDuringReheat / this->MaxAirVolFlowRate), 4)); - ShowContinueError(state, "Minimum terminal flow = " + RoundSigDigits((this->ZoneMinAirFracDes * this->MaxAirVolFlowRate), 6) + - " [m3/s] or flow fraction = " + RoundSigDigits(this->ZoneMinAirFracDes, 4)); + format("Maximum terminal flow during reheat = {:.6R} [m3/s] or flow fraction = {:.4R}", + this->MaxAirVolFlowRateDuringReheat, + (this->MaxAirVolFlowRateDuringReheat / this->MaxAirVolFlowRate))); + ShowContinueError(state, + format("Minimum terminal flow = {:.6R} [m3/s] or flow fraction = {:.4R}", + (this->ZoneMinAirFracDes * this->MaxAirVolFlowRate), + this->ZoneMinAirFracDes)); ShowContinueError(state, "The reheat maximum flow limit will be replaced by the minimum limit, and the simulation continues"); } this->MaxAirVolFlowRateDuringReheat = (this->ZoneMinAirFracDes * this->MaxAirVolFlowRate); @@ -5896,9 +5912,11 @@ namespace SingleDuct { Node(SysATMixer(SysNum).SecInNode).MassFlowRate = SecAirMassFlowRate; if (std::abs(PriMassFlowRate + SecAirMassFlowRate - MixedAirMassFlowRate) > SmallMassFlow) { ShowSevereError(state, "CalcATMixer: Invalid mass flow rates in AirTerminal:SingleDuct:Mixer=" + SysATMixer(SysNum).Name); - ShowContinueErrorTimeStamp(state, "Primary mass flow rate=" + General::RoundSigDigits(PriMassFlowRate, 6) + - "Secondary mass flow rate=" + General::RoundSigDigits(SecAirMassFlowRate, 6) + - "Mixed mass flow rate=" + General::RoundSigDigits(MixedAirMassFlowRate, 6)); + ShowContinueErrorTimeStamp(state, + format("Primary mass flow rate={:.6R}Secondary mass flow rate={:.6R}Mixed mass flow rate={:.6R}", + PriMassFlowRate, + SecAirMassFlowRate, + MixedAirMassFlowRate)); ShowFatalError(state, "Simulation terminates."); } } diff --git a/src/EnergyPlus/SizingAnalysisObjects.cc b/src/EnergyPlus/SizingAnalysisObjects.cc index 139ed75aa3d..be67b32ba98 100644 --- a/src/EnergyPlus/SizingAnalysisObjects.cc +++ b/src/EnergyPlus/SizingAnalysisObjects.cc @@ -450,8 +450,7 @@ void PlantCoinicidentAnalysis::ResolveDesignFlowRate(EnergyPlusData& state, int using DataSizing::LoopComponentSizingFactorMode; using DataSizing::NoSizingFactorMode; using DataSizing::PlantSizData; - using General::RoundSigDigits; - using General::TrimSigDigits; + using namespace DataPlant; using namespace OutputReportPredefined; using DataHVACGlobals::SmallWaterVolFlow; @@ -553,7 +552,7 @@ void PlantCoinicidentAnalysis::ResolveDesignFlowRate(EnergyPlusData& state, int "{},Normalized Change {},Specific Heat{J/kg-K},Density {kg/m3}\n"); eioHeaderDoneOnce = true; } - chIteration = TrimSigDigits(HVACSizingIterCount); + chIteration = fmt::to_string(HVACSizingIterCount); if (setNewSizes) { chSetSizes = "Yes"; } else { diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 4eca7d70b4b..be4ad64228b 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -173,8 +173,7 @@ namespace SizingManager { using ZoneEquipmentManager::UpdateZoneSizing; using namespace OutputReportPredefined; using DataHeatBalance::Zone; - using General::RoundSigDigits; - using General::TrimSigDigits; + using OutputReportTabular::AllocateLoadComponentArrays; using OutputReportTabular::ComputeLoadComponentDecayCurve; using OutputReportTabular::DeallocateLoadComponentArrays; @@ -353,11 +352,10 @@ namespace SizingManager { if (state.dataGlobal->DayOfSim == 1) { if (!state.dataGlobal->isPulseZoneSizing) { DisplayString(state, "Performing Zone Sizing Simulation"); - DisplayString(state, "...for Sizing Period: #" + RoundSigDigits(NumSizingPeriodsPerformed) + ' ' + EnvironmentName); } else { DisplayString(state, "Performing Zone Sizing Simulation for Load Component Report"); - DisplayString(state, "...for Sizing Period: #" + RoundSigDigits(NumSizingPeriodsPerformed) + ' ' + EnvironmentName); } + DisplayString(state, fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, EnvironmentName)); } UpdateZoneSizing(state, DataGlobalConstants::CallIndicator::BeginDay); UpdateFacilitySizing(state, DataGlobalConstants::CallIndicator::BeginDay); @@ -398,7 +396,7 @@ namespace SizingManager { if (!state.dataGlobal->WarmupFlag) { TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; if (state.dataGlobal->HourOfDay == 1 && state.dataGlobal->TimeStep == 1) { - DesDayWeath(CurOverallSimDay).DateString = TrimSigDigits(Month) + '/' + TrimSigDigits(DayOfMonth); + DesDayWeath(CurOverallSimDay).DateString = fmt::format("{}/{}", Month, DayOfMonth); } DesDayWeath(CurOverallSimDay).Temp(TimeStepInDay) = OutDryBulbTemp; DesDayWeath(CurOverallSimDay).HumRat(TimeStepInDay) = OutHumRat; @@ -540,7 +538,7 @@ namespace SizingManager { } else { // (.NOT.WarmupFlag) if (state.dataGlobal->DayOfSim == 1) { DisplayString(state, "Calculating System sizing"); - DisplayString(state, "...for Sizing Period: #" + RoundSigDigits(NumSizingPeriodsPerformed) + ' ' + EnvironmentName); + DisplayString(state, fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, EnvironmentName)); } UpdateSysSizing(state, DataGlobalConstants::CallIndicator::BeginDay); } @@ -2067,7 +2065,6 @@ namespace SizingManager { using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMaxValue; using namespace DataIPShortCuts; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetOARequirements: "); // include trailing blank space @@ -2186,7 +2183,6 @@ namespace SizingManager { using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMaxValue; using namespace DataIPShortCuts; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2473,7 +2469,6 @@ namespace SizingManager { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; // Number of Alphas for each GetObjectItem call @@ -2522,8 +2517,12 @@ namespace SizingManager { } if (NumTimeStepsInAvg < state.dataGlobal->NumOfTimeStepInHour) { - ShowWarningError(state, cCurrentModuleObject + ": note " + cNumericFieldNames(3) + " entered value=[" + RoundSigDigits(NumTimeStepsInAvg) + - "] is less than 1 hour (i.e., " + RoundSigDigits(state.dataGlobal->NumOfTimeStepInHour) + " timesteps)."); + ShowWarningError(state, + format("{}: note {} entered value=[{}] is less than 1 hour (i.e., {} timesteps).", + cCurrentModuleObject, + cNumericFieldNames(3), + NumTimeStepsInAvg, + state.dataGlobal->NumOfTimeStepInHour)); } cCurrentModuleObject = "OutputControl:Sizing:Style"; @@ -2583,7 +2582,6 @@ namespace SizingManager { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ZoneSizIndex; // loop index @@ -2759,8 +2757,8 @@ namespace SizingManager { ZoneSizingInput(ZoneSizIndex).CoolDesTemp = 0.0; } else if (rNumericArgs(1) < 0.0 && ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod == SupplyAirTemperature) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(1) + "=[" + RoundSigDigits(rNumericArgs(1), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(1), rNumericArgs(1))); ErrorsFound = true; } else if (rNumericArgs(1) >= 0.0 && ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod == SupplyAirTemperature) { ZoneSizingInput(ZoneSizIndex).CoolDesTemp = rNumericArgs(1); @@ -2809,8 +2807,8 @@ namespace SizingManager { ZoneSizingInput(ZoneSizIndex).HeatDesTemp = 0.0; } else if (rNumericArgs(3) < 0.0 && ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod == SupplyAirTemperature) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(3) + "=[" + RoundSigDigits(rNumericArgs(3), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(3), rNumericArgs(3))); ErrorsFound = true; } else if (rNumericArgs(3) >= 0.0 && ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod == SupplyAirTemperature) { ZoneSizingInput(ZoneSizIndex).HeatDesTemp = rNumericArgs(3); @@ -2839,7 +2837,7 @@ namespace SizingManager { if (lNumericFieldBlanks(5)) { ZoneSizingInput(ZoneSizIndex).CoolDesHumRat = 0.0; } else if (rNumericArgs(5) < 0.0) { - ShowSevereError(state, cCurrentModuleObject + ": incorrect " + cNumericFieldNames(5) + ": " + RoundSigDigits(rNumericArgs(5), 2)); + ShowSevereError(state, format("{}: incorrect {}: {:.2R}", cCurrentModuleObject, cNumericFieldNames(5), rNumericArgs(5))); ShowContinueError(state, ".. value should not be negative. Occurs in Sizing Object=" + cAlphaArgs(1)); ErrorsFound = true; } else { @@ -2853,7 +2851,7 @@ namespace SizingManager { if (lNumericFieldBlanks(6)) { ZoneSizingInput(ZoneSizIndex).HeatDesHumRat = 0.0; } else if (rNumericArgs(6) < 0.0) { - ShowSevereError(state, cCurrentModuleObject + ": incorrect " + cNumericFieldNames(6) + ": " + RoundSigDigits(rNumericArgs(6), 2)); + ShowSevereError(state, format("{}: incorrect {}: {:.2R}", cCurrentModuleObject, cNumericFieldNames(6), rNumericArgs(6))); ShowContinueError(state, ".. value should not be negative. Occurs in Sizing Object=" + cAlphaArgs(1)); ErrorsFound = true; } else { @@ -2892,8 +2890,8 @@ namespace SizingManager { ZoneSizingInput(ZoneSizIndex).HeatSizingFactor = GlobalHeatSizingFactor; } else if (rNumericArgs(7) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(7) + "=[" + RoundSigDigits(rNumericArgs(7), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(7), rNumericArgs(7))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).HeatSizingFactor = rNumericArgs(7); @@ -2905,8 +2903,8 @@ namespace SizingManager { ZoneSizingInput(ZoneSizIndex).CoolSizingFactor = GlobalCoolSizingFactor; } else if (rNumericArgs(8) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(8) + "=[" + RoundSigDigits(rNumericArgs(8), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(8), rNumericArgs(8))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).CoolSizingFactor = rNumericArgs(8); @@ -2923,8 +2921,8 @@ namespace SizingManager { ZoneSizingInput(ZoneSizIndex).DesCoolAirFlow = 0.0; } else if (rNumericArgs(9) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(9) + "=[" + RoundSigDigits(rNumericArgs(9), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(9), rNumericArgs(9))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).DesCoolAirFlow = rNumericArgs(9); @@ -2944,8 +2942,8 @@ namespace SizingManager { } } else if (rNumericArgs(10) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(108) + "=[" + RoundSigDigits(rNumericArgs(10), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(108), rNumericArgs(10))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowPerArea = rNumericArgs(10); @@ -2960,8 +2958,8 @@ namespace SizingManager { ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlow = 0.0; } else if (rNumericArgs(11) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(11) + "=[" + RoundSigDigits(rNumericArgs(11), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(11), rNumericArgs(11))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlow = rNumericArgs(11); @@ -2969,8 +2967,8 @@ namespace SizingManager { // N12,\field Cooling Minimum Air Flow Fraction if (rNumericArgs(12) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(12) + "=[" + RoundSigDigits(rNumericArgs(12), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(12), rNumericArgs(12))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowFrac = rNumericArgs(12); @@ -2988,8 +2986,8 @@ namespace SizingManager { ZoneSizingInput(ZoneSizIndex).DesHeatAirFlow = 0.0; } else if (rNumericArgs(13) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(13) + "=[" + RoundSigDigits(rNumericArgs(13), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(13), rNumericArgs(13))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).DesHeatAirFlow = rNumericArgs(13); @@ -3010,8 +3008,8 @@ namespace SizingManager { } } else if (rNumericArgs(14) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(14) + "=[" + RoundSigDigits(rNumericArgs(14), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(14), rNumericArgs(14))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = rNumericArgs(14); @@ -3033,8 +3031,8 @@ namespace SizingManager { } } else if (rNumericArgs(15) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(15) + "=[" + RoundSigDigits(rNumericArgs(15), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(15), rNumericArgs(15))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = rNumericArgs(15); @@ -3055,8 +3053,8 @@ namespace SizingManager { } } else if (rNumericArgs(16) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(16) + "=[" + RoundSigDigits(rNumericArgs(16), 2) + - "], value should not be negative."); + ShowContinueError( + state, format("... incorrect {}=[{:.2R}], value should not be negative.", cNumericFieldNames(16), rNumericArgs(16))); ErrorsFound = true; } else { ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = rNumericArgs(16); @@ -3270,8 +3268,6 @@ namespace SizingManager { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; // Sizing:System; int const iNameAlphaNum = 1; // A1, \field AirLoop Name @@ -3447,8 +3443,10 @@ namespace SizingManager { SysSizInput(SysSizIndex).DesOutAirVolFlow = AutoSize; } else if (rNumericArgs(iDesignOAVolFlowNumericNum) < 0.0 && rNumericArgs(iDesignOAVolFlowNumericNum) != AutoSize) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(iNameAlphaNum) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(iDesignOAVolFlowNumericNum) + "=[" + - RoundSigDigits(rNumericArgs(iDesignOAVolFlowNumericNum), 2) + "], value should not be negative."); + ShowContinueError(state, + format("... incorrect {}=[{:.2R}], value should not be negative.", + cNumericFieldNames(iDesignOAVolFlowNumericNum), + rNumericArgs(iDesignOAVolFlowNumericNum))); ErrorsFound = true; } else { SysSizInput(SysSizIndex).DesOutAirVolFlow = rNumericArgs(iDesignOAVolFlowNumericNum); @@ -3467,8 +3465,10 @@ namespace SizingManager { SysSizInput(SysSizIndex).SysAirMinFlowRat = 0.0; } else if ((rNumericArgs(iMinSysAirFlowRatioNumericNum) < 0.0) && (rNumericArgs(iMinSysAirFlowRatioNumericNum) != DataSizing::AutoSize)) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(iMinSysAirFlowRatioNumericNum) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(iMinSysAirFlowRatioNumericNum) + "=[" + - RoundSigDigits(rNumericArgs(iMinSysAirFlowRatioNumericNum), 2) + "], value should not be negative."); + ShowContinueError(state, + format("... incorrect {}=[{:.2R}], value should not be negative.", + cNumericFieldNames(iMinSysAirFlowRatioNumericNum), + rNumericArgs(iMinSysAirFlowRatioNumericNum))); ErrorsFound = true; } else { SysSizInput(SysSizIndex).SysAirMinFlowRat = rNumericArgs(iMinSysAirFlowRatioNumericNum); @@ -3510,8 +3510,10 @@ namespace SizingManager { SysSizInput(SysSizIndex).DesCoolAirFlow = 0.0; } else if (rNumericArgs(iMaxCoolAirVolFlowNumericNum) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(iNameAlphaNum) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(iMaxCoolAirVolFlowNumericNum) + "=[" + - RoundSigDigits(rNumericArgs(iMaxCoolAirVolFlowNumericNum), 2) + "], value should not be negative."); + ShowContinueError(state, + format("... incorrect {}=[{:.2R}], value should not be negative.", + cNumericFieldNames(iMaxCoolAirVolFlowNumericNum), + rNumericArgs(iMaxCoolAirVolFlowNumericNum))); ErrorsFound = true; } else { SysSizInput(SysSizIndex).DesCoolAirFlow = rNumericArgs(iMaxCoolAirVolFlowNumericNum); @@ -3535,8 +3537,10 @@ namespace SizingManager { SysSizInput(SysSizIndex).DesHeatAirFlow = 0.0; } else if (rNumericArgs(iMaxHeatAirVolFlowNumericNum) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(iNameAlphaNum) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(iMaxHeatAirVolFlowNumericNum) + "=[" + - RoundSigDigits(rNumericArgs(iMaxHeatAirVolFlowNumericNum), 2) + "], value should not be negative."); + ShowContinueError(state, + format("... incorrect {}=[{:.2R}], value should not be negative.", + cNumericFieldNames(iMaxHeatAirVolFlowNumericNum), + rNumericArgs(iMaxHeatAirVolFlowNumericNum))); ErrorsFound = true; } else { SysSizInput(SysSizIndex).DesHeatAirFlow = rNumericArgs(iMaxHeatAirVolFlowNumericNum); @@ -3554,8 +3558,10 @@ namespace SizingManager { SysSizInput(SysSizIndex).MaxZoneOAFraction = 0.0; } else if (rNumericArgs(iZoneMaxOAFractionNumericNum) < 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(iNameAlphaNum) + "\", invalid data."); - ShowContinueError(state, "... incorrect " + cNumericFieldNames(iZoneMaxOAFractionNumericNum) + "=[" + - RoundSigDigits(rNumericArgs(iZoneMaxOAFractionNumericNum), 2) + "], value should not be negative."); + ShowContinueError(state, + format("... incorrect {}=[{:.2R}], value should not be negative.", + cNumericFieldNames(iZoneMaxOAFractionNumericNum), + rNumericArgs(iZoneMaxOAFractionNumericNum))); ErrorsFound = true; } else { SysSizInput(SysSizIndex).MaxZoneOAFraction = rNumericArgs(iZoneMaxOAFractionNumericNum); @@ -3651,8 +3657,10 @@ namespace SizingManager { SysSizInput(SysSizIndex).ScaledCoolingCapacity = rNumericArgs(iCoolDesignCapacityNumericNum); if (SysSizInput(SysSizIndex).ScaledCoolingCapacity < 0.0 && SysSizInput(SysSizIndex).ScaledCoolingCapacity != AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + SysSizInput(SysSizIndex).AirPriLoopName); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iCoolDesignCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iCoolDesignCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iCoolDesignCapacityNumericNum), + rNumericArgs(iCoolDesignCapacityNumericNum))); ErrorsFound = true; } } else if (UtilityRoutines::SameString(cAlphaArgs(iCoolCAPMAlphaNum), "CAPACITYPERFLOORAREA")) { @@ -3662,8 +3670,10 @@ namespace SizingManager { if (SysSizInput(SysSizIndex).ScaledCoolingCapacity <= 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + SysSizInput(SysSizIndex).AirPriLoopName); ShowContinueError(state, "Input for " + cAlphaFieldNames(iCoolCAPMAlphaNum) + " = " + cAlphaArgs(iCoolCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iCoolCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iCoolCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iCoolCapacityPerFloorAreaNumericNum), + rNumericArgs(iCoolCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } else if (SysSizInput(SysSizIndex).ScaledCoolingCapacity == AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + SysSizInput(SysSizIndex).AirPriLoopName); @@ -3683,8 +3693,10 @@ namespace SizingManager { SysSizInput(SysSizIndex).ScaledCoolingCapacity = rNumericArgs(iCoolFracOfAutosizedCapacityNumericNum); if (SysSizInput(SysSizIndex).ScaledCoolingCapacity < 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + SysSizInput(SysSizIndex).AirPriLoopName); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iCoolFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iCoolFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iCoolFracOfAutosizedCapacityNumericNum), + rNumericArgs(iCoolFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -3710,8 +3722,10 @@ namespace SizingManager { SysSizInput(SysSizIndex).ScaledHeatingCapacity = rNumericArgs(iHeatDesignCapacityNumericNum); if (SysSizInput(SysSizIndex).ScaledHeatingCapacity < 0.0 && SysSizInput(SysSizIndex).ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + SysSizInput(SysSizIndex).AirPriLoopName); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatDesignCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatDesignCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatDesignCapacityNumericNum), + rNumericArgs(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } } else if (UtilityRoutines::SameString(cAlphaArgs(iHeatCAPMAlphaNum), "CAPACITYPERFLOORAREA")) { @@ -3721,8 +3735,10 @@ namespace SizingManager { if (SysSizInput(SysSizIndex).ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + SysSizInput(SysSizIndex).AirPriLoopName); ShowContinueError(state, "Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum), + rNumericArgs(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } else if (SysSizInput(SysSizIndex).ScaledHeatingCapacity == AutoSize) { ShowSevereError(state, cCurrentModuleObject + " = " + SysSizInput(SysSizIndex).AirPriLoopName); @@ -3742,8 +3758,10 @@ namespace SizingManager { SysSizInput(SysSizIndex).ScaledHeatingCapacity = rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); if (SysSizInput(SysSizIndex).ScaledHeatingCapacity < 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + SysSizInput(SysSizIndex).AirPriLoopName); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum), + rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -4023,7 +4041,6 @@ namespace SizingManager { // Using/Aliasing using DataStringGlobals::VerString; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4098,7 +4115,6 @@ namespace SizingManager { int const &TimeStepIndex // time step of the peak ) { - using General::RoundSigDigits; if (ReportSysSizingMyOneTimeFlag) { print(state.files.eio, @@ -4155,8 +4171,6 @@ namespace SizingManager { using namespace DataIPShortCuts; using DataSizing::NumZoneHVACSizing; using DataSizing::ZoneHVACSizing; - using General::RoundSigDigits; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetZoneHVACSizing: "); // include trailing blank space @@ -4282,8 +4296,9 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) ZoneHVACSizing(zSIndex).RequestAutoSize = true; if (ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 && ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); - ShowContinueError(state, "Illegal " + cNumericFields(iMaxCoolAirVolFlowNumericNum) + " = " + - TrimSigDigits(Numbers(iMaxCoolAirVolFlowNumericNum), 7)); + ShowContinueError( + state, + format("Illegal {} = {:.7T}", cNumericFields(iMaxCoolAirVolFlowNumericNum), Numbers(iMaxCoolAirVolFlowNumericNum))); ErrorsFound = true; } } else { @@ -4299,8 +4314,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 && ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iCoolSAFMAlphaNum) + " = " + Alphas(iCoolSAFMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iCoolFlowPerFloorAreaNumericNum) + " = " + - TrimSigDigits(Numbers(iCoolFlowPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iCoolFlowPerFloorAreaNumericNum), + Numbers(iCoolFlowPerFloorAreaNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) { @@ -4325,8 +4342,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 && ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iCoolSAFMAlphaNum) + " = " + Alphas(iCoolSAFMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iCoolFlowPerFracCoolNumericNum) + " = " + - TrimSigDigits(Numbers(iCoolFlowPerFracCoolNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iCoolFlowPerFracCoolNumericNum), + Numbers(iCoolFlowPerFracCoolNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) { @@ -4352,8 +4371,9 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 && ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iCoolSAFMAlphaNum) + " = " + Alphas(iCoolSAFMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iCoolFlowPerCoolCapNumericNum) + " = " + - TrimSigDigits(Numbers(iCoolFlowPerCoolCapNumericNum), 7)); + ShowContinueError( + state, + format("Illegal {} = {:.7T}", cNumericFields(iCoolFlowPerCoolCapNumericNum), Numbers(iCoolFlowPerCoolCapNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) { @@ -4389,8 +4409,9 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 && ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); - ShowContinueError(state, "Illegal " + cNumericFields(iMaxHeatAirVolFlowNumericNum) + " = " + - TrimSigDigits(Numbers(iMaxHeatAirVolFlowNumericNum), 7)); + ShowContinueError( + state, + format("Illegal {} = {:.7T}", cNumericFields(iMaxHeatAirVolFlowNumericNum), Numbers(iMaxHeatAirVolFlowNumericNum))); ErrorsFound = true; } } else { @@ -4406,8 +4427,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 && ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iHeatSAFMAlphaNum) + " = " + Alphas(iHeatSAFMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iHeatFlowPerFloorAreaNumericNum) + " = " + - TrimSigDigits(Numbers(iHeatFlowPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iHeatFlowPerFloorAreaNumericNum), + Numbers(iHeatFlowPerFloorAreaNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) { @@ -4432,8 +4455,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 && ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iHeatSAFMAlphaNum) + " = " + Alphas(iHeatSAFMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iHeatFlowPerFracCoolNumericNum) + " = " + - TrimSigDigits(Numbers(iHeatFlowPerFracCoolNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iHeatFlowPerFracCoolNumericNum), + Numbers(iHeatFlowPerFracCoolNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) { @@ -4458,8 +4483,9 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 && ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iHeatSAFMAlphaNum) + " = " + Alphas(iHeatSAFMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iHeatFlowPerHeatCapNumericNum) + " = " + - TrimSigDigits(Numbers(iHeatFlowPerHeatCapNumericNum), 7)); + ShowContinueError( + state, + format("Illegal {} = {:.7T}", cNumericFields(iHeatFlowPerHeatCapNumericNum), Numbers(iHeatFlowPerHeatCapNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) { @@ -4494,8 +4520,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) ZoneHVACSizing(zSIndex).RequestAutoSize = true; if (ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 && ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); - ShowContinueError(state, "Illegal " + cNumericFields(iMaxNoCoolHeatAirVolFlowNumericNum) + " = " + - TrimSigDigits(Numbers(iMaxNoCoolHeatAirVolFlowNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iMaxNoCoolHeatAirVolFlowNumericNum), + Numbers(iMaxNoCoolHeatAirVolFlowNumericNum))); ErrorsFound = true; } } else { @@ -4511,8 +4539,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 && ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iNoCoolHeatSAFMAlphaNum) + " = " + Alphas(iNoCoolHeatSAFMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iNoCoolHeatFlowPerFloorAreaNumericNum) + " = " + - TrimSigDigits(Numbers(iNoCoolHeatFlowPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iNoCoolHeatFlowPerFloorAreaNumericNum), + Numbers(iNoCoolHeatFlowPerFloorAreaNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) { @@ -4538,8 +4568,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 && ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iNoCoolHeatSAFMAlphaNum) + " = " + Alphas(iNoCoolHeatSAFMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iNoCoolHeatFlowPerFracCoolNumericNum) + " = " + - TrimSigDigits(Numbers(iNoCoolHeatFlowPerFracCoolNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iNoCoolHeatFlowPerFracCoolNumericNum), + Numbers(iNoCoolHeatFlowPerFracCoolNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) { @@ -4565,8 +4597,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 && ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iNoCoolHeatSAFMAlphaNum) + " = " + Alphas(iNoCoolHeatSAFMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iNoCoolHeatFlowPerFracHeatNumericNum) + " = " + - TrimSigDigits(Numbers(iNoCoolHeatFlowPerFracHeatNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iNoCoolHeatFlowPerFracHeatNumericNum), + Numbers(iNoCoolHeatFlowPerFracHeatNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) { @@ -4602,8 +4636,9 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize) ZoneHVACSizing(zSIndex).RequestAutoSize = true; if (ZoneHVACSizing(zSIndex).ScaledCoolingCapacity < 0.0 && ZoneHVACSizing(zSIndex).ScaledCoolingCapacity != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); - ShowContinueError(state, "Illegal " + cNumericFields(iCoolDesignCapacityNumericNum) + " = " + - TrimSigDigits(Numbers(iCoolDesignCapacityNumericNum), 7)); + ShowContinueError( + state, + format("Illegal {} = {:.7T}", cNumericFields(iCoolDesignCapacityNumericNum), Numbers(iCoolDesignCapacityNumericNum))); ErrorsFound = true; } } else { @@ -4619,8 +4654,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).ScaledCoolingCapacity <= 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iCoolCAPMAlphaNum) + " = " + Alphas(iCoolCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iCoolCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(Numbers(iCoolCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iCoolCapacityPerFloorAreaNumericNum), + Numbers(iCoolCapacityPerFloorAreaNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize) { @@ -4642,8 +4679,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize) ZoneHVACSizing(zSIndex).RequestAutoSize = true; if (ZoneHVACSizing(zSIndex).ScaledCoolingCapacity < 0.0 && ZoneHVACSizing(zSIndex).ScaledCoolingCapacity != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); - ShowContinueError(state, "Illegal " + cNumericFields(iCoolFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(Numbers(iCoolFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iCoolFracOfAutosizedCapacityNumericNum), + Numbers(iCoolFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -4668,8 +4707,9 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize) ZoneHVACSizing(zSIndex).RequestAutoSize = true; if (ZoneHVACSizing(zSIndex).ScaledHeatingCapacity < 0.0 && ZoneHVACSizing(zSIndex).ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); - ShowContinueError(state, "Illegal " + cNumericFields(iHeatDesignCapacityNumericNum) + " = " + - TrimSigDigits(Numbers(iHeatDesignCapacityNumericNum), 7)); + ShowContinueError( + state, + format("Illegal {} = {:.7T}", cNumericFields(iHeatDesignCapacityNumericNum), Numbers(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } } else { @@ -4685,8 +4725,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); ShowContinueError(state, "Input for " + cAlphaFields(iHeatCAPMAlphaNum) + " = " + Alphas(iHeatCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFields(iHeatCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(Numbers(iHeatCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iHeatCapacityPerFloorAreaNumericNum), + Numbers(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; // Autosized input is not allowed } else if (ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize) { @@ -4708,8 +4750,10 @@ namespace SizingManager { if (ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize) ZoneHVACSizing(zSIndex).RequestAutoSize = true; if (ZoneHVACSizing(zSIndex).ScaledHeatingCapacity < 0.0 && ZoneHVACSizing(zSIndex).ScaledCoolingCapacity != AutoSize) { ShowSevereError(state, CurrentModuleObject + " = " + ZoneHVACSizing(zSIndex).Name); - ShowContinueError(state, "Illegal " + cNumericFields(iHeatFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(Numbers(iHeatFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFields(iHeatFracOfAutosizedCapacityNumericNum), + Numbers(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -4751,8 +4795,6 @@ namespace SizingManager { // appropriate data structure. using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; static std::string const RoutineName("GetAirTerminalSizing: "); // include trailing blank space diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index 0c2ac4fc565..3887ab35a20 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -321,8 +321,8 @@ namespace SolarCollectors { DataIPShortCuts::cAlphaArgs(3)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Surface used for solar collector faces down"); - ShowContinueError(state, "Surface tilt angle (degrees from ground outward normal) = " + - General::RoundSigDigits(DataSurfaces::Surface(SurfNum).Tilt, 2)); + ShowContinueError( + state, format("Surface tilt angle (degrees from ground outward normal) = {:.2R}", DataSurfaces::Surface(SurfNum).Tilt)); } // Check to make sure other solar collectors are not using the same surface @@ -418,16 +418,14 @@ namespace SolarCollectors { state.dataSolarCollectors->Parameters(ParametersNum).Area = DataIPShortCuts::rNumericArgs(1); if (DataIPShortCuts::rNumericArgs(1) <= 0.0) { ShowSevereError(state, CurrentModuleParamObject + " = " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Illegal " + DataIPShortCuts::cNumericFieldNames(1) + " = " + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowContinueError(state, format("Illegal {} = {:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); ShowContinueError(state, " Collector gross area must be always gretaer than zero."); ErrorsFound = true; } state.dataSolarCollectors->Parameters(ParametersNum).Volume = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) <= 0.0) { ShowSevereError(state, CurrentModuleParamObject + " = " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Illegal " + DataIPShortCuts::cNumericFieldNames(2) + " = " + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); + ShowContinueError(state, format("Illegal {} = {:.2R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); ShowContinueError(state, " Collector water volume must be always gretaer than zero."); ErrorsFound = true; } @@ -467,8 +465,7 @@ namespace SolarCollectors { state.dataSolarCollectors->Parameters(ParametersNum).EmissOfCover(1) = DataIPShortCuts::rNumericArgs(12); } else { ShowSevereError(state, CurrentModuleParamObject + " = " + DataIPShortCuts::cAlphaArgs(1)); - ShowContinueError(state, "Illegal " + DataIPShortCuts::cNumericFieldNames(8) + " = " + - General::RoundSigDigits(DataIPShortCuts::rNumericArgs(8), 2)); + ShowContinueError(state, format("Illegal {} = {:.2R}", DataIPShortCuts::cNumericFieldNames(8), DataIPShortCuts::rNumericArgs(8))); ErrorsFound = true; } // Solar absorptance of the absorber plate @@ -552,8 +549,8 @@ namespace SolarCollectors { DataIPShortCuts::cAlphaArgs(3)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Surface used for solar collector faces down"); - ShowContinueError(state, "Surface tilt angle (degrees from ground outward normal) = " + - General::RoundSigDigits(DataSurfaces::Surface(SurfNum).Tilt, 2)); + ShowContinueError( + state, format("Surface tilt angle (degrees from ground outward normal) = {:.2R}", DataSurfaces::Surface(SurfNum).Tilt)); } // Check to make sure other solar collectors are not using the same surface diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index a41dbc7d748..5bafe4d1686 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -55,7 +55,6 @@ #include #include #include -#include // EnergyPlus Headers #include @@ -371,7 +370,7 @@ namespace SolarShading { // This subroutine gets the Shadowing Calculation object. // Using/Aliasing - using General::RoundSigDigits; + using namespace DataIPShortCuts; using DataSystemVariables::DetailedSkyDiffuseAlgorithm; using DataSystemVariables::DetailedSolarTimestepIntegration; @@ -425,7 +424,7 @@ namespace SolarShading { } if (state.dataSolarShading->ShadowingCalcFrequency > 31) { ShowWarningError(state, cCurrentModuleObject + ": suspect " + cNumericFieldNames(1)); - ShowContinueError(state, "Value entered=[" + RoundSigDigits(rNumericArgs(1), 0) + "], Shadowing Calculations will be inaccurate."); + ShowContinueError(state, format("Value entered=[{:.0R}], Shadowing Calculations will be inaccurate.", rNumericArgs(1))); } if (rNumericArgs(2) > 199.0) { @@ -760,8 +759,6 @@ namespace SolarShading { // METHODOLOGY EMPLOYED: // Allocation is dependent on the user input file. - using General::RoundSigDigits; - int SurfLoop; int I; int NumOfLayers; @@ -1189,7 +1186,8 @@ namespace SolarShading { } for (I = 1; I <= NumOfLayers; ++I) { if (state.dataConstruction->Construct(Surface(SurfLoop).Construction).WindowTypeBSDF) { - SetupOutputVariable(state, "Surface Window Total Absorbed Shortwave Radiation Rate Layer " + RoundSigDigits(I) + "", + SetupOutputVariable(state, + format("Surface Window Total Absorbed Shortwave Radiation Rate Layer {}", I), OutputProcessor::Unit::W, SurfWinQRadSWwinAbsLayer(I, SurfLoop), "Zone", @@ -1197,7 +1195,8 @@ namespace SolarShading { Surface(SurfLoop).Name); } if (state.dataConstruction->Construct(Surface(SurfLoop).Construction).WindowTypeBSDF || (I == 1)) { - SetupOutputVariable(state, "Surface Window Front Face Temperature Layer " + RoundSigDigits(I) + "", + SetupOutputVariable(state, + format("Surface Window Front Face Temperature Layer {}", I), OutputProcessor::Unit::C, SurfWinFenLaySurfTempFront(I, SurfLoop), "Zone", @@ -1205,7 +1204,8 @@ namespace SolarShading { Surface(SurfLoop).Name); } if (state.dataConstruction->Construct(Surface(SurfLoop).Construction).WindowTypeBSDF || (I == NumOfLayers)) { - SetupOutputVariable(state, "Surface Window Back Face Temperature Layer " + RoundSigDigits(I) + "", + SetupOutputVariable(state, + format("Surface Window Back Face Temperature Layer {}", I), OutputProcessor::Unit::C, SurfWinFenLaySurfTempBack(I, SurfLoop), "Zone", @@ -2256,7 +2256,6 @@ namespace SolarShading { // Using/Aliasing using DataSystemVariables::DetailedSkyDiffuseAlgorithm; - using General::TrimSigDigits; // Locals // SUBROUTINE PARAMETER DEFINITIONS: @@ -2333,7 +2332,7 @@ namespace SolarShading { ShowSevereError(state, "Cosine of incident angle of beam solar on surface out of range...too high"); ShowContinueError(state, "This is a diagnostic error that should not be encountered under normal circumstances"); ShowContinueError(state, "Occurs on surface: " + Surface(SurfNum).Name); - ShowContinueError(state, "Current value = " + TrimSigDigits(CosIncAngBeamOnSurface) + " ... should be within [-1, +1]"); + ShowContinueError(state, format("Current value = {} ... should be within [-1, +1]", CosIncAngBeamOnSurface)); ShowFatalError(state, "Anisotropic solar calculation causes fatal error"); } CosIncAngBeamOnSurface = 1.0; @@ -2342,7 +2341,7 @@ namespace SolarShading { ShowSevereError(state, "Cosine of incident angle of beam solar on surface out of range...too low"); ShowContinueError(state, "This is a diagnostic error that should not be encountered under normal circumstances"); ShowContinueError(state, "Occurs on surface: " + Surface(SurfNum).Name); - ShowContinueError(state, "Current value = " + TrimSigDigits(CosIncAngBeamOnSurface) + " ... should be within [-1, +1]"); + ShowContinueError(state, format("Current value = {} ... should be within [-1, +1]", CosIncAngBeamOnSurface)); ShowFatalError(state, "Anisotropic solar calculation causes fatal error"); } CosIncAngBeamOnSurface = -1.0; @@ -2430,8 +2429,12 @@ namespace SolarShading { if (DOTP > 0.0009) { ShowSevereError(state, "Problem in interior solar distribution calculation (CHKBKS)"); ShowContinueError(state, " Solar Distribution = FullInteriorExterior will not work in Zone=" + Surface(NRS).ZoneName); - ShowContinueError(state, " because one or more of vertices, such as Vertex " + std::to_string(N) + " of back surface=" + Surface(NBS).Name + - ", is in front of receiving surface=" + Surface(NRS).Name); + ShowContinueError( + state, + format(" because one or more of vertices, such as Vertex {} of back surface={}, is in front of receiving surface={}", + N, + Surface(NBS).Name, + Surface(NRS).Name)); ShowContinueError(state, format(" (Dot Product indicator={:20.4F})", DOTP)); ShowContinueError(state, " Check surface geometry; if OK, use Solar Distribution = FullExterior instead. Use Output:Diagnostics, DisplayExtraWarnings; for more details."); if (!state.dataGlobal->DisplayExtraWarnings) break; @@ -2901,7 +2904,6 @@ namespace SolarShading { // REFERENCES: // BLAST/IBLAST code, original author George Walton - using General::RoundSigDigits; using namespace DataWindowEquivalentLayer; Real64 AreaSum; // Intermediate calculation value @@ -2933,7 +2935,7 @@ namespace SolarShading { thisEnclosure.FloorArea = HorizAreaSum; ShowWarningError(state, "ComputeIntSolarAbsorpFactors: Solar distribution model is set to place solar gains on the zone floor,"); ShowContinueError(state, "...Enclosure=\"" + thisEnclosure.Name + "\" has no floor, but has approximate horizontal surfaces."); - ShowContinueError(state, "...these Tilt > 120 degrees, (area=[" + RoundSigDigits(HorizAreaSum, 2) + "] m2) will be used."); + ShowContinueError(state, format("...these Tilt > 120 degrees, (area=[{:.2R}] m2) will be used.", HorizAreaSum)); } // Compute ISABSF @@ -3211,14 +3213,13 @@ namespace SolarShading { // 'CRC Math Tables', 22 ED, 'Analytic Geometry', P.369 // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: // 1 - Compute H.C. of vertices & sides if (NS > 2 * state.dataSolarShading->MaxHCS) { - ShowFatalError(state, "Solar Shading: HTrans: Too many Figures (>" + TrimSigDigits(state.dataSolarShading->MaxHCS) + ')'); + ShowFatalError(state, format("Solar Shading: HTrans: Too many Figures (>{})", state.dataSolarShading->MaxHCS)); } state.dataSolarShading->HCNV(NS) = NumVertices; @@ -3276,12 +3277,11 @@ namespace SolarShading { ) { // Using/Aliasing - using General::TrimSigDigits; // Locals if (NS > 2 * state.dataSolarShading->MaxHCS) { - ShowFatalError(state, "Solar Shading: HTrans0: Too many Figures (>" + TrimSigDigits(state.dataSolarShading->MaxHCS) + ')'); + ShowFatalError(state, format("Solar Shading: HTrans0: Too many Figures (>{})", state.dataSolarShading->MaxHCS)); } state.dataSolarShading->HCNV(NS) = NumVertices; @@ -3322,10 +3322,9 @@ namespace SolarShading { ) { // Using/Aliasing - using General::TrimSigDigits; if (NS > 2 * state.dataSolarShading->MaxHCS) { - ShowFatalError(state, "Solar Shading: HTrans1: Too many Figures (>" + TrimSigDigits(state.dataSolarShading->MaxHCS) + ')'); + ShowFatalError(state, format("Solar Shading: HTrans1: Too many Figures (>{})", state.dataSolarShading->MaxHCS)); } state.dataSolarShading->HCNV(NS) = NumVertices; @@ -4346,7 +4345,6 @@ namespace SolarShading { // Using/Aliasing using DataSystemVariables::SutherlandHodgman; - using General::RoundSigDigits; int N; // Loop index int NV1; // Number of vertices of figure NS1 @@ -4365,8 +4363,10 @@ namespace SolarShading { state.dataSolarShading->OverlapStatus = state.dataSolarShading->TooManyFigures; if (!state.dataSolarShading->TooManyFiguresMessage && !state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, "DeterminePolygonOverlap: Too many figures [>" + RoundSigDigits(state.dataSolarShading->MaxHCS) + - "] detected in an overlap calculation. Use Output:Diagnostics,DisplayExtraWarnings; for more details."); + ShowWarningError(state, + format("DeterminePolygonOverlap: Too many figures [>{}] detected in an overlap calculation. Use " + "Output:Diagnostics,DisplayExtraWarnings; for more details.", + state.dataSolarShading->MaxHCS)); state.dataSolarShading->TooManyFiguresMessage = true; } @@ -4451,8 +4451,10 @@ namespace SolarShading { state.dataSolarShading->OverlapStatus = state.dataSolarShading->TooManyVertices; if (!state.dataSolarShading->TooManyVerticesMessage && !state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, "DeterminePolygonOverlap: Too many vertices [>" + RoundSigDigits(state.dataSolarShading->MaxHCV) + - "] detected in an overlap calculation. Use Output:Diagnostics,DisplayExtraWarnings; for more details."); + ShowWarningError(state, + format("DeterminePolygonOverlap: Too many vertices [>{}] detected in an overlap calculation. Use " + "Output:Diagnostics,DisplayExtraWarnings; for more details.", + state.dataSolarShading->MaxHCV)); state.dataSolarShading->TooManyVerticesMessage = true; } @@ -4467,8 +4469,10 @@ namespace SolarShading { state.dataSolarShading->OverlapStatus = state.dataSolarShading->TooManyFigures; if (!state.dataSolarShading->TooManyFiguresMessage && !state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, "DeterminePolygonOverlap: Too many figures [>" + RoundSigDigits(state.dataSolarShading->MaxHCS) + - "] detected in an overlap calculation. Use Output:Diagnostics,DisplayExtraWarnings; for more details."); + ShowWarningError(state, + format("DeterminePolygonOverlap: Too many figures [>{}] detected in an overlap calculation. Use " + "Output:Diagnostics,DisplayExtraWarnings; for more details.", + state.dataSolarShading->MaxHCS)); state.dataSolarShading->TooManyFiguresMessage = true; } @@ -4808,7 +4812,6 @@ namespace SolarShading { // Using/Aliasing using namespace DataErrorTracking; - using General::TrimSigDigits; Array1D_int GSS; // List of shadowing surfaces numbers for a receiving surface Array1D_int BKS; // List of back surface numbers for a receiving surface @@ -5195,16 +5198,18 @@ namespace SolarShading { } if (TotalReceivingNonConvexSurfaces > 0) { - ShowWarningMessage(state, "DetermineShadowingCombinations: There are " + TrimSigDigits(TotalReceivingNonConvexSurfaces) + - " surfaces which are receiving surfaces and are non-convex."); + ShowWarningMessage(state, + format("DetermineShadowingCombinations: There are {} surfaces which are receiving surfaces and are non-convex.", + TotalReceivingNonConvexSurfaces)); ShowContinueError(state, "...Shadowing values may be inaccurate. Check .shd report file for more surface shading details"); ShowContinueError(state, "...Add Output:Diagnostics,DisplayExtraWarnings; to see individual warnings for each surface."); TotalWarningErrors += TotalReceivingNonConvexSurfaces; } if (TotalCastingNonConvexSurfaces > 0) { - ShowSevereMessage(state, "DetermineShadowingCombinations: There are " + TrimSigDigits(TotalCastingNonConvexSurfaces) + - " surfaces which are casting surfaces and are non-convex."); + ShowSevereMessage(state, + format("DetermineShadowingCombinations: There are {} surfaces which are casting surfaces and are non-convex.", + TotalCastingNonConvexSurfaces)); ShowContinueError(state, "...Shadowing values may be inaccurate. Check .shd report file for more surface shading details"); ShowContinueError(state, "...Add Output:Diagnostics,DisplayExtraWarnings; to see individual severes for each surface."); TotalSevereErrors += TotalCastingNonConvexSurfaces; @@ -10532,7 +10537,6 @@ namespace SolarShading { // errors in the error file. using namespace DataErrorTracking; // for error tracking - using General::RoundSigDigits; static Array1D_string const MSG(4, {"misses", "", "within", "overlaps"}); @@ -10571,7 +10575,7 @@ namespace SolarShading { TotalWarningErrors += Count - 1; ShowWarningError(state, "Base surface does not surround subsurface (CHKSBS), Overlap Status=" + state.dataSolarShading->cOverLapStatus(state.dataSolarShading->TrackBaseSubSurround(Loop1).MiscIndex)); - ShowContinueError(state, " The base surround errors occurred " + std::to_string(Count) + " times."); + ShowContinueError(state, format(" The base surround errors occurred {} times.", Count)); for (Loop2 = 1; Loop2 <= state.dataSolarShading->NumBaseSubSurround; ++Loop2) { if (state.dataSolarShading->TrackBaseSubSurround(Loop1).SurfIndex1 == state.dataSolarShading->TrackBaseSubSurround(Loop2).SurfIndex1 && state.dataSolarShading->TrackBaseSubSurround(Loop1).MiscIndex == state.dataSolarShading->TrackBaseSubSurround(Loop2).MiscIndex) { @@ -10584,7 +10588,7 @@ namespace SolarShading { } if (TotCount > 0) { ShowMessage(state, ""); - ShowContinueError(state, " The base surround errors occurred " + std::to_string(TotCount) + " times (total)."); + ShowContinueError(state, format(" The base surround errors occurred {} times (total).", TotCount)); ShowMessage(state, ""); } @@ -10592,7 +10596,7 @@ namespace SolarShading { SurfErrorReported = false; TotCount = 0; if (state.dataSolarShading->NumTooManyVertices > 0) { - ShowMessage(state, "Too many vertices [>=" + RoundSigDigits(state.dataSolarShading->MaxHCV) + "] in shadow overlap errors occurring..."); + ShowMessage(state, format("Too many vertices [>={}] in shadow overlap errors occurring...", state.dataSolarShading->MaxHCV)); ShowMessage(state, "These occur throughout the year and may occur several times for the same surfaces. You may be able to reduce them by " "adding Output:Diagnostics,DoNotMirrorDetachedShading;"); } @@ -10608,10 +10612,10 @@ namespace SolarShading { TotCount += Count; TotalWarningErrors += Count - 1; ShowMessage(state, ""); - ShowWarningError(state, "Too many vertices [>=" + RoundSigDigits(state.dataSolarShading->MaxHCV) + "] in a shadow overlap"); + ShowWarningError(state, format("Too many vertices [>={}] in a shadow overlap", state.dataSolarShading->MaxHCV)); ShowContinueError(state, "Overlapping figure=" + Surface(state.dataSolarShading->TrackTooManyVertices(Loop1).SurfIndex1).Name + ", Surface Class=[" + cSurfaceClass(Surface(state.dataSolarShading->TrackTooManyVertices(Loop1).SurfIndex1).Class) + ']'); - ShowContinueError(state, " This error occurred " + std::to_string(Count) + " times."); + ShowContinueError(state, format(" This error occurred {} times.", Count)); for (Loop2 = 1; Loop2 <= state.dataSolarShading->NumTooManyVertices; ++Loop2) { if (state.dataSolarShading->TrackTooManyVertices(Loop1).SurfIndex1 == state.dataSolarShading->TrackTooManyVertices(Loop2).SurfIndex1) { if (SurfErrorReported2(state.dataSolarShading->TrackTooManyVertices(Loop2).SurfIndex2)) continue; @@ -10624,14 +10628,14 @@ namespace SolarShading { } if (TotCount > 0) { ShowMessage(state, ""); - ShowContinueError(state, " The too many vertices errors occurred " + std::to_string(TotCount) + " times (total)."); + ShowContinueError(state, format(" The too many vertices errors occurred {} times (total).", TotCount)); ShowMessage(state, ""); } SurfErrorReported = false; TotCount = 0; if (state.dataSolarShading->NumTooManyFigures > 0) { - ShowMessage(state, "Too many figures [>=" + RoundSigDigits(state.dataSolarShading->MaxHCS) + "] in shadow overlap errors occurring..."); + ShowMessage(state, format("Too many figures [>={}] in shadow overlap errors occurring...", state.dataSolarShading->MaxHCS)); ShowMessage(state, "These occur throughout the year and may occur several times for the same surfaces. You may be able to reduce them by " "adding OutputDiagnostics,DoNotMirrorDetachedShading;"); } @@ -10647,10 +10651,10 @@ namespace SolarShading { TotCount += Count; TotalWarningErrors += Count - 1; ShowMessage(state, ""); - ShowWarningError(state, "Too many figures [>=" + RoundSigDigits(state.dataSolarShading->MaxHCS) + "] in a shadow overlap"); + ShowWarningError(state, format("Too many figures [>={}] in a shadow overlap", state.dataSolarShading->MaxHCS)); ShowContinueError(state, "Overlapping figure=" + Surface(state.dataSolarShading->TrackTooManyFigures(Loop1).SurfIndex1).Name + ", Surface Class=[" + cSurfaceClass(Surface(state.dataSolarShading->TrackTooManyFigures(Loop1).SurfIndex1).Class) + ']'); - ShowContinueError(state, " This error occurred " + std::to_string(Count) + " times."); + ShowContinueError(state, format(" This error occurred {} times.", Count)); for (Loop2 = 1; Loop2 <= state.dataSolarShading->NumTooManyFigures; ++Loop2) { if (state.dataSolarShading->TrackTooManyFigures(Loop1).SurfIndex1 == state.dataSolarShading->TrackTooManyFigures(Loop2).SurfIndex1) { if (SurfErrorReported2(state.dataSolarShading->TrackTooManyFigures(Loop2).SurfIndex2)) continue; @@ -10663,7 +10667,7 @@ namespace SolarShading { } if (TotCount > 0) { ShowMessage(state, ""); - ShowContinueError(state, " The too many figures errors occurred " + std::to_string(TotCount) + " times (total)."); + ShowContinueError(state, format(" The too many figures errors occurred {} times (total).", TotCount)); ShowMessage(state, ""); } SurfErrorReported.deallocate(); diff --git a/src/EnergyPlus/SplitterComponent.cc b/src/EnergyPlus/SplitterComponent.cc index dc76d991d86..f5018604d1b 100644 --- a/src/EnergyPlus/SplitterComponent.cc +++ b/src/EnergyPlus/SplitterComponent.cc @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -92,9 +91,6 @@ namespace SplitterComponent { // It is called from the SimAirLoopComponent // at the system time step. - // Using/Aliasing - using General::TrimSigDigits; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int SplitterNum; // The Splitter that you are currently loading input for @@ -113,13 +109,19 @@ namespace SplitterComponent { } else { SplitterNum = CompIndex; if (SplitterNum > state.dataSplitterComponent->NumSplitters || SplitterNum < 1) { - ShowFatalError(state, "SimAirLoopSplitter: Invalid CompIndex passed=" + TrimSigDigits(SplitterNum) + - ", Number of Splitters=" + TrimSigDigits(state.dataSplitterComponent->NumSplitters) + ", Splitter name=" + CompName); + ShowFatalError(state, + format("SimAirLoopSplitter: Invalid CompIndex passed={}, Number of Splitters={}, Splitter name={}", + SplitterNum, + state.dataSplitterComponent->NumSplitters, + CompName)); } if (state.dataSplitterComponent->CheckEquipName(SplitterNum)) { if (CompName != state.dataSplitterComponent->SplitterCond(SplitterNum).SplitterName) { - ShowFatalError(state, "SimAirLoopSplitter: Invalid CompIndex passed=" + TrimSigDigits(SplitterNum) + ", Splitter name=" + CompName + - ", stored Splitter Name for that index=" + state.dataSplitterComponent->SplitterCond(SplitterNum).SplitterName); + ShowFatalError(state, + format("SimAirLoopSplitter: Invalid CompIndex passed={}, Splitter name={}, stored Splitter Name for that index={}", + SplitterNum, + CompName, + state.dataSplitterComponent->SplitterCond(SplitterNum).SplitterName)); } state.dataSplitterComponent->CheckEquipName(SplitterNum) = false; } @@ -159,7 +161,6 @@ namespace SplitterComponent { // Uses the status flags to trigger events. // Using/Aliasing - using General::TrimSigDigits; using NodeInputManager::GetOnlySingleNode; // SUBROUTINE PARAMETER DEFINITIONS: @@ -260,7 +261,7 @@ namespace SplitterComponent { ShowSevereError(state, CurrentModuleObject + " = " + state.dataSplitterComponent->SplitterCond(SplitterNum).SplitterName + " specifies an outlet node name the same as the inlet node."); ShowContinueError(state, ".." + cAlphaFields(2) + '=' + NodeID(NodeNum)); - ShowContinueError(state, "..Outlet Node #" + TrimSigDigits(OutNodeNum1) + " is duplicate."); + ShowContinueError(state, format("..Outlet Node #{} is duplicate.", OutNodeNum1)); ErrorsFound = true; } for (OutNodeNum1 = 1; OutNodeNum1 <= state.dataSplitterComponent->SplitterCond(SplitterNum).NumOutletNodes; ++OutNodeNum1) { @@ -268,8 +269,8 @@ namespace SplitterComponent { if (state.dataSplitterComponent->SplitterCond(SplitterNum).OutletNode(OutNodeNum1) != state.dataSplitterComponent->SplitterCond(SplitterNum).OutletNode(OutNodeNum2)) continue; ShowSevereError(state, CurrentModuleObject + " = " + state.dataSplitterComponent->SplitterCond(SplitterNum).SplitterName + " specifies duplicate outlet nodes in its outlet node list."); - ShowContinueError(state, "..Outlet Node #" + TrimSigDigits(OutNodeNum1) + " Name=" + NodeID(OutNodeNum1)); - ShowContinueError(state, "..Outlet Node #" + TrimSigDigits(OutNodeNum2) + " is duplicate."); + ShowContinueError(state, format("..Outlet Node #{} Name={}", OutNodeNum1, NodeID(OutNodeNum1))); + ShowContinueError(state, format("..Outlet Node #{} is duplicate.", OutNodeNum2)); ErrorsFound = true; } } diff --git a/src/EnergyPlus/StandardRatings.cc b/src/EnergyPlus/StandardRatings.cc index 009523ac881..1d3b3f52b47 100644 --- a/src/EnergyPlus/StandardRatings.cc +++ b/src/EnergyPlus/StandardRatings.cc @@ -262,7 +262,7 @@ namespace StandardRatings { using DataPlant::TypeOf_Chiller_ElectricReformEIR; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using General::SolveRoot; // Locals @@ -462,21 +462,22 @@ namespace StandardRatings { } } if (RefCap <= 0.0) { - ShowContinueError(state, " Check the chiller autosized or user specified capacity. Autosized or specified chiller capacity = " + - RoundSigDigits(RefCap, 2)); + ShowContinueError( + state, + format(" Check the chiller autosized or user specified capacity. Autosized or specified chiller capacity = {:.2R}", RefCap)); } if (RefCOP <= 0.0) { - ShowContinueError(state, " Check the chiller reference or rated COP specified. Specified COP = " + RoundSigDigits(RefCOP, 2)); + ShowContinueError(state, format(" Check the chiller reference or rated COP specified. Specified COP = {:.2R}", RefCOP)); } if (ChillerCapFT <= 0.0) { ShowContinueError(state, " Check limits in Cooling Capacity Function of Temperature Curve, Curve Type = " + state.dataCurveManager->PerfCurve(CapFTempCurveIndex).ObjectType + ", Curve Name = " + GetCurveName(state, CapFTempCurveIndex) + '.'); - ShowContinueError(state, " ..ChillerCapFT value at standard test condition = " + RoundSigDigits(ChillerCapFT, 2)); + ShowContinueError(state, format(" ..ChillerCapFT value at standard test condition = {:.2R}", ChillerCapFT)); } if (ChillerEIRFT <= 0.0) { ShowContinueError(state, " Check limits in EIR Function of Temperature Curve, Curve Type = " + state.dataCurveManager->PerfCurve(EIRFTempCurveIndex).ObjectType + ", Curve Name = " + GetCurveName(state, EIRFTempCurveIndex) + '.'); - ShowContinueError(state, " ..ChillerEIRFT value at standard test condition = " + RoundSigDigits(ChillerEIRFT, 2)); + ShowContinueError(state, format(" ..ChillerEIRFT value at standard test condition = {:.2R}", ChillerEIRFT)); } IPLV = 0.0; break; @@ -600,7 +601,6 @@ namespace StandardRatings { using namespace OutputReportPredefined; using DataPlant::TypeOf_Chiller_ElectricEIR; using DataPlant::TypeOf_Chiller_ElectricReformEIR; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static bool MyOneTimeFlag(true); @@ -880,7 +880,6 @@ namespace StandardRatings { using DataHVACGlobals::CoilDX_HeatingEmpirical; using DataHVACGlobals::CoilDX_MultiSpeedCooling; using DataHVACGlobals::CoilDX_MultiSpeedHeating; - using General::RoundSigDigits; // Argument array dimensioning RatedTotalCapacity.dim(ns); @@ -1182,7 +1181,6 @@ namespace StandardRatings { using CurveManager::CurveValue; using CurveManager::GetCurveMinMaxValues; using CurveManager::GetCurveName; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1308,37 +1306,58 @@ namespace StandardRatings { if (TotCapTempModFacRated < 0.0 || CapTempModFacH2Test < 0.0 || CapTempModFacH3Test < 0.0 || EIRTempModFacRated < 0.0 || EIRTempModFacH2Test < 0.0 || EIRTempModFacH3Test < 0.0) { if (TotCapTempModFacRated < 0.0) { - ShowSevereError(state, " Invalid Total Heating Capacity Function of Temperature Curve value = " + RoundSigDigits(TotCapTempModFacRated, 2) + - ", Curve Type = " + state.dataCurveManager->PerfCurve(CapFTempCurveIndex).ObjectType + ", Curve Name = " + GetCurveName(state, CapFTempCurveIndex)); + ShowSevereError( + state, + format(" Invalid Total Heating Capacity Function of Temperature Curve value = {:.2R}, Curve Type = {}, Curve Name = {}", + TotCapTempModFacRated, + state.dataCurveManager->PerfCurve(CapFTempCurveIndex).ObjectType, + GetCurveName(state, CapFTempCurveIndex))); ShowContinueError(state, " ...Net heating capacity at high temperature is set to zero. The curve value must be > 0. Check the curve."); NetHeatingCapRated = 0.0; } if (CapTempModFacH3Test < 0.0) { - ShowSevereError(state, " Invalid Total Heating Capacity Function of Temperature Curve value = " + RoundSigDigits(CapTempModFacH3Test, 2) + - ", Curve Type = " + state.dataCurveManager->PerfCurve(CapFTempCurveIndex).ObjectType + ", Curve Name = " + GetCurveName(state, CapFTempCurveIndex)); + ShowSevereError( + state, + format(" Invalid Total Heating Capacity Function of Temperature Curve value = {:.2R}, Curve Type = {}, Curve Name = {}", + CapTempModFacH3Test, + state.dataCurveManager->PerfCurve(CapFTempCurveIndex).ObjectType, + GetCurveName(state, CapFTempCurveIndex))); ShowContinueError(state, " ...Net heating capacity at low temperature is set to zero. The curve value must be > 0. Check the curve."); NetHeatingCapH3Test = 0.0; } if (CapTempModFacH2Test < 0.0) { - ShowSevereError(state, " Invalid Total Heating Capacity Function of Temperature Curve value = " + RoundSigDigits(CapTempModFacH2Test, 2) + - ", Curve Type = " + state.dataCurveManager->PerfCurve(CapFTempCurveIndex).ObjectType + ", Curve Name = " + GetCurveName(state, CapFTempCurveIndex)); + ShowSevereError( + state, + format(" Invalid Total Heating Capacity Function of Temperature Curve value = {:.2R}, Curve Type = {}, Curve Name = {}", + CapTempModFacH2Test, + state.dataCurveManager->PerfCurve(CapFTempCurveIndex).ObjectType, + GetCurveName(state, CapFTempCurveIndex))); ShowContinueError(state, " ...HSPF calculation is incorrect. The curve value must be > 0. Check the curve."); NetHeatingCapH3Test = 0.0; } // check EIR curve values if (EIRTempModFacRated < 0.0) { - ShowSevereError(state, " Invalid EIR Function of Temperature Curve value = " + RoundSigDigits(EIRTempModFacRated, 2) + - ", Curve Type = " + state.dataCurveManager->PerfCurve(EIRFTempCurveIndex).ObjectType + ", Curve Name = " + GetCurveName(state, EIRFTempCurveIndex)); + ShowSevereError(state, + format(" Invalid EIR Function of Temperature Curve value = {:.2R}, Curve Type = {}, Curve Name = {}", + EIRTempModFacRated, + state.dataCurveManager->PerfCurve(EIRFTempCurveIndex).ObjectType, + GetCurveName(state, EIRFTempCurveIndex))); ShowContinueError(state, " ...HSPF calculation is incorrect. The curve value must be > 0. Check the curve."); } if (EIRTempModFacH2Test < 0.0) { - ShowSevereError(state, " Invalid EIR Function of Temperature Curve value = " + RoundSigDigits(EIRTempModFacH2Test, 2) + - ", Curve Type = " + state.dataCurveManager->PerfCurve(EIRFTempCurveIndex).ObjectType + ", Curve Name = " + GetCurveName(state, EIRFTempCurveIndex)); + ShowSevereError(state, + format(" Invalid EIR Function of Temperature Curve value = {:.2R}, Curve Type = {}, Curve Name = {}", + EIRTempModFacH2Test, + state.dataCurveManager->PerfCurve(EIRFTempCurveIndex).ObjectType, + GetCurveName(state, EIRFTempCurveIndex))); ShowContinueError(state, " ...HSPF calculation is incorrect. The curve value must be > 0. Check the curve."); } if (EIRTempModFacH3Test < 0.0) { - ShowSevereError(state, " Invalid EIR Function of Temperature Curve value = " + RoundSigDigits(EIRTempModFacH3Test, 2) + - ", Curve Type = " + state.dataCurveManager->PerfCurve(EIRFTempCurveIndex).ObjectType + ", Curve Name = " + GetCurveName(state, EIRFTempCurveIndex)); + ShowSevereError(state, + format(" Invalid EIR Function of Temperature Curve value = {:.2R}, Curve Type = {}, Curve Name = {}", + EIRTempModFacH3Test, + state.dataCurveManager->PerfCurve(EIRFTempCurveIndex).ObjectType, + GetCurveName(state, EIRFTempCurveIndex))); ShowContinueError(state, " ...HSPF calculation is incorrect. The curve value must be > 0. Check the curve."); } ShowContinueError(state, " ...HSPF value has been reset to 0.0 and simulation is continuing."); @@ -2401,7 +2420,7 @@ namespace StandardRatings { // na // Using/Aliasing - using General::RoundSigDigits; + using namespace OutputReportPredefined; using DataHVACGlobals::CoilDX_CoolingSingleSpeed; using DataHVACGlobals::CoilDX_HeatingEmpirical; @@ -2525,7 +2544,7 @@ namespace StandardRatings { // Room Unitary Air Conditioners // Using/Aliasing - using General::RoundSigDigits; + using namespace OutputReportPredefined; using DataHVACGlobals::CoilDX_CoolingSingleSpeed; @@ -2566,8 +2585,8 @@ namespace StandardRatings { } for (ClassNum = 1; ClassNum <= 4; ++ClassNum) { Num = (ClassNum - 1) * 4; - ClassName = "Class " + RoundSigDigits(ClassNum); - CompNameNew = CompName + "(" + ClassName + ")"; + ClassName = format("Class {}", ClassNum); + CompNameNew = fmt::format("{}({})", CompName, ClassName); static constexpr auto Format_102(" DX Cooling Coil ASHRAE 127 Standard Ratings Information, {}, {}, {}, {:.1R}, {:.1R}, {:.1R}, " "{:.1R}, {:.1R}, {:.1R}, {:.1R}, {:.1R}\n"); print(state.files.eio, @@ -2584,10 +2603,10 @@ namespace StandardRatings { NetCoolingCapRated(Num + 4), TotElectricPowerRated(Num + 4)); PreDefTableEntry(pdchDXCoolCoilType, CompNameNew, CompType); - // Note: If you call RoundSigDigits(NetCoolingCapRated(Num + 1), 1), + // Note: If you call format("{:.1R}", NetCoolingCapRated(Num + 1)), // Then it's not the OutputReportPredefined::PreDefTableEntry prototype with Real64 that is called. // As a result, the entry isn't marked as being Real (origEntryIsReal) and unit conversion does not occur - // Bad: PreDefTableEntry(pdchDXCoolCoilNetCapSIA, CompNameNew, RoundSigDigits(NetCoolingCapRated(Num + 1), 1)); + // Bad: PreDefTableEntry(pdchDXCoolCoilNetCapSIA, CompNameNew, format("{:.1R}", NetCoolingCapRated(Num + 1))); PreDefTableEntry(pdchDXCoolCoilNetCapSIA, CompNameNew, NetCoolingCapRated(Num + 1), 1); PreDefTableEntry(pdchDXCoolCoilNetCapSIB, CompNameNew, NetCoolingCapRated(Num + 2), 1); PreDefTableEntry(pdchDXCoolCoilNetCapSIC, CompNameNew, NetCoolingCapRated(Num + 3), 1); diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index 26f24679e98..a7a7e0d4072 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -55,8 +55,6 @@ #include #include #include -#include -#include #include #include #include @@ -78,7 +76,6 @@ #include #include #include -#include #include #include #include @@ -120,10 +117,6 @@ namespace SteamBaseboardRadiator { using DataZoneEquipment::ZoneEquipConfig; using DataZoneEquipment::ZoneEquipInputsFilled; - // Use statements for access to subroutines in other modules - using Psychrometrics::PsyCpAirFnW; - using Psychrometrics::PsyRhoAirFnPbTdbW; - static std::string const fluidNameSteam("STEAM"); void SimSteamBaseboard(EnergyPlusData &state, @@ -147,7 +140,7 @@ namespace SteamBaseboardRadiator { // Using/Aliasing using DataZoneEnergyDemands::CurDeadBandOrSetback; using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using ScheduleManager::GetCurrentScheduleValue; @@ -173,13 +166,19 @@ namespace SteamBaseboardRadiator { } else { BaseboardNum = CompIndex; if (BaseboardNum > state.dataSteamBaseboardRadiator->NumSteamBaseboards || BaseboardNum < 1) { - ShowFatalError(state, "SimSteamBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + - ", Number of Units=" + TrimSigDigits(state.dataSteamBaseboardRadiator->NumSteamBaseboards) + ", Entered Unit name=" + EquipName); + ShowFatalError(state, + format("SimSteamBaseboard: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + BaseboardNum, + state.dataSteamBaseboardRadiator->NumSteamBaseboards, + EquipName)); } if (state.dataSteamBaseboardRadiator->CheckEquipName(BaseboardNum)) { if (EquipName != state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID) { - ShowFatalError(state, "SimSteamBaseboard: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + ", Unit name=" + EquipName + - ", stored Unit Name for that index=" + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID); + ShowFatalError(state, + format("SimSteamBaseboard: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + BaseboardNum, + EquipName, + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID)); } state.dataSteamBaseboardRadiator->CheckEquipName(BaseboardNum) = false; } @@ -230,7 +229,9 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BranchNum); } else { ShowSevereError(state, "SimSteamBaseboard: Errors in Baseboard=" + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Invalid or unimplemented equipment type=" + TrimSigDigits(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipType)); + ShowContinueError(state, + format("Invalid or unimplemented equipment type={}", + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipType)); ShowFatalError(state, "Preceding condition causes termination."); } } @@ -280,8 +281,7 @@ namespace SteamBaseboardRadiator { using BranchNodeConnections::TestCompSet; using DataSurfaces::Surface; using FluidProperties::FindRefrigerant; - using General::RoundSigDigits; - using General::TrimSigDigits; + using GlobalNames::VerifyUniqueBaseboardName; using NodeInputManager::GetOnlySingleNode; using ScheduleManager::GetCurrentScheduleValue; @@ -379,8 +379,10 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatDesignCapacityNumericNum); if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ScaledHeatingCapacity < 0.0 && state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ScaledHeatingCapacity != AutoSize) { ShowSevereError(state, state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + " = " + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatDesignCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatDesignCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatDesignCapacityNumericNum), + rNumericArgs(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } } else { @@ -396,8 +398,10 @@ namespace SteamBaseboardRadiator { if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ScaledHeatingCapacity <= 0.0) { ShowSevereError(state, state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + " = " + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID); ShowContinueError(state, "Input for " + cAlphaFieldNames(iHeatCAPMAlphaNum) + " = " + cAlphaArgs(iHeatCAPMAlphaNum)); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatCapacityPerFloorAreaNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum), + rNumericArgs(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } else if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ScaledHeatingCapacity == AutoSize) { ShowSevereError(state, state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + " = " + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID); @@ -417,8 +421,10 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ScaledHeatingCapacity = rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ScaledHeatingCapacity < 0.0) { ShowSevereError(state, state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + " = " + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Illegal " + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum) + " = " + - TrimSigDigits(rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum), 7)); + ShowContinueError(state, + format("Illegal {} = {:.7T}", + cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum), + rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } } else { @@ -440,13 +446,13 @@ namespace SteamBaseboardRadiator { if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamVolFlowRateMax >= MaxSteamFlowRate) { ShowWarningError(state, RoutineName + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(5) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxSteamFlowRate, 2) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxSteamFlowRate)); state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamVolFlowRateMax = MaxSteamFlowRate; } else if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamVolFlowRateMax <= MinSteamFlowRate && state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamVolFlowRateMax != AutoSize) { ShowWarningError(state, RoutineName + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(2) + " was less than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinSteamFlowRate, 2) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinSteamFlowRate)); state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamVolFlowRateMax = MinSteamFlowRate; } @@ -463,12 +469,12 @@ namespace SteamBaseboardRadiator { if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracRadiant < MinFraction) { ShowWarningError(state, RoutineName + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(7) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinFraction, 3) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.3R}].", MinFraction)); state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracRadiant = MinFraction; } else if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracRadiant > MaxFraction) { ShowWarningError(state, RoutineName + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(7) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 3) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.3R}].", MaxFraction)); state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracRadiant = MaxFraction; } @@ -487,13 +493,13 @@ namespace SteamBaseboardRadiator { if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribPerson < MinFraction) { ShowWarningError(state, RoutineName + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(8) + " was lower than the allowable minimum."); - ShowContinueError(state, "...reset to minimum value=[" + RoundSigDigits(MinFraction, 3) + "]."); + ShowContinueError(state, format("...reset to minimum value=[{:.3R}].", MinFraction)); state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribPerson = MinFraction; } if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribPerson > MaxFraction) { ShowWarningError(state, RoutineName + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(8) + " was higher than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 3) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.3R}].", MaxFraction)); state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribPerson = MaxFraction; } state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).TotSurfToDistrib = NumNumbers - 8; @@ -507,7 +513,7 @@ namespace SteamBaseboardRadiator { if ((state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).TotSurfToDistrib < MinDistribSurfaces) && (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracRadiant > MinFraction)) { ShowSevereError(state, RoutineName + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + "=\"" + cAlphaArgs(1) + "\", the number of surface/radiant fraction groups entered was less than the allowable minimum."); - ShowContinueError(state, "...the minimum that must be entered=[" + RoundSigDigits(MinDistribSurfaces) + "]."); + ShowContinueError(state, format("...the minimum that must be entered=[{}].", MinDistribSurfaces)); ErrorsFound = true; state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).TotSurfToDistrib = 0; } @@ -548,13 +554,13 @@ namespace SteamBaseboardRadiator { if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribToSurf(SurfNum) > MaxFraction) { ShowWarningError(state, RoutineName + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(SurfNum + 8) + "was greater than the allowable maximum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MaxFraction, 1) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.1R}].", MaxFraction)); state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).TotSurfToDistrib = MaxFraction; } if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribToSurf(SurfNum) < MinFraction) { ShowWarningError(state, RoutineName + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(SurfNum + 8) + "was less than the allowable minimum."); - ShowContinueError(state, "...reset to maximum value=[" + RoundSigDigits(MinFraction, 1) + "]."); + ShowContinueError(state, format("...reset to maximum value=[{:.1R}].", MinFraction)); state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).TotSurfToDistrib = MinFraction; } if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SurfacePtr(SurfNum) != 0) { @@ -879,7 +885,6 @@ namespace SteamBaseboardRadiator { // USE BranchInputManager, ONLY: MyPlantSizingIndex using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1023,10 +1028,10 @@ namespace SteamBaseboardRadiator { ShowMessage(state, "SizeSteamBaseboard: Potential issue with equipment sizing for " "ZoneHVAC:Baseboard:RadiantConvective:Steam=\"" + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID + "\"."); - ShowContinueError(state, "User-Specified Maximum Steam Flow Rate of " + RoundSigDigits(SteamVolFlowRateMaxUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Steam Flow Rate of " + - RoundSigDigits(SteamVolFlowRateMaxDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Steam Flow Rate of {:.5R} [m3/s]", SteamVolFlowRateMaxUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Steam Flow Rate of {:.5R} [m3/s]", SteamVolFlowRateMaxDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1278,7 +1283,6 @@ namespace SteamBaseboardRadiator { using DataHeatBalFanSys::QSteamBaseboardSurf; using DataHeatBalFanSys::QSteamBaseboardToPerson; using DataSurfaces::Surface; - using General::RoundSigDigits; Real64 const SmallestArea(0.001); // Smallest area in meters squared (to avoid a divide by zero) @@ -1306,16 +1310,16 @@ namespace SteamBaseboardRadiator { if (ThisSurfIntensity > MaxRadHeatFlux) { // CR 8074, trap for excessive intensity (throws off surface balance ) ShowSevereError(state, "DistributeBBSteamRadGains: excessive thermal radiation heat flux intensity detected"); ShowContinueError(state, "Surface = " + Surface(SurfNum).Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(Surface(SurfNum).Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", Surface(SurfNum).Area)); ShowContinueError(state, "Occurs in " + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + " = " + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID); - ShowContinueError(state, "Radiation intensity = " + RoundSigDigits(ThisSurfIntensity, 2) + " [W/m2]"); + ShowContinueError(state, format("Radiation intensity = {:.2R} [W/m2]", ThisSurfIntensity)); ShowContinueError(state, "Assign a larger surface area or more surfaces in " + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam); ShowFatalError(state, "DistributeBBSteamRadGains: excessive thermal radiation heat flux intensity detected"); } } else { // small surface ShowSevereError(state, "DistributeBBSteamRadGains: surface not large enough to receive thermal radiation heat flux"); ShowContinueError(state, "Surface = " + Surface(SurfNum).Name); - ShowContinueError(state, "Surface area = " + RoundSigDigits(Surface(SurfNum).Area, 3) + " [m2]"); + ShowContinueError(state, format("Surface area = {:.3R} [m2]", Surface(SurfNum).Area)); ShowContinueError(state, "Occurs in " + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam + " = " + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID); ShowContinueError(state, "Assign a larger surface area or more surfaces in " + state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam); ShowFatalError(state, "DistributeBBSteamRadGains: surface not large enough to receive thermal radiation heat flux"); @@ -1443,7 +1447,7 @@ namespace SteamBaseboardRadiator { using DataPlant::CriteriaType_MassFlowRate; using DataPlant::CriteriaType_Temperature; using DataPlant::TypeOf_Baseboard_Rad_Conv_Steam; - using General::TrimSigDigits; + using PlantUtilities::PullCompInterconnectTrigger; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -1460,19 +1464,29 @@ namespace SteamBaseboardRadiator { } else { BaseboardNum = CompIndex; if (BaseboardNum > state.dataSteamBaseboardRadiator->NumSteamBaseboards || BaseboardNum < 1) { - ShowFatalError(state, "UpdateSteamBaseboardPlantConnection: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + - ", Number of baseboards=" + TrimSigDigits(state.dataSteamBaseboardRadiator->NumSteamBaseboards) + ", Entered baseboard name=" + BaseboardName); + ShowFatalError( + state, + format("UpdateSteamBaseboardPlantConnection: Invalid CompIndex passed={}, Number of baseboards={}, Entered baseboard name={}", + BaseboardNum, + state.dataSteamBaseboardRadiator->NumSteamBaseboards, + BaseboardName)); } if (state.dataGlobal->KickOffSimulation) { if (BaseboardName != state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID) { - ShowFatalError(state, "UpdateSteamBaseboardPlantConnection: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + - ", baseboard name=" + BaseboardName + - ", stored baseboard Name for that index=" + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID); + ShowFatalError(state, + format("UpdateSteamBaseboardPlantConnection: Invalid CompIndex passed={}, baseboard name={}, stored baseboard " + "Name for that index={}", + BaseboardNum, + BaseboardName, + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID)); } if (BaseboardTypeNum != TypeOf_Baseboard_Rad_Conv_Steam) { - ShowFatalError(state, "UpdateSteamBaseboardPlantConnection: Invalid CompIndex passed=" + TrimSigDigits(BaseboardNum) + - ", baseboard name=" + BaseboardName + - ", stored baseboard Name for that index=" + ccSimPlantEquipTypes(BaseboardTypeNum)); + ShowFatalError(state, + format("UpdateSteamBaseboardPlantConnection: Invalid CompIndex passed={}, baseboard name={}, stored baseboard " + "Name for that index={}", + BaseboardNum, + BaseboardName, + ccSimPlantEquipTypes(BaseboardTypeNum))); } } } diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index cd1a3130f29..97d81b80ec9 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -129,9 +128,6 @@ namespace SteamCoils { // PURPOSE OF THIS SUBROUTINE: // This subroutine manages SteamCoil component simulation. - // Using/Aliasing - using General::TrimSigDigits; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 QCoilActualTemp; // coil load actually delivered returned to calling component int CoilNum; // The SteamCoil that you are currently loading input into @@ -155,13 +151,20 @@ namespace SteamCoils { } else { CoilNum = CompIndex; if (CoilNum > state.dataSteamCoils->NumSteamCoils || CoilNum < 1) { - ShowFatalError(state, "SimulateSteamCoilComponents: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Number of Steam Coils=" + TrimSigDigits(state.dataSteamCoils->NumSteamCoils) + ", Coil name=" + CompName); + ShowFatalError(state, + format("SimulateSteamCoilComponents: Invalid CompIndex passed={}, Number of Steam Coils={}, Coil name={}", + CoilNum, + state.dataSteamCoils->NumSteamCoils, + CompName)); } if (state.dataSteamCoils->CheckEquipName(CoilNum)) { if (CompName != state.dataSteamCoils->SteamCoil(CoilNum).Name) { - ShowFatalError(state, "SimulateSteamCoilComponents: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + ", Coil name=" + CompName + - ", stored Coil Name for that index=" + state.dataSteamCoils->SteamCoil(CoilNum).Name); + ShowFatalError( + state, + format("SimulateSteamCoilComponents: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + CoilNum, + CompName, + state.dataSteamCoils->SteamCoil(CoilNum).Name)); } state.dataSteamCoils->CheckEquipName(CoilNum) = false; } @@ -1534,9 +1537,6 @@ namespace SteamCoils { // PURPOSE OF THIS SUBROUTINE: // Gets the correct schedule value for this coil - // Using/Aliasing - using General::TrimSigDigits; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CoilNum; @@ -1557,12 +1557,18 @@ namespace SteamCoils { } else { CoilNum = CompIndex; if (CoilNum > state.dataSteamCoils->NumSteamCoils || CoilNum < 1) { - ShowFatalError(state, "SimulateSteamCoilComponents: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Number of Steam Coils=" + TrimSigDigits(state.dataSteamCoils->NumSteamCoils) + ", Coil name=" + CompName); + ShowFatalError(state, + format("SimulateSteamCoilComponents: Invalid CompIndex passed={}, Number of Steam Coils={}, Coil name={}", + CoilNum, + state.dataSteamCoils->NumSteamCoils, + CompName)); } if (CompName != state.dataSteamCoils->SteamCoil(CoilNum).Name) { - ShowFatalError(state, "SimulateSteamCoilComponents: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + ", Coil name=" + CompName + - ", stored Coil Name for that index=" + state.dataSteamCoils->SteamCoil(CoilNum).Name); + ShowFatalError(state, + format("SimulateSteamCoilComponents: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + CoilNum, + CompName, + state.dataSteamCoils->SteamCoil(CoilNum).Name)); } Value = GetCurrentScheduleValue(state, state.dataSteamCoils->SteamCoil(CoilNum).SchedPtr); // not scheduled? } @@ -2166,17 +2172,16 @@ namespace SteamCoils { // PURPOSE OF THIS FUNCTION: // This function sets data to water Heating Coil using the coil index and arguments passed - // Using/Aliasing - using General::TrimSigDigits; - if (state.dataSteamCoils->GetSteamCoilsInputFlag) { GetSteamCoilInput(state); state.dataSteamCoils->GetSteamCoilsInputFlag = false; } if (CoilNum <= 0 || CoilNum > state.dataSteamCoils->NumSteamCoils) { - ShowSevereError(state, "SetHeatingCoilData: called with heating coil Number out of range=" + TrimSigDigits(CoilNum) + " should be >0 and <" + - TrimSigDigits(state.dataSteamCoils->NumSteamCoils)); + ShowSevereError(state, + format("SetHeatingCoilData: called with heating coil Number out of range={} should be >0 and <{}", + CoilNum, + state.dataSteamCoils->NumSteamCoils)); ErrorsFound = true; return; } diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index e5775c089c1..e760f803268 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -274,7 +274,7 @@ namespace SurfaceGeometry { using namespace DataVectorTypes; using namespace OutputReportPredefined; - using General::RoundSigDigits; + using namespace DataReportingFlags; @@ -619,7 +619,7 @@ namespace SurfaceGeometry { if (Surface(SurfNum).Construction > 0 && Surface(SurfNum).Construction <= TotConstructs) { NominalUwithConvCoeffs = ComputeNominalUwithConvCoeffs(SurfNum, isWithConvCoefValid); if (isWithConvCoefValid) { - cNominalUwithConvCoeffs = RoundSigDigits(NominalUwithConvCoeffs, 3); + cNominalUwithConvCoeffs = format("{:.3R}", NominalUwithConvCoeffs); } else { cNominalUwithConvCoeffs = "[invalid]"; } @@ -627,7 +627,7 @@ namespace SurfaceGeometry { // SurfaceClass::Window also covers glass doors and TDD:Diffusers cNominalU = "N/A"; } else { - cNominalU = RoundSigDigits(NominalU(Surface(SurfNum).Construction), 3); + cNominalU = format("{:.3R}", NominalU(Surface(SurfNum).Construction)); } } else { cNominalUwithConvCoeffs = "**"; @@ -918,8 +918,7 @@ namespace SurfaceGeometry { // Surface%Vertex(1:) using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + using namespace Vectors; using ScheduleManager::GetScheduleMaxValue; using ScheduleManager::GetScheduleMinValue; @@ -1355,7 +1354,7 @@ namespace SurfaceGeometry { // A shading surface ++MovedSurfs; - // Store list of moved surface numbers in reporting order + // Store list of moved surface numbers in reporting order Surface(MovedSurfs) = state.dataSurfaceGeometry->SurfaceTmp(SurfNum); SurfaceTmpClassMoved(SurfNum) = true; //'Moved' DataSurfaces::AllSurfaceListReportOrder.push_back(MovedSurfs); @@ -1582,9 +1581,9 @@ namespace SurfaceGeometry { " does not have the same materials in the reverse order as the construction " + state.dataConstruction->Construct(ConstrNumFound).Name + " of adjacent surface " + Surface(Found).Name); ShowContinueError(state, "or the properties of the reversed layers are not correct due to differing layer front and back side values"); - ShowContinueError(state, "...but Nominal U values are similar, diff=[" + - RoundSigDigits(std::abs(NominalU(ConstrNum) - NominalU(ConstrNumFound)), 4) + - "] ... simulation proceeds."); + ShowContinueError(state, + format("...but Nominal U values are similar, diff=[{:.4R}] ... simulation proceeds.", + std::abs(NominalU(ConstrNum) - NominalU(ConstrNumFound)))); if (!izConstDiffMsg) { ShowContinueError(state, "...if the two zones are expected to have significantly different temperatures, the proper " "\"reverse\" construction should be created."); @@ -1619,10 +1618,16 @@ namespace SurfaceGeometry { "InterZone Surface Areas do not match as expected and might not satisfy conservation of energy:"); if (MultFound == 1 && MultSurfNum == 1) { - ShowContinueError(state, " Area=" + TrimSigDigits(Surface(SurfNum).Area, 1) + - " in Surface=" + Surface(SurfNum).Name + ", Zone=" + Surface(SurfNum).ZoneName); - ShowContinueError(state, " Area=" + TrimSigDigits(Surface(Found).Area, 1) + - " in Surface=" + Surface(Found).Name + ", Zone=" + Surface(Found).ZoneName); + ShowContinueError(state, + format(" Area={:.1T} in Surface={}, Zone={}", + Surface(SurfNum).Area, + Surface(SurfNum).Name, + Surface(SurfNum).ZoneName)); + ShowContinueError(state, + format(" Area={:.1T} in Surface={}, Zone={}", + Surface(Found).Area, + Surface(Found).Name, + Surface(Found).ZoneName)); } else { // Show multiplier info ShowContinueError(state, format(" Area={:.1T}, Multipliers={}, Total Area={:.1T} in Surface={} Zone={}", Surface(SurfNum).Area, @@ -1645,10 +1650,15 @@ namespace SurfaceGeometry { // Tilt if (std::abs(std::abs(Surface(Found).Tilt + Surface(SurfNum).Tilt) - 180.0) > 1.0) { ShowWarningError(state, RoutineName + "InterZone Surface Tilts do not match as expected."); - ShowContinueError(state, " Tilt=" + TrimSigDigits(Surface(SurfNum).Tilt, 1) + " in Surface=" + Surface(SurfNum).Name + - ", Zone=" + Surface(SurfNum).ZoneName); - ShowContinueError(state, " Tilt=" + TrimSigDigits(Surface(Found).Tilt, 1) + " in Surface=" + Surface(Found).Name + - ", Zone=" + Surface(Found).ZoneName); + ShowContinueError(state, + format(" Tilt={:.1T} in Surface={}, Zone={}", + Surface(SurfNum).Tilt, + Surface(SurfNum).Name, + Surface(SurfNum).ZoneName)); + ShowContinueError( + state, + format( + " Tilt={:.1T} in Surface={}, Zone={}", Surface(Found).Tilt, Surface(Found).Name, Surface(Found).ZoneName)); } // check surface class match. interzone surface. @@ -1683,12 +1693,18 @@ namespace SurfaceGeometry { if (std::abs(Surface(SurfNum).SinTilt) > 0.5 || state.dataGlobal->DisplayExtraWarnings) { // if horizontal surfaces, then these are windows/doors/etc in those items. ShowWarningError(state, RoutineName + "InterZone Surface Azimuths do not match as expected."); - ShowContinueError(state, " Azimuth=" + TrimSigDigits(Surface(SurfNum).Azimuth, 1) + - ", Tilt=" + TrimSigDigits(Surface(SurfNum).Tilt, 1) + - ", in Surface=" + Surface(SurfNum).Name + ", Zone=" + Surface(SurfNum).ZoneName); - ShowContinueError(state, " Azimuth=" + TrimSigDigits(Surface(Found).Azimuth, 1) + - ", Tilt=" + TrimSigDigits(Surface(Found).Tilt, 1) + ", in Surface=" + Surface(Found).Name + - ", Zone=" + Surface(Found).ZoneName); + ShowContinueError(state, + format(" Azimuth={:.1T}, Tilt={:.1T}, in Surface={}, Zone={}", + Surface(SurfNum).Azimuth, + Surface(SurfNum).Tilt, + Surface(SurfNum).Name, + Surface(SurfNum).ZoneName)); + ShowContinueError(state, + format(" Azimuth={:.1T}, Tilt={:.1T}, in Surface={}, Zone={}", + Surface(Found).Azimuth, + Surface(Found).Tilt, + Surface(Found).Name, + Surface(Found).ZoneName)); ShowContinueError(state, "..surface class of first surface=" + cSurfaceClass(Surface(SurfNum).Class)); ShowContinueError(state, "..surface class of second surface=" + cSurfaceClass(Surface(Found).Class)); } @@ -1932,9 +1948,11 @@ namespace SurfaceGeometry { // Warn user of using specified Zone Floor Area ShowWarningError(state, RoutineName + "Entered Floor Area entered for Zone=\"" + Zone(ZoneNum).Name + "\" significantly different from calculated Floor Area"); - ShowContinueError(state, "Entered Zone Floor Area value=" + RoundSigDigits(Zone(ZoneNum).UserEnteredFloorArea, 2) + - ", Calculated Zone Floor Area value=" + RoundSigDigits(Zone(ZoneNum).CalcFloorArea, 2) + - ", entered Floor Area will be used in calculations."); + ShowContinueError(state, + format("Entered Zone Floor Area value={:.2R}, Calculated Zone Floor Area value={:.2R}, entered " + "Floor Area will be used in calculations.", + Zone(ZoneNum).UserEnteredFloorArea, + Zone(ZoneNum).CalcFloorArea)); } } } @@ -1949,13 +1967,13 @@ namespace SurfaceGeometry { for (int SurfNum = 1; SurfNum <= MovedSurfs; ++SurfNum) { // TotSurfaces if (Surface(SurfNum).Area < 1.e-06) { - ShowSevereError(state, RoutineName + "Zero or negative surface area[" + RoundSigDigits(Surface(SurfNum).Area, 5) + - "], Surface=" + Surface(SurfNum).Name); + ShowSevereError( + state, format("{}Zero or negative surface area[{:.5R}], Surface={}", RoutineName, Surface(SurfNum).Area, Surface(SurfNum).Name)); SurfError = true; } if (Surface(SurfNum).Area >= 1.e-06 && Surface(SurfNum).Area < 0.001) { - ShowWarningError(state, RoutineName + "Very small surface area[" + RoundSigDigits(Surface(SurfNum).Area, 5) + - "], Surface=" + Surface(SurfNum).Name); + ShowWarningError(state, + format("{}Very small surface area[{:.5R}], Surface={}", RoutineName, Surface(SurfNum).Area, Surface(SurfNum).Name)); } } @@ -2145,8 +2163,9 @@ namespace SurfaceGeometry { } } if (iTmp1 > 0) { - ShowWarningError(state, RoutineName + "Surfaces use InfraredTransparent constructions " + TrimSigDigits(iTmp1) + - " in non-interzone surfaces. (illegal use)"); + ShowWarningError( + state, + format("{}Surfaces use InfraredTransparent constructions {} in non-interzone surfaces. (illegal use)", RoutineName, iTmp1)); ShowContinueError(state, "For explicit details on each use, use Output:Diagnostics,DisplayExtraWarnings;"); } } @@ -2154,41 +2173,53 @@ namespace SurfaceGeometry { // Note, could do same for Window Area and detecting if Interzone Surface in Zone if (state.dataSurfaceGeometry->Warning1Count > 0) { - ShowWarningMessage(state, RoutineName + "Window dimensions differ from Window 5/6 data file dimensions, " + TrimSigDigits(state.dataSurfaceGeometry->Warning1Count) + - " times."); + ShowWarningMessage(state, + format("{}Window dimensions differ from Window 5/6 data file dimensions, {} times.", + RoutineName, + state.dataSurfaceGeometry->Warning1Count)); ShowContinueError(state, "This will affect the frame heat transfer calculation if the frame in the Data File entry"); ShowContinueError(state, "is not uniform, i.e., has sections with different geometry and/or thermal properties."); ShowContinueError(state, "For explicit details on each window, use Output:Diagnostics,DisplayExtraWarnings;"); } if (state.dataSurfaceGeometry->Warning2Count > 0) { - ShowWarningMessage(state, RoutineName + "Exterior Windows have been replaced with Window 5/6 two glazing systems, " + - TrimSigDigits(state.dataSurfaceGeometry->Warning2Count) + " times."); + ShowWarningMessage(state, + format("{}Exterior Windows have been replaced with Window 5/6 two glazing systems, {} times.", + RoutineName, + state.dataSurfaceGeometry->Warning2Count)); ShowContinueError(state, "Note that originally entered dimensions are overridden."); ShowContinueError(state, "For explicit details on each window, use Output:Diagnostics,DisplayExtraWarnings;"); } if (state.dataSurfaceGeometry->Warning3Count > 0) { - ShowWarningMessage(state, RoutineName + "Interior Windows have been replaced with Window 5/6 two glazing systems, " + - TrimSigDigits(state.dataSurfaceGeometry->Warning3Count) + " times."); + ShowWarningMessage(state, + format("{}Interior Windows have been replaced with Window 5/6 two glazing systems, {} times.", + RoutineName, + state.dataSurfaceGeometry->Warning3Count)); ShowContinueError(state, "Note that originally entered dimensions are overridden."); ShowContinueError(state, "For explicit details on each window, use Output:Diagnostics,DisplayExtraWarnings;"); } if (TotalMultipliedWindows > 0) { - ShowWarningMessage(state, RoutineName + "There are " + TrimSigDigits(TotalMultipliedWindows) + - " window/glass door(s) that may cause inaccurate shadowing due to Solar Distribution."); + ShowWarningMessage(state, + format("{}There are {} window/glass door(s) that may cause inaccurate shadowing due to Solar Distribution.", + RoutineName, + TotalMultipliedWindows)); ShowContinueError(state, "For explicit details on each window, use Output:Diagnostics,DisplayExtraWarnings;"); TotalWarningErrors += TotalMultipliedWindows; } if (TotalCoincidentVertices > 0) { ShowWarningMessage(state, - RoutineName + "There are " + TrimSigDigits(TotalCoincidentVertices) + - " coincident/collinear vertices; These have been deleted unless the deletion would bring the number of surface sides < 3."); + format("{}There are {} coincident/collinear vertices; These have been deleted unless the deletion would bring the " + "number of surface sides < 3.", + RoutineName, + TotalCoincidentVertices)); ShowContinueError(state, "For explicit details on each problem surface, use Output:Diagnostics,DisplayExtraWarnings;"); TotalWarningErrors += TotalCoincidentVertices; } if (TotalDegenerateSurfaces > 0) { - ShowSevereMessage(state, RoutineName + "There are " + TrimSigDigits(TotalDegenerateSurfaces) + - " degenerate surfaces; Degenerate surfaces are those with number of sides < 3."); + ShowSevereMessage(state, + format("{}There are {} degenerate surfaces; Degenerate surfaces are those with number of sides < 3.", + RoutineName, + TotalDegenerateSurfaces)); ShowContinueError(state, "These surfaces should be deleted."); ShowContinueError(state, "For explicit details on each problem surface, use Output:Diagnostics,DisplayExtraWarnings;"); TotalSevereErrors += TotalDegenerateSurfaces; @@ -2257,27 +2288,34 @@ namespace SurfaceGeometry { if (((std::abs(baseSurface.Azimuth - subSurface.Azimuth) > errorTolerance) && !baseSurfHoriz) || (std::abs(baseSurface.Tilt - subSurface.Tilt) > errorTolerance)) { surfaceError = true; - ShowSevereError(state, "checkSubSurfAzTiltNorm: Outward facing angle of subsurface differs more than " + - General::RoundSigDigits(errorTolerance, 1) + " degrees from base surface."); - ShowContinueError(state, "Subsurface=\"" + subSurface.Name + "\" Tilt = " + General::RoundSigDigits(subSurface.Tilt, 1) + - " Azimuth = " + General::RoundSigDigits(subSurface.Azimuth, 1)); - ShowContinueError(state, "Base surface=\"" + baseSurface.Name + "\" Tilt = " + General::RoundSigDigits(baseSurface.Tilt, 1) + - " Azimuth = " + General::RoundSigDigits(baseSurface.Azimuth, 1)); + ShowSevereError( + state, + format("checkSubSurfAzTiltNorm: Outward facing angle of subsurface differs more than {:.1R} degrees from base surface.", + errorTolerance)); + ShowContinueError(state, + format("Subsurface=\"{}\" Tilt = {:.1R} Azimuth = {:.1R}", subSurface.Name, subSurface.Tilt, subSurface.Azimuth)); + ShowContinueError( + state, format("Base surface=\"{}\" Tilt = {:.1R} Azimuth = {:.1R}", baseSurface.Name, baseSurface.Tilt, baseSurface.Azimuth)); } else if (((std::abs(baseSurface.Azimuth - subSurface.Azimuth) > warningTolerance) && !baseSurfHoriz) || (std::abs(baseSurface.Tilt - subSurface.Tilt) > warningTolerance)) { ++state.dataSurfaceGeometry->checkSubSurfAzTiltNormErrCount; if (state.dataSurfaceGeometry->checkSubSurfAzTiltNormErrCount == 1 && !state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, "checkSubSurfAzTiltNorm: Some Outward Facing angles of subsurfaces differ more than " + - General::RoundSigDigits(warningTolerance, 1) + " degrees from base surface."); + ShowWarningError( + state, + format("checkSubSurfAzTiltNorm: Some Outward Facing angles of subsurfaces differ more than {:.1R} degrees from base surface.", + warningTolerance)); ShowContinueError(state, "...use Output:Diagnostics,DisplayExtraWarnings; to show more details on individual surfaces."); } if (state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, "checkSubSurfAzTiltNorm: Outward facing angle of subsurface differs more than " + - General::RoundSigDigits(warningTolerance, 1) + " degrees from base surface."); - ShowContinueError(state, "Subsurface=\"" + subSurface.Name + "\" Tilt = " + General::RoundSigDigits(subSurface.Tilt, 1) + - " Azimuth = " + General::RoundSigDigits(subSurface.Azimuth, 1)); - ShowContinueError(state, "Base surface=\"" + baseSurface.Name + "\" Tilt = " + General::RoundSigDigits(baseSurface.Tilt, 1) + - " Azimuth = " + General::RoundSigDigits(baseSurface.Azimuth, 1)); + ShowWarningError( + state, + format("checkSubSurfAzTiltNorm: Outward facing angle of subsurface differs more than {:.1R} degrees from base surface.", + warningTolerance)); + ShowContinueError( + state, format("Subsurface=\"{}\" Tilt = {:.1R} Azimuth = {:.1R}", subSurface.Name, subSurface.Tilt, subSurface.Azimuth)); + ShowContinueError( + state, + format("Base surface=\"{}\" Tilt = {:.1R} Azimuth = {:.1R}", baseSurface.Name, baseSurface.Tilt, baseSurface.Azimuth)); } } } @@ -2597,7 +2635,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; using namespace DataReportingFlags; - using General::TrimSigDigits; + using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMaxValue; @@ -2637,8 +2675,8 @@ namespace SurfaceGeometry { inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, Loop, NumAlphas, NumNumbers); if (NumAlphas != 2) { - ShowSevereError(state, cCurrentModuleObject + - ": Object Definition indicates not = 2 Alpha Objects, Number Indicated=" + TrimSigDigits(NumAlphas)); + ShowSevereError( + state, format("{}: Object Definition indicates not = 2 Alpha Objects, Number Indicated={}", cCurrentModuleObject, NumAlphas)); ErrorsFound = true; } @@ -2709,12 +2747,19 @@ namespace SurfaceGeometry { numSides = (NumNumbers - 1) / 3; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides = numSides; if (mod(NumNumbers - 1, 3) != 0) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + cNumericFieldNames(1) + - " not even multiple of 3. Will read in " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); + ShowWarningError(state, + cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + + format("{} not even multiple of 3. Will read in {}", + cNumericFieldNames(1), + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } if (numSides < 3) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + cNumericFieldNames(1) + - " (autocalculate) must be >= 3. Only " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + " provided."); + ShowSevereError(state, + format("{}=\"{}\", {} (autocalculate) must be >= 3. Only {} provided.", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + cNumericFieldNames(1), + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); ErrorsFound = true; continue; } @@ -2722,10 +2767,11 @@ namespace SurfaceGeometry { numSides = (NumNumbers - 1) / 3; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides = rNumericArgs(1); if (numSides > state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", field " + cNumericFieldNames(1) + '=' + - TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); - ShowContinueError(state, "...but " + TrimSigDigits(numSides) + " were entered. Only the indicated " + cNumericFieldNames(1) + - " will be used."); + ShowWarningError(state, + cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", field " + + cNumericFieldNames(1) + '=' + fmt::to_string(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); + ShowContinueError(state, + format("...but {} were entered. Only the indicated {} will be used.", numSides, cNumericFieldNames(1))); } } state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.allocate(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); @@ -2759,7 +2805,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; using namespace DataReportingFlags; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static Array1D_string const cModuleObjects(2, {"Shading:Site", "Shading:Building"}); @@ -2792,8 +2837,8 @@ namespace SurfaceGeometry { inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, Loop, NumAlphas, NumNumbers); if (NumAlphas != 1) { - ShowSevereError(state, cCurrentModuleObject + - ": Object Definition indicates not = 1 Alpha Objects, Number Indicated=" + TrimSigDigits(NumAlphas)); + ShowSevereError( + state, format("{}: Object Definition indicates not = 1 Alpha Objects, Number Indicated={}", cCurrentModuleObject, NumAlphas)); ErrorsFound = true; } @@ -2837,8 +2882,11 @@ namespace SurfaceGeometry { state, SurfNum, rNumericArgs(3), rNumericArgs(4), rNumericArgs(5), rNumericArgs(6), rNumericArgs(7), state.dataSurfaceGeometry->RectSurfRefWorldCoordSystem); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", Surface Area <= 0.0; Entered Area=" + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area, 2)); + ShowSevereError(state, + format("{}=\"{}\", Surface Area <= 0.0; Entered Area={:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area)); ErrorsFound = true; } @@ -2977,8 +3025,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static Array1D_string const cModuleObjects(4, {"BuildingSurface:Detailed", "Wall:Detailed", "Floor:Detailed", "RoofCeiling:Detailed"}); @@ -3022,14 +3068,16 @@ namespace SurfaceGeometry { inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, Loop, SurfaceNumAlpha, SurfaceNumProp); if (Item == 1) { if (SurfaceNumAlpha != 8) { - ShowSevereError(state, cCurrentModuleObject + - ": Object Definition indicates not = 8 Alpha Objects, Number Indicated=" + TrimSigDigits(SurfaceNumAlpha)); + ShowSevereError( + state, + format("{}: Object Definition indicates not = 8 Alpha Objects, Number Indicated={}", cCurrentModuleObject, SurfaceNumAlpha)); ErrorsFound = true; } } else { if (SurfaceNumAlpha != 7) { - ShowSevereError(state, cCurrentModuleObject + - ": Object Definition indicates not = 7 Alpha Objects, Number Indicated=" + TrimSigDigits(SurfaceNumAlpha)); + ShowSevereError( + state, + format("{}: Object Definition indicates not = 7 Alpha Objects, Number Indicated={}", cCurrentModuleObject, SurfaceNumAlpha)); ErrorsFound = true; } } @@ -3127,7 +3175,7 @@ namespace SurfaceGeometry { if (!GroundTempObjInput) { ShowWarningError(state, "GetHTSurfaceData: Surfaces with interface to Ground found but no \"Ground Temperatures\" were input."); ShowContinueError(state, "Found first in surface=" + cAlphaArgs(1)); - ShowContinueError(state, "Defaults, constant throughout the year of (" + RoundSigDigits(GroundTemp, 1) + ") will be used."); + ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTemp)); } state.dataSurfaceGeometry->NoGroundTempObjWarning = false; } @@ -3315,12 +3363,19 @@ namespace SurfaceGeometry { numSides = (SurfaceNumProp - 2) / 3; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides = numSides; if (mod(SurfaceNumProp - 2, 3) != 0) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + cNumericFieldNames(2) + - " not even multiple of 3. Will read in " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); + ShowWarningError(state, + cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + + format("{} not even multiple of 3. Will read in {}", + cNumericFieldNames(2), + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } if (numSides < 3) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + cNumericFieldNames(2) + - " (autocalculate) must be >= 3. Only " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + " provided."); + ShowSevereError(state, + format("{}=\"{}\", {} (autocalculate) must be >= 3. Only {} provided.", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + cNumericFieldNames(2), + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); ErrorsFound = true; continue; } @@ -3328,27 +3383,34 @@ namespace SurfaceGeometry { numSides = (SurfaceNumProp - 2) / 3; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides = rNumericArgs(2); if (numSides > state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", field " + cNumericFieldNames(2) + '=' + - TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); - ShowContinueError(state, "...but " + TrimSigDigits(numSides) + " were entered. Only the indicated " + cNumericFieldNames(2) + - " will be used."); + ShowWarningError(state, + cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", field " + + cNumericFieldNames(2) + '=' + fmt::to_string(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); + ShowContinueError(state, + format("...but {} were entered. Only the indicated {} will be used.", numSides, cNumericFieldNames(2))); } } state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.allocate(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); state.dataSurfaceGeometry->SurfaceTmp(SurfNum).NewVertex.allocate(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); GetVertices(state, SurfNum, state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides, rNumericArgs({3, _})); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", Surface Area <= 0.0; Entered Area=" + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area, 2)); + ShowSevereError(state, + format("{}=\"{}\", Surface Area <= 0.0; Entered Area={:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area)); ErrorsFound = true; } CheckConvexity(state, SurfNum, state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); if (UtilityRoutines::SameString(cAlphaArgs(5), "Surface")) { if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides != static_cast(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.size())) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", After CheckConvexity, mismatch between Sides (" + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + - ") and size of Vertex (" + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.size()) + ")."); + ShowSevereError(state, + format("{}=\"{}\", After CheckConvexity, mismatch between Sides ({}) and size of Vertex ({}).", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.size())); ShowContinueError(state, "CheckConvexity is used to verify the convexity of a surface and detect collinear points."); ErrorsFound = true; } @@ -3358,8 +3420,11 @@ namespace SurfaceGeometry { if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Wall && state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsCfactorWall) { if (std::abs(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Height - state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).Height) > 0.05) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", underground Wall Height = " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Height, 2)); + ShowWarningError(state, + format("{}=\"{}\", underground Wall Height = {:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Height)); ShowContinueError(state, "..which does not match its construction height."); } } @@ -3367,13 +3432,19 @@ namespace SurfaceGeometry { // Check area and perimeter for the FFactor floors if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Floor && state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsFfactorFloor) { if (std::abs(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area - state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).Area) > 0.1) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", underground Floor Area = " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area, 2)); + ShowWarningError(state, + format("{}=\"{}\", underground Floor Area = {:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area)); ShowContinueError(state, "..which does not match its construction area."); } if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Perimeter < state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).PerimeterExposed - 0.1) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", underground Floor Perimeter = " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Perimeter, 2)); + ShowWarningError(state, + format("{}=\"{}\", underground Floor Perimeter = {:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Perimeter)); ShowContinueError(state, "..which is less than its construction exposed perimeter."); } } @@ -3391,11 +3462,16 @@ namespace SurfaceGeometry { "\" references an outside boundary surface that cannot be found:" + state.dataSurfaceGeometry->SurfaceTmp(i).ExtBoundCondName); ErrorsFound = true; // If vertex size mistmatch - } else if (state.dataSurfaceGeometry->SurfaceTmp(i).Vertex.size() != state.dataSurfaceGeometry->SurfaceTmp(ExtSurfNum).Vertex.size()) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(i).Name + "\", Vertex size mismatch between base surface :" + - state.dataSurfaceGeometry->SurfaceTmp(i).Name + " and outside boundary surface: " + state.dataSurfaceGeometry->SurfaceTmp(ExtSurfNum).Name); - ShowContinueError(state, "The vertex sizes are " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(i).Vertex.size()) + " for base surface and " + - TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(ExtSurfNum).Vertex.size()) + " for outside boundary surface. Please check inputs."); + } else if (state.dataSurfaceGeometry->SurfaceTmp(i).Vertex.size() != + state.dataSurfaceGeometry->SurfaceTmp(ExtSurfNum).Vertex.size()) { + ShowSevereError(state, + cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(i).Name + + "\", Vertex size mismatch between base surface :" + state.dataSurfaceGeometry->SurfaceTmp(i).Name + + " and outside boundary surface: " + state.dataSurfaceGeometry->SurfaceTmp(ExtSurfNum).Name); + ShowContinueError(state, + format("The vertex sizes are {} for base surface and {} for outside boundary surface. Please check inputs.", + state.dataSurfaceGeometry->SurfaceTmp(i).Vertex.size(), + state.dataSurfaceGeometry->SurfaceTmp(ExtSurfNum).Vertex.size())); ErrorsFound = true; } } @@ -3431,8 +3507,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static Array1D_string const cModuleObjects(10, @@ -3545,8 +3619,8 @@ namespace SurfaceGeometry { } if (NumNumbers < 7) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", Too few number of numeric args=[" + - TrimSigDigits(NumNumbers) + "]."); + ShowSevereError(state, + format("{}=\"{}\", Too few number of numeric args=[{}].", cCurrentModuleObject, cAlphaArgs(1), NumNumbers)); ErrorsFound = true; } @@ -3636,7 +3710,7 @@ namespace SurfaceGeometry { if (!GroundTempObjInput) { ShowWarningError(state, "GetRectSurfaces: Surfaces with interface to Ground found but no \"Ground Temperatures\" were input."); ShowContinueError(state, "Found first in surface=" + cAlphaArgs(1)); - ShowContinueError(state, "Defaults, constant throughout the year of (" + RoundSigDigits(GroundTemp, 1) + ") will be used."); + ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTemp)); } state.dataSurfaceGeometry->NoGroundTempObjWarning = false; } @@ -3674,31 +3748,44 @@ namespace SurfaceGeometry { state, SurfNum, rNumericArgs(3), rNumericArgs(4), rNumericArgs(5), rNumericArgs(6), rNumericArgs(7), state.dataSurfaceGeometry->RectSurfRefWorldCoordSystem); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", Surface Area <= 0.0; Entered Area=" + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area, 2)); + ShowSevereError(state, + format("{}=\"{}\", Surface Area <= 0.0; Entered Area={:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area)); ErrorsFound = true; } // Check wall height for the CFactor walls - - if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Wall && state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == GroundFCfactorMethod) { + if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Wall && + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == GroundFCfactorMethod) { if (std::abs(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Height - state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).Height) > 0.05) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", underground Wall Height = " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Height, 2)); + ShowWarningError(state, + format("{}=\"{}\", underground Wall Height = {:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Height)); ShowContinueError(state, "..which deos not match its construction height."); } } // Check area and perimeter for the FFactor floors - if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Floor && state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == GroundFCfactorMethod) { + if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Floor && + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == GroundFCfactorMethod) { if (std::abs(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area - state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).Area) > 0.1) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", underground Floor Area = " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area, 2)); + ShowWarningError(state, + format("{}=\"{}\", underground Floor Area = {:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area)); ShowContinueError(state, "..which does not match its construction area."); } if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Perimeter < state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).PerimeterExposed - 0.1) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", underground Floor Perimeter = " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Perimeter, 2)); + ShowWarningError(state, + format("{}=\"{}\", underground Floor Perimeter = {:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Perimeter)); ShowContinueError(state, "..which is less than its construction exposed perimeter."); } } @@ -3987,8 +4074,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4009,14 +4094,14 @@ namespace SurfaceGeometry { inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, Loop, SurfaceNumAlpha, SurfaceNumProp); if (SurfaceNumAlpha != 6) { - ShowSevereError(state, cCurrentModuleObject + - ": Object Definition indicates not = 6 Alpha Objects, Number Indicated=" + TrimSigDigits(SurfaceNumAlpha)); + ShowSevereError( + state, format("{}: Object Definition indicates not = 6 Alpha Objects, Number Indicated={}", cCurrentModuleObject, SurfaceNumAlpha)); ErrorsFound = true; } if (SurfaceNumProp != 15) { - ShowSevereError(state, cCurrentModuleObject + - ": Object Definition indicates > 15 Numeric Objects, Number Indicated=" + TrimSigDigits(SurfaceNumAlpha)); + ShowSevereError( + state, format("{}: Object Definition indicates > 15 Numeric Objects, Number Indicated={}", cCurrentModuleObject, SurfaceNumAlpha)); ErrorsFound = true; } NeedToAddSurfaces = 0; @@ -4040,8 +4125,11 @@ namespace SurfaceGeometry { } if (SurfaceNumProp < 12) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", Too few number of numeric args=[" + - TrimSigDigits(SurfaceNumProp) + "]."); + ShowSevereError(state, + format("{}=\"{}\", Too few number of numeric args=[{}].", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + SurfaceNumProp)); ErrorsFound = true; } @@ -4188,12 +4276,19 @@ namespace SurfaceGeometry { rNumericArgs(3) = (SurfaceNumProp - 3) / 3; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides = rNumericArgs(3); if (mod(SurfaceNumProp - 3, 3) != 0) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + cNumericFieldNames(3) + - " not even multiple of 3. Will read in " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); + ShowWarningError(state, + cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + + format("{} not even multiple of 3. Will read in {}", + cNumericFieldNames(3), + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } if (rNumericArgs(3) < 3) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + cNumericFieldNames(3) + - " (autocalculate) must be >= 3. Only " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + " provided."); + ShowSevereError(state, + format("{}=\"{}\", {} (autocalculate) must be >= 3. Only {} provided.", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + cNumericFieldNames(3), + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); ErrorsFound = true; continue; } @@ -4201,10 +4296,10 @@ namespace SurfaceGeometry { numSides = (SurfaceNumProp - 2) / 3; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides = rNumericArgs(3); if (numSides > state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", field " + cNumericFieldNames(3) + '=' + - TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); - ShowContinueError(state, "...but " + TrimSigDigits(numSides) + " were entered. Only the indicated " + cNumericFieldNames(3) + - " will be used."); + ShowWarningError(state, + cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", field " + + cNumericFieldNames(3) + '=' + fmt::to_string(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); + ShowContinueError(state, format("...but {} were entered. Only the indicated {} will be used.", numSides, cNumericFieldNames(3))); } } state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.allocate(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); @@ -4215,8 +4310,12 @@ namespace SurfaceGeometry { if ((state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class != SurfaceClass::Window && state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class != SurfaceClass::GlassDoor && state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class != SurfaceClass::Door) && rNumericArgs(2) > 1.0) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", invalid " + cNumericFieldNames(2) + "=[" + - TrimSigDigits(rNumericArgs(2), 1) + "]."); + ShowWarningError(state, + format("{}=\"{}\", invalid {}=[{:.1T}].", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + cNumericFieldNames(2), + rNumericArgs(2))); ShowContinueError(state, "...because " + cAlphaFieldNames(2) + '=' + cAlphaArgs(2) + " multiplier will be set to 1.0."); state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Multiplier = 1.0; } @@ -4302,8 +4401,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4394,8 +4491,8 @@ namespace SurfaceGeometry { } if (NumNumbers < 5) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", Too few number of numeric args=[" + - TrimSigDigits(NumNumbers) + "]."); + ShowSevereError(state, + format("{}=\"{}\", Too few number of numeric args=[{}].", cCurrentModuleObject, cAlphaArgs(1), NumNumbers)); ErrorsFound = true; } @@ -4539,8 +4636,12 @@ namespace SurfaceGeometry { if ((state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class != SurfaceClass::Window && state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class != SurfaceClass::GlassDoor && state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class != SurfaceClass::Door) && rNumericArgs(1) > 1.0) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 1) + "]."); + ShowWarningError(state, + format("{}=\"{}\", invalid {}=[{:.1T}].", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + cNumericFieldNames(1), + rNumericArgs(1))); ShowContinueError(state, "...because " + cAlphaFieldNames(1) + '=' + cAlphaArgs(1) + " multiplier will be set to 1.0."); state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Multiplier = 1.0; } @@ -4549,8 +4650,11 @@ namespace SurfaceGeometry { state, state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurf, SurfNum, rNumericArgs(2), rNumericArgs(3), rNumericArgs(4), rNumericArgs(5)); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\", Surface Area <= 0.0; Entered Area=" + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area, 2)); + ShowSevereError(state, + format("{}=\"{}\", Surface Area <= 0.0; Entered Area={:.2T}", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Area)); ErrorsFound = true; } @@ -4608,8 +4712,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ConstrNumSh; // Construction number with Shade @@ -4756,12 +4858,19 @@ namespace SurfaceGeometry { ShowSevereError(state, cRoutineName + ": The gap width(s) for the unshaded window construction " + state.dataConstruction->Construct(ConstrNum).Name); ShowContinueError(state, "are inconsistent with the gap widths for shaded window construction " + state.dataConstruction->Construct(ConstrNumSh).Name); ShowContinueError(state, "for window " + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + ", which has a between-glass blind."); - ShowContinueError(state, "..Material=" + dataMaterial.Material(MatGap).Name + " thickness=" + RoundSigDigits(dataMaterial.Material(MatGap).Thickness, 3) + - " -"); - ShowContinueError(state, "..( Material=" + dataMaterial.Material(MatGap1).Name + - " thickness=" + RoundSigDigits(dataMaterial.Material(MatGap1).Thickness, 3) + " +"); - ShowContinueError(state, "..Material=" + dataMaterial.Material(MatGap2).Name + " thickness=" + - RoundSigDigits(dataMaterial.Material(MatGap2).Thickness, 3) + " )=[" + RoundSigDigits(MatGapCalc, 3) + "] >.001"); + ShowContinueError(state, + format("..Material={} thickness={:.3R} -", + dataMaterial.Material(MatGap).Name, + dataMaterial.Material(MatGap).Thickness)); + ShowContinueError(state, + format("..( Material={} thickness={:.3R} +", + dataMaterial.Material(MatGap1).Name, + dataMaterial.Material(MatGap1).Thickness)); + ShowContinueError(state, + format("..Material={} thickness={:.3R} )=[{:.3R}] >.001", + dataMaterial.Material(MatGap2).Name, + dataMaterial.Material(MatGap2).Thickness, + MatGapCalc)); ErrorsFound = true; } } else { // Between-glass shade @@ -4771,14 +4880,23 @@ namespace SurfaceGeometry { ShowSevereError(state, cRoutineName + ": The gap width(s) for the unshaded window construction " + state.dataConstruction->Construct(ConstrNum).Name); ShowContinueError(state, "are inconsistent with the gap widths for shaded window construction " + state.dataConstruction->Construct(ConstrNumSh).Name); ShowContinueError(state, "for window " + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + ", which has a between-glass shade."); - ShowContinueError(state, "..Material=" + dataMaterial.Material(MatGap).Name + " thickness=" + RoundSigDigits(dataMaterial.Material(MatGap).Thickness, 3) + - " -"); - ShowContinueError(state, "...( Material=" + dataMaterial.Material(MatGap1).Name + - " thickness=" + RoundSigDigits(dataMaterial.Material(MatGap1).Thickness, 3) + " +"); - ShowContinueError(state, "..Material=" + dataMaterial.Material(MatGap2).Name + - " thickness=" + RoundSigDigits(dataMaterial.Material(MatGap2).Thickness, 3) + " +"); - ShowContinueError(state, "..Material=" + dataMaterial.Material(MatSh).Name + " thickness=" + RoundSigDigits(dataMaterial.Material(MatSh).Thickness, 3) + - " )=[" + RoundSigDigits(MatGapCalc, 3) + "] >.001"); + ShowContinueError(state, + format("..Material={} thickness={:.3R} -", + dataMaterial.Material(MatGap).Name, + dataMaterial.Material(MatGap).Thickness)); + ShowContinueError(state, + format("...( Material={} thickness={:.3R} +", + dataMaterial.Material(MatGap1).Name, + dataMaterial.Material(MatGap1).Thickness)); + ShowContinueError(state, + format("..Material={} thickness={:.3R} +", + dataMaterial.Material(MatGap2).Name, + dataMaterial.Material(MatGap2).Thickness)); + ShowContinueError(state, + format("..Material={} thickness={:.3R} )=[{:.3R}] >.001", + dataMaterial.Material(MatSh).Name, + dataMaterial.Material(MatSh).Thickness, + MatGapCalc)); ErrorsFound = true; } } @@ -4830,8 +4948,10 @@ namespace SurfaceGeometry { cAlphaFieldNames(FrameField) + "=\"" + cAlphaArgs(FrameField) + "\""); ShowContinueError(state, "Divider cannot be specified because the construction has a between-glass shade or blind."); ShowContinueError(state, "Calculation will proceed without the divider for this window."); - ShowContinueError(state, "Divider width = [" + - RoundSigDigits(FrameDivider(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).FrameDivider).DividerWidth, 2) + "]."); + ShowContinueError( + state, + format("Divider width = [{:.2R}].", + FrameDivider(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).FrameDivider).DividerWidth)); FrameDivider(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).FrameDivider).DividerWidth = 0.0; } } // End of check if window has divider @@ -4872,8 +4992,7 @@ namespace SurfaceGeometry { // This routine performs miscellaneous checks on subsurfaces: Windows, GlassDoors, Doors, Tubular Devices. // Using/Aliasing - using General::RoundSigDigits; - using General::TrimSigDigits; + using namespace DataErrorTracking; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -5196,7 +5315,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; + using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMaxValue; @@ -5219,8 +5338,8 @@ namespace SurfaceGeometry { cCurrentModuleObject = "Shading:Zone:Detailed"; inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, Loop, NumAlphas, NumNumbers); if (NumAlphas != 3) { - ShowSevereError(state, cCurrentModuleObject + - ": Object Definition indicates not = 3 Alpha Objects, Number Indicated=" + TrimSigDigits(NumAlphas)); + ShowSevereError(state, + format("{}: Object Definition indicates not = 3 Alpha Objects, Number Indicated={}", cCurrentModuleObject, NumAlphas)); ErrorsFound = true; } @@ -5321,12 +5440,19 @@ namespace SurfaceGeometry { rNumericArgs(1) = (NumNumbers - 1) / 3; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides = rNumericArgs(1); if (mod(NumNumbers - 1, 3) != 0) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + cNumericFieldNames(1) + - " not even multiple of 3. Will read in " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); + ShowWarningError(state, + cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + + format("{} not even multiple of 3. Will read in {}", + cNumericFieldNames(1), + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } if (rNumericArgs(1) < 3) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + cNumericFieldNames(1) + - " (autocalculate) must be >= 3. Only " + TrimSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + " provided."); + ShowSevereError(state, + format("{}=\"{}\", {} (autocalculate) must be >= 3. Only {} provided.", + cCurrentModuleObject, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + cNumericFieldNames(1), + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); ErrorsFound = true; continue; } @@ -5374,8 +5500,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + using namespace DataReportingFlags; using namespace Vectors; @@ -5503,8 +5628,11 @@ namespace SurfaceGeometry { } if (Length * Depth <= 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", illegal surface area=[" + - RoundSigDigits(Length * Depth, 2) + "]. Surface will NOT be entered."); + ShowSevereError(state, + format("{}=\"{}\", illegal surface area=[{:.2R}]. Surface will NOT be entered.", + cCurrentModuleObject, + cAlphaArgs(1), + Length * Depth)); continue; } @@ -5573,8 +5701,11 @@ namespace SurfaceGeometry { MakeFin = true; if (Length * Depth <= 0.0) { - ShowWarningError(state, cCurrentModuleObject + "=Left Fin of \"" + cAlphaArgs(1) + "\", illegal surface area=[" + - RoundSigDigits(Length * Depth, 2) + "]. Surface will NOT be entered."); + ShowWarningError(state, + format("{}=Left Fin of \"{}\", illegal surface area=[{:.2R}]. Surface will NOT be entered.", + cCurrentModuleObject, + cAlphaArgs(1), + Length * Depth)); MakeFin = false; } @@ -5661,8 +5792,11 @@ namespace SurfaceGeometry { MakeFin = true; if (Length * Depth <= 0.0) { - ShowWarningError(state, cCurrentModuleObject + "=Right Fin of \"" + cAlphaArgs(1) + "\", illegal surface area=[" + - RoundSigDigits(Length * Depth, 2) + "]. Surface will NOT be entered."); + ShowWarningError(state, + format("{}=Right Fin of \"{}\", illegal surface area=[{:.2R}]. Surface will NOT be entered.", + cCurrentModuleObject, + cAlphaArgs(1), + Length * Depth)); MakeFin = false; } @@ -5964,7 +6098,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -6115,7 +6248,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -6140,8 +6272,8 @@ namespace SurfaceGeometry { inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, Dummy, MaxNumAlphas, MaxNumNumbers); if (MaxNumNumbers != 8) { - ShowSevereError(state, cCurrentModuleObject + - ": Object Definition indicates not = 8 Number Objects, Number Indicated=" + TrimSigDigits(MaxNumNumbers)); + ShowSevereError( + state, format("{}: Object Definition indicates not = 8 Number Objects, Number Indicated={}", cCurrentModuleObject, MaxNumNumbers)); ErrorsFound = true; } @@ -6313,8 +6445,8 @@ namespace SurfaceGeometry { if (ExtVentedCavity(Item).PlenGapThick <= 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + ExtVentedCavity(Item).Name + "\", invalid ."); ErrorsFound = true; - ShowContinueError(state, "...because field \"" + cNumericFieldNames(5) + "\" must be greater than Zero=[" + - TrimSigDigits(rNumericArgs(5), 2) + "]."); + ShowContinueError(state, + format("...because field \"{}\" must be greater than Zero=[{:.2T}].", cNumericFieldNames(5), rNumericArgs(5))); continue; } ExtVentedCavity(Item).AreaRatio = rNumericArgs(6); @@ -6329,8 +6461,9 @@ namespace SurfaceGeometry { if (ExtVentedCavity(Item).ProjArea <= 0.0) { ShowSevereError(state, cCurrentModuleObject + "=\"" + ExtVentedCavity(Item).Name + "\", invalid ."); ErrorsFound = true; - ShowContinueError(state, "...because gross area of underlying surfaces must be greater than Zero=[" + - TrimSigDigits(ExtVentedCavity(Item).ProjArea, 2) + "]."); + ShowContinueError( + state, + format("...because gross area of underlying surfaces must be greater than Zero=[{:.2T}].", ExtVentedCavity(Item).ProjArea)); continue; } ExtVentedCavity(Item).ActualArea = ExtVentedCavity(Item).ProjArea * ExtVentedCavity(Item).AreaRatio; @@ -6378,8 +6511,6 @@ namespace SurfaceGeometry { { using namespace DataIPShortCuts; using DataSurfaces::Surface; - using General::RoundSigDigits; - using General::TrimSigDigits; int IOStatus; // Used in GetObjectItem int NumAlphas; @@ -6435,8 +6566,12 @@ namespace SurfaceGeometry { if (data.exposedFraction > 1 + tolerance) { ShowWarningError(state, cCurrentModuleObject + ": " + Surface(Found).Name + ", " + cNumericFieldNames(numF) + " is greater than the perimeter of " + Surface(Found).Name); - ShowContinueError(state, Surface(Found).Name + " perimeter = " + RoundSigDigits(Surface(Found).Perimeter) + ", " + - cCurrentModuleObject + " exposed perimeter = " + RoundSigDigits(rNumericArgs(numF))); + ShowContinueError(state, + format("{} perimeter = {}, {} exposed perimeter = {}", + Surface(Found).Name, + Surface(Found).Perimeter, + cCurrentModuleObject, + rNumericArgs(numF))); ShowContinueError(state, cNumericFieldNames(numF) + " will be set equal to " + Surface(Found).Name + " perimeter"); data.exposedFraction = 1.0; } @@ -6481,8 +6616,12 @@ namespace SurfaceGeometry { ShowSevereError(state, cCurrentModuleObject + ": " + Surface(Found).Name + ", must have equal number of segments as the floor has vertices." + cAlphaFieldNames(alpF) + "\" and \"" + cNumericFieldNames(numF - 1) + "\""); - ShowContinueError(state, Surface(Found).Name + " number of vertices = " + TrimSigDigits(Surface(Found).Vertex.size()) + ", " + - cCurrentModuleObject + " number of segments = " + TrimSigDigits(numRemainingFields)); + ShowContinueError(state, + format("{} number of vertices = {}, {} number of segments = {}", + Surface(Found).Name, + Surface(Found).Vertex.size(), + cCurrentModuleObject, + numRemainingFields)); ErrorsFound = true; } for (int segNum = 0; segNum < numRemainingFields; segNum++) { @@ -6822,7 +6961,6 @@ namespace SurfaceGeometry { using DataHeatBalance::LowHConvLimit; using DataHeatBalSurface::MaxSurfaceTempLimit; using DataSurfaces::Surface; - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CountHTAlgoObjectsSingleSurf; @@ -7256,25 +7394,30 @@ namespace SurfaceGeometry { if (NumEMPDMat > 0 && !DataHeatBalance::AnyEMPD) { ShowWarningError(state, - "The input file includes " + RoundSigDigits(NumEMPDMat) + - " MaterialProperty:MoisturePenetrationDepth:Settings objects but the moisture penetration depth algorithm is not used anywhere."); + format("The input file includes {} MaterialProperty:MoisturePenetrationDepth:Settings objects but the moisture " + "penetration depth algorithm is not used anywhere.", + NumEMPDMat)); msgneeded = true; } if (NumPCMat > 0 && !DataHeatBalance::AnyCondFD) { - ShowWarningError(state, "The input file includes " + RoundSigDigits(NumPCMat) + - " MaterialProperty:PhaseChange objects but the conduction finite difference algorithm is not used anywhere."); + ShowWarningError(state, + format("The input file includes {} MaterialProperty:PhaseChange objects but the conduction finite difference algorithm " + "is not used anywhere.", + NumPCMat)); msgneeded = true; } if (NumVTCMat > 0 && !DataHeatBalance::AnyCondFD) { ShowWarningError(state, - "The input file includes " + RoundSigDigits(NumVTCMat) + - " MaterialProperty:VariableThermalConductivity objects but the conduction finite difference algorithm is not used anywhere."); + format("The input file includes {} MaterialProperty:VariableThermalConductivity objects but the conduction finite " + "difference algorithm is not used anywhere.", + NumVTCMat)); msgneeded = true; } if (SumHAMTMat > 0 && !DataHeatBalance::AnyHAMT) { - ShowWarningError(state, "The input file includes " + RoundSigDigits(SumHAMTMat) + - " MaterialProperty:HeatAndMoistureTransfer:* objects but the combined heat and moisture finite difference algorithm is " - "not used anywhere."); + ShowWarningError(state, + format("The input file includes {} MaterialProperty:HeatAndMoistureTransfer:* objects but the combined heat and " + "moisture finite difference algorithm is not used anywhere.", + SumHAMTMat)); msgneeded = true; } if (msgneeded) { @@ -7417,7 +7560,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace Vectors; - using General::RoundSigDigits; + using namespace DataErrorTracking; // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7554,27 +7697,38 @@ namespace SurfaceGeometry { DistanceCheck = distance(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides), state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(1)); if (DistanceCheck < 0.01) { if (state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, RoutineName + "Distance between two vertices < .01, possibly coincident. for Surface=" + - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + ", in Zone=" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName); - ShowContinueError(state, "Vertex [" + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + "]=(" + - RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides).x, 2) + ',' + - RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides).y, 2) + ',' + - RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides).z, 2) + ')'); - ShowContinueError(state, "Vertex [" + RoundSigDigits(1) + "]=(" + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(1).x, 2) + ',' + - RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(1).y, 2) + ',' + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(1).z, 2) + - ')'); + ShowWarningError(state, + RoutineName + "Distance between two vertices < .01, possibly coincident. for Surface=" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + + ", in Zone=" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName); + ShowContinueError( + state, + format("Vertex [{}", state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + + format("]=({:.2R},{:.2R},{:.2R})", + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides).x, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides).y, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides).z)); + ShowContinueError(state, + format("Vertex [{}", 1) + + format("]=({:.2R},{:.2R},{:.2R}", + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(1).x, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(1).y, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(1).z) + + ')'); } ++TotalCoincidentVertices; if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides > 3) { if (state.dataGlobal->DisplayExtraWarnings) { - ShowContinueError(state, "Dropping Vertex [" + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + "]."); + ShowContinueError(state, format("Dropping Vertex [{}].", state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } --state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.redimension(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); } else { if (state.dataGlobal->DisplayExtraWarnings) { - ShowContinueError(state, "Cannot Drop Vertex [" + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + - "]; Number of Surface Sides at minimum. This surface is now a degenerate surface."); + ShowContinueError( + state, + format("Cannot Drop Vertex [{}]; Number of Surface Sides at minimum. This surface is now a degenerate surface.", + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } ++TotalDegenerateSurfaces; // mark degenerate surface? @@ -7588,27 +7742,35 @@ namespace SurfaceGeometry { DistanceCheck = distance(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt), state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt - 1)); if (DistanceCheck < 0.01) { if (state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, RoutineName + "Distance between two vertices < .01, possibly coincident. for Surface=" + - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + ", in Zone=" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName); - ShowContinueError(state, "Vertex [" + RoundSigDigits(Vrt) + "]=(" + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt).x, 2) + ',' + - RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt).y, 2) + ',' + - RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt).z, 2) + ')'); - ShowContinueError(state, "Vertex [" + RoundSigDigits(Vrt - 1) + "]=(" + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt - 1).x, 2) + - ',' + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt - 1).y, 2) + ',' + - RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt - 1).z, 2) + ')'); + ShowWarningError(state, + RoutineName + "Distance between two vertices < .01, possibly coincident. for Surface=" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + + ", in Zone=" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName); + ShowContinueError(state, + format("Vertex [{}", Vrt) + format("]=({:.2R},{:.2R},{:.2R})", + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt).x, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt).y, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt).z)); + ShowContinueError(state, + format("Vertex [{}]=({:.2R},", Vrt - 1, state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt - 1).x) + + format("{:.2R},{:.2R})", + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt - 1).y, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(Vrt - 1).z)); } ++TotalCoincidentVertices; if (Vrt == state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) { if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides > 3) { if (state.dataGlobal->DisplayExtraWarnings) { - ShowContinueError(state, "Dropping Vertex [" + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + "]."); + ShowContinueError(state, format("Dropping Vertex [{}].", state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } --state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.redimension(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); } else { if (state.dataGlobal->DisplayExtraWarnings) { - ShowContinueError(state, "Cannot Drop Vertex [" + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + - "]; Number of Surface Sides at minimum. This surface is now a degenerate surface."); + ShowContinueError( + state, + format("Cannot Drop Vertex [{}]; Number of Surface Sides at minimum. This surface is now a degenerate surface.", + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } ++TotalDegenerateSurfaces; // mark degenerate surface? @@ -7617,7 +7779,7 @@ namespace SurfaceGeometry { } else { if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides > 3) { if (state.dataGlobal->DisplayExtraWarnings) { - ShowContinueError(state, "Dropping Vertex [" + RoundSigDigits(Vrt) + "]."); + ShowContinueError(state, format("Dropping Vertex [{}].", Vrt)); } for (n = Vrt; n <= state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides - 1; ++n) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(n).x = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex(n + 1).x; @@ -7628,8 +7790,10 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.redimension(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); } else { if (state.dataGlobal->DisplayExtraWarnings) { - ShowContinueError(state, "Cannot Drop Vertex [" + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides) + - "]; Number of Surface Sides at minimum. This surface is now a degenerate surface."); + ShowContinueError( + state, + format("Cannot Drop Vertex [{}]; Number of Surface Sides at minimum. This surface is now a degenerate surface.", + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } ++TotalDegenerateSurfaces; // mark degenerate surface? @@ -7662,27 +7826,34 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).NewellSurfaceNormalVector); dotp = dot(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).NewellSurfaceNormalVector, TestVector); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Roof && dotp < -0.000001) { - TiltString = RoundSigDigits(SurfTilt, 1); - ShowWarningError(state, RoutineName + "Roof/Ceiling is upside down! Tilt angle=[" + TiltString + "], should be near 0, Surface=\"" + - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", in Zone=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName + "\"."); + TiltString = format("{:.1R}", SurfTilt); + ShowWarningError(state, + RoutineName + "Roof/Ceiling is upside down! Tilt angle=[" + TiltString + "], should be near 0, Surface=\"" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", in Zone=\"" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName + "\"."); ShowContinueError(state, "Automatic fix is attempted."); ReverseAndRecalculate(state, SurfNum, state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides, SurfWorldAz, SurfTilt); } else if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Roof && SurfTilt > 80.0) { - TiltString = RoundSigDigits(SurfTilt, 1); - ShowWarningError(state, RoutineName + "Roof/Ceiling is not oriented correctly! Tilt angle=[" + TiltString + - "], should be near 0, Surface=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", in Zone=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName + - "\"."); + TiltString = format("{:.1R}", SurfTilt); + ShowWarningError(state, + RoutineName + "Roof/Ceiling is not oriented correctly! Tilt angle=[" + TiltString + + "], should be near 0, Surface=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", in Zone=\"" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName + "\"."); } if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Floor && dotp > 0.000001) { - TiltString = RoundSigDigits(SurfTilt, 1); - ShowWarningError(state, RoutineName + "Floor is upside down! Tilt angle=[" + TiltString + "], should be near 180, Surface=\"" + - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", in Zone=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName + "\"."); + TiltString = format("{:.1R}", SurfTilt); + ShowWarningError(state, + RoutineName + "Floor is upside down! Tilt angle=[" + TiltString + "], should be near 180, Surface=\"" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", in Zone=\"" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName + "\"."); ShowContinueError(state, "Automatic fix is attempted."); ReverseAndRecalculate(state, SurfNum, state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides, SurfWorldAz, SurfTilt); } else if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Floor && SurfTilt < 158.2) { // slope/grade = 40%! - TiltString = RoundSigDigits(SurfTilt, 1); - ShowWarningError(state, RoutineName + "Floor is not oriented correctly! Tilt angle=[" + TiltString + "], should be near 180, Surface=\"" + - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", in Zone=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName + "\"."); + TiltString = format("{:.1R}", SurfTilt); + ShowWarningError(state, + RoutineName + "Floor is not oriented correctly! Tilt angle=[" + TiltString + "], should be near 180, Surface=\"" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", in Zone=\"" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName + "\"."); } state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Azimuth = SurfWorldAz; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Tilt = SurfTilt; @@ -7756,8 +7927,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace Vectors; - using General::RoundSigDigits; - // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7808,7 +7977,7 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).GrossArea, state.dataSurfaceGeometry->SurfaceTmp(SurfNum).NewellSurfaceNormalVector); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Roof && SurfTilt > 80.0) { - TiltString = RoundSigDigits(SurfTilt, 1); + TiltString = format("{:.1R}", SurfTilt); ShowWarningError(state, RoutineName + "Roof/Ceiling is still upside down! Tilt angle=[" + TiltString + "], should be near 0, please fix manually."); } @@ -8577,7 +8746,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -8625,8 +8793,10 @@ namespace SurfaceGeometry { StormWindow(StormWinNum).DateOff = General::OrdinalDay(StormWindow(StormWinNum).MonthOff, StormWindow(StormWinNum).DayOfMonthOff, 1); if (StormWindow(StormWinNum).DateOn == StormWindow(StormWinNum).DateOff) { - ShowSevereError(state, cCurrentModuleObject + ": Date On = Date Off -- not allowed, occurred in WindowProperty:StormWindow Input #" + - TrimSigDigits(StormWinNum)); + ShowSevereError(state, + format("{}: Date On = Date Off -- not allowed, occurred in WindowProperty:StormWindow Input #{}", + cCurrentModuleObject, + StormWinNum)); ErrorsFound = true; } @@ -8636,25 +8806,37 @@ namespace SurfaceGeometry { if ((SELECT_CASE_var == 1) || (SELECT_CASE_var == 3) || (SELECT_CASE_var == 5) || (SELECT_CASE_var == 7) || (SELECT_CASE_var == 8) || (SELECT_CASE_var == 10) || (SELECT_CASE_var == 12)) { if (StormWindow(StormWinNum).DayOfMonthOn > 31) { - ShowSevereError(state, cCurrentModuleObject + ": Date On (Day of Month) [" + TrimSigDigits(StormWindow(StormWinNum).DayOfMonthOn) + - "], invalid for WindowProperty:StormWindow Input #" + TrimSigDigits(StormWinNum)); + ShowSevereError(state, + format("{}: Date On (Day of Month) [{}], invalid for WindowProperty:StormWindow Input #{}", + cCurrentModuleObject, + StormWindow(StormWinNum).DayOfMonthOn, + StormWinNum)); ErrorsFound = true; } } else if ((SELECT_CASE_var == 4) || (SELECT_CASE_var == 6) || (SELECT_CASE_var == 9) || (SELECT_CASE_var == 11)) { if (StormWindow(StormWinNum).DayOfMonthOn > 30) { - ShowSevereError(state, cCurrentModuleObject + ": Date On (Day of Month) [" + TrimSigDigits(StormWindow(StormWinNum).DayOfMonthOn) + - "], invalid for WindowProperty:StormWindow Input #" + TrimSigDigits(StormWinNum)); + ShowSevereError(state, + format("{}: Date On (Day of Month) [{}], invalid for WindowProperty:StormWindow Input #{}", + cCurrentModuleObject, + StormWindow(StormWinNum).DayOfMonthOn, + StormWinNum)); ErrorsFound = true; } } else if (SELECT_CASE_var == 2) { if (StormWindow(StormWinNum).DayOfMonthOn > 29) { - ShowSevereError(state, cCurrentModuleObject + ": Date On (Day of Month) [" + TrimSigDigits(StormWindow(StormWinNum).DayOfMonthOn) + - "], invalid for WindowProperty:StormWindow Input #" + TrimSigDigits(StormWinNum)); + ShowSevereError(state, + format("{}: Date On (Day of Month) [{}], invalid for WindowProperty:StormWindow Input #{}", + cCurrentModuleObject, + StormWindow(StormWinNum).DayOfMonthOn, + StormWinNum)); ErrorsFound = true; } } else { - ShowSevereError(state, cCurrentModuleObject + ": Date On Month [" + TrimSigDigits(StormWindow(StormWinNum).MonthOn) + - "], invalid for WindowProperty:StormWindow Input #" + TrimSigDigits(StormWinNum)); + ShowSevereError(state, + format("{}: Date On Month [{}], invalid for WindowProperty:StormWindow Input #{}", + cCurrentModuleObject, + StormWindow(StormWinNum).MonthOn, + StormWinNum)); ErrorsFound = true; } } @@ -8664,25 +8846,37 @@ namespace SurfaceGeometry { if ((SELECT_CASE_var == 1) || (SELECT_CASE_var == 3) || (SELECT_CASE_var == 5) || (SELECT_CASE_var == 7) || (SELECT_CASE_var == 8) || (SELECT_CASE_var == 10) || (SELECT_CASE_var == 12)) { if (StormWindow(StormWinNum).DayOfMonthOff > 31) { - ShowSevereError(state, cCurrentModuleObject + ": Date Off (Day of Month) [" + TrimSigDigits(StormWindow(StormWinNum).DayOfMonthOff) + - "], invalid for WindowProperty:StormWindow Input #" + TrimSigDigits(StormWinNum)); + ShowSevereError(state, + format("{}: Date Off (Day of Month) [{}], invalid for WindowProperty:StormWindow Input #{}", + cCurrentModuleObject, + StormWindow(StormWinNum).DayOfMonthOff, + StormWinNum)); ErrorsFound = true; } } else if ((SELECT_CASE_var == 4) || (SELECT_CASE_var == 6) || (SELECT_CASE_var == 9) || (SELECT_CASE_var == 11)) { if (StormWindow(StormWinNum).DayOfMonthOff > 30) { - ShowSevereError(state, cCurrentModuleObject + ": Date Off (Day of Month) [" + TrimSigDigits(StormWindow(StormWinNum).DayOfMonthOff) + - "], invalid for WindowProperty:StormWindow Input #" + TrimSigDigits(StormWinNum)); + ShowSevereError(state, + format("{}: Date Off (Day of Month) [{}], invalid for WindowProperty:StormWindow Input #{}", + cCurrentModuleObject, + StormWindow(StormWinNum).DayOfMonthOff, + StormWinNum)); ErrorsFound = true; } } else if (SELECT_CASE_var == 2) { if (StormWindow(StormWinNum).DayOfMonthOff > 29) { - ShowSevereError(state, cCurrentModuleObject + ": Date Off (Day of Month) [" + TrimSigDigits(StormWindow(StormWinNum).DayOfMonthOff) + - "], invalid for WindowProperty:StormWindow Input #" + TrimSigDigits(StormWinNum)); + ShowSevereError(state, + format("{}: Date Off (Day of Month) [{}], invalid for WindowProperty:StormWindow Input #{}", + cCurrentModuleObject, + StormWindow(StormWinNum).DayOfMonthOff, + StormWinNum)); ErrorsFound = true; } } else { - ShowSevereError(state, cCurrentModuleObject + ": Date Off Month [" + TrimSigDigits(StormWindow(StormWinNum).MonthOff) + - "], invalid for WindowProperty:StormWindow Input #" + TrimSigDigits(StormWinNum)); + ShowSevereError(state, + format("{}: Date Off Month [{}], invalid for WindowProperty:StormWindow Input #{}", + cCurrentModuleObject, + StormWindow(StormWinNum).MonthOff, + StormWinNum)); ErrorsFound = true; } } @@ -8736,11 +8930,13 @@ namespace SurfaceGeometry { if ((Latitude > 0.0 && (StormWindow(StormWinNum).MonthOn < StormWindow(StormWinNum).MonthOff)) || (Latitude <= 0.0 && (StormWindow(StormWinNum).MonthOn > StormWindow(StormWinNum).MonthOff))) { ShowWarningError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" check times that storm window"); - ShowContinueError(state, "is put on (month=" + TrimSigDigits(StormWindow(StormWinNum).MonthOn) + - ", day=" + TrimSigDigits(StormWindow(StormWinNum).DayOfMonthOn) + - ") and taken off (month=" + TrimSigDigits(StormWindow(StormWinNum).MonthOff) + - ", day=" + TrimSigDigits(StormWindow(StormWinNum).DayOfMonthOff) + ");"); - ShowContinueError(state, "these times may be reversed for your building latitude=" + TrimSigDigits(Latitude, 2) + " deg."); + ShowContinueError(state, + format("is put on (month={}, day={}) and taken off (month={}, day={});", + StormWindow(StormWinNum).MonthOn, + StormWindow(StormWinNum).DayOfMonthOn, + StormWindow(StormWinNum).MonthOff, + StormWindow(StormWinNum).DayOfMonthOff)); + ShowContinueError(state, format("these times may be reversed for your building latitude={:.2R} deg.", Latitude)); } } } @@ -9404,8 +9600,11 @@ namespace SurfaceGeometry { if (numRemainingFields > 0) { int numBlocks = numRemainingFields / 4; if (mod(numRemainingFields, 4) != 0) { - ShowWarningError(state, cCurrentModuleObject + "=\"" + fndInput.name + - "\", number of Block fields not even multiple of 4. Will read in " + General::TrimSigDigits(numBlocks)); + ShowWarningError(state, + format("{}=\"{}\", number of Block fields not even multiple of 4. Will read in {}", + cCurrentModuleObject, + fndInput.name, + numBlocks)); } for (int blockNum = 0; blockNum < numBlocks; blockNum++) { Kiva::InputBlock block; @@ -9546,7 +9745,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; // Locals @@ -9638,14 +9837,14 @@ namespace SurfaceGeometry { if (!lNumericFieldBlanks(10)) { OSC(OSCNum).MinLimitPresent = true; OSC(OSCNum).MinTempLimit = rNumericArgs(10); - cOSCLimitsString = RoundSigDigits(rNumericArgs(10), 3); + cOSCLimitsString = format("{:.3R}", rNumericArgs(10)); } else { cOSCLimitsString = "N/A"; } if (!lNumericFieldBlanks(11)) { OSC(OSCNum).MaxLimitPresent = true; OSC(OSCNum).MaxTempLimit = rNumericArgs(11); - cOSCLimitsString += "," + RoundSigDigits(rNumericArgs(10), 3); + cOSCLimitsString += format(",{:.3R}", rNumericArgs(10)); } else { cOSCLimitsString += ",N/A"; } @@ -9663,7 +9862,7 @@ namespace SurfaceGeometry { print(state.files.eio, "{}\n", OSCFormat1); } if (OSC(Loop).SurfFilmCoef > 0.0) { - cAlphaArgs(1) = RoundSigDigits(OSC(Loop).SurfFilmCoef, 3); + cAlphaArgs(1) = format("{:.3R}", OSC(Loop).SurfFilmCoef); SetupOutputVariable(state, "Surface Other Side Coefficients Exterior Air Drybulb Temperature", OutputProcessor::Unit::C, OSC(Loop).OSCTempCalc, @@ -9878,8 +10077,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + using ScheduleManager::GetScheduleIndex; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -9963,9 +10161,10 @@ namespace SurfaceGeometry { ShowSevereError(state, cCurrentModuleObject + ", " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\", invalid material."); ShowContinueError(state, "\"Outside\", invalid material for movable insulation."); - ShowContinueError(state, "Material=\"" + dataMaterial.Material(MaterNum).Name + "\",Resistance=[" + - RoundSigDigits(dataMaterial.Material(MaterNum).Resistance, 3) + - "], must be > 0 for use in Movable Insulation."); + ShowContinueError(state, + format("Material=\"{}\",Resistance=[{:.3R}], must be > 0 for use in Movable Insulation.", + dataMaterial.Material(MaterNum).Name, + dataMaterial.Material(MaterNum).Resistance)); ErrorsFound = true; } else if (dataMaterial.Material(MaterNum).Conductivity > 0.0) { dataMaterial.Material(MaterNum).Resistance = dataMaterial.Material(MaterNum).Thickness / dataMaterial.Material(MaterNum).Conductivity; @@ -9976,9 +10175,10 @@ namespace SurfaceGeometry { ShowSevereError(state, cCurrentModuleObject + ", " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\", invalid material."); ShowContinueError(state, "\"Outside\", invalid material for movable insulation."); - ShowContinueError(state, "Material=\"" + dataMaterial.Material(MaterNum).Name + "\",Conductivity=[" + - RoundSigDigits(dataMaterial.Material(MaterNum).Conductivity, 3) + - "], must be > 0 for use in Movable Insulation."); + ShowContinueError(state, + format("Material=\"{}\",Conductivity=[{:.3R}], must be > 0 for use in Movable Insulation.", + dataMaterial.Material(MaterNum).Name, + dataMaterial.Material(MaterNum).Conductivity)); ErrorsFound = true; } } @@ -9998,9 +10198,10 @@ namespace SurfaceGeometry { ShowSevereError(state, cCurrentModuleObject + ", " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\", invalid material."); ShowContinueError(state, "\"Inside\", invalid material for movable insulation."); - ShowContinueError(state, "Material=\"" + dataMaterial.Material(MaterNum).Name + "\",Resistance=[" + - RoundSigDigits(dataMaterial.Material(MaterNum).Resistance, 3) + - "], must be > 0 for use in Movable Insulation."); + ShowContinueError(state, + format("Material=\"{}\",Resistance=[{:.3R}], must be > 0 for use in Movable Insulation.", + dataMaterial.Material(MaterNum).Name, + dataMaterial.Material(MaterNum).Resistance)); ErrorsFound = true; } else if (dataMaterial.Material(MaterNum).Conductivity > 0.0) { dataMaterial.Material(MaterNum).Resistance = dataMaterial.Material(MaterNum).Thickness / dataMaterial.Material(MaterNum).Conductivity; @@ -10040,7 +10241,6 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace Vectors; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: @@ -10193,10 +10393,8 @@ namespace SurfaceGeometry { for (auto edge : listOfedgeNotUsedTwice) { ShowContinueError(state, " The surface \"" + Surface(edge.surfNum).Name + "\" has an edge that is either not an edge on another surface or is an edge on three or more surfaces: "); - ShowContinueError(state, " Vertex start { " + RoundSigDigits(edge.start.x, 4) + ", " + RoundSigDigits(edge.start.y, 4) + ", " + - RoundSigDigits(edge.start.z, 4) + "}"); - ShowContinueError(state, " Vertex end { " + RoundSigDigits(edge.end.x, 4) + ", " + RoundSigDigits(edge.end.y, 4) + ", " + - RoundSigDigits(edge.end.z, 4) + "}"); + ShowContinueError(state, format(" Vertex start {{ {:.4R}, {:.4R}, {:.4R}}}", edge.start.x, edge.start.y, edge.start.z)); + ShowContinueError(state, format(" Vertex end {{ {:.4R}, {:.4R}, {:.4R}}}", edge.end.x, edge.end.y, edge.end.z)); } } } @@ -10220,9 +10418,11 @@ namespace SurfaceGeometry { // Warn user of using specified Zone Volume ShowWarningError(state, "Entered Volume entered for Zone=\"" + Zone(ZoneNum).Name + "\" significantly different from calculated Volume"); - ShowContinueError(state, "Entered Zone Volume value=" + RoundSigDigits(Zone(ZoneNum).Volume, 2) + - ", Calculated Zone Volume value=" + RoundSigDigits(CalcVolume, 2) + - ", entered volume will be used in calculations."); + ShowContinueError(state, + format("Entered Zone Volume value={:.2R}, Calculated Zone Volume value={:.2R}, entered volume will be " + "used in calculations.", + Zone(ZoneNum).Volume, + CalcVolume)); } } } @@ -10238,7 +10438,7 @@ namespace SurfaceGeometry { if (Zone(ZoneNum).Volume <= 0.0) { ShowWarningError(state, "Indicated Zone Volume <= 0.0 for Zone=" + Zone(ZoneNum).Name); - ShowContinueError(state, "The calculated Zone Volume was=" + RoundSigDigits(Zone(ZoneNum).Volume, 2)); + ShowContinueError(state, format("The calculated Zone Volume was={:.2R}", Zone(ZoneNum).Volume)); ShowContinueError(state, "The simulation will continue with the Zone Volume set to 10.0 m3. "); ShowContinueError(state, "...use Output:Diagnostics,DisplayExtraWarnings; to show more details on individual zones."); Zone(ZoneNum).Volume = 10.; @@ -10294,8 +10494,10 @@ namespace SurfaceGeometry { ShowWarningError(state, "CalculateZoneVolume: 1 zone is not fully enclosed. For more details use: Output:Diagnostics,DisplayExtrawarnings; "); } else if (countNotFullyEnclosedZones > 1) { - ShowWarningError(state, "CalculateZoneVolume: " + RoundSigDigits(countNotFullyEnclosedZones) + - " zones are not fully enclosed. For more details use: Output:Diagnostics,DisplayExtrawarnings; "); + ShowWarningError( + state, + format("CalculateZoneVolume: {} zones are not fully enclosed. For more details use: Output:Diagnostics,DisplayExtrawarnings; ", + countNotFullyEnclosedZones)); } } } @@ -10844,7 +11046,6 @@ namespace SurfaceGeometry { // Detached Shading, Base Surfaces, Attached Shading surfaces are represented in the // same manner as original. Subsurfaces (windows, doors) are a "relative coordinate". - using General::TrimSigDigits; using namespace Vectors; static std::string const RoutineName("ProcessSurfaceVertices: "); @@ -10921,11 +11122,19 @@ namespace SurfaceGeometry { CalcCoPlanarNess(Surface(ThisSurf).Vertex, Surface(ThisSurf).Sides, IsCoPlanar, OutOfLine, LastVertexInError); if (!IsCoPlanar) { if (OutOfLine > 0.01) { - ShowSevereError(state, RoutineName + "Suspected non-planar surface:\"" + Surface(ThisSurf).Name + - "\", Max \"out of line\"=" + TrimSigDigits(OutOfLine, 5) + " at Vertex # " + TrimSigDigits(LastVertexInError)); + ShowSevereError(state, + format("{}Suspected non-planar surface:\"{}\", Max \"out of line\"={:.5T} at Vertex # {}", + RoutineName, + Surface(ThisSurf).Name, + OutOfLine, + LastVertexInError)); } else { - ShowWarningError(state, RoutineName + "Possible non-planar surface:\"" + Surface(ThisSurf).Name + - "\", Max \"out of line\"=" + TrimSigDigits(OutOfLine, 5) + " at Vertex # " + TrimSigDigits(LastVertexInError)); + ShowWarningError(state, + format("{}Possible non-planar surface:\"{}\", Max \"out of line\"={:.5T} at Vertex # {}", + RoutineName, + Surface(ThisSurf).Name, + OutOfLine, + LastVertexInError)); } // ErrorInSurface=.TRUE. } @@ -11081,9 +11290,10 @@ namespace SurfaceGeometry { ShowSevereError(state, RoutineName + "Base Surface=\"" + Surface(Surface(ThisSurf).BaseSurf).Name + "\", "); ShowContinueError(state, "Window Surface=\"" + Surface(ThisSurf).Name + "\" area (with frame) is too large to fit on the surface."); - ShowContinueError(state, "Base surface area (-windows and doors)=[" + - TrimSigDigits(Surface(Surface(ThisSurf).BaseSurf).Area, 2) + "] m2, frame area=[" + - TrimSigDigits(SurfWinFrameArea(ThisSurf), 2) + "] m2."); + ShowContinueError(state, + format("Base surface area (-windows and doors)=[{:.2T}] m2, frame area=[{:.2T}] m2.", + Surface(Surface(ThisSurf).BaseSurf).Area, + SurfWinFrameArea(ThisSurf))); ErrorInSurface = true; } Surface(Surface(ThisSurf).BaseSurf).Area -= SurfWinFrameArea(ThisSurf); @@ -11097,8 +11307,10 @@ namespace SurfaceGeometry { SurfWinDividerArea(ThisSurf) = DivArea * Surface(ThisSurf).Multiplier; if ((Surface(ThisSurf).Area - SurfWinDividerArea(ThisSurf)) <= 0.0) { ShowSevereError(state, RoutineName + "Divider area exceeds glazed opening for window " + Surface(ThisSurf).Name); - ShowContinueError(state, "Window surface area=[" + TrimSigDigits(Surface(ThisSurf).Area, 2) + "] m2, divider area=[" + - TrimSigDigits(SurfWinDividerArea(ThisSurf), 2) + "] m2."); + ShowContinueError(state, + format("Window surface area=[{:.2T}] m2, divider area=[{:.2T}] m2.", + Surface(ThisSurf).Area, + SurfWinDividerArea(ThisSurf))); ErrorInSurface = true; } Surface(ThisSurf).Area -= SurfWinDividerArea(ThisSurf); // Glazed area @@ -11614,7 +11826,7 @@ namespace SurfaceGeometry { int createAirMaterialFromDistance(Real64 distance, std::string namePrefix) { int mmDistance = int(1000 * distance); // Thickness of air gap in mm (usually between storm window and rest of window) - std::string MatNameStAir = namePrefix + fmt::to_string(mmDistance) + "MM"; // Name of created air layer material + std::string MatNameStAir = namePrefix + format("{}MM", mmDistance); // Name of created air layer material int newAirMaterial = UtilityRoutines::FindItemInList(MatNameStAir, dataMaterial.Material, TotMaterials); if (newAirMaterial == 0) { // Create new material @@ -11792,7 +12004,7 @@ namespace SurfaceGeometry { // the glazing systems. // Using/Aliasing - using General::RoundSigDigits; + using namespace Vectors; // Locals @@ -11862,10 +12074,9 @@ namespace SurfaceGeometry { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "SurfaceGeometry: ModifyWindow: Window " + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + " uses the Window5 Data File Construction " + state.dataConstruction->Construct(IConst).Name); - ShowContinueError(state, "The height " + RoundSigDigits(H, 3) + "(m) or width " + RoundSigDigits(W, 3) + - " (m) of this window differs by more than 10%"); - ShowContinueError(state, "from the corresponding height " + RoundSigDigits(h1, 3) + " (m) or width " + RoundSigDigits(w1, 3) + - " (m) on the Window5 Data file."); + ShowContinueError(state, format("The height {:.3R}(m) or width (m) of this window differs by more than 10%{:.3R}", H, W)); + ShowContinueError(state, + format("from the corresponding height {:.3R} (m) or width (m) on the Window5 Data file.{:.3R}", h1, w1)); ShowContinueError(state, "This will affect the frame heat transfer calculation if the frame in the Data File entry"); ShowContinueError(state, "is not uniform, i.e., has sections with different geometry and/or thermal properties."); } else { @@ -11950,7 +12161,7 @@ namespace SurfaceGeometry { // specific warnings or errors issued. // Using/Aliasing - using General::RoundSigDigits; + using namespace Vectors; // Locals @@ -12104,11 +12315,12 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(TotSurfaces).Width = w2; if (state.dataSurfaceGeometry->SurfaceTmp(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurf).Area <= 0.0) { - ShowSevereError(state, "SurfaceGeometry: ModifyWindow: Subsurfaces have too much area for base surface=" + - state.dataSurfaceGeometry->SurfaceTmp(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurf).Name); + ShowSevereError(state, + "SurfaceGeometry: ModifyWindow: Subsurfaces have too much area for base surface=" + + state.dataSurfaceGeometry->SurfaceTmp(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurf).Name); ShowContinueError(state, "Subsurface (window) creating error=" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name); - ShowContinueError(state, "This window has been replaced by two windows from the Window5 Data File of total area " + RoundSigDigits(AreaNew, 2) + - " m2"); + ShowContinueError(state, + format("This window has been replaced by two windows from the Window5 Data File of total area {:.2R} m2", AreaNew)); ErrorsFound = true; } @@ -12490,7 +12702,6 @@ namespace SurfaceGeometry { // polygons with more than four sides). using namespace Vectors; - using General::RoundSigDigits; static Array1D Triangle1(3); // working struct for a 3-sided surface static Array1D Triangle2(3); // working struct for a 3-sided surface @@ -12594,11 +12805,11 @@ namespace SurfaceGeometry { if (!surface.Name.empty()) { ShowWarningError(state, "CalcSurfaceCentroid: caught problem with # of sides, for surface=" + surface.Name); - ShowContinueError(state, "... number of sides must be >= 3, this surface # sides=" + RoundSigDigits(surface.Sides)); + ShowContinueError(state, format("... number of sides must be >= 3, this surface # sides={}", surface.Sides)); } else { - ShowWarningError(state, "CalcSurfaceCentroid: caught problem with # of sides, for surface=#" + RoundSigDigits(ThisSurf)); + ShowWarningError(state, format("CalcSurfaceCentroid: caught problem with # of sides, for surface=#{}", ThisSurf)); ShowContinueError(state, "...surface name is blank. Examine surfaces -- this may be a problem with ill-formed interzone surfaces."); - ShowContinueError(state, "... number of sides must be >= 3, this surface # sides=" + RoundSigDigits(surface.Sides)); + ShowContinueError(state, format("... number of sides must be >= 3, this surface # sides={}", surface.Sides)); } centroid = 0.0; } @@ -12614,10 +12825,11 @@ namespace SurfaceGeometry { } // loop through surfaces if (negZcount > 0) { - ShowWarningError(state, "CalcSurfaceCentroid: " + RoundSigDigits(negZcount) + " Surfaces have the Z coordinate < 0."); + ShowWarningError(state, format("CalcSurfaceCentroid: {} Surfaces have the Z coordinate < 0.", negZcount)); ShowContinueError(state, "...in any calculations, Wind Speed will be 0.0 for these surfaces."); - ShowContinueError(state, "...in any calculations, Outside temperatures will be the outside temperature + " + - RoundSigDigits(WeatherFileTempModCoeff, 3) + " for these surfaces."); + ShowContinueError(state, + format("...in any calculations, Outside temperatures will be the outside temperature + {:.3R} for these surfaces.", + WeatherFileTempModCoeff)); ShowContinueError(state, "...that is, these surfaces will have conditions as though at ground level."); } } @@ -12819,7 +13031,7 @@ namespace SurfaceGeometry { ++enclosureNum; auto &thisEnclosure(Enclosures(enclosureNum)); thisSideEnclosureNum = enclosureNum; - thisEnclosure.Name = RadiantOrSolar + " Enclosure " + General::RoundSigDigits(enclosureNum); + thisEnclosure.Name = format("{} Enclosure {}", RadiantOrSolar, enclosureNum); thisEnclosure.ZoneNames.push_back(surf.ZoneName); thisEnclosure.ZoneNums.push_back(surf.Zone); thisEnclosure.FloorArea += Zone(surf.Zone).FloorArea; @@ -12942,8 +13154,7 @@ namespace SurfaceGeometry { } } if (errorCount > 0) { - ShowSevereError(state, RoutineName + ": " + General::TrimSigDigits(errorCount) + - " surfaces use Construction:AirBoundary in non-interzone surfaces."); + ShowSevereError(state, format("{}: {} surfaces use Construction:AirBoundary in non-interzone surfaces.", RoutineName, errorCount)); ShowContinueError(state, "For explicit details on each use, use Output:Diagnostics,DisplayExtraWarnings;"); } } @@ -13030,7 +13241,7 @@ namespace SurfaceGeometry { // http://mathworld.wolfram.com/ConvexPolygon.html // Using/Aliasing - using General::RoundSigDigits; + using namespace DataErrorTracking; constexpr Real64 TurnThreshold(0.000001); // Sensitivity of convexity test, in radians @@ -13187,16 +13398,12 @@ namespace SurfaceGeometry { if (Np1 > NSides) Np1 -= NSides; Np2 = n + 2; if (Np2 > NSides) Np2 -= NSides; - ShowContinueError(state, "...vertex " + RoundSigDigits(n) + " to vertex " + RoundSigDigits(Np1) + " to vertex " + - RoundSigDigits(Np2)); - ShowContinueError(state, "...vertex " + RoundSigDigits(n) + "=[" + RoundSigDigits(X(n), 2) + ',' + RoundSigDigits(Y(n), 2) + ',' + - RoundSigDigits(Z(n), 2) + ']'); - ShowContinueError(state, "...vertex " + RoundSigDigits(Np1) + "=[" + RoundSigDigits(X(n + 1), 2) + ',' + - RoundSigDigits(Y(n + 1), 2) + ',' + RoundSigDigits(Z(n + 1), 2) + ']'); - ShowContinueError(state, "...vertex " + RoundSigDigits(Np2) + "=[" + RoundSigDigits(X(n + 2), 2) + ',' + - RoundSigDigits(Y(n + 2), 2) + ',' + RoundSigDigits(Z(n + 2), 2) + ']'); - // CALL ShowContinueError(state, '...theta angle=['//TRIM(RoundSigDigits(Theta,6))//']') - // CALL ShowContinueError(state, '...last theta angle=['//TRIM(RoundSigDigits(LastTheta,6))//']') + ShowContinueError(state, format("...vertex {} to vertex {} to vertex {}", n, Np1, Np2)); + ShowContinueError(state, format("...vertex {}=[{:.2R},{:.2R},{:.2R}]", n, X(n), Y(n), Z(n))); + ShowContinueError(state, format("...vertex {}=[{:.2R},{:.2R},{:.2R}]", Np1, X(n + 1), Y(n + 1), Z(n + 1))); + ShowContinueError(state, format("...vertex {}=[{:.2R},{:.2R},{:.2R}]", Np2, X(n + 2), Y(n + 2), Z(n + 2))); + // CALL ShowContinueError(state, '...theta angle=['//TRIM(format("{:.6R}", Theta))//']') + // CALL ShowContinueError(state, '...last theta angle=['//TRIM(format("{:.6R}", LastTheta))//']') } } state.dataSurfaceGeometry->SurfaceTmp(SurfNum).IsConvex = false; @@ -13212,8 +13419,9 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides = NSides - M; } else { // too many if (state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, "CheckConvexity: Surface=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\" has [" + RoundSigDigits(M) + - "] collinear points."); + ShowWarningError( + state, + format("CheckConvexity: Surface=\"{}\" has [{}] collinear points.", state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, M)); ShowContinueError(state, "...too many to remove all. Will leave the surface with 3 sides. But this is now a degenerate surface"); } ++TotalDegenerateSurfaces; @@ -13242,8 +13450,10 @@ namespace SurfaceGeometry { } OldVertex.deallocate(); if (state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, "CheckConvexity: Surface=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + - "\": The vertex points has been reprocessed as Sides = " + RoundSigDigits(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); + ShowWarningError(state, + format("CheckConvexity: Surface=\"{}\": The vertex points has been reprocessed as Sides = {}", + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides)); } } } diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc index 2b46aa4d922..d4c26ddfab6 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -188,7 +188,7 @@ namespace SurfaceGroundHeatExchanger { using DataEnvironment::GroundTemp_SurfaceObjInput; using FluidProperties::CheckFluidPropertyName; using FluidProperties::FindGlycol; - using General::RoundSigDigits; + using NodeInputManager::GetOnlySingleNode; using namespace DataLoopNode; @@ -266,13 +266,13 @@ namespace SurfaceGroundHeatExchanger { state.dataSurfaceGroundHeatExchangers->SurfaceGHE(Item).TubeSpacing = rNumericArgs(3); if (rNumericArgs(2) == 0) { - ShowSevereError(state, "Invalid " + cNumericFieldNames(2) + '=' + RoundSigDigits(rNumericArgs(2), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", cNumericFieldNames(2), rNumericArgs(2))); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; } if (rNumericArgs(3) == 0.0) { - ShowSevereError(state, "Invalid " + cNumericFieldNames(3) + '=' + RoundSigDigits(rNumericArgs(3), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", cNumericFieldNames(3), rNumericArgs(3))); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; @@ -282,13 +282,13 @@ namespace SurfaceGroundHeatExchanger { state.dataSurfaceGroundHeatExchangers->SurfaceGHE(Item).SurfaceLength = rNumericArgs(4); state.dataSurfaceGroundHeatExchangers->SurfaceGHE(Item).SurfaceWidth = rNumericArgs(5); if (rNumericArgs(4) <= 0.0) { - ShowSevereError(state, "Invalid " + cNumericFieldNames(4) + '=' + RoundSigDigits(rNumericArgs(4), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", cNumericFieldNames(4), rNumericArgs(4))); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; } if (rNumericArgs(5) <= 0.0) { - ShowSevereError(state, "Invalid " + cNumericFieldNames(5) + '=' + RoundSigDigits(rNumericArgs(5), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", cNumericFieldNames(5), rNumericArgs(5))); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "Value must be greater than 0.0"); ErrorsFound = true; @@ -392,7 +392,7 @@ namespace SurfaceGroundHeatExchanger { if (state.dataSurfaceGroundHeatExchangers->NoSurfaceGroundTempObjWarning) { if (!GroundTemp_SurfaceObjInput) { ShowWarningError(state, "GetSurfaceGroundHeatExchanger: No \"Site:GroundTemperature:Shallow\" were input."); - ShowContinueError(state, "Defaults, constant throughout the year of (" + RoundSigDigits(GroundTemp_Surface, 1) + ") will be used."); + ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTemp_Surface)); } state.dataSurfaceGroundHeatExchangers->NoSurfaceGroundTempObjWarning = false; } @@ -591,7 +591,6 @@ namespace SurfaceGroundHeatExchanger { using DataLoopNode::Node; using namespace DataEnvironment; using DataPlant::PlantLoop; - using General::TrimSigDigits; Real64 const SurfFluxTol(0.001); // tolerance on the surface fluxes Real64 const SrcFluxTol(0.001); // tolerance on the source flux @@ -674,8 +673,8 @@ namespace SurfaceGroundHeatExchanger { // Check for non-convergence if (iter > Maxiter) { if (this->ConvErrIndex1 == 0) { - ShowWarningMessage(state, "CalcSurfaceGroundHeatExchanger=\"" + this->Name + - "\", Did not converge (part 1), Iterations=" + TrimSigDigits(Maxiter)); + ShowWarningMessage( + state, format("CalcSurfaceGroundHeatExchanger=\"{}\", Did not converge (part 1), Iterations={}", this->Name, Maxiter)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, "CalcSurfaceGroundHeatExchanger=\"" + this->Name + "\", Did not converge (part 1)", @@ -735,7 +734,7 @@ namespace SurfaceGroundHeatExchanger { ++iter1; // update top coefficients CalcTopFluxCoefficents(TempBtm, TempTop); - // calc top surface fluxe + // calc top surface flux FluxTop = this->QtopConstCoef + this->QtopVarCoef * state.dataSurfaceGroundHeatExchangers->SourceFlux; // calc new surface temps CalcTopSurfTemp(-FluxTop, @@ -769,8 +768,9 @@ namespace SurfaceGroundHeatExchanger { // Check for non-convergence if (iter1 > Maxiter1) { if (this->ConvErrIndex2 == 0) { - ShowWarningMessage(state, "CalcSurfaceGroundHeatExchanger=\"" + this->Name + - "\", Did not converge (part 2), Iterations=" + TrimSigDigits(Maxiter)); + ShowWarningMessage( + state, + format("CalcSurfaceGroundHeatExchanger=\"{}\", Did not converge (part 2), Iterations={}", this->Name, Maxiter)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, "CalcSurfaceGroundHeatExchanger=\"" + this->Name + "\", Did not converge (part 2)", @@ -788,8 +788,8 @@ namespace SurfaceGroundHeatExchanger { // Check for non-convergence if (iter > Maxiter) { if (this->ConvErrIndex3 == 0) { - ShowWarningMessage(state, "CalcSurfaceGroundHeatExchanger=\"" + this->Name + - "\", Did not converge (part 3), Iterations=" + TrimSigDigits(Maxiter)); + ShowWarningMessage( + state, format("CalcSurfaceGroundHeatExchanger=\"{}\", Did not converge (part 3), Iterations={}", this->Name, Maxiter)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, "CalcSurfaceGroundHeatExchanger=\"" + this->Name + "\", Did not converge (part 3)", @@ -1056,7 +1056,6 @@ namespace SurfaceGroundHeatExchanger { // Using/Aliasing using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; // Return value Real64 CalcHXEffectTerm; @@ -1125,8 +1124,11 @@ namespace SurfaceGroundHeatExchanger { if (Temperature < 0.0) { // check if fluid is water and would be freezing if (PlantLoop(this->LoopNum).FluidIndex == WaterIndex) { if (this->FrozenErrIndex1 == 0) { - ShowWarningMessage(state, "GroundHeatExchanger:Surface=\"" + this->Name + - "\", water is frozen; Model not valid. Calculated Water Temperature=[" + RoundSigDigits(this->InletTemp, 2) + "] C"); + ShowWarningMessage( + state, + format("GroundHeatExchanger:Surface=\"{}\", water is frozen; Model not valid. Calculated Water Temperature=[{:.2R}] C", + this->Name, + this->InletTemp)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, "GroundHeatExchanger:Surface=\"" + this->Name + "\", water is frozen", diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index 08cf577ca60..3e3201a08a9 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -1713,7 +1713,6 @@ namespace SystemAvailabilityManager { // System Availability Manager algorithm. // Using/Aliasing - using General::TrimSigDigits; { auto const SELECT_CASE_var(SysAvailType); @@ -1828,7 +1827,7 @@ namespace SystemAvailabilityManager { } } else { - ShowSevereError(state, "AvailabilityManager Type not found: " + TrimSigDigits(SysAvailType)); + ShowSevereError(state, format("AvailabilityManager Type not found: {}", SysAvailType)); ShowContinueError(state, "Occurs in Manager=" + SysAvailName); ShowFatalError(state, "Preceding condition causes termination."); } @@ -3751,7 +3750,7 @@ namespace SystemAvailabilityManager { using NodeInputManager::GetOnlySingleNode; using NodeInputManager::MarkNode; using namespace DataLoopNode; - using General::TrimSigDigits; + using namespace DataIPShortCuts; using CurveManager::CurveValue; using CurveManager::GetCurveIndex; @@ -3840,13 +3839,13 @@ namespace SystemAvailabilityManager { if (SchedMax > 7.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, cAlphaFieldNames(4) + "=\"" + cAlphaArgs(4) + "\", the maximum schedule value should be 7. However, "); - ShowContinueError(state, "the maximum entered value in the schedule is " + TrimSigDigits(SchedMax, 1)); + ShowContinueError(state, format("the maximum entered value in the schedule is {:.1T}", SchedMax)); ErrorsFound = true; } if (SchedMin < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, cAlphaFieldNames(4) + "=\"" + cAlphaArgs(4) + "the minimum schedule value should be 0. However, "); - ShowContinueError(state, "the minimum entered value in the schedule is " + TrimSigDigits(SchedMin, 1)); + ShowContinueError(state, format("the minimum entered value in the schedule is {:.1T}", SchedMin)); ErrorsFound = true; } if (SchedMax == 7.0 && !Contaminant.CO2Simulation) { @@ -3874,7 +3873,7 @@ namespace SystemAvailabilityManager { if (rNumericArgs(1) > 40.0 || rNumericArgs(1) < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, cNumericFieldNames(1) + " is beyond the range."); - ShowContinueError(state, "The input value is " + TrimSigDigits(rNumericArgs(1), 0) + ". The allowed value must be >= 0 and <= 40 m/s"); + ShowContinueError(state, format("The input value is {:.0T}. The allowed value must be >= 0 and <= 40 m/s", rNumericArgs(1))); ErrorsFound = true; } } @@ -3885,8 +3884,8 @@ namespace SystemAvailabilityManager { if (rNumericArgs(2) > 100.0 || rNumericArgs(2) < -100.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, cNumericFieldNames(2) + " is beyond the range."); - ShowContinueError(state, "The input value is " + TrimSigDigits(rNumericArgs(2), 0) + - ". The allowed value must be between -100 C and +100 C"); + ShowContinueError(state, + format("The input value is {:.0T}. The allowed value must be between -100 C and +100 C", rNumericArgs(2))); ErrorsFound = true; } } @@ -3895,8 +3894,8 @@ namespace SystemAvailabilityManager { if (rNumericArgs(3) > 100.0 || rNumericArgs(3) < -100.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, cNumericFieldNames(3) + " is beyond the range."); - ShowContinueError(state, "The input value is " + TrimSigDigits(rNumericArgs(3), 0) + - ". The allowed value must be between -100 C and +100 C"); + ShowContinueError(state, + format("The input value is {:.0T}. The allowed value must be between -100 C and +100 C", rNumericArgs(3))); ErrorsFound = true; } } @@ -3904,8 +3903,9 @@ namespace SystemAvailabilityManager { if (rNumericArgs(2) >= rNumericArgs(3)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" The " + cNumericFieldNames(2) + " must be less than the " + cNumericFieldNames(3)); - ShowContinueError(state, "The " + cNumericFieldNames(2) + " is " + TrimSigDigits(rNumericArgs(2), 0) + ". The " + cNumericFieldNames(3) + - " is " + TrimSigDigits(rNumericArgs(3), 0) + '.'); + ShowContinueError( + state, + format("The {} is {:.0T}. The {} is {:.0T}.", cNumericFieldNames(2), rNumericArgs(2), cNumericFieldNames(3), rNumericArgs(3))); ErrorsFound = true; } @@ -3915,8 +3915,8 @@ namespace SystemAvailabilityManager { if (rNumericArgs(4) > 300000.0 || rNumericArgs(4) < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, cNumericFieldNames(4) + " is beyond the range."); - ShowContinueError(state, "The input value is " + TrimSigDigits(rNumericArgs(4), 0) + - ". The allowed value must be between 0 and 300000 J/kg"); + ShowContinueError(state, + format("The input value is {:.0T}. The allowed value must be between 0 and 300000 J/kg", rNumericArgs(4))); ErrorsFound = true; } } @@ -3925,8 +3925,8 @@ namespace SystemAvailabilityManager { if (rNumericArgs(5) > 300000.0 || rNumericArgs(5) < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, cNumericFieldNames(5) + " is beyond the range."); - ShowContinueError(state, "The input value is " + TrimSigDigits(rNumericArgs(5), 0) + - ". The allowed value must be between 0 and 300000 J/kg"); + ShowContinueError(state, + format("The input value is {:.0T}. The allowed value must be between 0 and 300000 J/kg", rNumericArgs(5))); ErrorsFound = true; } } @@ -3934,8 +3934,9 @@ namespace SystemAvailabilityManager { if (rNumericArgs(4) >= rNumericArgs(5)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" The " + cNumericFieldNames(4) + " must be less than the " + cNumericFieldNames(5)); - ShowContinueError(state, "The " + cNumericFieldNames(4) + " is " + TrimSigDigits(rNumericArgs(4), 0) + ". The " + cNumericFieldNames(5) + - " is " + TrimSigDigits(rNumericArgs(5), 0) + '.'); + ShowContinueError( + state, + format("The {} is {:.0T}. The {} is {:.0T}.", cNumericFieldNames(4), rNumericArgs(4), cNumericFieldNames(5), rNumericArgs(5))); ErrorsFound = true; } @@ -3945,8 +3946,8 @@ namespace SystemAvailabilityManager { if (rNumericArgs(6) > 100.0 || rNumericArgs(6) < -100.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, cNumericFieldNames(6) + " is beyond the range."); - ShowContinueError(state, "The input value is " + TrimSigDigits(rNumericArgs(6), 0) + - ". The allowed value must be between -100 C and +100 C"); + ShowContinueError(state, + format("The input value is {:.0T}. The allowed value must be between -100 C and +100 C", rNumericArgs(6))); ErrorsFound = true; } } @@ -3955,8 +3956,8 @@ namespace SystemAvailabilityManager { if (rNumericArgs(7) > 100.0 || rNumericArgs(7) < -100.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, cNumericFieldNames(7) + " is beyond the range."); - ShowContinueError(state, "The input value is " + TrimSigDigits(rNumericArgs(7), 0) + - ". The allowed value must be between -100 C and +100 C"); + ShowContinueError(state, + format("The input value is {:.0T}. The allowed value must be between -100 C and +100 C", rNumericArgs(7))); ErrorsFound = true; } } @@ -3964,8 +3965,9 @@ namespace SystemAvailabilityManager { if (rNumericArgs(6) >= rNumericArgs(7)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" The " + cNumericFieldNames(6) + " must be less than the " + cNumericFieldNames(7)); - ShowContinueError(state, "The " + cNumericFieldNames(6) + " is " + TrimSigDigits(rNumericArgs(6), 0) + ". The " + cNumericFieldNames(7) + - " is " + TrimSigDigits(rNumericArgs(7), 0) + '.'); + ShowContinueError( + state, + format("The {} is {:.0T}. The {} is {:.0T}.", cNumericFieldNames(6), rNumericArgs(6), cNumericFieldNames(7), rNumericArgs(7))); ErrorsFound = true; } @@ -3980,7 +3982,7 @@ namespace SystemAvailabilityManager { if (SchedMin < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", Schedule value must be >= 0 in " + cAlphaFieldNames(6) + "=\"" + cAlphaArgs(6) + "\"."); - ShowContinueError(state, "The minimum schedule value is " + TrimSigDigits(SchedMin, 1)); + ShowContinueError(state, format("The minimum schedule value is {:.1T}", SchedMin)); ErrorsFound = true; } @@ -4005,7 +4007,7 @@ namespace SystemAvailabilityManager { ShowContinueError(state, "The minimum value of " + cAlphaFieldNames(7) + " must be greater than or equal to 0.0 at the minimum value of wind speed."); ShowContinueError(state, cAlphaFieldNames(7) + "=\"" + cAlphaArgs(7) + "\"."); - ShowContinueError(state, "Curve output at the minimum wind speed = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at the minimum wind speed = {:.3T}", CurveVal)); ErrorsFound = true; } CurveVal = CurveValue(state, state.dataSystemAvailabilityManager->HybridVentSysAvailMgrData(SysAvailNum).OpeningFactorFWS, CurveMax); @@ -4014,7 +4016,7 @@ namespace SystemAvailabilityManager { ShowContinueError(state, "The maximum value of " + cAlphaFieldNames(7) + " must be less than or equal to 1.0 at the maximum value of wind speed."); ShowContinueError(state, cAlphaFieldNames(7) + "=\"" + cAlphaArgs(7) + "\"."); - ShowContinueError(state, "Curve output at the maximum wind speed = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at the maximum wind speed = {:.3T}", CurveVal)); ErrorsFound = true; } // Check curve type @@ -4039,14 +4041,14 @@ namespace SystemAvailabilityManager { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, " For " + cAlphaFieldNames(8) + "=\"" + cAlphaArgs(8) + "\","); ShowContinueError(state, "the maximum schedule value should be 1. However, "); - ShowContinueError(state, "the maximum entered value in the schedule is " + TrimSigDigits(SchedMax, 1)); + ShowContinueError(state, format("the maximum entered value in the schedule is {:.1T}", SchedMax)); ErrorsFound = true; } if (SchedMin < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, "For " + cAlphaFieldNames(8) + "=\"" + cAlphaArgs(8) + "\","); ShowContinueError(state, "the minimum schedule value should be 0. However, "); - ShowContinueError(state, "the minimum entered value in the schedule is " + TrimSigDigits(SchedMin, 1)); + ShowContinueError(state, format("the minimum entered value in the schedule is {:.1T}", SchedMin)); ErrorsFound = true; } } @@ -4066,14 +4068,14 @@ namespace SystemAvailabilityManager { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, "For " + cAlphaFieldNames(9) + "=\"" + cAlphaArgs(9) + "\","); ShowContinueError(state, "the maximum schedule value should be 1. However, "); - ShowContinueError(state, "the maximum entered value in the schedule is " + TrimSigDigits(SchedMax, 1)); + ShowContinueError(state, format("the maximum entered value in the schedule is {:.1T}", SchedMax)); ErrorsFound = true; } if (SchedMin < 0.0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError(state, "For " + cAlphaFieldNames(9) + "=\"" + cAlphaArgs(9) + "\","); ShowContinueError(state, "the minimum schedule value should be 0. However, "); - ShowContinueError(state, "the minimum entered value in the schedule is " + TrimSigDigits(SchedMin, 1)); + ShowContinueError(state, format("the minimum entered value in the schedule is {:.1T}", SchedMin)); ErrorsFound = true; } } @@ -4927,8 +4929,6 @@ namespace SystemAvailabilityManager { // This routine was designed to find whether this zone is controlled by hybrid ventilation // ventilation control option. - using General::TrimSigDigits; - // Return value bool VentControl; // Set to true if ventilation control in the same zone diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index a76bffcf653..03ef6098336 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -5271,12 +5271,12 @@ namespace SystemReports { std::string ChrOut; std::string ChrOut2; if (state.dataAirLoop->AirToOANodeInfo(Count).OASysInletNodeNum > 0) { - ChrOut = std::to_string(state.dataAirLoop->AirToOANodeInfo(Count).OASysInletNodeNum); + ChrOut = fmt::to_string(state.dataAirLoop->AirToOANodeInfo(Count).OASysInletNodeNum); } else { ChrOut = errstring; } if (state.dataAirLoop->AirToOANodeInfo(Count).OASysOutletNodeNum > 0) { - ChrOut2 = std::to_string(state.dataAirLoop->AirToOANodeInfo(Count).OASysOutletNodeNum); + ChrOut2 = fmt::to_string(state.dataAirLoop->AirToOANodeInfo(Count).OASysOutletNodeNum); } else { ChrOut2 = errstring; } diff --git a/src/EnergyPlus/ThermalChimney.cc b/src/EnergyPlus/ThermalChimney.cc index 32c73284e12..58ad552ddec 100644 --- a/src/EnergyPlus/ThermalChimney.cc +++ b/src/EnergyPlus/ThermalChimney.cc @@ -149,7 +149,7 @@ namespace ThermalChimney { // stores it in the ThermalChimney data structure. // Using/Aliasing - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using namespace DataIPShortCuts; @@ -224,22 +224,34 @@ namespace ThermalChimney { state.dataThermalChimneys->ThermalChimneySys(Loop).AbsorberWallWidth = rNumericArgs(1); if (state.dataThermalChimneys->ThermalChimneySys(Loop).AbsorberWallWidth < 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + - " must be >= 0, entered value=[" + RoundSigDigits(rNumericArgs(1), 2) + "]."); + ShowSevereError(state, + format("{}=\"{} invalid {} must be >= 0, entered value=[{:.2R}].", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ErrorsFound = true; } state.dataThermalChimneys->ThermalChimneySys(Loop).AirOutletCrossArea = rNumericArgs(2); if (state.dataThermalChimneys->ThermalChimneySys(Loop).AirOutletCrossArea < 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid " + cNumericFieldNames(2) + - " must be >= 0, entered value=[" + RoundSigDigits(rNumericArgs(2), 2) + "]."); + ShowSevereError(state, + format("{}=\"{} invalid {} must be >= 0, entered value=[{:.2R}].", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(2), + rNumericArgs(2))); ErrorsFound = true; } state.dataThermalChimneys->ThermalChimneySys(Loop).DischargeCoeff = rNumericArgs(3); if ((state.dataThermalChimneys->ThermalChimneySys(Loop).DischargeCoeff <= 0.0) || (state.dataThermalChimneys->ThermalChimneySys(Loop).DischargeCoeff > 1.0)) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid " + cNumericFieldNames(3) + - " must be > 0 and <=1.0, entered value=[" + RoundSigDigits(rNumericArgs(3), 2) + "]."); + ShowSevereError(state, + format("{}=\"{} invalid {} must be > 0 and <=1.0, entered value=[{:.2R}].", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(3), + rNumericArgs(3))); ErrorsFound = true; } @@ -273,21 +285,33 @@ namespace ThermalChimney { } if (state.dataThermalChimneys->ThermalChimneySys(Loop).DistanceThermChimInlet(TCZoneNum) < 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid " + cNumericFieldNames(3 * TCZoneNum + 1) + - " must be >= 0, entered value=[" + RoundSigDigits(rNumericArgs(3 * TCZoneNum + 1), 2) + "]."); + ShowSevereError(state, + format("{}=\"{} invalid {} must be >= 0, entered value=[{:.2R}].", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(3 * TCZoneNum + 1), + rNumericArgs(3 * TCZoneNum + 1))); ErrorsFound = true; } if ((state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) <= 0.0) || (state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) > 1.0)) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid " + cNumericFieldNames(3 * TCZoneNum + 2) + - " must be > 0 and <=1.0, entered value=[" + RoundSigDigits(rNumericArgs(3 * TCZoneNum + 2), 2) + "]."); + ShowSevereError(state, + format("{}=\"{} invalid {} must be > 0 and <=1.0, entered value=[{:.2R}].", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(3 * TCZoneNum + 2), + rNumericArgs(3 * TCZoneNum + 2))); ErrorsFound = true; } if (state.dataThermalChimneys->ThermalChimneySys(Loop).EachAirInletCrossArea(TCZoneNum) < 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid " + cNumericFieldNames(3 * TCZoneNum + 3) + - " must be >= 0, entered value=[" + RoundSigDigits(rNumericArgs(3 * TCZoneNum + 3), 2) + "]."); + ShowSevereError(state, + format("{}=\"{} invalid {} must be >= 0, entered value=[{:.2R}].", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(3 * TCZoneNum + 3), + rNumericArgs(3 * TCZoneNum + 3))); ErrorsFound = true; } @@ -297,9 +321,11 @@ namespace ThermalChimney { // Error trap if the sum of fractions is not equal to 1.0 if (std::abs(AllRatiosSummed - 1.0) > FlowFractionTolerance) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + - " invalid sum of fractions, must be =1.0, entered value (summed from entries)=[" + - RoundSigDigits(AllRatiosSummed, 4) + "]."); + ShowSevereError(state, + format("{}=\"{} invalid sum of fractions, must be =1.0, entered value (summed from entries)=[{:.4R}].", + cCurrentModuleObject, + cAlphaArgs(1), + AllRatiosSummed)); ErrorsFound = true; } diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index 1bde4d6253f..233e38fdf75 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -1618,7 +1618,6 @@ namespace ThermalComfort { using namespace DataHeatBalance; using DataSurfaces::Surface; using namespace DataIPShortCuts; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: Real64 const AngleFacLimit(0.01); // To set the limit of sum of angle factors @@ -1709,8 +1708,10 @@ namespace ThermalComfort { if (std::abs(AllAngleFacSummed - 1.0) > AngleFacLimit) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid - Sum[AngleFactors]"); - ShowContinueError(state, "...Sum of Angle Factors [" + RoundSigDigits(AllAngleFacSummed, 3) + - "] exceed expected sum [1.0] by more than limit [" + RoundSigDigits(AngleFacLimit, 3) + "]."); + ShowContinueError(state, + format("...Sum of Angle Factors [{:.3R}] exceed expected sum [1.0] by more than limit [{:.3R}].", + AllAngleFacSummed, + AngleFacLimit)); ErrorsFound = true; } } @@ -1977,7 +1978,7 @@ namespace ThermalComfort { using DataEnvironment::EnvironmentName; using DataEnvironment::EnvironmentStartEnd; using DataEnvironment::RunPeriodEnvironment; - using General::RoundSigDigits; + using OutputReportTabular::isInQuadrilateral; using namespace OutputReportPredefined; @@ -2099,7 +2100,7 @@ namespace ThermalComfort { } // if any zones should be warning print it out if (showWarning) { - ShowWarningError(state, "More than 4% of time (" + RoundSigDigits(allowedHours, 1) + " hours) uncomfortable in one or more zones "); + ShowWarningError(state, format("More than 4% of time ({:.1R} hours) uncomfortable in one or more zones ", allowedHours)); ShowContinueError(state, "Based on ASHRAE 55-2004 graph (Section 5.2.1.1)"); if (RunPeriodEnvironment) { ShowContinueError(state, "During Environment [" + EnvironmentStartEnd + "]: " + EnvironmentName); @@ -2109,8 +2110,10 @@ namespace ThermalComfort { for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (state.dataThermalComforts->ThermalComfortInASH55(iZone).Enable55Warning) { if (state.dataThermalComforts->ThermalComfortInASH55(iZone).totalTimeNotEither > allowedHours) { - ShowContinueError(state, RoundSigDigits(state.dataThermalComforts->ThermalComfortInASH55(iZone).totalTimeNotEither, 1) + - " hours were uncomfortable in zone: " + Zone(iZone).Name); + ShowContinueError(state, + format("{:.1R} hours were uncomfortable in zone: {}", + state.dataThermalComforts->ThermalComfortInASH55(iZone).totalTimeNotEither, + Zone(iZone).Name)); } } } diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index 8d710efebb4..001bacb66b4 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -138,7 +138,7 @@ namespace TranspiredCollector { // Using/Aliasing using DataHVACGlobals::TempControlTol; using DataLoopNode::Node; - using General::TrimSigDigits; + using ScheduleManager::GetCurrentScheduleValue; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -160,13 +160,20 @@ namespace TranspiredCollector { } else { UTSCNum = CompIndex; if (UTSCNum > state.dataTranspiredCollector->NumUTSC || UTSCNum < 1) { - ShowFatalError(state, "SimTranspiredCollector: Invalid CompIndex passed=" + TrimSigDigits(UTSCNum) + - ", Number of Transpired Collectors=" + TrimSigDigits(state.dataTranspiredCollector->NumUTSC) + ", UTSC name=" + CompName); + ShowFatalError(state, + format("SimTranspiredCollector: Invalid CompIndex passed={}, Number of Transpired Collectors={}, UTSC name={}", + UTSCNum, + state.dataTranspiredCollector->NumUTSC, + CompName)); } if (state.dataTranspiredCollector->CheckEquipName(UTSCNum)) { if (CompName != state.dataTranspiredCollector->UTSC(UTSCNum).Name) { - ShowFatalError(state, "SimTranspiredCollector: Invalid CompIndex passed=" + TrimSigDigits(UTSCNum) + ", Transpired Collector name=" + - CompName + ", stored Transpired Collector Name for that index=" + state.dataTranspiredCollector->UTSC(UTSCNum).Name); + ShowFatalError(state, + format("SimTranspiredCollector: Invalid CompIndex passed={}, Transpired Collector name={}, stored Transpired " + "Collector Name for that index={}", + UTSCNum, + CompName, + state.dataTranspiredCollector->UTSC(UTSCNum).Name)); } state.dataTranspiredCollector->CheckEquipName(UTSCNum) = false; } @@ -239,8 +246,7 @@ namespace TranspiredCollector { using DataSurfaces::OtherSideCondModeledExt; using DataSurfaces::Surface; using DataSurfaces::SurfaceData; - using General::RoundSigDigits; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; using ScheduleManager::GetScheduleIndex; @@ -286,8 +292,10 @@ namespace TranspiredCollector { inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, Dummy, MaxNumAlphas, MaxNumNumbers); if (MaxNumNumbers != 11) { - ShowSevereError(state, "GetTranspiredCollectorInput: " + CurrentModuleObject + - " Object Definition indicates not = 11 Number Objects, Number Indicated=" + TrimSigDigits(MaxNumNumbers)); + ShowSevereError(state, + format("GetTranspiredCollectorInput: {} Object Definition indicates not = 11 Number Objects, Number Indicated={}", + CurrentModuleObject, + MaxNumNumbers)); ErrorsFound = true; } Alphas.allocate(MaxNumAlphas); @@ -324,8 +332,10 @@ namespace TranspiredCollector { inputProcessor->getObjectDefMaxArgs(state, CurrentModuleMultiObject, Dummy, MaxNumAlphasSplit, MaxNumNumbersSplit); if (MaxNumNumbersSplit != 0) { - ShowSevereError(state, "GetTranspiredCollectorInput: " + CurrentModuleMultiObject + - " Object Definition indicates not = 0 Number Objects, Number Indicated=" + TrimSigDigits(MaxNumNumbersSplit)); + ShowSevereError(state, + format("GetTranspiredCollectorInput: {} Object Definition indicates not = 0 Number Objects, Number Indicated={}", + CurrentModuleMultiObject, + MaxNumNumbersSplit)); ErrorsFound = true; } if (!allocated(AlphasSplit)) AlphasSplit.allocate(MaxNumAlphasSplit); @@ -531,7 +541,7 @@ namespace TranspiredCollector { ShowWarningError(state, "Suspected input problem with collector surface = " + Alphas(ThisSurf + AlphaOffset)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + " = " + state.dataTranspiredCollector->UTSC(Item).Name); ShowContinueError(state, "Surface used for solar collector faces down"); - ShowContinueError(state, "Surface tilt angle (degrees from ground outward normal) = " + RoundSigDigits(Surface(Found).Tilt, 2)); + ShowContinueError(state, format("Surface tilt angle (degrees from ground outward normal) = {:.2R}", Surface(Found).Tilt)); } state.dataTranspiredCollector->UTSC(Item).SurfPtrs(ThisSurf) = Found; @@ -851,7 +861,7 @@ namespace TranspiredCollector { using DataHVACGlobals::TimeStepSys; using DataSurfaces::Surface; using DataSurfaces::SurfaceData; - using General::RoundSigDigits; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -968,7 +978,7 @@ namespace TranspiredCollector { if (state.dataTranspiredCollector->UTSC(UTSCNum).VsucErrIndex == 0) { ShowWarningMessage(state, "Solar Collector:Unglazed Transpired=\"" + state.dataTranspiredCollector->UTSC(UTSCNum).Name + "\", Suction velocity is outside of range for a good design"); - ShowContinueErrorTimeStamp(state, "Suction velocity =" + RoundSigDigits(Vsuction, 4)); + ShowContinueErrorTimeStamp(state, format("Suction velocity ={:.4R}", Vsuction)); if (Vsuction < 0.003) { ShowContinueError(state, "Velocity is low -- suggest decreasing area of transpired collector"); } diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 47aa12732a0..282cfdc81a1 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -115,7 +115,6 @@ namespace UFADManager { using DataHVACGlobals::ShortenTimeStepSysRoomAir; using DataHVACGlobals::SysTimeElapsed; using namespace DataUCSDSharedData; - using General::RoundSigDigits; // Data // MODULE VARIABLE DECLARATIONS: @@ -684,8 +683,8 @@ namespace UFADManager { if (std::abs(ZInfSurf - ZSupSurf) < 1.e-10) { ShowSevereError(state, "RoomAirModelUFAD:HcUCSDUF: Surface values will cause divide by zero."); ShowContinueError(state, "Zone=\"" + Zone(Surface(SurfNum).Zone).Name + "\", Surface=\"" + Surface(SurfNum).Name + "\"."); - ShowContinueError(state, "ZInfSurf=[" + RoundSigDigits(ZInfSurf, 4) + "], LayH=[" + RoundSigDigits(LayH, 4) + "]."); - ShowContinueError(state, "ZSupSurf=[" + RoundSigDigits(ZSupSurf, 4) + "], LayH=[" + RoundSigDigits(LayH, 4) + "]."); + ShowContinueError(state, format("ZInfSurf=[{:.4R}], LayH=[{:.4R}].", ZInfSurf, LayH)); + ShowContinueError(state, format("ZSupSurf=[{:.4R}], LayH=[{:.4R}].", ZSupSurf, LayH)); ShowFatalError(state, "...Previous condition causes termination."); } diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 7abee8eec3a..4ef1b96101a 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -154,7 +154,6 @@ namespace UnitHeater { // Using/Aliasing using DataSizing::ZoneEqUnitHeater; using DataSizing::ZoneHeatingOnlyFan; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int UnitHeatNum; // index of unit heater being simulated @@ -175,13 +174,19 @@ namespace UnitHeater { } else { UnitHeatNum = CompIndex; if (UnitHeatNum > state.dataUnitHeaters->NumOfUnitHeats || UnitHeatNum < 1) { - ShowFatalError(state, "SimUnitHeater: Invalid CompIndex passed=" + TrimSigDigits(UnitHeatNum) + - ", Number of Units=" + TrimSigDigits(state.dataUnitHeaters->NumOfUnitHeats) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimUnitHeater: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + UnitHeatNum, + state.dataUnitHeaters->NumOfUnitHeats, + CompName)); } if (state.dataUnitHeaters->CheckEquipName(UnitHeatNum)) { if (CompName != state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name) { - ShowFatalError(state, "SimUnitHeater: Invalid CompIndex passed=" + TrimSigDigits(UnitHeatNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name); + ShowFatalError(state, + format("SimUnitHeater: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + UnitHeatNum, + CompName, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name)); } state.dataUnitHeaters->CheckEquipName(UnitHeatNum) = false; } @@ -239,7 +244,7 @@ namespace UnitHeater { using Fans::GetFanOutletNode; using Fans::GetFanType; using Fans::GetFanVolFlow; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; using SteamCoils::GetCoilSteamInletNode; using SteamCoils::GetSteamCoilIndex; @@ -374,9 +379,13 @@ namespace UnitHeater { if (FanVolFlow != AutoSize && state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow != AutoSize && FanVolFlow < state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow) { ShowSevereError(state, "Specified in " + CurrentModuleObject + " = " + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name); - ShowContinueError(state, "...air flow rate (" + TrimSigDigits(FanVolFlow, 7) + ") in fan object " + - state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanName + " is less than the unit heater maximum supply air flow rate (" + - TrimSigDigits(state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow, 7) + ")."); + ShowContinueError( + state, + format( + "...air flow rate ({:.7T}) in fan object {} is less than the unit heater maximum supply air flow rate ({:.7T}).", + FanVolFlow, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanName, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow)); ShowContinueError(state, "...the fan flow rate must be greater than or equal to the unit heater maximum supply air flow rate."); ErrorsFound = true; } else if (FanVolFlow == AutoSize && state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow != AutoSize) { @@ -400,9 +409,12 @@ namespace UnitHeater { if (FanVolFlow != AutoSize && state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow != AutoSize && FanVolFlow < state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow) { ShowSevereError(state, "Specified in " + CurrentModuleObject + " = " + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name); - ShowContinueError(state, "...air flow rate (" + TrimSigDigits(FanVolFlow, 7) + ") in fan object " + state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanName + - " is less than the unit heater maximum supply air flow rate (" + - TrimSigDigits(state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow, 7) + ")."); + ShowContinueError( + state, + format("...air flow rate ({:.7T}) in fan object {} is less than the unit heater maximum supply air flow rate ({:.7T}).", + FanVolFlow, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanName, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow)); ShowContinueError(state, "...the fan flow rate must be greater than or equal to the unit heater maximum supply air flow rate."); ErrorsFound = true; } else if (FanVolFlow == AutoSize && state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirVolFlow != AutoSize) { @@ -921,7 +933,7 @@ namespace UnitHeater { using DataHVACGlobals::HeatingAirflowSizing; using DataHVACGlobals::HeatingCapacitySizing; using DataPlant::PlantLoop; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; using Psychrometrics::CPHW; using SteamCoils::GetCoilSteamInletNode; @@ -1194,10 +1206,10 @@ namespace UnitHeater { if ((std::abs(MaxVolHotWaterFlowDes - MaxVolHotWaterFlowUser) / MaxVolHotWaterFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeUnitHeater: Potential issue with equipment sizing for ZoneHVAC:UnitHeater " + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name); - ShowContinueError(state, "User-Specified Maximum Hot Water Flow of " + RoundSigDigits(MaxVolHotWaterFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Hot Water Flow of " + - RoundSigDigits(MaxVolHotWaterFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Hot Water Flow of {:.5R} [m3/s]", MaxVolHotWaterFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Hot Water Flow of {:.5R} [m3/s]", MaxVolHotWaterFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1306,10 +1318,9 @@ namespace UnitHeater { if ((std::abs(MaxVolHotSteamFlowDes - MaxVolHotSteamFlowUser) / MaxVolHotSteamFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeUnitHeater: Potential issue with equipment sizing for ZoneHVAC:UnitHeater " + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name); - ShowContinueError(state, "User-Specified Maximum Steam Flow of " + RoundSigDigits(MaxVolHotSteamFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Steam Flow of " + RoundSigDigits(MaxVolHotSteamFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Steam Flow of {:.5R} [m3/s]", MaxVolHotSteamFlowUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Steam Flow of {:.5R} [m3/s]", MaxVolHotSteamFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index acd6b23e84a..a6eee0083a9 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -160,7 +160,6 @@ namespace UnitVentilator { // Using/Aliasing using DataSizing::ZoneEqUnitVent; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int UnitVentNum; // index of unit ventilator being simulated @@ -181,13 +180,19 @@ namespace UnitVentilator { } else { UnitVentNum = CompIndex; if (UnitVentNum > state.dataUnitVentilators->NumOfUnitVents || UnitVentNum < 1) { - ShowFatalError(state, "SimUnitVentilator: Invalid CompIndex passed=" + TrimSigDigits(UnitVentNum) + - ", Number of Units=" + TrimSigDigits(state.dataUnitVentilators->NumOfUnitVents) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimUnitVentilator: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + UnitVentNum, + state.dataUnitVentilators->NumOfUnitVents, + CompName)); } if (state.dataUnitVentilators->CheckEquipName(UnitVentNum)) { if (CompName != state.dataUnitVentilators->UnitVent(UnitVentNum).Name) { - ShowFatalError(state, "SimUnitVentilator: Invalid CompIndex passed=" + TrimSigDigits(UnitVentNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + state.dataUnitVentilators->UnitVent(UnitVentNum).Name); + ShowFatalError(state, + format("SimUnitVentilator: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + UnitVentNum, + CompName, + state.dataUnitVentilators->UnitVent(UnitVentNum).Name)); } state.dataUnitVentilators->CheckEquipName(UnitVentNum) = false; } @@ -255,7 +260,7 @@ namespace UnitVentilator { using DataSizing::AutoSize; using DataSizing::ZoneHVACSizing; using DataZoneEquipment::ZoneEquipConfig; - using General::TrimSigDigits; + using SingleDuct::GetATMixer; // SUBROUTINE PARAMETER DEFINITIONS: @@ -477,10 +482,12 @@ namespace UnitVentilator { if (FanVolFlow != AutoSize && state.dataUnitVentilators->UnitVent(UnitVentNum).MaxAirVolFlow != AutoSize && FanVolFlow < state.dataUnitVentilators->UnitVent(UnitVentNum).MaxAirVolFlow) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataUnitVentilators->UnitVent(UnitVentNum).Name + "\""); - ShowContinueError(state, "...air flow rate [" + TrimSigDigits(FanVolFlow, 7) + "] in fan object " + - state.dataUnitVentilators->UnitVent(UnitVentNum).FanName + - " is less than the unit ventilator maximum supply air flow rate [" + - TrimSigDigits(state.dataUnitVentilators->UnitVent(UnitVentNum).MaxAirVolFlow, 7) + "]."); + ShowContinueError(state, + format("...air flow rate [{:.7T}] in fan object {} is less than the unit ventilator maximum " + "supply air flow rate [{:.7T}].", + FanVolFlow, + state.dataUnitVentilators->UnitVent(UnitVentNum).FanName, + state.dataUnitVentilators->UnitVent(UnitVentNum).MaxAirVolFlow)); ShowContinueError(state, "...the fan flow rate must be greater than or equal to the unit ventilator maximum supply air flow rate."); ErrorsFound = true; @@ -517,9 +524,13 @@ namespace UnitVentilator { if (FanVolFlow != AutoSize && state.dataUnitVentilators->UnitVent(UnitVentNum).MaxAirVolFlow != AutoSize && FanVolFlow < state.dataUnitVentilators->UnitVent(UnitVentNum).MaxAirVolFlow) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataUnitVentilators->UnitVent(UnitVentNum).Name + "\""); - ShowContinueError(state, "...air flow rate [" + TrimSigDigits(FanVolFlow, 7) + "] in fan object " + state.dataUnitVentilators->UnitVent(UnitVentNum).FanName + - " is less than the unit ventilator maximum supply air flow rate [" + - TrimSigDigits(state.dataUnitVentilators->UnitVent(UnitVentNum).MaxAirVolFlow, 7) + "]."); + ShowContinueError( + state, + format( + "...air flow rate [{:.7T}] in fan object {} is less than the unit ventilator maximum supply air flow rate [{:.7T}].", + FanVolFlow, + state.dataUnitVentilators->UnitVent(UnitVentNum).FanName, + state.dataUnitVentilators->UnitVent(UnitVentNum).MaxAirVolFlow)); ShowContinueError(state, "...the fan flow rate must be greater than or equal to the unit ventilator maximum supply air flow rate."); ErrorsFound = true; } else if (FanVolFlow == AutoSize && state.dataUnitVentilators->UnitVent(UnitVentNum).MaxAirVolFlow != AutoSize) { @@ -1555,8 +1566,7 @@ namespace UnitVentilator { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; - using General::TrimSigDigits; + using HVACHXAssistedCoolingCoil::GetHXCoilType; using HVACHXAssistedCoolingCoil::GetHXDXCoilName; using PlantUtilities::MyPlantSizingIndex; @@ -1988,10 +1998,9 @@ namespace UnitVentilator { if ((std::abs(OutAirVolFlowDes - OutAirVolFlowUser) / OutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeUnitVentilator: Potential issue with equipment sizing for " + state.dataUnitVentilators->cMO_UnitVentilator + ' ' + state.dataUnitVentilators->UnitVent(UnitVentNum).Name); - ShowContinueError(state, "User-Specified Maximum Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Outdoor Air Flow Rate of {:.5R} [m3/s]", OutAirVolFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Outdoor Air Flow Rate of {:.5R} [m3/s]", OutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2042,10 +2051,10 @@ namespace UnitVentilator { if ((std::abs(MinOutAirVolFlowDes - MinOutAirVolFlowUser) / MinOutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeUnitVentilator: Potential issue with equipment sizing for " + state.dataUnitVentilators->cMO_UnitVentilator + ' ' + state.dataUnitVentilators->UnitVent(UnitVentNum).Name); - ShowContinueError(state, "User-Specified Minimum Outdoor Air Flow Rate of " + RoundSigDigits(MinOutAirVolFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Minimum Outdoor Air Flow Rate of " + - RoundSigDigits(MinOutAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Minimum Outdoor Air Flow Rate of {:.5R} [m3/s]", MinOutAirVolFlowUser)); + ShowContinueError( + state, format("differs from Design Size Minimum Outdoor Air Flow Rate of {:.5R} [m3/s]", MinOutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2174,10 +2183,10 @@ namespace UnitVentilator { if ((std::abs(MaxVolHotWaterFlowDes - MaxVolHotWaterFlowUser) / MaxVolHotWaterFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeUnitVentilator: Potential issue with equipment sizing for " + state.dataUnitVentilators->cMO_UnitVentilator + ' ' + state.dataUnitVentilators->UnitVent(UnitVentNum).Name); - ShowContinueError(state, "User-Specified Maximum Hot Water Flow of " + RoundSigDigits(MaxVolHotWaterFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Hot Water Flow of " + - RoundSigDigits(MaxVolHotWaterFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Hot Water Flow of {:.5R} [m3/s]", MaxVolHotWaterFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Hot Water Flow of {:.5R} [m3/s]", MaxVolHotWaterFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2292,10 +2301,9 @@ namespace UnitVentilator { if ((std::abs(MaxVolHotSteamFlowDes - MaxVolHotSteamFlowUser) / MaxVolHotSteamFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeUnitVentilator: Potential issue with equipment sizing for " + state.dataUnitVentilators->cMO_UnitVentilator + ' ' + state.dataUnitVentilators->UnitVent(UnitVentNum).Name); - ShowContinueError(state, "User-Specified Maximum Steam Flow of " + RoundSigDigits(MaxVolHotSteamFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Steam Flow of " + RoundSigDigits(MaxVolHotSteamFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Steam Flow of {:.5R} [m3/s]", MaxVolHotSteamFlowUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Steam Flow of {:.5R} [m3/s]", MaxVolHotSteamFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2413,8 +2421,8 @@ namespace UnitVentilator { ShowWarningError(state, "Autosizing of water flow resulted in negative value."); ShowContinueError(state, "Occurs in " + state.dataUnitVentilators->cMO_UnitVentilator + " Object=" + state.dataUnitVentilators->UnitVent(UnitVentNum).Name); ShowContinueError(state, "...Sizing information found during sizing simulation:"); - ShowContinueError(state, "...Calculated coil design load = " + TrimSigDigits(DesCoolingLoad, 3) + " W"); - ShowContinueError(state, "...Calculated water flow rate = " + TrimSigDigits(MaxVolColdWaterFlowDes, 3) + " m3/s"); + ShowContinueError(state, format("...Calculated coil design load = {:.3T} W", DesCoolingLoad)); + ShowContinueError(state, format("...Calculated water flow rate = {:.3T} m3/s", MaxVolColdWaterFlowDes)); ShowContinueError(state, "...Water flow rate will be set to 0. Check sizing inputs for zone and plant, inputs for water " "cooling coil object, and design day specifications."); ShowContinueError(state, "...Consider autosizing all inputs if not already doing so."); @@ -2443,10 +2451,10 @@ namespace UnitVentilator { AutoVsHardSizingThreshold) { ShowMessage(state, "SizeUnitVentilator: Potential issue with equipment sizing for " + state.dataUnitVentilators->cMO_UnitVentilator + ' ' + state.dataUnitVentilators->UnitVent(UnitVentNum).Name); - ShowContinueError(state, "User-Specified Maximum Cold Water Flow of " + RoundSigDigits(MaxVolColdWaterFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Cold Water Flow of " + - RoundSigDigits(MaxVolColdWaterFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Cold Water Flow of {:.5R} [m3/s]", MaxVolColdWaterFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Cold Water Flow of {:.5R} [m3/s]", MaxVolColdWaterFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 8d801075337..171bb052c9f 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -417,8 +416,10 @@ namespace UnitarySystems { } } else if (numSpeedInputs < maxSpeeds) { ShowSevereError(state, cCurrentModuleObject + ": Error getting inputs for system named: " + thisObjectName); - ShowContinueError(state, "Number of speed inputs (" + General::TrimSigDigits(Real64(numSpeedInputs), 0) + - " is less than number of speeds (" + General::TrimSigDigits(Real64(maxSpeeds), 0) + ")."); + ShowContinueError(state, + format("Number of speed inputs ({:.0T} is less than number of speeds ({:.0T}).", + Real64(numSpeedInputs), + Real64(maxSpeeds))); errorsFound = true; } } @@ -537,10 +538,9 @@ namespace UnitarySystems { ShowContinueError(state, "...For fan type and name = " + FanType + " \"" + FanName + "\""); ShowContinueError(state, "...Fan power ratio function of speed ratio curve has no impact if fan volumetric flow rate is the " "same as the unitary system volumetric flow rate."); - ShowContinueError(state, "...Fan volumetric flow rate = " + - General::RoundSigDigits(this->m_ActualFanVolFlowRate, 5) + " m3/s."); ShowContinueError(state, - "...Unitary system volumetric flow rate = " + General::RoundSigDigits(this->m_MaxHeatAirVolFlow, 5) + " m3/s."); + format("...Fan volumetric flow rate = {:.5R} m3/s.", this->m_ActualFanVolFlowRate)); + ShowContinueError(state, format("...Unitary system volumetric flow rate = {:.5R} m3/s.", this->m_MaxHeatAirVolFlow)); } } } @@ -2239,8 +2239,10 @@ namespace UnitarySystems { ShowContinueError(state, "Design specification object = " + state.dataUnitarySystems->designSpecMSHP[MSHPIndex].name); ShowContinueError(state, "When control type = SetPointBased the outlet air temperature must change with coil capacity, if " "air flow also changes outlet air temperature will be relatively constant."); - ShowContinueError(state, "Speed " + General::TrimSigDigits(Iter) + - " Supply Air Flow Ratio During Heating Operation will be set = 1.0 and the simulation continues"); + ShowContinueError( + state, + format("Speed {} Supply Air Flow Ratio During Heating Operation will be set = 1.0 and the simulation continues", + Iter)); state.dataUnitarySystems->designSpecMSHP[MSHPIndex].heatingVolFlowRatio[Iter - 1] = 1.0; } } @@ -2737,8 +2739,9 @@ namespace UnitarySystems { ShowContinueError(state, " For SingleZoneVAV control the No Load Supply Air Flow Rate must be less than both the cooling and heating supply " "air flow rates."); this->m_MaxNoCoolHeatAirVolFlow = min(this->m_MaxCoolAirVolFlow, this->m_MaxHeatAirVolFlow) - 0.01; - ShowContinueError(state, " The SingleZoneVAV control No Load Supply Air Flow Rate is reset to " + - General::TrimSigDigits(this->m_MaxNoCoolHeatAirVolFlow, 5) + " and the simulation continues."); + ShowContinueError(state, + format(" The SingleZoneVAV control No Load Supply Air Flow Rate is reset to {:.5T} and the simulation continues.", + this->m_MaxNoCoolHeatAirVolFlow)); } } @@ -5522,8 +5525,7 @@ namespace UnitarySystems { } if (thisSys.m_ControlType != ControlType::CCMASHRAE && thisSys.DesignMinOutletTemp > 7.5) { ShowWarningError(state, cCurrentModuleObject + " = " + thisObjectName); - ShowContinueError(state, "Invalid entry for Minimum Supply Air Temperature = " + - General::RoundSigDigits(thisSys.DesignMinOutletTemp, 4)); + ShowContinueError(state, format("Invalid entry for Minimum Supply Air Temperature = {:.4R}", thisSys.DesignMinOutletTemp)); ShowContinueError(state, "The minimum supply air temperature will be limited to 7.5C and the simulation continues."); thisSys.DesignMinOutletTemp = 7.5; } @@ -5864,8 +5866,9 @@ namespace UnitarySystems { if (thisSys.m_MaxCoolAirVolFlow <= DataHVACGlobals::SmallAirVolFlow && thisSys.m_CoolCoilExists) { ShowWarningError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for Cooling Supply Air Flow Rate Method = SupplyAirFlowRate."); - ShowContinueError(state, "Suspicious Cooling Supply Air Flow Rate = " + - General::RoundSigDigits(thisSys.m_MaxCoolAirVolFlow, 7) + " when cooling coil is present."); + ShowContinueError(state, + format("Suspicious Cooling Supply Air Flow Rate = {:.7R} when cooling coil is present.", + thisSys.m_MaxCoolAirVolFlow)); } if (thisSys.m_MaxCoolAirVolFlow < 0.0) errorsFound = true; } @@ -5885,9 +5888,10 @@ namespace UnitarySystems { if (thisSys.m_MaxCoolAirVolFlow <= 0.0001 && thisSys.m_CoolCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for Cooling Supply Air Flow Rate Method = FlowPerFloorArea."); - ShowContinueError(state, "Suspicious Cooling Supply Air Flow Rate Per Floor Area = " + - General::RoundSigDigits(thisSys.m_MaxCoolAirVolFlow, 7) + - " [m3/s/m2] when cooling coil is present."); + ShowContinueError( + state, + format("Suspicious Cooling Supply Air Flow Rate Per Floor Area = {:.7R} [m3/s/m2] when cooling coil is present.", + thisSys.m_MaxCoolAirVolFlow)); if (thisSys.m_MaxCoolAirVolFlow < 0.0) errorsFound = true; } thisSys.m_MaxCoolAirVolFlow *= TotalFloorAreaOnAirLoop; @@ -5914,9 +5918,10 @@ namespace UnitarySystems { if (thisSys.m_MaxCoolAirVolFlow <= DataHVACGlobals::SmallAirVolFlow && thisSys.m_CoolCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for Cooling Supply Air Flow Rate Method = FractionOfAutosizedCoolingValue."); - ShowContinueError(state, "Suspicious Cooling Fraction of Autosized Cooling Supply Air Flow Rate = " + - General::RoundSigDigits(thisSys.m_MaxCoolAirVolFlow, 7) + - " [m3/s/m3] when cooling coil is present."); + ShowContinueError(state, + format("Suspicious Cooling Fraction of Autosized Cooling Supply Air Flow Rate = {:.7R} [m3/s/m3] " + "when cooling coil is present.", + thisSys.m_MaxCoolAirVolFlow)); if (thisSys.m_MaxCoolAirVolFlow < 0.0) errorsFound = true; } thisSys.m_RequestAutoSize = true; @@ -5942,9 +5947,10 @@ namespace UnitarySystems { if (thisSys.m_MaxCoolAirVolFlow <= 0.00001 && thisSys.m_CoolCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for Cooling Supply Air Flow Rate Method = FlowPerCoolingCapacity."); - ShowContinueError(state, "Suspicious Cooling Supply Air Flow Rate Per Unit of Capacity = " + - General::RoundSigDigits(thisSys.m_MaxCoolAirVolFlow, 7) + - " [m3/s/W] when cooling coil is present."); + ShowContinueError(state, + format("Suspicious Cooling Supply Air Flow Rate Per Unit of Capacity = {:.7R} [m3/s/W] when " + "cooling coil is present.", + thisSys.m_MaxCoolAirVolFlow)); if (thisSys.m_MaxCoolAirVolFlow < 0.0) errorsFound = true; } thisSys.m_RequestAutoSize = true; @@ -5992,8 +5998,9 @@ namespace UnitarySystems { if (thisSys.m_MaxHeatAirVolFlow <= DataHVACGlobals::SmallAirVolFlow && thisSys.m_HeatCoilExists) { ShowWarningError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for Heating Supply Air Flow Rate Method = SupplyAirFlowRate."); - ShowContinueError(state, "Suspicious Heating Supply Air Flow Rate = " + - General::RoundSigDigits(thisSys.m_MaxHeatAirVolFlow, 7) + " when heating coil is present."); + ShowContinueError(state, + format("Suspicious Heating Supply Air Flow Rate = {:.7R} when heating coil is present.", + thisSys.m_MaxHeatAirVolFlow)); } if (thisSys.m_MaxHeatAirVolFlow < 0.0) errorsFound = true; } @@ -6011,9 +6018,10 @@ namespace UnitarySystems { if (thisSys.m_MaxHeatAirVolFlow <= 0.0001 && thisSys.m_HeatCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for Heating Supply Air Flow Rate Method = FlowPerFloorArea."); - ShowContinueError(state, "Suspicious Heating Supply Air Flow Rate Per Floor Area = " + - General::RoundSigDigits(thisSys.m_MaxHeatAirVolFlow, 7) + - " [m3/s/m2] when heating coil is present."); + ShowContinueError( + state, + format("Suspicious Heating Supply Air Flow Rate Per Floor Area = {:.7R} [m3/s/m2] when heating coil is present.", + thisSys.m_MaxHeatAirVolFlow)); } if (thisSys.m_MaxHeatAirVolFlow < 0.0) errorsFound = true; thisSys.m_MaxHeatAirVolFlow *= TotalFloorAreaOnAirLoop; @@ -6039,9 +6047,10 @@ namespace UnitarySystems { if (thisSys.m_MaxHeatAirVolFlow <= DataHVACGlobals::SmallAirVolFlow && thisSys.m_HeatCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for Heating Supply Air Flow Rate Method = FractionOfAutosizedHeatingValue."); - ShowContinueError(state, "Suspicious Heating Fraction of Autosized Heating Supply Air Flow Rate = " + - General::RoundSigDigits(thisSys.m_MaxHeatAirVolFlow, 7) + - " [m3/s/m3] when heating coil is present."); + ShowContinueError(state, + format("Suspicious Heating Fraction of Autosized Heating Supply Air Flow Rate = {:.7R} [m3/s/m3] " + "when heating coil is present.", + thisSys.m_MaxHeatAirVolFlow)); if (thisSys.m_MaxHeatAirVolFlow < 0.0) errorsFound = true; } thisSys.m_RequestAutoSize = true; @@ -6066,9 +6075,10 @@ namespace UnitarySystems { if (thisSys.m_MaxHeatAirVolFlow <= 0.00001 && thisSys.m_HeatCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for Heating Supply Air Flow Rate Method = FlowPerHeatingCapacity."); - ShowContinueError(state, "Suspicious Heating Supply Air Flow Rate Per Unit of Capacity = " + - General::RoundSigDigits(thisSys.m_MaxHeatAirVolFlow, 7) + - " [m3/s/W] when heating coil is present."); + ShowContinueError(state, + format("Suspicious Heating Supply Air Flow Rate Per Unit of Capacity = {:.7R} [m3/s/W] when " + "heating coil is present.", + thisSys.m_MaxHeatAirVolFlow)); if (thisSys.m_MaxHeatAirVolFlow < 0.0) errorsFound = true; } thisSys.m_RequestAutoSize = true; @@ -6115,8 +6125,7 @@ namespace UnitarySystems { if (thisSys.m_MaxNoCoolHeatAirVolFlow < 0.0) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for No Load Supply Air Flow Rate Method = SupplyAirFlowRate"); - ShowContinueError(state, "Illegal No Load Supply Air Flow Rate = " + - General::RoundSigDigits(thisSys.m_MaxNoCoolHeatAirVolFlow, 7)); + ShowContinueError(state, format("Illegal No Load Supply Air Flow Rate = {:.7R}", thisSys.m_MaxNoCoolHeatAirVolFlow)); errorsFound = true; } } @@ -6135,8 +6144,9 @@ namespace UnitarySystems { if (thisSys.m_MaxNoCoolHeatAirVolFlow <= 0.0001) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for No Load Supply Air Flow Rate Method = FlowPerFloorArea."); - ShowContinueError(state, "Suspicious No Load Supply Air Flow Rate Per Floor Area = " + - General::RoundSigDigits(thisSys.m_MaxNoCoolHeatAirVolFlow, 7) + " [m3/s/m2]"); + ShowContinueError(state, + format("Suspicious No Load Supply Air Flow Rate Per Floor Area = {:.7R} [m3/s/m2]", + thisSys.m_MaxNoCoolHeatAirVolFlow)); } if (thisSys.m_MaxNoCoolHeatAirVolFlow < 0.0) errorsFound = true; thisSys.m_MaxNoCoolHeatAirVolFlow *= TotalFloorAreaOnAirLoop; @@ -6162,8 +6172,11 @@ namespace UnitarySystems { if (thisSys.m_MaxNoCoolHeatAirVolFlow <= DataHVACGlobals::SmallAirVolFlow) { ShowWarningError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for No Load Supply Air Flow Rate Method = FractionOfAutosizedCoolingValue."); - ShowContinueError(state, "Suspicious No Load Supply Air Flow Rate Per Unit of Capacity During Cooling Operation = " + - General::RoundSigDigits(thisSys.m_MaxNoCoolHeatAirVolFlow, 7) + " [m3/s/m3]."); + ShowContinueError( + state, + format( + "Suspicious No Load Supply Air Flow Rate Per Unit of Capacity During Cooling Operation = {:.7R} [m3/s/m3].", + thisSys.m_MaxNoCoolHeatAirVolFlow)); if (thisSys.m_MaxNoCoolHeatAirVolFlow < 0.0) errorsFound = true; } thisSys.m_RequestAutoSize = true; @@ -6189,8 +6202,11 @@ namespace UnitarySystems { if (thisSys.m_MaxNoCoolHeatAirVolFlow <= DataHVACGlobals::SmallAirVolFlow) { ShowWarningError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for No Load Supply Air Flow Rate Method = FractionOfAutosizedHeatingValue."); - ShowContinueError(state, "Suspicious No Load Supply Air Flow Rate Per Unit of Capacity During Heating Operation = " + - General::RoundSigDigits(thisSys.m_MaxNoCoolHeatAirVolFlow, 7) + " [m3/s/m3]."); + ShowContinueError( + state, + format( + "Suspicious No Load Supply Air Flow Rate Per Unit of Capacity During Heating Operation = {:.7R} [m3/s/m3].", + thisSys.m_MaxNoCoolHeatAirVolFlow)); if (thisSys.m_MaxNoCoolHeatAirVolFlow < 0.0) errorsFound = true; } thisSys.m_RequestAutoSize = true; @@ -6216,8 +6232,10 @@ namespace UnitarySystems { if (thisSys.m_MaxNoCoolHeatAirVolFlow <= 0.00001 && thisSys.m_CoolCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for No Load Supply Air Flow Rate Method = FlowPerCoolingCapacity."); - ShowContinueError(state, "Suspicious No Load Supply Air Flow Rate Per Unit of Capacity During Cooling Operation = " + - General::RoundSigDigits(thisSys.m_MaxNoCoolHeatAirVolFlow, 7) + " [m3/s/W]."); + ShowContinueError( + state, + format("Suspicious No Load Supply Air Flow Rate Per Unit of Capacity During Cooling Operation = {:.7R} [m3/s/W].", + thisSys.m_MaxNoCoolHeatAirVolFlow)); if (thisSys.m_MaxNoCoolHeatAirVolFlow < 0.0) errorsFound = true; } thisSys.m_RequestAutoSize = true; @@ -6242,8 +6260,10 @@ namespace UnitarySystems { if (thisSys.m_MaxNoCoolHeatAirVolFlow <= 0.00001 && thisSys.m_HeatCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); ShowContinueError(state, "Input for No Load Supply Air Flow Rate Method = FlowPerHeatingCapacity."); - ShowContinueError(state, "Suspicious No Load Supply Air Flow Rate Per Unit of Capacity During Heating Operation = " + - General::RoundSigDigits(thisSys.m_MaxNoCoolHeatAirVolFlow, 7) + " [m3/s/W]."); + ShowContinueError( + state, + format("Suspicious No Load Supply Air Flow Rate Per Unit of Capacity During Heating Operation = {:.7R} [m3/s/W].", + thisSys.m_MaxNoCoolHeatAirVolFlow)); if (thisSys.m_MaxNoCoolHeatAirVolFlow < 0.0) errorsFound = true; } thisSys.m_RequestAutoSize = true; @@ -6599,8 +6619,11 @@ namespace UnitarySystems { if (FanVolFlowRate < thisSys.m_MaxCoolAirVolFlow && thisSys.m_MaxCoolAirVolFlow != DataSizing::AutoSize && thisSys.m_CoolCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); - ShowContinueError(state, "... air flow rate = " + General::TrimSigDigits(FanVolFlowRate, 7) + " in fan object " + thisSys.m_FanName + - " is less than the maximum HVAC system air flow rate in cooling mode."); + ShowContinueError( + state, + format("... air flow rate = {:.7T} in fan object {} is less than the maximum HVAC system air flow rate in cooling mode.", + FanVolFlowRate, + thisSys.m_FanName)); ShowContinueError(state, " The Cooling Supply Air Flow Rate is reset to the fan flow rate and the simulation continues."); thisSys.m_MaxCoolAirVolFlow = FanVolFlowRate; thisSys.m_DesignFanVolFlowRate = FanVolFlowRate; @@ -6608,8 +6631,11 @@ namespace UnitarySystems { if (FanVolFlowRate < thisSys.m_MaxHeatAirVolFlow && thisSys.m_MaxHeatAirVolFlow != DataSizing::AutoSize && thisSys.m_HeatCoilExists) { ShowSevereError(state, cCurrentModuleObject + " = " + thisObjectName); - ShowContinueError(state, "... air flow rate = " + General::TrimSigDigits(FanVolFlowRate, 7) + " in fan object " + thisSys.m_FanName + - " is less than the maximum HVAC system air flow rate in heating mode."); + ShowContinueError( + state, + format("... air flow rate = {:.7T} in fan object {} is less than the maximum HVAC system air flow rate in heating mode.", + FanVolFlowRate, + thisSys.m_FanName)); ShowContinueError(state, " The Heating Supply Air Flow Rate is reset to the fan flow rate and the simulation continues."); thisSys.m_MaxHeatAirVolFlow = FanVolFlowRate; thisSys.m_DesignFanVolFlowRate = FanVolFlowRate; @@ -6762,8 +6788,7 @@ namespace UnitarySystems { ShowContinueError(state, "Illegal Heat Recovery Water Outlet Node Name = " + loc_heatRecoveryOutletNodeName); ShowContinueError(state, "... heat recovery nodes must be specified when Design Heat Recovery Water Flow Rate" " is greater than 0."); - ShowContinueError(state, "... Design Heat Recovery Water Flow Rate = " + - General::RoundSigDigits(thisSys.m_DesignHRWaterVolumeFlow, 7)); + ShowContinueError(state, format("... Design Heat Recovery Water Flow Rate = {:.7R}", thisSys.m_DesignHRWaterVolumeFlow)); errorsFound = true; } } @@ -8911,9 +8936,11 @@ namespace UnitarySystems { if (this->MaxIterIndex == 0) { ShowWarningMessage(state, "Coil control failed to converge for " + this->UnitType + ':' + this->Name); ShowContinueError(state, " Iteration limit exceeded in calculating system sensible part-load ratio."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met = " + General::TrimSigDigits(ZoneLoad, 2) + - " (watts), sensible output = " + General::TrimSigDigits(TempSensOutput, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp(state, + format("Sensible load to be met = {:.2T} (watts), sensible output = {:.2T} " + "(watts), and the simulation continues.", + ZoneLoad, + TempSensOutput)); } ShowRecurringWarningErrorAtEnd(state, this->UnitType + " \"" + this->Name + "\" - Iteration limit exceeded in calculating sensible part-load ratio error " @@ -8926,8 +8953,8 @@ namespace UnitarySystems { if (this->RegulaFalsiFailedIndex == 0) { ShowWarningMessage(state, "Coil control failed for " + this->UnitType + ':' + this->Name); ShowContinueError(state, " sensible part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met = " + General::TrimSigDigits(ZoneLoad, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, format("Sensible load to be met = {:.2T} (watts), and the simulation continues.", ZoneLoad)); } ShowRecurringWarningErrorAtEnd(state, this->UnitType + " \"" + this->Name + @@ -8940,8 +8967,8 @@ namespace UnitarySystems { if (this->RegulaFalsiFailedIndex == 0) { ShowWarningMessage(state, "Coil control failed for " + this->UnitType + ':' + this->Name); ShowContinueError(state, " sensible part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, "Sensible load to be met = " + General::TrimSigDigits(ZoneLoad, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, format("Sensible load to be met = {:.2T} (watts), and the simulation continues.", ZoneLoad)); } ShowRecurringWarningErrorAtEnd(state, this->UnitType + " \"" + this->Name + @@ -9312,9 +9339,11 @@ namespace UnitarySystems { if (this->warnIndex.m_LatMaxIterIndex == 0) { ShowWarningMessage(state, "Coil control failed to converge for " + this->UnitType + ':' + this->Name); ShowContinueError(state, " Iteration limit exceeded in calculating system Latent part-load ratio."); - ShowContinueErrorTimeStamp(state, "Latent load to be met = " + General::TrimSigDigits(state.dataUnitarySystems->MoistureLoad, 2) + - " (watts), Latent output = " + General::TrimSigDigits(TempLatOutput, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, + format("Latent load to be met = {:.2T} (watts), Latent output = {:.2T} (watts), and the simulation continues.", + state.dataUnitarySystems->MoistureLoad, + TempLatOutput)); } ShowRecurringWarningErrorAtEnd(state, this->UnitType + " \"" + this->Name + @@ -9327,8 +9356,9 @@ namespace UnitarySystems { if (this->warnIndex.m_LatRegulaFalsiFailedIndex == 0) { ShowWarningMessage(state, "Coil control failed for " + this->UnitType + ':' + this->Name); ShowContinueError(state, " Latent part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, "Latent load to be met = " + General::TrimSigDigits(state.dataUnitarySystems->MoistureLoad, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, + format("Latent load to be met = {:.2T} (watts), and the simulation continues.", state.dataUnitarySystems->MoistureLoad)); } ShowRecurringWarningErrorAtEnd(state, this->UnitType + " \"" + this->Name + "\" - Latent part-load ratio out of range error continues. Latent load statistics:", @@ -9340,8 +9370,8 @@ namespace UnitarySystems { if (this->warnIndex.m_LatRegulaFalsiFailedIndex == 0) { ShowWarningMessage(state, "Coil control failed for " + this->UnitType + ':' + this->Name); ShowContinueError(state, " Latent part-load ratio determined to be outside the range of 0-1."); - ShowContinueErrorTimeStamp(state, "Latent load to be met = " + General::TrimSigDigits(state.dataUnitarySystems->MoistureLoad, 2) + - " (watts), and the simulation continues."); + ShowContinueErrorTimeStamp( + state, format("Latent load to be met = {:.2T} (watts), and the simulation continues.", state.dataUnitarySystems->MoistureLoad)); } ShowRecurringWarningErrorAtEnd(state, this->UnitType + " \"" + this->Name + "\" - Latent part-load ratio out of range error continues. Latent load statistics:", @@ -11737,9 +11767,8 @@ namespace UnitarySystems { ShowWarningError(state, this->UnitType + " - Iteration limit exceeded calculating DX unit sensible part-load ratio for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + - General::RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -11760,7 +11789,7 @@ namespace UnitarySystems { " - DX unit sensible part-load ratio calculation unexpectedly failed: part-load ratio " "limits exceeded, for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -11782,7 +11811,7 @@ namespace UnitarySystems { " - DX unit sensible part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -12154,9 +12183,9 @@ namespace UnitarySystems { this->UnitType + " - Iteration limit exceeded calculating DX unit latent part-load ratio for unit = " + this->Name); - ShowContinueError(state, "Estimated latent part-load ratio = " + - General::RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated latent part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, + format("Estimated latent part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated latent part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated latent part-load ratio will be used and the simulation " "continues. Occurrence info:"); } @@ -12179,7 +12208,7 @@ namespace UnitarySystems { " - DX unit latent part-load ratio calculation failed unexpectedly: part-load ratio " "limits exceeded, for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -12201,7 +12230,7 @@ namespace UnitarySystems { " - DX unit latent part-load ratio calculation failed: part-load ratio limits " "exceeded, for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } @@ -12417,8 +12446,8 @@ namespace UnitarySystems { if (this->warnIndex.m_SensPLRIter < 1) { ++this->warnIndex.m_SensPLRIter; ShowWarningError(state, this->UnitType + " - Iteration limit exceeded calculating part-load ratio for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { ShowRecurringWarningErrorAtEnd(state, @@ -12436,7 +12465,7 @@ namespace UnitarySystems { ++this->warnIndex.m_SensPLRFail; ShowWarningError(state, this->UnitType + " - sensible part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { ShowRecurringWarningErrorAtEnd(state, @@ -12454,8 +12483,8 @@ namespace UnitarySystems { if (this->warnIndex.m_LatPLRIter < 1) { ++this->warnIndex.m_LatPLRIter; ShowWarningError(state, this->UnitType + " - Iteration limit exceeded calculating latent part-load ratio for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } ShowRecurringWarningErrorAtEnd(state, @@ -12477,7 +12506,7 @@ namespace UnitarySystems { ++this->warnIndex.m_LatPLRFail; ShowWarningError(state, this->UnitType + " - latent part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } ShowRecurringWarningErrorAtEnd(state, this->UnitType + " \"" + this->Name + @@ -13097,8 +13126,8 @@ namespace UnitarySystems { ++this->warnIndex.m_HeatCoilSensPLRIter; ShowWarningError(state, this->UnitType + " - Iteration limit exceeded calculating sensible part-load ratio for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { ShowRecurringWarningErrorAtEnd(state, this->UnitType + " \"" + this->Name + @@ -13116,7 +13145,7 @@ namespace UnitarySystems { ++this->warnIndex.m_HeatCoilSensPLRFail; ShowWarningError(state, this->UnitType + " - sensible part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { ShowRecurringWarningErrorAtEnd(state, @@ -13472,8 +13501,8 @@ namespace UnitarySystems { if (this->warnIndex.m_SuppHeatCoilSensPLRIter < 1) { ++this->warnIndex.m_SuppHeatCoilSensPLRIter; ShowWarningError(state, this->UnitType + " - Iteration limit exceeded calculating sensible part-load ratio for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits((ReqOutput / FullOutput), 3)); - ShowContinueError(state, "Calculated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", (ReqOutput / FullOutput))); + ShowContinueError(state, format("Calculated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The calculated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { ShowRecurringWarningErrorAtEnd(state, @@ -13491,7 +13520,7 @@ namespace UnitarySystems { ++this->warnIndex.m_SuppHeatCoilSensPLRFail; ShowWarningError(state, this->UnitType + " - sensible part-load ratio calculation failed: part-load ratio limits exceeded, for unit = " + this->Name); - ShowContinueError(state, "Estimated part-load ratio = " + General::RoundSigDigits(PartLoadFrac, 3)); + ShowContinueError(state, format("Estimated part-load ratio = {:.3R}", PartLoadFrac)); ShowContinueErrorTimeStamp(state, "The estimated part-load ratio will be used and the simulation continues. Occurrence info:"); } else { ShowRecurringWarningErrorAtEnd(state, diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index 275b62599f1..c5050b40f55 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -146,9 +145,11 @@ namespace UserDefinedComponents { } else { // throw warning - ShowFatalError(state, "SimUserDefinedPlantComponent: did not find where called from loop number called from =" + - General::TrimSigDigits(calledFromLocation.loopNum) + - " , loop side called from =" + General::TrimSigDigits(calledFromLocation.loopSideNum)); + ShowFatalError( + state, + format("SimUserDefinedPlantComponent: did not find where called from loop number called from ={} , loop side called from ={}", + calledFromLocation.loopNum, + calledFromLocation.loopSideNum)); } } @@ -246,13 +247,20 @@ namespace UserDefinedComponents { } else { CompNum = CompIndex; if (CompNum < 1 || CompNum > state.dataUserDefinedComponents->NumUserCoils) { - ShowFatalError(state, "SimUserDefinedPlantComponent: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Number of units =" + General::TrimSigDigits(state.dataUserDefinedComponents->NumUserCoils) + ", Entered Unit name = " + EquipName); + ShowFatalError(state, + format("SimUserDefinedPlantComponent: Invalid CompIndex passed={}, Number of units ={}, Entered Unit name = {}", + CompNum, + state.dataUserDefinedComponents->NumUserCoils, + EquipName)); } if (state.dataUserDefinedComponents->CheckUserCoilName(CompNum)) { if (EquipName != state.dataUserDefinedComponents->UserCoil(CompNum).Name) { - ShowFatalError(state, "SimUserDefinedPlantComponent: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Unit name=" + EquipName + ", stored unit name for that index=" + state.dataUserDefinedComponents->UserCoil(CompNum).Name); + ShowFatalError( + state, + format("SimUserDefinedPlantComponent: Invalid CompIndex passed={}, Unit name={}, stored unit name for that index={}", + CompNum, + EquipName, + state.dataUserDefinedComponents->UserCoil(CompNum).Name)); } state.dataUserDefinedComponents->CheckUserCoilName(CompNum) = false; } @@ -336,13 +344,20 @@ namespace UserDefinedComponents { } else { CompNum = CompIndex; if (CompNum < 1 || CompNum > state.dataUserDefinedComponents->NumUserZoneAir) { - ShowFatalError(state, "SimUserDefinedPlantComponent: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Number of units =" + General::TrimSigDigits(state.dataUserDefinedComponents->NumUserZoneAir) + ", Entered Unit name = " + CompName); + ShowFatalError(state, + format("SimUserDefinedPlantComponent: Invalid CompIndex passed={}, Number of units ={}, Entered Unit name = {}", + CompNum, + state.dataUserDefinedComponents->NumUserZoneAir, + CompName)); } if (state.dataUserDefinedComponents->CheckUserZoneAirName(CompNum)) { if (CompName != state.dataUserDefinedComponents->UserZoneAirHVAC(CompNum).Name) { - ShowFatalError(state, "SimUserDefinedPlantComponent: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Unit name=" + CompName + ", stored unit name for that index=" + state.dataUserDefinedComponents->UserZoneAirHVAC(CompNum).Name); + ShowFatalError( + state, + format("SimUserDefinedPlantComponent: Invalid CompIndex passed={}, Unit name={}, stored unit name for that index={}", + CompNum, + CompName, + state.dataUserDefinedComponents->UserZoneAirHVAC(CompNum).Name)); } state.dataUserDefinedComponents->CheckUserZoneAirName(CompNum) = false; } @@ -436,13 +451,20 @@ namespace UserDefinedComponents { } else { CompNum = CompIndex; if (CompNum < 1 || CompNum > state.dataUserDefinedComponents->NumUserAirTerminals) { - ShowFatalError(state, "SimUserDefinedPlantComponent: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Number of units =" + General::TrimSigDigits(state.dataUserDefinedComponents->NumUserAirTerminals) + ", Entered Unit name = " + CompName); + ShowFatalError(state, + format("SimUserDefinedPlantComponent: Invalid CompIndex passed={}, Number of units ={}, Entered Unit name = {}", + CompNum, + state.dataUserDefinedComponents->NumUserAirTerminals, + CompName)); } if (state.dataUserDefinedComponents->CheckUserAirTerminal(CompNum)) { if (CompName != state.dataUserDefinedComponents->UserAirTerminal(CompNum).Name) { - ShowFatalError(state, "SimUserDefinedPlantComponent: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Unit name=" + CompName + ", stored unit name for that index=" + state.dataUserDefinedComponents->UserAirTerminal(CompNum).Name); + ShowFatalError( + state, + format("SimUserDefinedPlantComponent: Invalid CompIndex passed={}, Unit name={}, stored unit name for that index={}", + CompNum, + CompName, + state.dataUserDefinedComponents->UserAirTerminal(CompNum).Name)); } state.dataUserDefinedComponents->CheckUserAirTerminal(CompNum) = false; } diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index 5c06c5a1fda..26ba8391478 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -614,7 +614,7 @@ namespace UtilityRoutines { using BranchNodeConnections::TestCompSetInletOutletNodes; using ExternalInterface::CloseSocket; using ExternalInterface::NumExternalInterfaces; - using General::RoundSigDigits; + using NodeInputManager::CheckMarkedNodes; using NodeInputManager::SetupNodeVarsForReporting; using PlantManager::CheckPlantOnAbort; @@ -805,7 +805,7 @@ namespace UtilityRoutines { using ExternalInterface::CloseSocket; using ExternalInterface::haveExternalInterfaceBCVTB; using ExternalInterface::NumExternalInterfaces; - using General::RoundSigDigits; + using SolarShading::ReportSurfaceErrors; std::string NumWarnings; @@ -826,24 +826,24 @@ namespace UtilityRoutines { ShowRecurringErrors(state); SummarizeErrors(state); CloseMiscOpenFiles(state); - NumWarnings = RoundSigDigits(TotalWarningErrors); + NumWarnings = fmt::to_string(TotalWarningErrors); strip(NumWarnings); - NumSevere = RoundSigDigits(TotalSevereErrors); + NumSevere = fmt::to_string(TotalSevereErrors); strip(NumSevere); - NumWarningsDuringWarmup = RoundSigDigits(TotalWarningErrorsDuringWarmup); + NumWarningsDuringWarmup = fmt::to_string(TotalWarningErrorsDuringWarmup); strip(NumWarningsDuringWarmup); - NumSevereDuringWarmup = RoundSigDigits(TotalSevereErrorsDuringWarmup); + NumSevereDuringWarmup = fmt::to_string(TotalSevereErrorsDuringWarmup); strip(NumSevereDuringWarmup); - NumWarningsDuringSizing = RoundSigDigits(TotalWarningErrorsDuringSizing); + NumWarningsDuringSizing = fmt::to_string(TotalWarningErrorsDuringSizing); strip(NumWarningsDuringSizing); - NumSevereDuringSizing = RoundSigDigits(TotalSevereErrorsDuringSizing); + NumSevereDuringSizing = fmt::to_string(TotalSevereErrorsDuringSizing); strip(NumSevereDuringSizing); Time_Finish = epElapsedTime(); if (Time_Finish < Time_Start) Time_Finish += 24.0 * 3600.0; Elapsed_Time = Time_Finish - Time_Start; if (state.dataGlobal->createPerfLog) { - UtilityRoutines::appendPerfLog(state, "Run Time [seconds]", RoundSigDigits(Elapsed_Time, 2)); + UtilityRoutines::appendPerfLog(state, "Run Time [seconds]", format("{:.2R}", Elapsed_Time)); } #ifdef EP_Detailed_Timings epStopTime("EntireRun="); @@ -1038,13 +1038,12 @@ namespace UtilityRoutines { // Calls AbortEnergyPlus using namespace DataErrorTracking; - using General::RoundSigDigits; ShowErrorMessage(state, " ** Fatal ** " + ErrorMessage, OutUnit1, OutUnit2); DisplayString(state, "**FATAL:" + ErrorMessage); ShowErrorMessage(state, " ...Summary of Errors that led to program termination:", OutUnit1, OutUnit2); - ShowErrorMessage(state, " ..... Reference severe error count=" + RoundSigDigits(TotalSevereErrors), OutUnit1, OutUnit2); + ShowErrorMessage(state, format(" ..... Reference severe error count={}", TotalSevereErrors), OutUnit1, OutUnit2); ShowErrorMessage(state, " ..... Last severe error=" + LastSevereError, OutUnit1, OutUnit2); if (sqlite) { sqlite->createSQLiteErrorRecord(1, 2, ErrorMessage, 1); @@ -1681,7 +1680,7 @@ namespace UtilityRoutines { // Using/Aliasing using namespace DataErrorTracking; - using General::RoundSigDigits; + using General::strip_trailing_zeros; static std::string const StatMessageStart(" ** ~~~ ** "); @@ -1713,9 +1712,9 @@ namespace UtilityRoutines { ShowMessage(state, ""); ShowMessage(state, error.Message); - ShowMessage(state, StatMessageStart + " This error occurred " + RoundSigDigits(error.Count) + " total times;"); - ShowMessage(state, StatMessageStart + " during Warmup " + RoundSigDigits(error.WarmupCount) + " times;"); - ShowMessage(state, StatMessageStart + " during Sizing " + RoundSigDigits(error.SizingCount) + " times."); + ShowMessage(state, format("{} This error occurred {} total times;", StatMessageStart, error.Count)); + ShowMessage(state, format("{} during Warmup {} times;", StatMessageStart, error.WarmupCount)); + ShowMessage(state, format("{} during Sizing {} times.", StatMessageStart, error.SizingCount)); if (sqlite) { if (warning) { sqlite->createSQLiteErrorRecord(1, 0, error.Message.substr(15), error.Count); @@ -1734,19 +1733,19 @@ namespace UtilityRoutines { } StatMessage = ""; if (error.ReportMax) { - MaxOut = RoundSigDigits(error.MaxValue, 6); + MaxOut = format("{:.6R}", error.MaxValue); strip_trailing_zeros(MaxOut); StatMessage += " Max=" + MaxOut; if (!error.MaxUnits.empty()) StatMessage += ' ' + error.MaxUnits; } if (error.ReportMin) { - MinOut = RoundSigDigits(error.MinValue, 6); + MinOut = format("{:.6R}", error.MinValue); strip_trailing_zeros(MinOut); StatMessage += " Min=" + MinOut; if (!error.MinUnits.empty()) StatMessage += ' ' + error.MinUnits; } if (error.ReportSum) { - SumOut = RoundSigDigits(error.SumValue, 6); + SumOut = format("{:.6R}", error.SumValue); strip_trailing_zeros(SumOut); StatMessage += " Sum=" + SumOut; if (!error.SumUnits.empty()) StatMessage += ' ' + error.SumUnits; diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index a37c7b5847e..a05de57e789 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -106,7 +106,6 @@ namespace VariableSpeedCoils { using DataPlant::TypeOf_CoilVSWAHPHeatingEquationFit; using DXCoils::AdjustCBF; using DXCoils::CalcCBF; - using General::RoundSigDigits; static std::string const BlankString; @@ -138,7 +137,6 @@ namespace VariableSpeedCoils { // Using/Aliasing using FluidProperties::FindGlycol; using General::SolveRoot; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int DXCoilNum; // The WatertoAirHP that you are currently loading input into @@ -161,12 +159,19 @@ namespace VariableSpeedCoils { } else { DXCoilNum = CompIndex; if (DXCoilNum > state.dataVariableSpeedCoils->NumVarSpeedCoils || DXCoilNum < 1) { - ShowFatalError(state, "SimVariableSpeedCoils: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + - ", Number of Water to Air HPs=" + TrimSigDigits(state.dataVariableSpeedCoils->NumVarSpeedCoils) + ", WaterToAir HP name=" + CompName); + ShowFatalError(state, + format("SimVariableSpeedCoils: Invalid CompIndex passed={}, Number of Water to Air HPs={}, WaterToAir HP name={}", + DXCoilNum, + state.dataVariableSpeedCoils->NumVarSpeedCoils, + CompName)); } if (!CompName.empty() && CompName != state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name) { - ShowFatalError(state, "SimVariableSpeedCoils: Invalid CompIndex passed=" + TrimSigDigits(DXCoilNum) + ", WaterToAir HP name=" + CompName + - ", stored WaterToAir HP Name for that index=" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); + ShowFatalError( + state, + format("SimVariableSpeedCoils: Invalid CompIndex passed={}, WaterToAir HP name={}, stored WaterToAir HP Name for that index={}", + DXCoilNum, + CompName, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name)); } } @@ -263,7 +268,7 @@ namespace VariableSpeedCoils { using CurveManager::CurveValue; using CurveManager::GetCurveIndex; using CurveManager::SetCurveOutputMinMaxValues; - using General::TrimSigDigits; + using OutAirNodeManager::CheckOutAirNodeNumber; using ScheduleManager::GetScheduleIndex; using WaterManager::SetupTankDemandComponent; @@ -398,8 +403,9 @@ namespace VariableSpeedCoils { // If (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%NumOfSpeeds .LT. 2) Then if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(1) + " must be >= 1. entered number is " + TrimSigDigits(NumArray(1), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be >= 1. entered number is {:.0T}", cNumericFields(1), NumArray(1))); ErrorsFound = true; } @@ -408,8 +414,9 @@ namespace VariableSpeedCoils { } if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(2) + " must be valid speed level entered number is " + TrimSigDigits(NumArray(2), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be valid speed level entered number is {:.0T}", cNumericFields(2), NumArray(2))); ErrorsFound = true; } @@ -429,7 +436,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(6) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } @@ -466,7 +473,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -496,7 +503,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -526,7 +533,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -556,7 +563,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -586,7 +593,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -616,7 +623,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -647,7 +654,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -777,8 +784,9 @@ namespace VariableSpeedCoils { TestCompSet(state, CurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Air Nodes"); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(1) + " must be >= 1. entered number is " + TrimSigDigits(NumArray(1), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be >= 1. entered number is {:.0T}", cNumericFields(1), NumArray(1))); ErrorsFound = true; } @@ -787,8 +795,9 @@ namespace VariableSpeedCoils { } if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(2) + " must be valid speed level entered number is " + TrimSigDigits(NumArray(2), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be valid speed level entered number is {:.0T}", cNumericFields(2), NumArray(2))); ErrorsFound = true; } @@ -808,7 +817,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(4) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } @@ -849,18 +858,20 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower = NumArray(7); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower < 0.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(7) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(NumArray(7), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", NumArray(7))); ErrorsFound = true; } // Set crankcase heater capacity state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity = NumArray(8); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(8) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(NumArray(8), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", NumArray(8))); ErrorsFound = true; } @@ -902,9 +913,10 @@ namespace VariableSpeedCoils { // Basin heater power as a function of temperature must be greater than or equal to 0 state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterPowerFTempDiff = NumArray(11); if (NumArray(11) < 0.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(11) + " must be >= 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(NumArray(11), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", NumArray(11))); ErrorsFound = true; } @@ -913,7 +925,7 @@ namespace VariableSpeedCoils { if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BasinHeaterSetPointTemp < 2.0) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", freeze possible"); ShowContinueError(state, "..." + cNumericFields(12) + " is < 2 {C}. Freezing could occur."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(NumArray(12), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", NumArray(12))); } } @@ -935,9 +947,11 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondEffect(I) = NumArray(18 + (I - 1) * 6); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondEffect(I) < 0.0 || state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondEffect(I) > 1.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(18 + (I - 1) * 6) + " cannot be < 0.0 or > 1.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(NumArray(18 + (I - 1) * 6), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", NumArray(18 + (I - 1) * 6))); ErrorsFound = true; } @@ -966,7 +980,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -996,7 +1010,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1026,7 +1040,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1056,7 +1070,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1177,8 +1191,9 @@ namespace VariableSpeedCoils { // If (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%NumOfSpeeds .LT. 2) Then if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(1) + " must be >= 1. entered number is " + TrimSigDigits(NumArray(1), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be >= 1. entered number is {:.0T}", cNumericFields(1), NumArray(1))); ErrorsFound = true; } @@ -1187,8 +1202,9 @@ namespace VariableSpeedCoils { } if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(2) + " must be valid speed level entered number is " + TrimSigDigits(NumArray(2), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be valid speed level entered number is {:.0T}", cNumericFields(2), NumArray(2))); ErrorsFound = true; } @@ -1208,7 +1224,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(6) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } @@ -1244,7 +1260,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1274,7 +1290,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1304,7 +1320,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1334,7 +1350,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1364,7 +1380,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1394,7 +1410,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1425,7 +1441,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1523,8 +1539,9 @@ namespace VariableSpeedCoils { TestCompSet(state, CurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Air Nodes"); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(1) + " must be >= 1. entered number is " + TrimSigDigits(NumArray(1), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be >= 1. entered number is {:.0T}", cNumericFields(1), NumArray(1))); ErrorsFound = true; } @@ -1533,8 +1550,9 @@ namespace VariableSpeedCoils { } if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(2) + " must be valid speed level entered number is " + TrimSigDigits(NumArray(2), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be valid speed level entered number is {:.0T}", cNumericFields(2), NumArray(2))); ErrorsFound = true; } @@ -1554,7 +1572,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(4) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } @@ -1612,9 +1630,10 @@ namespace VariableSpeedCoils { // Set crankcase heater capacity state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity = NumArray(8); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError(state, "..." + cNumericFields(9) + " cannot be < 0.0."); - ShowContinueError(state, "...entered value=[" + TrimSigDigits(NumArray(9), 2) + "]."); + ShowContinueError(state, format("...entered value=[{:.2T}].", NumArray(9))); ErrorsFound = true; } @@ -1641,9 +1660,13 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(I) = NumArray(14 + (I - 1) * 3); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I) < 1.e-10) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid value"); - ShowContinueError(state, "...too small " + cNumericFields(12 + (I - 1) * 3) + "=[" + - RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I), 2) + "]."); + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + + "\", invalid value"); + ShowContinueError(state, + format("...too small {}=[{:.2R}].", + cNumericFields(12 + (I - 1) * 3), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(I))); ErrorsFound = true; } @@ -1672,7 +1695,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1702,7 +1725,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1732,7 +1755,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1762,7 +1785,7 @@ namespace VariableSpeedCoils { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", curve values"); ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 (+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -1850,11 +1873,9 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel = int(NumArray(2)); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds < 1) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(1) + - " must be >= 1." - " entered number is " + - TrimSigDigits(NumArray(1), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be >= 1. entered number is {:.0T}", cNumericFields(1), NumArray(1))); ErrorsFound = true; } @@ -1863,18 +1884,17 @@ namespace VariableSpeedCoils { } if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NormSpedLevel <= 0)) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(2) + - " must be valid speed level" - " entered number is " + - TrimSigDigits(NumArray(2), 0)); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be valid speed level entered number is {:.0T}", cNumericFields(2), NumArray(2))); ErrorsFound = true; } state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH = NumArray(3); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH <= 0.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(3) + " must be > 0.0, entered value=[" + TrimSigDigits(NumArray(3), 2) + "]."); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be > 0.0, entered value=[{:.2T}].", cNumericFields(3), NumArray(3))); ErrorsFound = true; } @@ -1887,16 +1907,20 @@ namespace VariableSpeedCoils { if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate != DataGlobalConstants::AutoCalculate()) { if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate <= 0.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(7) + " must be > 0.0. entered value=[" + TrimSigDigits(NumArray(7), 3) + "]."); + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + + "\", invalid"); + ShowContinueError(state, format("...{} must be > 0.0. entered value=[{:.3T}].", cNumericFields(7), NumArray(7))); ErrorsFound = true; } } if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate != DataGlobalConstants::AutoCalculate()) { if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate <= 0.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(8) + " must be > 0.0 entered value=[" + TrimSigDigits(NumArray(8), 3) + "]."); + ShowSevereError(state, + RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + + "\", invalid"); + ShowContinueError(state, format("...{} must be > 0.0 entered value=[{:.3T}].", cNumericFields(8), NumArray(8))); ErrorsFound = true; } } @@ -1942,8 +1966,9 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater = NumArray(9); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater <= 0.0 || state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpFracToWater > 1.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(10) + " must be >= 0 and <= 1. entered value=[" + TrimSigDigits(NumArray(9), 3) + "]."); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be >= 0 and <= 1. entered value=[{:.3T}].", cNumericFields(10), NumArray(9))); ErrorsFound = true; } @@ -1974,15 +1999,17 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity = NumArray(10); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CrankcaseHeaterCapacity < 0.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(10) + " must be >= 0.0 entered value=[" + TrimSigDigits(NumArray(10), 1) + "]."); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be >= 0.0 entered value=[{:.1T}].", cNumericFields(10), NumArray(10))); ErrorsFound = true; } state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater = NumArray(11); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater < 0.0) { - ShowSevereError(state,RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); - ShowContinueError(state, "..." + cNumericFields(11) + " must be >= 0 {C}. entered value=[" + TrimSigDigits(NumArray(11), 1) + "]."); + ShowSevereError( + state, RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); + ShowContinueError(state, format("...{} must be >= 0 {{C}}. entered value=[{:.1T}].", cNumericFields(11), NumArray(11))); ErrorsFound = true; } @@ -2025,7 +2052,7 @@ namespace VariableSpeedCoils { ShowContinueError(state, "..." + cAlphaFields(10) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } @@ -2064,7 +2091,7 @@ namespace VariableSpeedCoils { ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -2096,7 +2123,7 @@ namespace VariableSpeedCoils { ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -2128,7 +2155,7 @@ namespace VariableSpeedCoils { ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -2160,7 +2187,7 @@ namespace VariableSpeedCoils { ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -2192,7 +2219,7 @@ namespace VariableSpeedCoils { ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -2224,7 +2251,7 @@ namespace VariableSpeedCoils { ShowContinueError(state, "..." + cAlphaFields(AlfaFieldIncre) + " output is not equal to 1.0 " "(+ or - 10%) at rated conditions."); - ShowContinueError(state, "...Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("...Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -3035,7 +3062,7 @@ namespace VariableSpeedCoils { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; @@ -3146,13 +3173,19 @@ namespace VariableSpeedCoils { for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds; ++Mode) { // Check for zero capacity or zero max flow rate if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) <= 0.0) { - ShowSevereError(state,"Sizing: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + - " has zero rated total capacity at speed " + TrimSigDigits(Mode)); + ShowSevereError(state, + format("Sizing: {} {} has zero rated total capacity at speed {}", + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + Mode)); ErrorsFound = true; } if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) <= 0.0) { - ShowSevereError(state,"Sizing: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + - " has zero rated air flow rate at speed " + TrimSigDigits(Mode)); + ShowSevereError(state, + format("Sizing: {} {} has zero rated air flow rate at speed {}", + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + Mode)); ErrorsFound = true; } if (ErrorsFound) { @@ -3641,8 +3674,7 @@ namespace VariableSpeedCoils { using DataHVACGlobals::SmallAirVolFlow; using DataHVACGlobals::SmallLoad; using DataPlant::PlantLoop; - using General::RoundSigDigits; - using General::TrimSigDigits; + using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::RegisterPlantCompDesignFlow; using namespace OutputReportPredefined; @@ -4058,9 +4090,9 @@ namespace VariableSpeedCoils { ShowMessage(state, "SizeVarSpeedCoil: Potential issue with equipment sizing for " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); ShowContinueError(state, "Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Rated Total Cooling Capacity of " + RoundSigDigits(RatedCapCoolTotalUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Rated Total Cooling Capacity of " + RoundSigDigits(RatedCapCoolTotalDes, 2) + - " [W]"); + ShowContinueError(state, format("User-Specified Rated Total Cooling Capacity of {:.2R} [W]", RatedCapCoolTotalUser)); + ShowContinueError(state, + format("differs from Design Size Rated Total Cooling Capacity of {:.2R} [W]", RatedCapCoolTotalDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -4159,8 +4191,8 @@ namespace VariableSpeedCoils { ShowMessage(state, "SizeVarSpeedCoil: Potential issue with equipment sizing for " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); ShowContinueError(state, "Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Rated Total Heating Capacity of " + RoundSigDigits(RatedCapHeatUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Rated Total Heating Capacity of " + RoundSigDigits(RatedCapHeatDes, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Rated Total Heating Capacity of {:.2R} [W]", RatedCapHeatUser)); + ShowContinueError(state, format("differs from Design Size Rated Total Heating Capacity of {:.2R} [W]", RatedCapHeatDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -4198,9 +4230,8 @@ namespace VariableSpeedCoils { ShowMessage(state, "SizeVarSpeedCoil: Potential issue with equipment sizing for" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); ShowContinueError(state, "Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Rated Air Flow Rate of " + RoundSigDigits(RatedAirVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Rated Air Flow Rate of " + RoundSigDigits(RatedAirVolFlowRateDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Rated Air Flow Rate of {:.5R} [m3/s]", RatedAirVolFlowRateUser)); + ShowContinueError(state, format("differs from Design Size Rated Air Flow Rate of {:.5R} [m3/s]", RatedAirVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -4226,9 +4257,13 @@ namespace VariableSpeedCoils { ":WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT \"" + state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).Name + "\""); ShowContinueError(state, "...heating capacity is disproportionate (> 20% different) to total cooling capacity"); - ShowContinueError(state, "...heating capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat, 3) + " W"); - ShowContinueError(state, "...cooling capacity = " + - TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum).RatedCapCoolTotal, 3) + " W"); + ShowContinueError(state, + format("...heating capacity = {:.3T} W", state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapHeat)); + ShowContinueError(state, + format("...cooling capacity = {:.3T} W", + state.dataVariableSpeedCoils + ->VarSpeedCoil(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CompanionCoolingCoilNum) + .RatedCapCoolTotal)); } } } @@ -4447,11 +4482,17 @@ namespace VariableSpeedCoils { // equal to the flow rate at higher speed. Otherwise, a severe error is isssued. for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode) > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(Mode + 1) * 1.05) { - ShowWarningError(state, "SizeDXCoil: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + ", Speed " + - TrimSigDigits(Mode) + " Rated Air Flow Rate must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + - " Rated Air Flow Rate."); - ShowContinueError(state, "Instead, " + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), 2) + " > " + - RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1), 2)); + ShowWarningError( + state, + format("SizeDXCoil: {} {}, Speed {} Rated Air Flow Rate must be less than or equal to Speed {} Rated Air Flow Rate.", + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + Mode, + Mode + 1)); + ShowContinueError(state, + format("Instead, {:.2R} > {:.2R}", + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -4469,9 +4510,8 @@ namespace VariableSpeedCoils { ShowMessage(state, "SizeVarSpeedCoil: Potential issue with equipment sizing for" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); ShowContinueError(state, "Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Rated Water Flow Rate of " + RoundSigDigits(RatedWaterVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Rated Water Flow Rate of " + RoundSigDigits(RatedWaterVolFlowRateDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Rated Water Flow Rate of {:.5R} [m3/s]", RatedWaterVolFlowRateUser)); + ShowContinueError(state, format("differs from Design Size Rated Water Flow Rate of {:.5R} [m3/s]", RatedWaterVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -4531,24 +4571,37 @@ namespace VariableSpeedCoils { // Ensure air flow rate at lower speed must be lower or // equal to the flow rate at higher speed. Otherwise, a severe error is isssued. for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { - if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1)) { - ShowWarningError(state, "SizeDXCoil: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + ", Speed " + - TrimSigDigits(Mode) + " Rated Air Flow Rate must be less than or equal to Speed " + TrimSigDigits(Mode + 1) + - " Rated Air Flow Rate."); - ShowContinueError(state, "Instead, " + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), 2) + " > " + - RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1), 2)); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode) > + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1)) { + ShowWarningError(state, + format("SizeDXCoil: {} {}, Speed {} Rated Air Flow Rate must be less than or equal to Speed {} Rated Air Flow Rate.", + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + Mode, + Mode + 1)); + ShowContinueError(state, + format("Instead, {:.2R} > {:.2R}", + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(Mode + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } // Ensure capacity at lower speed must be lower or equal to the capacity at higher speed. for (Mode = 1; Mode <= state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds - 1; ++Mode) { - if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) > state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode + 1)) { - ShowWarningError(state, "SizeDXCoil: " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType + ' ' + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + ", Speed " + - TrimSigDigits(Mode) + " Rated Total Cooling Capacity must be less than or equal to Speed " + - TrimSigDigits(Mode + 1) + " Rated Total Cooling Capacity."); - ShowContinueError(state, "Instead, " + RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode), 2) + " > " + - RoundSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode + 1), 2)); + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode) > + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode + 1)) { + ShowWarningError(state, + format("SizeDXCoil: {} {}, Speed {} Rated Total Cooling Capacity must be less than or equal to Speed {} Rated Total " + "Cooling Capacity.", + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VarSpeedCoilType, + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, + Mode, + Mode + 1)); + ShowContinueError(state, + format("Instead, {:.2R} > {:.2R}", + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode), + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(Mode + 1))); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -4746,10 +4799,12 @@ namespace VariableSpeedCoils { ShowMessage(state, "SizeVarSpeedCoil: Potential issue with equipment sizing for " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); ShowContinueError(state, "Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Evaporative Condenser Pump Rated Power Consumption of " + - RoundSigDigits(EvapCondPumpElecNomPowerUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Evaporative Condenser Pump Rated Power Consumption of " + - RoundSigDigits(EvapCondPumpElecNomPowerDes, 2) + " [W]"); + ShowContinueError(state, + format("User-Specified Evaporative Condenser Pump Rated Power Consumption of {:.2R} [W]", + EvapCondPumpElecNomPowerUser)); + ShowContinueError(state, + format("differs from Design Size Evaporative Condenser Pump Rated Power Consumption of {:.2R} [W]", + EvapCondPumpElecNomPowerDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -4790,10 +4845,9 @@ namespace VariableSpeedCoils { ShowMessage(state, "SizeVarSpeedCoil: Potential issue with equipment sizing for " + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType + ' ' + CurrentObjSubfix); ShowContinueError(state, "Coil Name =" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name); - ShowContinueError(state, "User-Specified Resistive Defrost Heater Capacity of " + RoundSigDigits(DefrostCapacityUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Resistive Defrost Heater Capacity of " + - RoundSigDigits(DefrostCapacityDes, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Resistive Defrost Heater Capacity of {:.2R} [W]", DefrostCapacityUser)); + ShowContinueError(state, + format("differs from Design Size Resistive Defrost Heater Capacity of {:.2R} [W]", DefrostCapacityDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -4810,21 +4864,25 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\""); ShowContinueError(state, RoutineName + ": Rated Sensible Cooling Capacity > Rated Total Cooling Capacity"); ShowContinueError(state, "Each of these capacity inputs have been autosized."); - ShowContinueError(state, "Rated Sensible Cooling Capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens, 2) + " W"); - ShowContinueError(state, "Rated Total Cooling Capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal, 2) + " W"); + ShowContinueError( + state, + format("Rated Sensible Cooling Capacity = {:.2T} W", state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens)); + ShowContinueError( + state, + format("Rated Total Cooling Capacity = {:.2T} W", state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal)); ShowContinueError(state, "See eio file for further details."); ShowContinueError(state, "Check Total and Sensible Cooling Capacity Coefficients to ensure they are accurate."); ShowContinueError(state, "Check Zone and System Sizing objects to verify sizing inputs."); ShowContinueError(state, "Sizing statistics:"); - ShowContinueError(state, "Entering Air Dry-Bulb Temperature = " + TrimSigDigits(MixTemp, 3) + " C"); - ShowContinueError(state, "Entering Air Wet-Bulb Temperature = " + TrimSigDigits(MixWetBulb, 3) + " C"); + ShowContinueError(state, format("Entering Air Dry-Bulb Temperature = {:.3T} C", MixTemp)); + ShowContinueError(state, format("Entering Air Wet-Bulb Temperature = {:.3T} C", MixWetBulb)); ShowContinueError(state, "Entering Condenser Water Temperature used = 24.4444 C"); ShowContinueError(state, "Used design air and water flow rates (i.e., used 1 for ratioVL and ratioVS)"); - ShowContinueError(state, "ratioTDB = " + TrimSigDigits(((MixTemp + 283.15) / 273.15), 3)); - ShowContinueError(state, "ratioTWB = " + TrimSigDigits(((MixWetBulb + 283.15) / 273.15), 3)); - ShowContinueError(state, "ratioTS = " + TrimSigDigits(((85.0 + 283.15) / 273.15), 3)); + ShowContinueError(state, format("ratioTDB = {:.3T}", ((MixTemp + 283.15) / 273.15))); + ShowContinueError(state, format("ratioTWB = {:.3T}", ((MixWetBulb + 283.15) / 273.15))); + ShowContinueError(state, format("ratioTS = {:.3T}", ((85.0 + 283.15) / 273.15))); ShowContinueError(state, "Rated Sensible Cooling Capacity = Rated Total Cooling Capacity * Sensible Heat Ratio"); - ShowContinueError(state, "Total Cooling Capacity Modifier = " + TrimSigDigits(TotCapTempModFac, 5)); + ShowContinueError(state, format("Total Cooling Capacity Modifier = {:.5T}", TotCapTempModFac)); ShowContinueError(state, "...Rated Total Cooling Capacity = Total Design Load / Total Cooling Capacity Modifier"); ShowContinueError(state, "Carefully review the Load Side Total, Sensible, and Latent heat transfer rates"); ShowContinueError(state, "... to ensure they meet the expected manufacturers performance specifications."); @@ -4835,17 +4893,21 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\""); ShowContinueError(state, RoutineName + ": Rated Sensible Cooling Capacity > Rated Total Cooling Capacity"); ShowContinueError(state, "Only the rated total capacity input is autosized, consider autosizing both inputs."); - ShowContinueError(state, "Rated Sensible Cooling Capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens, 2) + " W"); - ShowContinueError(state, "Rated Total Cooling Capacity = " + TrimSigDigits(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal, 2) + " W"); + ShowContinueError( + state, + format("Rated Sensible Cooling Capacity = {:.2T} W", state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolSens)); + ShowContinueError( + state, + format("Rated Total Cooling Capacity = {:.2T} W", state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapCoolTotal)); ShowContinueError(state, "See eio file for further details."); ShowContinueError(state, "Check Total and Sensible Cooling Capacity Coefficients to ensure they are accurate."); ShowContinueError(state, "Check Zone and System Sizing objects to verify sizing inputs."); ShowContinueError(state, "Sizing statistics for Total Cooling Capacity:"); - ShowContinueError(state, "Entering Air Wet-Bulb Temperature = " + TrimSigDigits(MixWetBulb, 3) + " C"); + ShowContinueError(state, format("Entering Air Wet-Bulb Temperature = {:.3T} C", MixWetBulb)); ShowContinueError(state, "Entering Condenser Water Temperature used = 24.4444 C"); ShowContinueError(state, "Used design air and water flow rates (i.e., used 1 for ratioVL and ratioVS)"); - ShowContinueError(state, "ratioTWB = " + TrimSigDigits(((MixWetBulb + 283.15) / 273.15), 3)); - ShowContinueError(state, "ratioTS = " + TrimSigDigits(((85.0 + 283.15) / 273.15), 3)); + ShowContinueError(state, format("ratioTWB = {:.3T}", ((MixWetBulb + 283.15) / 273.15))); + ShowContinueError(state, format("ratioTS = {:.3T}", ((85.0 + 283.15) / 273.15))); ShowContinueError(state, "Rated Sensible Cooling Capacity = Rated Total Cooling Capacity * Sensible Heat Ratio"); ShowContinueError(state, "Carefully review the Load Side Total, Sensible, and Latent heat transfer rates"); ShowContinueError(state, "... to ensure they meet the expected manufacturers performance specifications."); @@ -5545,7 +5607,6 @@ namespace VariableSpeedCoils { using DataHVACGlobals::DXCoilTotalCapacity; using DataHVACGlobals::HPWHInletDBTemp; using DataHVACGlobals::HPWHInletWBTemp; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7038,7 +7099,6 @@ namespace VariableSpeedCoils { // Using/Aliasing using FluidProperties::FindGlycol; - using General::TrimSigDigits; // Obtains and Allocates WatertoAirHP related parameters from input file if (state.dataVariableSpeedCoils->GetCoilsInputFlag) { // First time subroutine has been entered @@ -7048,8 +7108,10 @@ namespace VariableSpeedCoils { } if (WSHPNum <= 0 || WSHPNum > state.dataVariableSpeedCoils->NumVarSpeedCoils) { - ShowSevereError(state,"SetVarSpeedCoilData: called with VS WSHP Coil Number out of range=" + TrimSigDigits(WSHPNum) + " should be >0 and <" + - TrimSigDigits(state.dataVariableSpeedCoils->NumVarSpeedCoils)); + ShowSevereError(state, + format("SetVarSpeedCoilData: called with VS WSHP Coil Number out of range={} should be >0 and <{}", + WSHPNum, + state.dataVariableSpeedCoils->NumVarSpeedCoils)); ErrorsFound = true; return; } diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 682e4c94cf8..907e4f8464e 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -161,7 +161,6 @@ namespace VentilatedSlab { // Using/Aliasing using DataSizing::ZoneEqVentedSlab; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Item; // index of ventilated slab being simulated @@ -182,13 +181,19 @@ namespace VentilatedSlab { } else { Item = CompIndex; if (Item > state.dataVentilatedSlab->NumOfVentSlabs || Item < 1) { - ShowFatalError(state, "SimVentilatedSlab: Invalid CompIndex passed=" + TrimSigDigits(Item) + - ", Number of Systems=" + TrimSigDigits(state.dataVentilatedSlab->NumOfVentSlabs) + ", Entered System name=" + CompName); + ShowFatalError(state, + format("SimVentilatedSlab: Invalid CompIndex passed={}, Number of Systems={}, Entered System name={}", + Item, + state.dataVentilatedSlab->NumOfVentSlabs, + CompName)); } if (state.dataVentilatedSlab->CheckEquipName(Item)) { if (CompName != state.dataVentilatedSlab->VentSlab(Item).Name ) { - ShowFatalError(state, "SimVentilatedSlab: Invalid CompIndex passed=" + TrimSigDigits(Item) + ", System name=" + CompName + - ", stored System Name for that index=" + state.dataVentilatedSlab->VentSlab(Item).Name); + ShowFatalError(state, + format("SimVentilatedSlab: Invalid CompIndex passed={}, System name={}, stored System Name for that index={}", + Item, + CompName, + state.dataVentilatedSlab->VentSlab(Item).Name)); } state.dataVentilatedSlab->CheckEquipName(Item) = false; } @@ -1649,7 +1654,7 @@ namespace VentilatedSlab { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using HVACHXAssistedCoolingCoil::GetHXCoilType; using HVACHXAssistedCoolingCoil::GetHXDXCoilName; using PlantUtilities::MyPlantSizingIndex; @@ -1902,10 +1907,9 @@ namespace VentilatedSlab { if ((std::abs(OutAirVolFlowDes - OutAirVolFlowUser) / OutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Outdoor Air Flow Rate of " + RoundSigDigits(OutAirVolFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Outdoor Air Flow Rate of {:.5R} [m3/s]", OutAirVolFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Outdoor Air Flow Rate of {:.5R} [m3/s]", OutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1950,10 +1954,10 @@ namespace VentilatedSlab { if ((std::abs(MinOutAirVolFlowDes - MinOutAirVolFlowUser) / MinOutAirVolFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); - ShowContinueError(state, "User-Specified Minimum Outdoor Air Flow Rate of " + RoundSigDigits(MinOutAirVolFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Minimum Outdoor Air Flow Rate of " + - RoundSigDigits(MinOutAirVolFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Minimum Outdoor Air Flow Rate of {:.5R} [m3/s]", MinOutAirVolFlowUser)); + ShowContinueError( + state, format("differs from Design Size Minimum Outdoor Air Flow Rate of {:.5R} [m3/s]", MinOutAirVolFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2078,10 +2082,10 @@ namespace VentilatedSlab { if ((std::abs(MaxVolHotWaterFlowDes - MaxVolHotWaterFlowUser) / MaxVolHotWaterFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Hot Water Flow of " + RoundSigDigits(MaxVolHotWaterFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Hot Water Flow of " + - RoundSigDigits(MaxVolHotWaterFlowDes, 5) + " [m3/s]"); + ShowContinueError(state, + format("User-Specified Maximum Hot Water Flow of {:.5R} [m3/s]", MaxVolHotWaterFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Hot Water Flow of {:.5R} [m3/s]", MaxVolHotWaterFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2195,10 +2199,9 @@ namespace VentilatedSlab { if ((std::abs(MaxVolHotSteamFlowDes - MaxVolHotSteamFlowUser) / MaxVolHotSteamFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Steam Flow of " + RoundSigDigits(MaxVolHotSteamFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Steam Flow of " + RoundSigDigits(MaxVolHotSteamFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Steam Flow of {:.5R} [m3/s]", MaxVolHotSteamFlowUser)); + ShowContinueError(state, + format("differs from Design Size Maximum Steam Flow of {:.5R} [m3/s]", MaxVolHotSteamFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2323,10 +2326,9 @@ namespace VentilatedSlab { if ((std::abs(MaxVolColdWaterFlowDes - MaxVolColdWaterFlowUser) / MaxVolColdWaterFlowUser) > AutoVsHardSizingThreshold) { ShowMessage(state, "SizeVentilatedSlab: Potential issue with equipment sizing for ZoneHVAC:VentilatedSlab = \"" + state.dataVentilatedSlab->VentSlab(Item).Name + "\"."); - ShowContinueError(state, "User-Specified Maximum Cold Water Flow of " + RoundSigDigits(MaxVolColdWaterFlowUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Maximum Cold Water Flow of " + RoundSigDigits(MaxVolColdWaterFlowDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Maximum Cold Water Flow of {:.5R} [m3/s]", MaxVolColdWaterFlowUser)); + ShowContinueError( + state, format("differs from Design Size Maximum Cold Water Flow of {:.5R} [m3/s]", MaxVolColdWaterFlowDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -2423,7 +2425,7 @@ namespace VentilatedSlab { using DataHVACGlobals::ZoneCompTurnFansOff; using DataHVACGlobals::ZoneCompTurnFansOn; using DataLoopNode::Node; - using General::TrimSigDigits; + using HeatingCoils::CheckHeatingCoilSchedule; using HVACHXAssistedCoolingCoil::CheckHXAssistedCoolingCoilSchedule; using NodeInputManager::GetOnlySingleNode; @@ -3405,7 +3407,6 @@ namespace VentilatedSlab { // Using/Aliasing using DataEnvironment::OutBaroPress; - using General::RoundSigDigits; using DataHeatBalance::Zone; using DataHeatBalFanSys::CTFTsrcConstPart; @@ -3701,15 +3702,16 @@ namespace VentilatedSlab { ShowContinueError(state, "Surface [" + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)).Name + "] temperature below dew-point temperature--potential for condensation exists"); ShowContinueError(state, "Flow to the ventilated slab system will be shut-off to avoid condensation"); - ShowContinueError(state, "Predicted radiant system surface temperature = " + - RoundSigDigits(TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)), 2)); - ShowContinueError(state, "Zone dew-point temperature + safety factor delta= " + - RoundSigDigits(DewPointTemp + CondDeltaTemp, 2)); + ShowContinueError(state, + format("Predicted radiant system surface temperature = {:.2R}", + TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)))); + ShowContinueError( + state, format("Zone dew-point temperature + safety factor delta= {:.2R}", DewPointTemp + CondDeltaTemp)); ShowContinueErrorTimeStamp(state, ""); } if (CondensationErrorCount == 1) { - ShowContinueError(state, "Note that there is a " + RoundSigDigits(CondDeltaTemp, 4) + - " C safety built-in to the shut-off criteria"); + ShowContinueError( + state, format("Note that there is a {:.4R} C safety built-in to the shut-off criteria", CondDeltaTemp)); ShowContinueError(state, "Note also that this affects all surfaces that are part of this system"); } ShowRecurringWarningErrorAtEnd(state, state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + @@ -3754,12 +3756,14 @@ namespace VentilatedSlab { ShowContinueError(state, "However, it could also result from improper input for the ventilated slab or"); ShowContinueError(state, "illogical control temperatures. Check your input for this ventilated slab and"); ShowContinueError(state, "also look at the internal data shown below."); - ShowContinueError(state, "Predicted return air temperature [C] from the overall energy balance = " + - RoundSigDigits(Node(ReturnAirNode).Temp, 4)); - ShowContinueError(state, "Predicted return air temperature [C] from the slab section energy balances = " + - RoundSigDigits(AirOutletTempCheck, 4)); - ShowContinueError(state, "Total energy rate (power) [W] added to the slab = " + - RoundSigDigits(TotalVentSlabRadPower, 4)); + ShowContinueError(state, + format("Predicted return air temperature [C] from the overall energy balance = {:.4R}", + Node(ReturnAirNode).Temp)); + ShowContinueError(state, + format("Predicted return air temperature [C] from the slab section energy balances = {:.4R}", + AirOutletTempCheck)); + ShowContinueError(state, + format("Total energy rate (power) [W] added to the slab = {:.4R}", TotalVentSlabRadPower)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + @@ -3787,12 +3791,14 @@ namespace VentilatedSlab { ShowContinueError(state, "However, it could also result from improper input for the ventilated slab or"); ShowContinueError(state, "illogical control temperatures. Check your input for this ventilated slab and"); ShowContinueError(state, "also look at the internal data shown below."); - ShowContinueError(state, "Predicted return air temperature [C] from the overall energy balance = " + - RoundSigDigits(Node(ReturnAirNode).Temp, 4)); - ShowContinueError(state, "Predicted return air temperature [C] from the slab section energy balances = " + - RoundSigDigits(AirOutletTempCheck, 4)); - ShowContinueError(state, "Total energy rate (power) [W] added to the slab = " + - RoundSigDigits(TotalVentSlabRadPower, 4)); + ShowContinueError(state, + format("Predicted return air temperature [C] from the overall energy balance = {:.4R}", + Node(ReturnAirNode).Temp)); + ShowContinueError(state, + format("Predicted return air temperature [C] from the slab section energy balances = {:.4R}", + AirOutletTempCheck)); + ShowContinueError(state, + format("Total energy rate (power) [W] added to the slab = {:.4R}", TotalVentSlabRadPower)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + @@ -3950,15 +3956,16 @@ namespace VentilatedSlab { ShowContinueError(state, "Surface [" + Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)).Name + "] temperature below dew-point temperature--potential for condensation exists"); ShowContinueError(state, "Flow to the ventilated slab system will be shut-off to avoid condensation"); - ShowContinueError(state, "Predicted radiant system surface temperature = " + - RoundSigDigits(TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)), 2)); - ShowContinueError(state, "Zone dew-point temperature + safety factor delta= " + - RoundSigDigits(DewPointTemp + CondDeltaTemp, 2)); + ShowContinueError(state, + format("Predicted radiant system surface temperature = {:.2R}", + TH(2, 1, state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(RadSurfNum2)))); + ShowContinueError( + state, format("Zone dew-point temperature + safety factor delta= {:.2R}", DewPointTemp + CondDeltaTemp)); ShowContinueErrorTimeStamp(state, ""); } if (CondensationErrorCount == 1) { - ShowContinueError(state, "Note that there is a " + RoundSigDigits(CondDeltaTemp, 4) + - " C safety built-in to the shut-off criteria"); + ShowContinueError( + state, format("Note that there is a {:.4R} C safety built-in to the shut-off criteria", CondDeltaTemp)); ShowContinueError(state, "Note also that this affects all surfaces that are part of this system"); } ShowRecurringWarningErrorAtEnd(state, state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + @@ -4033,11 +4040,13 @@ namespace VentilatedSlab { ShowContinueError(state, "However, it could also result from improper input for the ventilated slab or"); ShowContinueError(state, "illogical control temperatures. Check your input for this ventilated slab and"); ShowContinueError(state, "also look at the internal data shown below."); - ShowContinueError(state, "Predicted return air temperature [C] from the overall energy balance = " + - RoundSigDigits(Node(ReturnAirNode).Temp, 4)); - ShowContinueError(state, "Predicted return air temperature [C] from the slab section energy balances = " + - RoundSigDigits(AirOutletTempCheck, 4)); - ShowContinueError(state, "Total energy rate (power) [W] added to the slab = " + RoundSigDigits(TotalVentSlabRadPower, 4)); + ShowContinueError(state, + format("Predicted return air temperature [C] from the overall energy balance = {:.4R}", + Node(ReturnAirNode).Temp)); + ShowContinueError(state, + format("Predicted return air temperature [C] from the slab section energy balances = {:.4R}", + AirOutletTempCheck)); + ShowContinueError(state, format("Total energy rate (power) [W] added to the slab = {:.4R}", TotalVentSlabRadPower)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, state.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index 7ecd1bc54b4..d034eb85a12 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -75,7 +75,6 @@ #include #include #include -#include #include #include #include @@ -91,7 +90,6 @@ #include #include #include -#include #include #include #include @@ -185,7 +183,6 @@ namespace WaterCoils { // This subroutine manages WaterCoil component simulation. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CoilNum; // The WaterCoil that you are currently loading input into @@ -210,13 +207,20 @@ namespace WaterCoils { } else { CoilNum = CompIndex; if (CoilNum > state.dataWaterCoils->NumWaterCoils || CoilNum < 1) { - ShowFatalError(state, "SimulateWaterCoilComponents: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Number of Water Coils=" + TrimSigDigits(state.dataWaterCoils->NumWaterCoils) + ", Coil name=" + CompName); + ShowFatalError(state, + format("SimulateWaterCoilComponents: Invalid CompIndex passed={}, Number of Water Coils={}, Coil name={}", + CoilNum, + state.dataWaterCoils->NumWaterCoils, + CompName)); } if (state.dataWaterCoils->CheckEquipName(CoilNum)) { if (CompName != state.dataWaterCoils->WaterCoil(CoilNum).Name) { - ShowFatalError(state, "SimulateWaterCoilComponents: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + ", Coil name=" + CompName + - ", stored Coil Name for that index=" + state.dataWaterCoils->WaterCoil(CoilNum).Name); + ShowFatalError( + state, + format("SimulateWaterCoilComponents: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + CoilNum, + CompName, + state.dataWaterCoils->WaterCoil(CoilNum).Name)); } state.dataWaterCoils->CheckEquipName(CoilNum) = false; } @@ -898,7 +902,7 @@ namespace WaterCoils { // Using/Aliasing using General::Iterate; - using General::RoundSigDigits; + using General::SafeDivide; using General::SolveRoot; using namespace OutputReportPredefined; @@ -1174,8 +1178,7 @@ namespace WaterCoils { // be less than 1 TubeToFinDiamRatio = state.dataWaterCoils->WaterCoil(CoilNum).TubeOutsideDiam / state.dataWaterCoils->WaterCoil(CoilNum).EffectiveFinDiam; if (TubeToFinDiamRatio > 1.0) { - ShowWarningError(state, "InitWaterCoil: Detailed Flat Fin Coil, TubetoFinDiamRatio > 1.0, [" + RoundSigDigits(TubeToFinDiamRatio, 4) + - ']'); + ShowWarningError(state, format("InitWaterCoil: Detailed Flat Fin Coil, TubetoFinDiamRatio > 1.0, [{:.4R}]", TubeToFinDiamRatio)); // reset tube depth spacing and recalc dependent parameters state.dataWaterCoils->WaterCoil(CoilNum).TubeDepthSpacing *= (pow_2(TubeToFinDiamRatio) + 0.1); state.dataWaterCoils->WaterCoil(CoilNum).CoilDepth = state.dataWaterCoils->WaterCoil(CoilNum).TubeDepthSpacing * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubeRows; @@ -1184,8 +1187,9 @@ namespace WaterCoils { state.dataWaterCoils->WaterCoil(CoilNum).CoilEffectiveInsideDiam = 4.0 * state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea * state.dataWaterCoils->WaterCoil(CoilNum).CoilDepth / state.dataWaterCoils->WaterCoil(CoilNum).TotCoilOutsideSurfArea; TubeToFinDiamRatio = state.dataWaterCoils->WaterCoil(CoilNum).TubeOutsideDiam / state.dataWaterCoils->WaterCoil(CoilNum).EffectiveFinDiam; - ShowContinueError(state, " Resetting tube depth spacing to " + RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).TubeDepthSpacing, 4) + " meters"); - ShowContinueError(state, " Resetting coil depth to " + RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).CoilDepth, 4) + " meters"); + ShowContinueError( + state, format(" Resetting tube depth spacing to {:.4R} meters", state.dataWaterCoils->WaterCoil(CoilNum).TubeDepthSpacing)); + ShowContinueError(state, format(" Resetting coil depth to {:.4R} meters", state.dataWaterCoils->WaterCoil(CoilNum).CoilDepth)); } CalcDryFinEffCoef(state, TubeToFinDiamRatio, CoefSeries); @@ -1244,16 +1248,21 @@ namespace WaterCoils { if (DesOutletAirEnth >= DesInletAirEnth || state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp >= state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp) { ShowWarningError(state, "The design cooling capacity is zero for Coil:Cooling:Water " + state.dataWaterCoils->WaterCoil(CoilNum).Name); ShowContinueError(state, " The maximum water flow rate for this coil will be set to zero and the coil will do no cooling."); - ShowContinueError(state, " Check the following coil design inputs for problems: Tair,in = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp, 4)); - ShowContinueError(state, " Wair,in = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat, 6)); - ShowContinueError(state, " Twater,in = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp, 4)); - ShowContinueError(state, " Tair,out = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp, 4)); - ShowContinueError(state, " Wair,out = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat, 6)); + ShowContinueError(state, + format(" Check the following coil design inputs for problems: Tair,in = {:.4R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp)); + ShowContinueError(state, + format(" Wair,in = {:.6R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat)); + ShowContinueError(state, + format(" Twater,in = {:.4R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp)); + ShowContinueError(state, + format(" Tair,out = {:.4R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp)); + ShowContinueError(state, + format(" Wair,out = {:.6R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat)); state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = 0.0; state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterMassFlowRate = 0.0; } @@ -1285,19 +1294,24 @@ namespace WaterCoils { if (!NoExitCondReset) { ShowContinueError(state, "the coil outlet design conditions will be changed to correct the problem."); } - ShowContinueError(state, "The initial design conditions are: Tair,in = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp, 4)); - ShowContinueError(state, " Wair,in = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat, 6)); - ShowContinueError(state, " Twater,in = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp, 4)); - ShowContinueError(state, " Tair,out = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp, 4)); - ShowContinueError(state, " Wair,out = " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat, 6)); + ShowContinueError(state, + format("The initial design conditions are: Tair,in = {:.4R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp)); + ShowContinueError(state, + format(" Wair,in = {:.6R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat)); + ShowContinueError(state, + format(" Twater,in = {:.4R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp)); + ShowContinueError(state, + format(" Tair,out = {:.4R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp)); + ShowContinueError(state, + format(" Wair,out = {:.6R}", + state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat)); if (!NoExitCondReset) { - ShowContinueError(state, "The revised design conditions are: Tair,out = " + RoundSigDigits(TOutNew, 4)); - ShowContinueError(state, " Wair,out = " + RoundSigDigits(WOutNew, 6)); + ShowContinueError(state, format("The revised design conditions are: Tair,out = {:.4R}", TOutNew)); + ShowContinueError(state, format(" Wair,out = {:.6R}", WOutNew)); state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = WOutNew; state.dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = TOutNew; // update outlet air conditions used for sizing @@ -1405,11 +1419,12 @@ namespace WaterCoils { if (DesEnthWaterOut > DesInletAirEnth) { ShowWarningError(state, "In calculating the design coil UA for Coil:Cooling:Water " + state.dataWaterCoils->WaterCoil(CoilNum).Name); ShowContinueError(state, "the outlet chilled water design enthalpy is greater than the inlet air design enthalpy."); - ShowContinueError(state, "To correct this condition the design chilled water flow rate will be increased from " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate, 5)); + ShowContinueError(state, + format("To correct this condition the design chilled water flow rate will be increased from {:.5R}", + state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate)); EnthCorrFrac = (DesEnthWaterOut - DesInletAirEnth) / (DesEnthWaterOut - DesSatEnthAtWaterInTemp); state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate *= (1.0 + 2.0 * EnthCorrFrac); - ShowContinueError(state, "to " + RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate, 5) + " m3/s"); + ShowContinueError(state, format("to {:.5R} m3/s", state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate)); state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterMassFlowRate = rho * state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate; DesOutletWaterTemp = state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp + state.dataWaterCoils->WaterCoil(CoilNum).DesTotWaterCoilLoad / (state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterMassFlowRate * Cp); @@ -1449,12 +1464,13 @@ namespace WaterCoils { if (DesOutletWaterTemp > state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp) { ShowWarningError(state, "In calculating the design coil UA for Coil:Cooling:Water " + state.dataWaterCoils->WaterCoil(CoilNum).Name); ShowContinueError(state, "the outlet chilled water design temperature is greater than the inlet air design temperature."); - ShowContinueError(state, "To correct this condition the design chilled water flow rate will be increased from " + - RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate, 5)); + ShowContinueError(state, + format("To correct this condition the design chilled water flow rate will be increased from {:.5R}", + state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate)); TempCorrFrac = (DesOutletWaterTemp - state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp) / (DesOutletWaterTemp - state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp); state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate *= (1.0 + 2.0 * TempCorrFrac); - ShowContinueError(state, "to " + RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate, 5) + " m3/s"); + ShowContinueError(state, format("to {:.5R} m3/s", state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate)); state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterMassFlowRate = rho * state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate; DesOutletWaterTemp = state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp + state.dataWaterCoils->WaterCoil(CoilNum).DesTotWaterCoilLoad / (state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterMassFlowRate * Cp); @@ -1517,7 +1533,7 @@ namespace WaterCoils { state.dataWaterCoils->WaterCoil(CoilNum).UACoilInternalPerUnitArea = state.dataWaterCoils->WaterCoil(CoilNum).UACoilInternal / state.dataWaterCoils->WaterCoil(CoilNum).TotCoilOutsideSurfArea; state.dataWaterCoils->WaterCoil(CoilNum).UAWetExtPerUnitArea = state.dataWaterCoils->WaterCoil(CoilNum).UACoilExternal / state.dataWaterCoils->WaterCoil(CoilNum).TotCoilOutsideSurfArea; state.dataWaterCoils->WaterCoil(CoilNum).UADryExtPerUnitArea = state.dataWaterCoils->WaterCoil(CoilNum).UAWetExtPerUnitArea; - ShowContinueError(state, " Coil design UA set to " + RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).UACoilTotal, 6) + " [W/C]"); + ShowContinueError(state, format(" Coil design UA set to {:.6R} [W/C]", state.dataWaterCoils->WaterCoil(CoilNum).UACoilTotal)); } else if (SolFla == -2) { ShowSevereError(state, "Calculation of cooling coil design UA failed for coil " + state.dataWaterCoils->WaterCoil(CoilNum).Name); ShowContinueError(state, " Bad starting values for UA"); @@ -1529,7 +1545,7 @@ namespace WaterCoils { state.dataWaterCoils->WaterCoil(CoilNum).UACoilInternalPerUnitArea = state.dataWaterCoils->WaterCoil(CoilNum).UACoilInternal / state.dataWaterCoils->WaterCoil(CoilNum).TotCoilOutsideSurfArea; state.dataWaterCoils->WaterCoil(CoilNum).UAWetExtPerUnitArea = state.dataWaterCoils->WaterCoil(CoilNum).UACoilExternal / state.dataWaterCoils->WaterCoil(CoilNum).TotCoilOutsideSurfArea; state.dataWaterCoils->WaterCoil(CoilNum).UADryExtPerUnitArea = state.dataWaterCoils->WaterCoil(CoilNum).UAWetExtPerUnitArea; - ShowContinueError(state, " Coil design UA set to " + RoundSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).UACoilTotal, 6) + " [W/C]"); + ShowContinueError(state, format(" Coil design UA set to {:.6R} [W/C]", state.dataWaterCoils->WaterCoil(CoilNum).UACoilTotal)); } // cooling coil surface area @@ -2045,8 +2061,7 @@ namespace WaterCoils { // Using/Aliasing using namespace DataSizing; using DataEnvironment::StdBaroPress; - using General::RoundSigDigits; - using General::TrimSigDigits; + using PlantUtilities::RegisterPlantCompDesignFlow; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2352,8 +2367,9 @@ namespace WaterCoils { if (state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea <= 0.0) { ShowSevereError(state, "Coil:Cooling:Water:DetailedGeometry: \"" + state.dataWaterCoils->WaterCoil(CoilNum).Name + "\""); - ShowContinueError(state, "Coil Minimum Airflow Area must be greater than 0. Coil area = " + - TrimSigDigits(state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea, 6)); + ShowContinueError(state, + format("Coil Minimum Airflow Area must be greater than 0. Coil area = {:.6T}", + state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea)); ErrorsFound = true; } @@ -2400,8 +2416,11 @@ namespace WaterCoils { if ((state.dataWaterCoils->WaterCoil(CoilNum).FinSurfArea + state.dataWaterCoils->WaterCoil(CoilNum).TubeOutsideSurfArea) <= 0.0) { ShowSevereError(state, "Coil:Cooling:Water:DetailedGeometry: \"" + state.dataWaterCoils->WaterCoil(CoilNum).Name + "\""); - ShowContinueError(state, "Coil Fin Surface Area plus Coil Tube Outside Surface Area must be greater than 0. Total surface area = " + - TrimSigDigits((state.dataWaterCoils->WaterCoil(CoilNum).FinSurfArea + state.dataWaterCoils->WaterCoil(CoilNum).TubeOutsideSurfArea), 6)); + ShowContinueError( + state, + format("Coil Fin Surface Area plus Coil Tube Outside Surface Area must be greater than 0. Total surface area = {:.6T}", + (state.dataWaterCoils->WaterCoil(CoilNum).FinSurfArea + + state.dataWaterCoils->WaterCoil(CoilNum).TubeOutsideSurfArea))); ErrorsFound = true; } @@ -2687,10 +2706,10 @@ namespace WaterCoils { state.dataWaterCoils->WaterCoil(CoilNum).UACoil = sizerHWCoilUA.size(state, TempSize, ErrorsFound); if (DesCoilWaterInTempSaved < DesCoilHWInletTempMin) { ShowWarningError(state, "Autosizing of heating coil UA for Coil:Heating:Water \"" + CompName + "\""); - ShowContinueError(state, " Plant design loop exit temperature = " + TrimSigDigits(PlantSizData(DataPltSizHeatNum).ExitTemp, 2) + " C"); + ShowContinueError(state, format(" Plant design loop exit temperature = {:.2T} C", PlantSizData(DataPltSizHeatNum).ExitTemp)); ShowContinueError(state, " Plant design loop exit temperature is low for design load and leaving air temperature anticipated."); - ShowContinueError(state, - " Heating coil UA-value is sized using coil water inlet temperature = " + TrimSigDigits(DesCoilInletWaterTempUsed, 2) + " C"); + ShowContinueError( + state, format(" Heating coil UA-value is sized using coil water inlet temperature = {:.2T} C", DesCoilInletWaterTempUsed)); state.dataWaterCoils->WaterCoil(DataCoilNum).InletWaterTemp = DesCoilWaterInTempSaved; // reset the Design Coil Inlet Water Temperature } // if coil UA did not size due to one of these variables being 0, must set UACoilVariable to avoid crash later on @@ -2948,7 +2967,6 @@ namespace WaterCoils { // Re-engineered for EnergyPlus by Richard Liesen PhD in 1998 // Using/Aliasing - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -3090,21 +3108,23 @@ namespace WaterCoils { if (AirMassFlow > (5.0 * state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea / AirDensity) && state.dataWaterCoils->CoilWarningOnceFlag(CoilNum)) { ShowWarningError(state, "Coil:Cooling:Water:DetailedGeometry in Coil =" + state.dataWaterCoils->WaterCoil(CoilNum).Name); ShowContinueError(state, "Air Flow Rate Velocity has greatly exceeded upper design guidelines of ~2.5 m/s"); - ShowContinueError(state, "Air MassFlowRate[kg/s]=" + TrimSigDigits(AirMassFlow, 6)); + ShowContinueError(state, format("Air MassFlowRate[kg/s]={:.6T}", AirMassFlow)); AirVelocity = AirMassFlow * AirDensity / state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea; - ShowContinueError(state, "Air Face Velocity[m/s]=" + TrimSigDigits(AirVelocity, 6)); - ShowContinueError(state, "Approximate MassFlowRate limit for Face Area[kg/s]=" + - TrimSigDigits(2.5 * state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea / AirDensity, 6)); + ShowContinueError(state, format("Air Face Velocity[m/s]={:.6T}", AirVelocity)); + ShowContinueError(state, + format("Approximate MassFlowRate limit for Face Area[kg/s]={:.6T}", + 2.5 * state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea / AirDensity)); ShowContinueError(state, "Coil:Cooling:Water:DetailedGeometry could be resized/autosized to handle capacity"); state.dataWaterCoils->CoilWarningOnceFlag(CoilNum) = false; } else if (AirMassFlow > (44.7 * state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea / AirDensity)) { ShowSevereError(state, "Coil:Cooling:Water:DetailedGeometry in Coil =" + state.dataWaterCoils->WaterCoil(CoilNum).Name); ShowContinueError(state, "Air Flow Rate Velocity is > 100MPH (44.7m/s) and simulation cannot continue"); - ShowContinueError(state, "Air Mass Flow Rate[kg/s]=" + TrimSigDigits(AirMassFlow, 6)); + ShowContinueError(state, format("Air Mass Flow Rate[kg/s]={:.6T}", AirMassFlow)); AirVelocity = AirMassFlow * AirDensity / state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea; - ShowContinueError(state, "Air Face Velocity[m/s]=" + TrimSigDigits(AirVelocity, 6)); - ShowContinueError(state, "Approximate MassFlowRate limit for Face Area[kg/s]=" + - TrimSigDigits(2.5 * state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea / AirDensity, 6)); + ShowContinueError(state, format("Air Face Velocity[m/s]={:.6T}", AirVelocity)); + ShowContinueError(state, + format("Approximate MassFlowRate limit for Face Area[kg/s]={:.6T}", + 2.5 * state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea / AirDensity)); ShowFatalError(state, "Coil:Cooling:Water:DetailedGeometry needs to be resized/autosized to handle capacity"); } @@ -5612,7 +5632,6 @@ namespace WaterCoils { // // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CoilNum; @@ -5634,12 +5653,18 @@ namespace WaterCoils { } else { CoilNum = CompIndex; if (CoilNum > state.dataWaterCoils->NumWaterCoils || CoilNum < 1) { - ShowFatalError(state, "CheckWaterCoilSchedule: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Number of Heating Coils=" + TrimSigDigits(state.dataWaterCoils->NumWaterCoils) + ", Coil name=" + CompName); + ShowFatalError(state, + format("CheckWaterCoilSchedule: Invalid CompIndex passed={}, Number of Heating Coils={}, Coil name={}", + CoilNum, + state.dataWaterCoils->NumWaterCoils, + CompName)); } if (CompName != state.dataWaterCoils->WaterCoil(CoilNum).Name) { - ShowFatalError(state, "CheckWaterCoilSchedule: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + ", Coil name=" + CompName + - ", stored Coil Name for that index=" + state.dataWaterCoils->WaterCoil(CoilNum).Name); + ShowFatalError(state, + format("CheckWaterCoilSchedule: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + CoilNum, + CompName, + state.dataWaterCoils->WaterCoil(CoilNum).Name)); } Value = GetCurrentScheduleValue(state, state.dataWaterCoils->WaterCoil(CoilNum).SchedPtr); // not scheduled? } @@ -6189,7 +6214,7 @@ namespace WaterCoils { // none // Using/Aliasing - using General::RoundSigDigits; + using General::SolveRoot; // Return value @@ -6227,11 +6252,11 @@ namespace WaterCoils { if (SolFla == -1) { ShowSevereError(state, "Calculation of drybulb temperature failed in TdbFnHRhPb(H,RH,PB)"); ShowContinueError(state, " Iteration limit exceeded"); - ShowContinueError(state, " H=[" + RoundSigDigits(H, 6) + "], RH=[" + RoundSigDigits(RH, 4) + "], PB=[" + RoundSigDigits(PB, 5) + "]."); + ShowContinueError(state, format(" H=[{:.6R}], RH=[{:.4R}], PB=[{:.5R}].", H, RH, PB)); } else if (SolFla == -2) { ShowSevereError(state, "Calculation of drybulb temperature failed in TdbFnHRhPb(H,RH,PB)"); ShowContinueError(state, " Bad starting values for Tdb"); - ShowContinueError(state, " H=[" + RoundSigDigits(H, 6) + "], RH=[" + RoundSigDigits(RH, 4) + "], PB=[" + RoundSigDigits(PB, 5) + "]."); + ShowContinueError(state, format(" H=[{:.6R}], RH=[{:.4R}], PB=[{:.5R}].", H, RH, PB)); } if (SolFla < 0) { T = 0.0; @@ -6486,7 +6511,6 @@ namespace WaterCoils { using DataLoopNode::Node; using DataPlant::ccSimPlantEquipTypes; using DataPlant::PlantLoop; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -6505,17 +6529,28 @@ namespace WaterCoils { } else { CoilNum = CompIndex; if (CoilNum > state.dataWaterCoils->NumWaterCoils || CoilNum < 1) { - ShowFatalError(state, "UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Number of Coils=" + TrimSigDigits(state.dataWaterCoils->NumWaterCoils) + ", Entered Coil name=" + CoilName); + ShowFatalError(state, + format("UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed={}, Number of Coils={}, Entered Coil name={}", + CoilNum, + state.dataWaterCoils->NumWaterCoils, + CoilName)); } if (state.dataGlobal->KickOffSimulation) { if (CoilName != state.dataWaterCoils->WaterCoil(CoilNum).Name) { - ShowFatalError(state, "UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Coil name=" + CoilName + ", stored Coil Name for that index=" + state.dataWaterCoils->WaterCoil(CoilNum).Name); + ShowFatalError( + state, + format("UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + CoilNum, + CoilName, + state.dataWaterCoils->WaterCoil(CoilNum).Name)); } if (CoilTypeNum != state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType_Num) { - ShowFatalError(state, "UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed=" + TrimSigDigits(CoilNum) + - ", Coil name=" + CoilName + ", stored Coil Name for that index=" + ccSimPlantEquipTypes(CoilTypeNum)); + ShowFatalError( + state, + format("UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", + CoilNum, + CoilName, + ccSimPlantEquipTypes(CoilTypeNum))); } } } @@ -6621,7 +6656,6 @@ namespace WaterCoils { // This function sets data to water Heating Coil using the coil index and arguments passed // Using/Aliasing - using General::TrimSigDigits; if (state.dataWaterCoils->GetWaterCoilsInputFlag) { GetWaterCoilInput(state); @@ -6629,8 +6663,10 @@ namespace WaterCoils { } if (CoilNum <= 0 || CoilNum > state.dataWaterCoils->NumWaterCoils) { - ShowSevereError(state, "SetHeatingCoilData: called with heating coil Number out of range=" + TrimSigDigits(CoilNum) + " should be >0 and <" + - TrimSigDigits(state.dataWaterCoils->NumWaterCoils)); + ShowSevereError(state, + format("SetHeatingCoilData: called with heating coil Number out of range={} should be >0 and <{}", + CoilNum, + state.dataWaterCoils->NumWaterCoils)); ErrorsFound = true; return; } diff --git a/src/EnergyPlus/WaterManager.cc b/src/EnergyPlus/WaterManager.cc index fbefebe9aff..43118ecc290 100644 --- a/src/EnergyPlus/WaterManager.cc +++ b/src/EnergyPlus/WaterManager.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -164,7 +163,7 @@ namespace WaterManager { // Using/Aliasing using DataHeatBalance::Zone; using DataSurfaces::Surface; - using General::RoundSigDigits; + using ScheduleManager::CheckScheduleValue; using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; @@ -294,10 +293,14 @@ namespace WaterManager { ShowSevereError(state, "Invalid " + cNumericFieldNames(5) + " and/or " + cNumericFieldNames(6)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, cNumericFieldNames(6) + " must be greater than " + cNumericFieldNames(5)); - ShowContinueError(state, "Check value for " + cNumericFieldNames(5) + " = " + - RoundSigDigits(state.dataWaterData->WaterStorage(Item).ValveOnCapacity, 5)); - ShowContinueError(state, "which must be lower than " + cNumericFieldNames(6) + " = " + - RoundSigDigits(state.dataWaterData->WaterStorage(Item).ValveOffCapacity, 5)); + ShowContinueError(state, + format("Check value for {} = {:.5R}", + cNumericFieldNames(5), + state.dataWaterData->WaterStorage(Item).ValveOnCapacity)); + ShowContinueError(state, + format("which must be lower than {} = {:.5R}", + cNumericFieldNames(6), + state.dataWaterData->WaterStorage(Item).ValveOffCapacity)); ErrorsFound = true; } } @@ -421,12 +424,12 @@ namespace WaterManager { } state.dataWaterData->RainCollector(Item).LossFactor = rNumericArgs(1); if (state.dataWaterData->RainCollector(Item).LossFactor > 1.0) { - ShowWarningError(state, "Invalid " + cNumericFieldNames(1) + '=' + RoundSigDigits(rNumericArgs(1), 2)); + ShowWarningError(state, format("Invalid {}={:.2R}", cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "found rain water collection loss factor greater than 1.0, simulation continues"); } if (state.dataWaterData->RainCollector(Item).LossFactor < 0.0) { - ShowSevereError(state, "Invalid " + cNumericFieldNames(1) + '=' + RoundSigDigits(rNumericArgs(1), 2)); + ShowSevereError(state, format("Invalid {}={:.2R}", cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "found rain water collection loss factor less than 0.0"); ErrorsFound = true; diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 029a335c239..937ef12b8a1 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -217,13 +217,20 @@ namespace WaterThermalTanks { } else { CompNum = CompIndex; if (CompNum > state.dataWaterThermalTanks->numWaterThermalTank || CompNum < 1) { - ShowFatalError(state, "SimWaterThermalTank_WaterTank: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Number of Units=" + General::TrimSigDigits(state.dataWaterThermalTanks->numWaterThermalTank) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimWaterThermalTank_WaterTank: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + CompNum, + state.dataWaterThermalTanks->numWaterThermalTank, + CompName)); } if (state.dataWaterThermalTanks->WaterThermalTank(CompNum).CheckWTTEquipName) { if (CompName != state.dataWaterThermalTanks->WaterThermalTank(CompNum).Name) { - ShowFatalError(state, "SimWaterThermalTank_WaterTank: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Unit name=" + CompName + ", stored Unit Name for that index=" + state.dataWaterThermalTanks->WaterThermalTank(CompNum).Name); + ShowFatalError( + state, + format("SimWaterThermalTank_WaterTank: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + CompNum, + CompName, + state.dataWaterThermalTanks->WaterThermalTank(CompNum).Name)); } state.dataWaterThermalTanks->WaterThermalTank(CompNum).CheckWTTEquipName = false; } @@ -250,13 +257,20 @@ namespace WaterThermalTanks { } else { CompNum = CompIndex; if (CompNum > state.dataWaterThermalTanks->numWaterThermalTank || CompNum < 1) { - ShowFatalError(state, "SimWaterThermalTank_HeatPump: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Number of Units=" + General::TrimSigDigits(state.dataWaterThermalTanks->numHeatPumpWaterHeater) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimWaterThermalTank_HeatPump: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + CompNum, + state.dataWaterThermalTanks->numHeatPumpWaterHeater, + CompName)); } if (state.dataWaterThermalTanks->HPWaterHeater(CompNum).CheckHPWHEquipName) { if (CompName != state.dataWaterThermalTanks->HPWaterHeater(CompNum).Name) { - ShowFatalError(state, "SimWaterThermalTank_HeatPump: Invalid CompIndex passed=" + General::TrimSigDigits(CompNum) + - ", Unit name=" + CompName + ", stored Unit Name for that index=" + state.dataWaterThermalTanks->HPWaterHeater(CompNum).Name); + ShowFatalError( + state, + format("SimWaterThermalTank_HeatPump: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + CompNum, + CompName, + state.dataWaterThermalTanks->HPWaterHeater(CompNum).Name)); } state.dataWaterThermalTanks->HPWaterHeater(CompNum).CheckHPWHEquipName = false; } @@ -535,8 +549,11 @@ namespace WaterThermalTanks { } else { HeatPumpNum = CompIndex; if (HeatPumpNum > state.dataWaterThermalTanks->numHeatPumpWaterHeater || HeatPumpNum < 1) { - ShowFatalError(state, "SimHeatPumpWaterHeater: Invalid CompIndex passed=" + General::TrimSigDigits(HeatPumpNum) + - ", Number of Units=" + General::TrimSigDigits(state.dataWaterThermalTanks->numHeatPumpWaterHeater) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimHeatPumpWaterHeater: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + HeatPumpNum, + state.dataWaterThermalTanks->numHeatPumpWaterHeater, + CompName)); } } @@ -704,9 +721,13 @@ namespace WaterThermalTanks { state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).DeadBandTempDiff = DataIPShortCuts::rNumericArgs(1); if (state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).DeadBandTempDiff <= 0.0 || state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).DeadBandTempDiff > 20.0) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + ": " + - DataIPShortCuts::cNumericFieldNames(1) + " must be > 0 and <= 20. " + DataIPShortCuts::cNumericFieldNames(1) + " = " + - General::TrimSigDigits(DataIPShortCuts::rNumericArgs(1), 1)); + ShowSevereError(state, + format("{} = {}: {} must be > 0 and <= 20. {} = {:.1T}", + DataIPShortCuts::cCurrentModuleObject, + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name, + DataIPShortCuts::cNumericFieldNames(1), + DataIPShortCuts::cNumericFieldNames(1), + DataIPShortCuts::rNumericArgs(1))); ErrorsFound = true; } @@ -741,8 +762,7 @@ namespace WaterThermalTanks { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + ", \"" + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + "\":"); ShowContinueError(state, "The " + DataIPShortCuts::cAlphaFieldNames(4) + " should be normalized "); - ShowContinueError(state, " to 1.0 at the rating point. Curve output at the rating point = " + - General::TrimSigDigits(HEffFTemp, 3)); + ShowContinueError(state, format(" to 1.0 at the rating point. Curve output at the rating point = {:.3T}", HEffFTemp)); ShowContinueError(state, " The simulation continues using the user-specified curve."); } } @@ -800,9 +820,12 @@ namespace WaterThermalTanks { state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff = DataIPShortCuts::rNumericArgs(2); if (state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff <= 0.0 || state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff > 0.9) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + ": " + - DataIPShortCuts::cNumericFieldNames(2) + " must be > 0.0 and <= 0.9, Efficiency = " + - General::TrimSigDigits(state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff, 3)); + ShowSevereError(state, + format("{} = {}: {} must be > 0.0 and <= 0.9, Efficiency = {:.3T}", + DataIPShortCuts::cCurrentModuleObject, + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name, + DataIPShortCuts::cNumericFieldNames(2), + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff)); ErrorsFound = true; } } // Blank Num(2) @@ -813,10 +836,13 @@ namespace WaterThermalTanks { state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff = DataIPShortCuts::rNumericArgs(2); if (state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff <= 0.0 || state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff > 0.3) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + ": " + - DataIPShortCuts::cNumericFieldNames(2) + " must be > 0.0 and <= 0.3, " + - DataIPShortCuts::cNumericFieldNames(2) + " = " + - General::TrimSigDigits(state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff, 3)); + ShowSevereError(state, + format("{} = {}: {} must be > 0.0 and <= 0.3, {} = {:.3T}", + DataIPShortCuts::cCurrentModuleObject, + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name, + DataIPShortCuts::cNumericFieldNames(2), + DataIPShortCuts::cNumericFieldNames(2), + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).HeatReclaimRecoveryEff)); ErrorsFound = true; } } // Blank Num(2) @@ -986,28 +1012,40 @@ namespace WaterThermalTanks { state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).OperatingWaterFlowRate = DataIPShortCuts::rNumericArgs(6); if (state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).OperatingWaterFlowRate <= 0.0) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + ": " + - DataIPShortCuts::cNumericFieldNames(6) + " must be greater than 0. " + DataIPShortCuts::cNumericFieldNames(6) + - " = " + General::TrimSigDigits(DataIPShortCuts::rNumericArgs(6), 6)); + ShowSevereError(state, + format("{} = {}: {} must be greater than 0. {} = {:.6T}", + DataIPShortCuts::cCurrentModuleObject, + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name, + DataIPShortCuts::cNumericFieldNames(6), + DataIPShortCuts::cNumericFieldNames(6), + DataIPShortCuts::rNumericArgs(6))); ErrorsFound = true; } state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).PumpElecPower = DataIPShortCuts::rNumericArgs(7); if (state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).PumpElecPower < 0.0) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + ": " + - DataIPShortCuts::cNumericFieldNames(7) + " must be >= 0. " + DataIPShortCuts::cNumericFieldNames(7) + " = " + - General::TrimSigDigits(DataIPShortCuts::rNumericArgs(7), 2)); + ShowSevereError(state, + format("{} = {}: {} must be >= 0. {} = {:.2T}", + DataIPShortCuts::cCurrentModuleObject, + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name, + DataIPShortCuts::cNumericFieldNames(7), + DataIPShortCuts::cNumericFieldNames(7), + DataIPShortCuts::rNumericArgs(7))); ErrorsFound = true; } if ((state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).PumpElecPower / state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).OperatingWaterFlowRate) > 7.9264e6) { - ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + " = " + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + ": " + - DataIPShortCuts::cNumericFieldNames(7) + " to " + DataIPShortCuts::cNumericFieldNames(6) + " ratio > 7.9264E6. " + - DataIPShortCuts::cNumericFieldNames(7) + " to " + DataIPShortCuts::cNumericFieldNames(6) + " = " + - General::TrimSigDigits((state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).PumpElecPower / - state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).OperatingWaterFlowRate), - 3)); + ShowWarningError(state, + format("{} = {}: {} to {} ratio > 7.9264E6. {} to {} = {:.3T}", + DataIPShortCuts::cCurrentModuleObject, + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name, + DataIPShortCuts::cNumericFieldNames(7), + DataIPShortCuts::cNumericFieldNames(6), + DataIPShortCuts::cNumericFieldNames(7), + DataIPShortCuts::cNumericFieldNames(6), + (state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).PumpElecPower / + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).OperatingWaterFlowRate))); ShowContinueError(state, " Suggest reducing " + DataIPShortCuts::cNumericFieldNames(7) + " or increasing " + DataIPShortCuts::cNumericFieldNames(6) + '.'); ShowContinueError(state, " The simulation will continue using the user defined values."); @@ -1016,25 +1054,37 @@ namespace WaterThermalTanks { state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).PumpFracToWater = DataIPShortCuts::rNumericArgs(8); if (state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).PumpFracToWater < 0.0 || state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).PumpFracToWater > 1.0) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + ": " + - DataIPShortCuts::cNumericFieldNames(8) + " must be >= 0 or <= 1. " + DataIPShortCuts::cNumericFieldNames(8) + " = " + - General::TrimSigDigits(DataIPShortCuts::rNumericArgs(8), 3)); + ShowSevereError(state, + format("{} = {}: {} must be >= 0 or <= 1. {} = {:.3T}", + DataIPShortCuts::cCurrentModuleObject, + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name, + DataIPShortCuts::cNumericFieldNames(8), + DataIPShortCuts::cNumericFieldNames(8), + DataIPShortCuts::rNumericArgs(8))); ErrorsFound = true; } state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).OnCycParaLoad = DataIPShortCuts::rNumericArgs(9); if (state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).OnCycParaLoad < 0.0) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + ": " + - DataIPShortCuts::cNumericFieldNames(9) + " must be >= 0. " + DataIPShortCuts::cNumericFieldNames(9) + " = " + - General::TrimSigDigits(DataIPShortCuts::rNumericArgs(9), 2)); + ShowSevereError(state, + format("{} = {}: {} must be >= 0. {} = {:.2T}", + DataIPShortCuts::cCurrentModuleObject, + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name, + DataIPShortCuts::cNumericFieldNames(9), + DataIPShortCuts::cNumericFieldNames(9), + DataIPShortCuts::rNumericArgs(9))); ErrorsFound = true; } state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).OffCycParaLoad = DataIPShortCuts::rNumericArgs(10); if (state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).OffCycParaLoad < 0.0) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name + ": " + - DataIPShortCuts::cNumericFieldNames(10) + " must be >= 0. " + DataIPShortCuts::cNumericFieldNames(10) + " = " + - General::TrimSigDigits(DataIPShortCuts::rNumericArgs(10), 2)); + ShowSevereError(state, + format("{} = {}: {} must be >= 0. {} = {:.2T}", + DataIPShortCuts::cCurrentModuleObject, + state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum).Name, + DataIPShortCuts::cNumericFieldNames(10), + DataIPShortCuts::cNumericFieldNames(10), + DataIPShortCuts::rNumericArgs(10))); ErrorsFound = true; } } @@ -1164,8 +1214,9 @@ namespace WaterThermalTanks { HPWH.DeadBandTempDiff = hpwhNumeric[1 + nNumericOffset]; if (HPWH.DeadBandTempDiff <= 0.0 || HPWH.DeadBandTempDiff > 20.0) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\", "); - ShowContinueError(state, hpwhNumericFieldNames[1 + nNumericOffset] + - " difference must be > 0 and <= 20. Dead band = " + General::TrimSigDigits(hpwhNumeric[1 + nNumericOffset], 1)); + ShowContinueError(state, + hpwhNumericFieldNames[1 + nNumericOffset] + + format(" difference must be > 0 and <= 20. Dead band = {:.1T}", hpwhNumeric[1 + nNumericOffset])); ErrorsFound = true; } @@ -1195,8 +1246,8 @@ namespace WaterThermalTanks { HPWH.OperatingWaterFlowRate = hpwhNumeric[2]; if (HPWH.OperatingWaterFlowRate <= 0.0 && hpwhNumeric[2] != DataGlobalConstants::AutoCalculate()) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\", "); - ShowContinueError(state, hpwhNumericFieldNames[2] + - " must be greater than 0. Condenser water flow rate = " + General::TrimSigDigits(hpwhNumeric[2], 6)); + ShowContinueError( + state, format("{} must be greater than 0. Condenser water flow rate = {:.6T}", hpwhNumericFieldNames[2], hpwhNumeric[2])); ErrorsFound = true; } @@ -1208,16 +1259,21 @@ namespace WaterThermalTanks { if (HPWH.WrappedCondenserBottomLocation < 0.0) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\", "); - ShowContinueError(state, hpwhNumericFieldNames[2] + " must be greater than 0. Condenser bottom location = " + - General::TrimSigDigits(HPWH.WrappedCondenserBottomLocation, 6)); + ShowContinueError(state, + format("{} must be greater than 0. Condenser bottom location = {:.6T}", + hpwhNumericFieldNames[2], + HPWH.WrappedCondenserBottomLocation)); ErrorsFound = true; } if (HPWH.WrappedCondenserBottomLocation >= HPWH.WrappedCondenserTopLocation) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\", "); - ShowContinueError(state, hpwhNumericFieldNames[3] + " (" + General::TrimSigDigits(HPWH.WrappedCondenserTopLocation, 6) + - ") must be greater than " + hpwhNumericFieldNames[2] + " (" + - General::TrimSigDigits(HPWH.WrappedCondenserBottomLocation, 6) + ")."); + ShowContinueError(state, + format("{} ({:.6T}) must be greater than {} ({:.6T}).", + HPWH.WrappedCondenserTopLocation, + hpwhNumericFieldNames[2], + hpwhNumericFieldNames[3], + HPWH.WrappedCondenserBottomLocation)); ErrorsFound = true; } @@ -1233,8 +1289,9 @@ namespace WaterThermalTanks { HPWH.OperatingAirFlowRate = hpwhNumeric[3 + nNumericOffset]; if (HPWH.OperatingAirFlowRate <= 0.0 && hpwhNumeric[3 + nNumericOffset] != DataGlobalConstants::AutoCalculate()) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\", "); - ShowContinueError(state, hpwhNumericFieldNames[3 + nNumericOffset] + " must be greater than 0. Evaporator air flow rate = " + - General::TrimSigDigits(hpwhNumeric[3 + nNumericOffset], 6)); + ShowContinueError(state, + hpwhNumericFieldNames[3 + nNumericOffset] + + format(" must be greater than 0. Evaporator air flow rate = {:.6T}", hpwhNumeric[3 + nNumericOffset])); ErrorsFound = true; } @@ -1461,7 +1518,7 @@ namespace WaterThermalTanks { if (HPWH.MinAirTempForHPOperation < -5) { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\": minimum inlet air temperature for heat pump compressor operation must be greater than or equal to -5 C."); - ShowContinueError(state, "...Minimum inlet air temperature = " + General::TrimSigDigits(hpwhNumeric[4 + nNumericOffset], 1)); + ShowContinueError(state, format("...Minimum inlet air temperature = {:.1T}", hpwhNumeric[4 + nNumericOffset])); } // Maximum Inlet Air Temperature for Compressor Operation @@ -1470,8 +1527,8 @@ namespace WaterThermalTanks { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\": maximum inlet air temperature for heat pump compressor operation"); ShowContinueError(state, "must be greater than the minimum inlet air temperature for heat pump compressor operation."); - ShowContinueError(state, "...Minimum inlet air temperature = " + General::TrimSigDigits(HPWH.MinAirTempForHPOperation, 1)); - ShowContinueError(state, "...Maximum inlet air temperature = " + General::TrimSigDigits(HPWH.MaxAirTempForHPOperation, 1)); + ShowContinueError(state, format("...Minimum inlet air temperature = {:.1T}", HPWH.MinAirTempForHPOperation)); + ShowContinueError(state, format("...Maximum inlet air temperature = {:.1T}", HPWH.MaxAirTempForHPOperation)); } // Compressor Location @@ -1570,8 +1627,11 @@ namespace WaterThermalTanks { if (FanVolFlow != DataSizing::AutoSize && !errFlag) { if (FanVolFlow < HPWH.OperatingAirFlowRate) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " - air flow rate = " + General::TrimSigDigits(FanVolFlow, 7) + - " in fan object " + HPWH.FanName + " is less than the HPWHs evaporator air flow rate."); + ShowSevereError(state, + format("{} - air flow rate = {:.7T} in fan object {} is less than the HPWHs evaporator air flow rate.", + DataIPShortCuts::cCurrentModuleObject, + FanVolFlow, + HPWH.FanName)); ShowContinueError(state, " The fan flow rate must be >= to the HPWHs evaporator volumetric air flow rate."); ShowContinueError(state, " Occurs in unit = " + HPWH.Name); ErrorsFound = true; @@ -1598,12 +1658,12 @@ namespace WaterThermalTanks { HPWH.DXCoilPLFFPLR = DXCoils::DXCoil(HPWH.DXCoilNum).PLFFPLR(1); // check the range of condenser pump power to be <= 5 gpm/ton if (DXCoils::DXCoil(HPWH.DXCoilNum).HPWHCondPumpElecNomPower / DXCoils::DXCoil(HPWH.DXCoilNum).RatedTotCap2 > 0.1422) { - ShowWarningError(state, + ShowWarningError( + state, DXCoils::DXCoil(HPWH.DXCoilNum).DXCoilType + "= " + DXCoils::DXCoil(HPWH.DXCoilNum).Name + - ": Rated condenser pump power per watt of rated heating capacity has exceeded the recommended maximum of 0.1422 W/W " - "(41.67 watt/MBH). Condenser pump power per watt = " + - General::TrimSigDigits( - (DXCoils::DXCoil(HPWH.DXCoilNum).HPWHCondPumpElecNomPower / DXCoils::DXCoil(HPWH.DXCoilNum).RatedTotCap2), 4)); + format(": Rated condenser pump power per watt of rated heating capacity has exceeded the recommended maximum of 0.1422 " + "W/W (41.67 watt/MBH). Condenser pump power per watt = {:.4T}", + (DXCoils::DXCoil(HPWH.DXCoilNum).HPWHCondPumpElecNomPower / DXCoils::DXCoil(HPWH.DXCoilNum).RatedTotCap2))); } } else if ((HPWH.DXCoilNum > 0) && (bIsVScoil)) { @@ -1634,8 +1694,9 @@ namespace WaterThermalTanks { HPWH.OnCycParaLoad = hpwhNumeric[6 + nNumericOffset]; if (HPWH.OnCycParaLoad < 0.0) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\","); - ShowContinueError(state, hpwhNumericFieldNames[6 + nNumericOffset] + " must be >= 0. " + hpwhNumericFieldNames[6 + nNumericOffset] + " = " + - General::TrimSigDigits(hpwhNumeric[6 + nNumericOffset], 2)); + ShowContinueError(state, + hpwhNumericFieldNames[6 + nNumericOffset] + " must be >= 0. " + hpwhNumericFieldNames[6 + nNumericOffset] + + format(" = {:.2T}", hpwhNumeric[6 + nNumericOffset])); ErrorsFound = true; } @@ -1643,8 +1704,9 @@ namespace WaterThermalTanks { HPWH.OffCycParaLoad = hpwhNumeric[7 + nNumericOffset]; if (HPWH.OffCycParaLoad < 0.0) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\","); - ShowContinueError(state, hpwhNumericFieldNames[7 + nNumericOffset] + " must be >= 0. " + hpwhNumericFieldNames[2 + nNumericOffset] + " = " + - General::TrimSigDigits(hpwhNumeric[7 + nNumericOffset], 2)); + ShowContinueError(state, + hpwhNumericFieldNames[7 + nNumericOffset] + " must be >= 0. " + hpwhNumericFieldNames[2 + nNumericOffset] + + format(" = {:.2T}", hpwhNumeric[7 + nNumericOffset])); ErrorsFound = true; } @@ -2733,8 +2795,8 @@ namespace WaterThermalTanks { if ((!Tank.HeightWasAutoSized) && (Tank.HeaterHeight1 > tankHeightForTesting)) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Heater 1 is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(7) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(7), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(7), DataIPShortCuts::rNumericArgs(7))); ErrorsFound = true; } @@ -2763,8 +2825,8 @@ namespace WaterThermalTanks { if ((!Tank.HeightWasAutoSized) && (Tank.HeaterHeight2 > tankHeightForTesting)) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Heater 2 is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(10) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(10), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); ErrorsFound = true; } @@ -2940,8 +3002,8 @@ namespace WaterThermalTanks { if ((!Tank.HeightWasAutoSized) && (Tank.UseInletHeight > Tank.Height)) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Use inlet is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(24) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(24), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(24), DataIPShortCuts::rNumericArgs(24))); ErrorsFound = true; } @@ -2957,8 +3019,8 @@ namespace WaterThermalTanks { if ((!Tank.HeightWasAutoSized) && (Tank.UseOutletHeight > Tank.Height)) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Use outlet is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(25) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(25), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(25), DataIPShortCuts::rNumericArgs(25))); ErrorsFound = true; } @@ -2985,8 +3047,8 @@ namespace WaterThermalTanks { if ((!Tank.HeightWasAutoSized) && (Tank.SourceInletHeight > Tank.Height)) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Source inlet is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(27) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(27), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(27), DataIPShortCuts::rNumericArgs(27))); ErrorsFound = true; } @@ -2999,8 +3061,8 @@ namespace WaterThermalTanks { if ((!Tank.HeightWasAutoSized) && (Tank.SourceOutletHeight > Tank.Height)) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Source outlet is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(28) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(28), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(28), DataIPShortCuts::rNumericArgs(28))); ErrorsFound = true; } @@ -3633,8 +3695,8 @@ namespace WaterThermalTanks { if (Tank.UseInletHeight > Tank.Height) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Use inlet is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(10) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(10), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); ErrorsFound = true; } @@ -3642,8 +3704,8 @@ namespace WaterThermalTanks { if (Tank.UseOutletHeight > Tank.Height) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Use outlet is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(11) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(11), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(11), DataIPShortCuts::rNumericArgs(11))); ErrorsFound = true; } @@ -3658,8 +3720,8 @@ namespace WaterThermalTanks { if (Tank.SourceInletHeight > Tank.Height) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Source inlet is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(14) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(14), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(14), DataIPShortCuts::rNumericArgs(14))); ErrorsFound = true; } @@ -3670,8 +3732,8 @@ namespace WaterThermalTanks { if (Tank.SourceOutletHeight > Tank.Height) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": Source outlet is located higher than overall tank height."); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(2) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 4)); - ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(15) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(15), 4)); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); + ShowContinueError(state, format("{} = {:.4R}", DataIPShortCuts::cNumericFieldNames(15), DataIPShortCuts::rNumericArgs(15))); ErrorsFound = true; } @@ -4030,9 +4092,11 @@ namespace WaterThermalTanks { // check that water heater source side effectiveness is greater than 0 if (Tank.SourceEffectiveness <= 0.0) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = " + HPWH.Name + - ": Invalid source side effectiveness for heat pump water heater = " + - General::TrimSigDigits(Tank.SourceEffectiveness, 3)); + ShowSevereError(state, + format("{} = {}: Invalid source side effectiveness for heat pump water heater = {:.3T}", + DataIPShortCuts::cCurrentModuleObject, + HPWH.Name, + Tank.SourceEffectiveness)); ShowContinueError(state, " water heater source effectiveness will default to 1.0 and simulation continues."); Tank.SourceEffectiveness = 1.0; } @@ -4646,7 +4710,8 @@ namespace WaterThermalTanks { if (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankStratified) { for (int NodeNum = 1; NodeNum <= this->Nodes; ++NodeNum) { - SetupOutputVariable(state, "Chilled Water Thermal Storage Temperature Node " + General::TrimSigDigits(NodeNum) + "", + SetupOutputVariable(state, + format("Chilled Water Thermal Storage Temperature Node {}", NodeNum), OutputProcessor::Unit::C, this->Node(NodeNum).TempAvg, "System", @@ -4655,7 +4720,8 @@ namespace WaterThermalTanks { } for (int NodeNum = 1; NodeNum <= this->Nodes; ++NodeNum) { - SetupOutputVariable(state, "Chilled Water Thermal Storage Final Temperature Node " + General::TrimSigDigits(NodeNum) + "", + SetupOutputVariable(state, + format("Chilled Water Thermal Storage Final Temperature Node {}", NodeNum), OutputProcessor::Unit::C, this->Node(NodeNum).Temp, "System", @@ -5037,7 +5103,8 @@ namespace WaterThermalTanks { "Water Heater Heater 2 Runtime Fraction", OutputProcessor::Unit::None, this->RuntimeFraction2, "System", "Average", this->Name); for (int NodeNum = 1; NodeNum <= this->Nodes; ++NodeNum) { - SetupOutputVariable(state, "Water Heater Temperature Node " + General::TrimSigDigits(NodeNum), + SetupOutputVariable(state, + format("Water Heater Temperature Node {}", NodeNum), OutputProcessor::Unit::C, this->Node(NodeNum).TempAvg, "System", @@ -5046,7 +5113,8 @@ namespace WaterThermalTanks { } for (int NodeNum = 1; NodeNum <= this->Nodes; ++NodeNum) { - SetupOutputVariable(state, "Water Heater Final Temperature Node " + General::TrimSigDigits(NodeNum), + SetupOutputVariable(state, + format("Water Heater Final Temperature Node {}", NodeNum), OutputProcessor::Unit::C, this->Node(NodeNum).Temp, "System", @@ -5481,12 +5549,10 @@ namespace WaterThermalTanks { if (TankChangeRateScale < 60.0) { // nominal change over in less than one minute ShowSevereError(state, "InitWaterThermalTank: Detected problem for stratified tank model. Model cannot be applied."); ShowContinueError(state, "Occurs for stratified tank name = " + this->Name); - ShowContinueError(state, "Tank volume = " + General::RoundSigDigits(this->Volume, 4) + " [m3]"); - ShowContinueError(state, "Tank use side volume flow rate = " + General::RoundSigDigits(this->UseDesignVolFlowRate, 4) + - " [m3/s]"); - ShowContinueError(state, "Tank source side volume flow rate = " + General::RoundSigDigits(this->SourceDesignVolFlowRate, 4) + - " [m3/s]"); - ShowContinueError(state, "Nominal tank change over rate = " + General::RoundSigDigits(TankChangeRateScale, 2) + " [s]"); + ShowContinueError(state, format("Tank volume = {:.4R} [m3]", this->Volume)); + ShowContinueError(state, format("Tank use side volume flow rate = {:.4R} [m3/s]", this->UseDesignVolFlowRate)); + ShowContinueError(state, format("Tank source side volume flow rate = {:.4R} [m3/s]", this->SourceDesignVolFlowRate)); + ShowContinueError(state, format("Nominal tank change over rate = {:.2R} [s]", TankChangeRateScale)); ShowContinueError(state, "Change over rate is too fast, increase tank volume, decrease connection flow rates or use mixed tank model"); @@ -5687,8 +5753,10 @@ namespace WaterThermalTanks { if (this->ShowSetPointWarning) { ShowSevereError(state, "Water heater = " + this->Name + ": Water heater tank set point temperature is greater than the maximum tank temperature limit."); - ShowContinueErrorTimeStamp(state, "Water heater tank set point temperature is reset to Tank Temperature Limit minus 1 C (" + - General::TrimSigDigits(this->SetPointTemp, 2) + ") and simulation continues."); + ShowContinueErrorTimeStamp(state, + format("Water heater tank set point temperature is reset to Tank Temperature Limit minus 1 C " + "({:.2T}) and simulation continues.", + this->SetPointTemp)); this->ShowSetPointWarning = false; } } @@ -5700,8 +5768,10 @@ namespace WaterThermalTanks { if (this->ShowSetPointWarning) { ShowSevereError(state, "Chilled Water Tank = " + this->Name + ": Water heater tank set point temperature is lower than the minimum tank temperature limit."); - ShowContinueErrorTimeStamp(state, "Chilled water tank set point temperature is reset to Tank Temperature Limit plus 1 C (" + - General::TrimSigDigits(this->SetPointTemp, 2) + ") and simulation continues."); + ShowContinueErrorTimeStamp(state, + format("Chilled water tank set point temperature is reset to Tank Temperature Limit plus 1 C " + "({:.2T}) and simulation continues.", + this->SetPointTemp)); this->ShowSetPointWarning = false; } } @@ -5758,8 +5828,9 @@ namespace WaterThermalTanks { "Heat Pump Water Heater = " + state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).Name + ": Heat Pump water heater set point temperature is equal to or greater than the maximum tank temperature limit."); ShowContinueErrorTimeStamp(state, - "Heat Pump water heater tank set point temperature is reset to Tank Temperature Limit minus 1 C (" + - General::TrimSigDigits(state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).SetPointTemp, 2) + ") and simulation continues."); + format("Heat Pump water heater tank set point temperature is reset to Tank Temperature Limit " + "minus 1 C ({:.2T}) and simulation continues.", + state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).SetPointTemp)); state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).ShowSetPointWarning = false; } } @@ -6048,11 +6119,12 @@ namespace WaterThermalTanks { state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHAirVolFlowRate(state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed)) { // but this is the not the scaled mas flow // if ( FanVolFlow < HPWaterHeater( HPNum ).HPWHAirVolFlowRate( HPWaterHeater( HPNum ).NumofSpeed ) ) { - ShowWarningError(state, "InitWaterThermalTank: -air flow rate = " + General::TrimSigDigits(FanVolFlow, 7) + - " in fan object " - " is less than the MSHP system air flow rate" - " when waterheating is required(" + - General::TrimSigDigits(state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHAirVolFlowRate(state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed), 7) + ")."); + ShowWarningError(state, + format("InitWaterThermalTank: -air flow rate = {:.7T} in fan object is less than the MSHP system air flow rate " + "when waterheating is required({:.7T}).", + FanVolFlow, + state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHAirVolFlowRate( + state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed))); ShowContinueError(state, " The MSHP system flow rate when waterheating is required is reset to the" " fan flow rate and the simulation continues."); ShowContinueError(state, " Occurs in " + state.dataWaterThermalTanks->HPWaterHeater(HPNum).Name); @@ -6060,9 +6132,10 @@ namespace WaterThermalTanks { // Check flow rates in other speeds and ensure flow rates are not above the max flow rate for (int Iter = state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed - 1; Iter >= 1; --Iter) { if (state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHAirVolFlowRate(Iter) > state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHAirVolFlowRate(Iter + 1)) { - ShowContinueError(state, " The MSHP system flow rate when waterheating is required is reset to the" - " flow rate at higher speed and the simulation continues at Speed" + - General::TrimSigDigits(Iter) + '.'); + ShowContinueError(state, + format(" The MSHP system flow rate when waterheating is required is reset to the flow rate at higher " + "speed and the simulation continues at Speed{}.", + Iter)); ShowContinueError(state, " Occurs in " + state.dataWaterThermalTanks->HPWaterHeater(HPNum).Name); state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHAirVolFlowRate(Iter) = state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHAirVolFlowRate(Iter + 1); } @@ -6672,9 +6745,13 @@ namespace WaterThermalTanks { // Warn for potential freezing when avg of final temp over all nodes is below 2°C (nearing 0°C) if (this->TankTemp < 2) { if (this->FreezingErrorIndex == 0) { - ShowWarningError(state, RoutineName + ": " + this->Type + " = '" + this->Name + - "': Temperature of tank < 2C indicates of possibility of freeze. Tank Temperature = " + - General::RoundSigDigits(this->TankTemp, 2) + " C."); + ShowWarningError( + state, + format("{}: {} = '{}': Temperature of tank < 2C indicates of possibility of freeze. Tank Temperature = {:.2R} C.", + RoutineName, + this->Type, + this->Name, + this->TankTemp)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, this->Type + " = '" + this->Name + "': Temperature of tank < 2C indicates of possibility of freeze", @@ -7539,9 +7616,13 @@ namespace WaterThermalTanks { // Warn for potential freezing when avg of final temp over all nodes is below 2°C (nearing 0°C) if (this->TankTemp < 2) { if (this->FreezingErrorIndex == 0) { - ShowWarningError(state, RoutineName + ": " + this->Type + " = '" + this->Name + - "': Temperature of tank < 2C indicates of possibility of freeze. Tank Temperature = " + - General::RoundSigDigits(this->TankTemp, 2) + " C."); + ShowWarningError( + state, + format("{}: {} = '{}': Temperature of tank < 2C indicates of possibility of freeze. Tank Temperature = {:.2R} C.", + RoutineName, + this->Type, + this->Name, + this->TankTemp)); ShowContinueErrorTimeStamp(state, ""); } ShowRecurringWarningErrorAtEnd(state, this->Type + " = '" + this->Name + "': Temperature of tank < 2C indicates of possibility of freeze", @@ -7869,7 +7950,7 @@ namespace WaterThermalTanks { ShowWarningError(state, DesupHtr.Type + " \"" + DesupHtr.Name + "\": Water heater tank set point temperature is greater than or equal to the cut-in temperature of the " "desuperheater. Desuperheater will be disabled."); - ShowContinueErrorTimeStamp(state, " ...Desuperheater cut-in temperature = " + General::RoundSigDigits(MinTemp, 2)); + ShowContinueErrorTimeStamp(state, format(" ...Desuperheater cut-in temperature = {:.2R}", MinTemp)); } else { ShowRecurringWarningErrorAtEnd(state, DesupHtr.Type + " \"" + DesupHtr.Name + "\": Water heater tank set point temperature is greater than or equal to the cut-in " @@ -8031,8 +8112,10 @@ namespace WaterThermalTanks { if (DesupHtr.IterLimitExceededNum1 == 1) { ShowWarningError(state, DesupHtr.Type + " \"" + DesupHtr.Name + "\""); ShowContinueError(state, - "Iteration limit exceeded calculating desuperheater unit part-load ratio, maximum iterations = " + - IterNum + ". Part-load ratio returned = " + General::RoundSigDigits(partLoadRatio, 3)); + format("Iteration limit exceeded calculating desuperheater unit part-load ratio, " + "maximum iterations = {}. Part-load ratio returned = {:.3R}", + IterNum, + partLoadRatio)); ShowContinueErrorTimeStamp(state, "This error occurred in heating mode."); } else { ShowRecurringWarningErrorAtEnd(state, DesupHtr.Type + " \"" + DesupHtr.Name + @@ -8053,9 +8136,10 @@ namespace WaterThermalTanks { ++DesupHtr.RegulaFalsiFailedNum1; if (DesupHtr.RegulaFalsiFailedNum1 == 1) { ShowWarningError(state, DesupHtr.Type + " \"" + DesupHtr.Name + "\""); - ShowContinueError(state, "Desuperheater unit part-load ratio calculation failed: PLR limits of 0 to 1 exceeded. " - "Part-load ratio used = " + - General::RoundSigDigits(partLoadRatio, 3)); + ShowContinueError(state, + format("Desuperheater unit part-load ratio calculation failed: PLR limits of 0 to 1 " + "exceeded. Part-load ratio used = {:.3R}", + partLoadRatio)); ShowContinueError(state, "Please send this information to the EnergyPlus support group."); ShowContinueErrorTimeStamp(state, "This error occurred in heating mode."); } else { @@ -8148,8 +8232,10 @@ namespace WaterThermalTanks { if (DesupHtr.IterLimitExceededNum2 == 1) { ShowWarningError(state, DesupHtr.Type + " \"" + DesupHtr.Name + "\""); ShowContinueError(state, - "Iteration limit exceeded calculating desuperheater unit part-load ratio, maximum iterations = " + - IterNum + ". Part-load ratio returned = " + General::RoundSigDigits(partLoadRatio, 3)); + format("Iteration limit exceeded calculating desuperheater unit part-load ratio, " + "maximum iterations = {}. Part-load ratio returned = {:.3R}", + IterNum, + partLoadRatio)); ShowContinueErrorTimeStamp(state, "This error occurred in float mode."); } else { ShowRecurringWarningErrorAtEnd(state, DesupHtr.Type + " \"" + DesupHtr.Name + @@ -8169,9 +8255,9 @@ namespace WaterThermalTanks { if (DesupHtr.RegulaFalsiFailedNum2 == 1) { ShowWarningError(state, DesupHtr.Type + " \"" + DesupHtr.Name + "\""); ShowContinueError(state, - "Desuperheater unit part-load ratio calculation failed: PLR limits of 0 to 1 exceeded. " - "Part-load ratio used = " + - General::RoundSigDigits(partLoadRatio, 3)); + format("Desuperheater unit part-load ratio calculation failed: PLR limits of 0 to " + "1 exceeded. Part-load ratio used = {:.3R}", + partLoadRatio)); ShowContinueError(state, "Please send this information to the EnergyPlus support group."); ShowContinueErrorTimeStamp(state, "This error occurred in float mode."); } else { @@ -8860,8 +8946,10 @@ namespace WaterThermalTanks { if (HeatPump.IterLimitExceededNum2 == 1) { ShowWarningError(state, HeatPump.Type + " \"" + HeatPump.Name + "\""); ShowContinueError(state, - "Iteration limit exceeded calculating heat pump water heater compressor part-load ratio, maximum iterations = " + - IterNum + ". Part-load ratio returned = " + General::RoundSigDigits(state.dataWaterThermalTanks->hpPartLoadRatio, 3)); + format("Iteration limit exceeded calculating heat pump water heater compressor part-load ratio, " + "maximum iterations = {}. Part-load ratio returned = {:.3R}", + IterNum, + state.dataWaterThermalTanks->hpPartLoadRatio)); ShowContinueErrorTimeStamp(state, "This error occurred in float mode."); } else { ShowRecurringWarningErrorAtEnd(state, @@ -8878,9 +8966,10 @@ namespace WaterThermalTanks { ++HeatPump.RegulaFalsiFailedNum2; if (HeatPump.RegulaFalsiFailedNum2 == 1) { ShowWarningError(state, HeatPump.Type + " \"" + HeatPump.Name + "\""); - ShowContinueError(state, "Heat pump water heater compressor part-load ratio calculation failed: PLR limits of 0 to 1 " - "exceeded. Part-load ratio used = " + - General::RoundSigDigits(state.dataWaterThermalTanks->hpPartLoadRatio, 3)); + ShowContinueError(state, + format("Heat pump water heater compressor part-load ratio calculation failed: PLR limits of 0 to 1 " + "exceeded. Part-load ratio used = {:.3R}", + state.dataWaterThermalTanks->hpPartLoadRatio)); ShowContinueError(state, "Please send this information to the EnergyPlus support group."); ShowContinueErrorTimeStamp(state, "This error occurred in float mode."); } else { @@ -9050,9 +9139,11 @@ namespace WaterThermalTanks { ++HeatPump.IterLimitExceededNum1; if (HeatPump.IterLimitExceededNum1 == 1) { ShowWarningError(state, HeatPump.Type + " \"" + HeatPump.Name + "\""); - ShowContinueError(state, "Iteration limit exceeded calculating heat pump water heater speed" - " speed ratio ratio, maximum iterations = " + - IterNum + ". speed ratio returned = " + General::RoundSigDigits(SpeedRatio, 3)); + ShowContinueError(state, + format("Iteration limit exceeded calculating heat pump water heater speed speed ratio ratio, " + "maximum iterations = {}. speed ratio returned = {:.3R}", + IterNum, + SpeedRatio)); ShowContinueErrorTimeStamp(state, "This error occurred in heating mode."); } else { ShowRecurringWarningErrorAtEnd(state, @@ -9069,9 +9160,10 @@ namespace WaterThermalTanks { ++HeatPump.RegulaFalsiFailedNum1; if (HeatPump.RegulaFalsiFailedNum1 == 1) { ShowWarningError(state, HeatPump.Type + " \"" + HeatPump.Name + "\""); - ShowContinueError(state, "Heat pump water heater speed ratio calculation failed: speed ratio limits " - "of 0 to 1 exceeded. speed ratio used = " + - General::RoundSigDigits(SpeedRatio, 3)); + ShowContinueError(state, + format("Heat pump water heater speed ratio calculation failed: speed ratio limits of 0 to 1 " + "exceeded. speed ratio used = {:.3R}", + SpeedRatio)); ShowContinueError(state, "Please send this information to the EnergyPlus support group."); ShowContinueErrorTimeStamp(state, "This error occurred in heating mode."); } else { diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index 799d629be23..4b480f828eb 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -134,7 +134,6 @@ namespace WaterToAirHeatPump { // Using/Aliasing using FluidProperties::FindGlycol; - using General::TrimSigDigits; // shut off after compressor cycle off [s] // cycling fan/cycling compressor @@ -160,13 +159,20 @@ namespace WaterToAirHeatPump { } else { HPNum = CompIndex; if (HPNum > state.dataWaterToAirHeatPump->NumWatertoAirHPs || HPNum < 1) { - ShowFatalError(state, "SimWatertoAirHP: Invalid CompIndex passed=" + TrimSigDigits(HPNum) + - ", Number of Water to Air HPs=" + TrimSigDigits(state.dataWaterToAirHeatPump->NumWatertoAirHPs) + ", WaterToAir HP name=" + CompName); + ShowFatalError(state, + format("SimWatertoAirHP: Invalid CompIndex passed={}, Number of Water to Air HPs={}, WaterToAir HP name={}", + HPNum, + state.dataWaterToAirHeatPump->NumWatertoAirHPs, + CompName)); } if (state.dataWaterToAirHeatPump->CheckEquipName(HPNum)) { if (!CompName.empty() && CompName != state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name) { - ShowFatalError(state, "SimWatertoAirHP: Invalid CompIndex passed=" + TrimSigDigits(HPNum) + ", WaterToAir HP name=" + CompName + - ", stored WaterToAir HP Name for that index=" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name); + ShowFatalError( + state, + format("SimWatertoAirHP: Invalid CompIndex passed={}, WaterToAir HP name={}, stored WaterToAir HP Name for that index={}", + HPNum, + CompName, + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name)); } state.dataWaterToAirHeatPump->CheckEquipName(HPNum) = false; } @@ -1051,7 +1057,7 @@ namespace WaterToAirHeatPump { // Using/Aliasing using namespace FluidProperties; using DataPlant::PlantLoop; - using General::RoundSigDigits; + using General::SolveRoot; using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; // ,PsyHFnTdbRhPb,PsyWFnTdpPb @@ -1414,8 +1420,9 @@ namespace WaterToAirHeatPump { if (LoadSidePressure < LowPressCutoff && !FirstHVACIteration) { if (!state.dataGlobal->WarmupFlag) { - ShowRecurringWarningErrorAtEnd(state, "WaterToAir Heat pump:cooling [" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + - "] shut off on low pressure < " + RoundSigDigits(LowPressCutoff, 0), + ShowRecurringWarningErrorAtEnd(state, format("WaterToAir Heat pump:cooling [{}] shut off on low pressure < {:.0R}", + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name, + LowPressCutoff), state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LowPressClgError, LoadSidePressure, LoadSidePressure, @@ -1429,8 +1436,9 @@ namespace WaterToAirHeatPump { if (SourceSidePressure > HighPressCutoff && !FirstHVACIteration) { if (!state.dataGlobal->WarmupFlag) { - ShowRecurringWarningErrorAtEnd(state, "WaterToAir Heat pump:cooling [" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + - "] shut off on high pressure > " + RoundSigDigits(HighPressCutoff, 0), + ShowRecurringWarningErrorAtEnd(state, format("WaterToAir Heat pump:cooling [{}] shut off on high pressure > {:.0R}", + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name, + HighPressCutoff), state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).HighPressClgError, SourceSideInletTemp, SourceSideInletTemp, @@ -1722,7 +1730,7 @@ namespace WaterToAirHeatPump { using Psychrometrics::PsyWFnTdbH; // USE DataZoneEnergyDemands using DataPlant::PlantLoop; - using General::RoundSigDigits; + using General::SolveRoot; // Locals @@ -1944,8 +1952,9 @@ namespace WaterToAirHeatPump { LoadSidePressure = GetSatPressureRefrig(state, Refrigerant, LoadSideTemp, state.dataWaterToAirHeatPump->RefrigIndex, RoutineNameLoadSideTemp); if (SourceSidePressure < LowPressCutoff && !FirstHVACIteration) { if (!state.dataGlobal->WarmupFlag) { - ShowRecurringWarningErrorAtEnd(state, "WaterToAir Heat pump:heating [" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + "] shut off on low pressure < " + - RoundSigDigits(LowPressCutoff, 0), + ShowRecurringWarningErrorAtEnd(state, format("WaterToAir Heat pump:heating [{}] shut off on low pressure < {:.0R}", + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name, + LowPressCutoff), state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LowPressHtgError, SourceSidePressure, SourceSidePressure, @@ -1959,8 +1968,9 @@ namespace WaterToAirHeatPump { if (LoadSidePressure > HighPressCutoff && !FirstHVACIteration) { if (!state.dataGlobal->WarmupFlag) { - ShowRecurringWarningErrorAtEnd(state, "WaterToAir Heat pump:heating [" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + - "] shut off on high pressure > " + RoundSigDigits(HighPressCutoff, 0), + ShowRecurringWarningErrorAtEnd(state, format("WaterToAir Heat pump:heating [{}] shut off on high pressure > {:.0R}", + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name, + HighPressCutoff), state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).HighPressHtgError, SourceSideInletTemp, SourceSideInletTemp, diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index f84d1a63dfe..b075b440dbf 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -169,7 +169,6 @@ namespace WaterToAirHeatPumpSimple { // Using/Aliasing using FluidProperties::FindGlycol; - using General::TrimSigDigits; // percent on-time (on-time/cycle time) // shut off after compressor cycle off [s] @@ -196,12 +195,19 @@ namespace WaterToAirHeatPumpSimple { } else { HPNum = CompIndex; if (HPNum > state.dataWaterToAirHeatPumpSimple->NumWatertoAirHPs || HPNum < 1) { - ShowFatalError(state, "SimWatertoAirHPSimple: Invalid CompIndex passed=" + TrimSigDigits(HPNum) + - ", Number of Water to Air HPs=" + TrimSigDigits(state.dataWaterToAirHeatPumpSimple->NumWatertoAirHPs) + ", WaterToAir HP name=" + CompName); + ShowFatalError(state, + format("SimWatertoAirHPSimple: Invalid CompIndex passed={}, Number of Water to Air HPs={}, WaterToAir HP name={}", + HPNum, + state.dataWaterToAirHeatPumpSimple->NumWatertoAirHPs, + CompName)); } if (!CompName.empty() && CompName != state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name) { - ShowFatalError(state, "SimWatertoAirHPSimple: Invalid CompIndex passed=" + TrimSigDigits(HPNum) + ", WaterToAir HP name=" + CompName + - ", stored WaterToAir HP Name for that index=" + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name); + ShowFatalError( + state, + format("SimWatertoAirHPSimple: Invalid CompIndex passed={}, WaterToAir HP name={}, stored WaterToAir HP Name for that index={}", + HPNum, + CompName, + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name)); } } @@ -1096,8 +1102,7 @@ namespace WaterToAirHeatPumpSimple { using DataHVACGlobals::SmallAirVolFlow; using DataHVACGlobals::SmallLoad; using DataPlant::PlantLoop; - using General::RoundSigDigits; - using General::TrimSigDigits; + using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::RegisterPlantCompDesignFlow; using namespace OutputReportPredefined; @@ -1261,10 +1266,9 @@ namespace WaterToAirHeatPumpSimple { ShowMessage(state, "SizeHVACWaterToAir: Potential issue with equipment sizing for coil " + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WatertoAirHPType + ":WATERTOAIRHEATPUMP:EQUATIONFIT \"" + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name + "\""); - ShowContinueError(state, "User-Specified Rated Air Volume Flow Rate of " + RoundSigDigits(RatedAirVolFlowRateUser, 5) + - " [m3/s]"); - ShowContinueError(state, "differs from Design Size Rated Air Volume Flow Rate of " + RoundSigDigits(RatedAirVolFlowRateDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Rated Air Volume Flow Rate of {:.5R} [m3/s]", RatedAirVolFlowRateUser)); + ShowContinueError(state, + format("differs from Design Size Rated Air Volume Flow Rate of {:.5R} [m3/s]", RatedAirVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1702,10 +1706,9 @@ namespace WaterToAirHeatPumpSimple { ShowMessage(state, "SizeHVACWaterToAir: Potential issue with equipment sizing for coil " + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WatertoAirHPType + ":WATERTOAIRHEATPUMP:EQUATIONFIT \"" + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name + "\""); - ShowContinueError(state, "User-Specified Rated Total Cooling Capacity of " + RoundSigDigits(RatedCapCoolTotalUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Rated Total Cooling Capacity of " + - RoundSigDigits(RatedCapCoolTotalDes, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Rated Total Cooling Capacity of {:.2R} [W]", RatedCapCoolTotalUser)); + ShowContinueError( + state, format("differs from Design Size Rated Total Cooling Capacity of {:.2R} [W]", RatedCapCoolTotalDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1757,10 +1760,10 @@ namespace WaterToAirHeatPumpSimple { ShowMessage(state, "SizeHVACWaterToAir: Potential issue with equipment sizing for coil " + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WatertoAirHPType + ":WATERTOAIRHEATPUMP:EQUATIONFIT \"" + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name + "\""); - ShowContinueError(state, "User-Specified Rated Sensible Cooling Capacity of " + RoundSigDigits(RatedCapCoolSensUser, 2) + - " [W]"); - ShowContinueError(state, "differs from Design Size Rated Sensible Cooling Capacity of " + - RoundSigDigits(RatedCapCoolSensDes, 2) + " [W]"); + ShowContinueError(state, + format("User-Specified Rated Sensible Cooling Capacity of {:.2R} [W]", RatedCapCoolSensUser)); + ShowContinueError( + state, format("differs from Design Size Rated Sensible Cooling Capacity of {:.2R} [W]", RatedCapCoolSensDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1779,22 +1782,26 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name + "\""); ShowContinueError(state, RoutineName + ": Rated Sensible Cooling Capacity > Rated Total Cooling Capacity"); ShowContinueError(state, "Each of these capacity inputs have been autosized."); - ShowContinueError(state, "Rated Sensible Cooling Capacity = " + TrimSigDigits(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens, 2) + " W"); - ShowContinueError(state, "Rated Total Cooling Capacity = " + TrimSigDigits(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal, 2) + " W"); + ShowContinueError(state, + format("Rated Sensible Cooling Capacity = {:.2T} W", + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens)); + ShowContinueError(state, + format("Rated Total Cooling Capacity = {:.2T} W", + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal)); ShowContinueError(state, "See eio file for further details."); ShowContinueError(state, "Check Total and Sensible Cooling Capacity Coefficients to ensure they are accurate."); ShowContinueError(state, "Check Zone and System Sizing objects to verify sizing inputs."); ShowContinueError(state, "Sizing statistics:"); - ShowContinueError(state, "Entering Air Dry-Bulb Temperature = " + TrimSigDigits(MixTemp, 3) + " C"); - ShowContinueError(state, "Entering Air Wet-Bulb Temperature = " + TrimSigDigits(MixWetBulb, 3) + " C"); + ShowContinueError(state, format("Entering Air Dry-Bulb Temperature = {:.3T} C", MixTemp)); + ShowContinueError(state, format("Entering Air Wet-Bulb Temperature = {:.3T} C", MixWetBulb)); ShowContinueError(state, "Entering Condenser Water Temperature used = 24.4444 C"); ShowContinueError(state, "Used design air and water flow rates (i.e., used 1 for ratioVL and ratioVS)"); - ShowContinueError(state, "ratioTDB = " + TrimSigDigits(((MixTemp + 283.15) / 273.15), 3)); - ShowContinueError(state, "ratioTWB = " + TrimSigDigits(((MixWetBulb + 283.15) / 273.15), 3)); - ShowContinueError(state, "ratioTS = " + TrimSigDigits(((85.0 + 283.15) / 273.15), 3)); - ShowContinueError(state, "Sensible Cooling Capacity Modifier = " + TrimSigDigits(SensCapTempModFac, 5)); + ShowContinueError(state, format("ratioTDB = {:.3T}", ((MixTemp + 283.15) / 273.15))); + ShowContinueError(state, format("ratioTWB = {:.3T}", ((MixWetBulb + 283.15) / 273.15))); + ShowContinueError(state, format("ratioTS = {:.3T}", ((85.0 + 283.15) / 273.15))); + ShowContinueError(state, format("Sensible Cooling Capacity Modifier = {:.5T}", SensCapTempModFac)); ShowContinueError(state, "...Rated Sensible Cooling Capacity = Sensible Design Load / Sensible Cooling Capacity Modifier"); - ShowContinueError(state, "Total Cooling Capacity Modifier = " + TrimSigDigits(TotCapTempModFac, 5)); + ShowContinueError(state, format("Total Cooling Capacity Modifier = {:.5T}", TotCapTempModFac)); ShowContinueError(state, "...Rated Total Cooling Capacity = Total Design Load / Total Cooling Capacity Modifier"); ShowContinueError(state, "Carefully review the Load Side Total, Sensible, and Latent heat transfer rates"); ShowContinueError(state, "... to ensure they meet the expected manufacturers performance specifications."); @@ -1805,18 +1812,22 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name + "\""); ShowContinueError(state, RoutineName + ": Rated Sensible Cooling Capacity > Rated Total Cooling Capacity"); ShowContinueError(state, "Only the rated total capacity input is autosized, consider autosizing both inputs."); - ShowContinueError(state, "Rated Sensible Cooling Capacity = " + TrimSigDigits(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens, 2) + " W"); - ShowContinueError(state, "Rated Total Cooling Capacity = " + TrimSigDigits(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal, 2) + " W"); + ShowContinueError(state, + format("Rated Sensible Cooling Capacity = {:.2T} W", + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens)); + ShowContinueError(state, + format("Rated Total Cooling Capacity = {:.2T} W", + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal)); ShowContinueError(state, "See eio file for further details."); ShowContinueError(state, "Check Total and Sensible Cooling Capacity Coefficients to ensure they are accurate."); ShowContinueError(state, "Check Zone and System Sizing objects to verify sizing inputs."); ShowContinueError(state, "Sizing statistics for Total Cooling Capacity:"); - ShowContinueError(state, "Entering Air Wet-Bulb Temperature = " + TrimSigDigits(MixWetBulb, 3) + " C"); + ShowContinueError(state, format("Entering Air Wet-Bulb Temperature = {:.3T} C", MixWetBulb)); ShowContinueError(state, "Entering Condenser Water Temperature used = 24.4444 C"); ShowContinueError(state, "Used design air and water flow rates (i.e., used 1 for ratioVL and ratioVS)"); - ShowContinueError(state, "ratioTWB = " + TrimSigDigits(((MixWetBulb + 283.15) / 273.15), 3)); - ShowContinueError(state, "ratioTS = " + TrimSigDigits(((85.0 + 283.15) / 273.15), 3)); - ShowContinueError(state, "Sensible Cooling Capacity Modifier = " + TrimSigDigits(SensCapTempModFac, 5)); + ShowContinueError(state, format("ratioTWB = {:.3T}", ((MixWetBulb + 283.15) / 273.15))); + ShowContinueError(state, format("ratioTS = {:.3T}", ((85.0 + 283.15) / 273.15))); + ShowContinueError(state, format("Sensible Cooling Capacity Modifier = {:.5T}", SensCapTempModFac)); ShowContinueError(state, "...Rated Sensible Cooling Capacity = Sensible Design Load / Sensible Cooling Capacity Modifier"); ShowContinueError(state, "Carefully review the Load Side Total, Sensible, and Latent heat transfer rates"); ShowContinueError(state, "... to ensure they meet the expected manufacturers performance specifications."); @@ -1874,8 +1885,8 @@ namespace WaterToAirHeatPumpSimple { ShowMessage(state, "SizeHVACWaterToAir: Potential issue with equipment sizing for coil " + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WatertoAirHPType + ":WATERTOAIRHEATPUMP:EQUATIONFIT \"" + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name + "\""); - ShowContinueError(state, "User-Specified Rated Heating Capacity of " + RoundSigDigits(RatedCapHeatUser, 2) + " [W]"); - ShowContinueError(state, "differs from Design Size Rated Heating Capacity of " + RoundSigDigits(RatedCapHeatDes, 2) + " [W]"); + ShowContinueError(state, format("User-Specified Rated Heating Capacity of {:.2R} [W]", RatedCapHeatUser)); + ShowContinueError(state, format("differs from Design Size Rated Heating Capacity of {:.2R} [W]", RatedCapHeatDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -1907,10 +1918,15 @@ namespace WaterToAirHeatPumpSimple { "...used with COIL:" + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CompanionCoolingCoilNum).WatertoAirHPType + ":WATERTOAIRHEATPUMP:EQUATIONFIT \"" + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CompanionCoolingCoilNum).Name + "\""); ShowContinueError(state, "...heating capacity is disproportionate (> 20% different) to total cooling capacity"); - ShowContinueError(state, "...heating capacity = " + TrimSigDigits(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapHeat, 3) + " W"); - ShowContinueError(state, "...cooling capacity = " + - TrimSigDigits(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CompanionCoolingCoilNum).RatedCapCoolTotal, 3) + - " W"); + ShowContinueError( + state, + format("...heating capacity = {:.3T} W", state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapHeat)); + ShowContinueError( + state, + format("...cooling capacity = {:.3T} W", + state.dataWaterToAirHeatPumpSimple + ->SimpleWatertoAirHP(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CompanionCoolingCoilNum) + .RatedCapCoolTotal)); } } } @@ -2016,9 +2032,8 @@ namespace WaterToAirHeatPumpSimple { ShowMessage(state, "SizeHVACWaterToAir: Potential issue with equipment sizing for coil " + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WatertoAirHPType + ":WATERTOAIRHEATPUMP:EQUATIONFIT \"" + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name + "\""); - ShowContinueError(state, "User-Specified Rated Water Flow Rate of " + RoundSigDigits(RatedWaterVolFlowRateUser, 5) + " [m3/s]"); - ShowContinueError(state, "differs from Design Size Rated Water Flow Rate of " + RoundSigDigits(RatedWaterVolFlowRateDes, 5) + - " [m3/s]"); + ShowContinueError(state, format("User-Specified Rated Water Flow Rate of {:.5R} [m3/s]", RatedWaterVolFlowRateUser)); + ShowContinueError(state, format("differs from Design Size Rated Water Flow Rate of {:.5R} [m3/s]", RatedWaterVolFlowRateDes)); ShowContinueError(state, "This may, or may not, indicate mismatched component sizes."); ShowContinueError(state, "Verify that the value entered is intended and is consistent with other components."); } @@ -3169,7 +3184,6 @@ namespace WaterToAirHeatPumpSimple { // Using/Aliasing using FluidProperties::FindGlycol; - using General::TrimSigDigits; // Obtains and Allocates WatertoAirHP related parameters from input file if (state.dataWaterToAirHeatPumpSimple->GetCoilsInputFlag) { // First time subroutine has been entered @@ -3179,8 +3193,10 @@ namespace WaterToAirHeatPumpSimple { } if (SimpleWSHPNum <= 0 || SimpleWSHPNum > state.dataWaterToAirHeatPumpSimple->NumWatertoAirHPs) { - ShowSevereError(state, "SetSimpleWSHPData: called with WSHP Coil Number out of range=" + TrimSigDigits(SimpleWSHPNum) + " should be >0 and <" + - TrimSigDigits(state.dataWaterToAirHeatPumpSimple->NumWatertoAirHPs)); + ShowSevereError(state, + format("SetSimpleWSHPData: called with WSHP Coil Number out of range={} should be >0 and <{}", + SimpleWSHPNum, + state.dataWaterToAirHeatPumpSimple->NumWatertoAirHPs)); ErrorsFound = true; return; } diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index 8a7e510dfdf..b58a415bef5 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -50,7 +50,6 @@ #include #include #include -#include // ObjexxFCL Headers #include @@ -599,7 +598,7 @@ namespace WeatherManager { DataEnvironment::DayOfYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartJDay; DataEnvironment::DayOfMonth = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay; state.dataGlobal->CalendarYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear; - state.dataGlobal->CalendarYearChr = std::to_string(state.dataGlobal->CalendarYear); + state.dataGlobal->CalendarYearChr = fmt::to_string(state.dataGlobal->CalendarYear); DataEnvironment::Month = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth; state.dataGlobal->NumOfDayInEnvrn = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).TotalDays; // Set day loop maximum from DataGlobals if (!state.dataGlobal->DoingSizing && !state.dataGlobal->KickOffSimulation) { @@ -684,8 +683,10 @@ namespace WeatherManager { if (state.dataWeatherManager->Environment( state.dataWeatherManager->Envrn).ActualWeather && !state.dataWeatherManager->WFAllowsLeapYears) { for (int year = state.dataWeatherManager->Environment( state.dataWeatherManager->Envrn).StartYear; year <= state.dataWeatherManager->Environment( state.dataWeatherManager->Envrn).EndYear; year++) { if (isLeapYear(year)) { - ShowSevereError(state, RoutineName + "Weatherfile does not support leap years but runperiod includes a leap year (" + - std::to_string(year) + ")"); + ShowSevereError(state, + format("{}Weatherfile does not support leap years but runperiod includes a leap year ({})", + RoutineName, + year)); missingLeap = true; } } @@ -746,12 +747,12 @@ namespace WeatherManager { StDate = format(DateFormat, state.dataWeatherManager->DataPeriods(1).StMon, state.dataWeatherManager->DataPeriods(1).StDay); EnDate = format(DateFormat, state.dataWeatherManager->DataPeriods(1).EnMon, state.dataWeatherManager->DataPeriods(1).EnDay); if (state.dataWeatherManager->DataPeriods(1).StYear > 0) { - StDate += "/" + General::RoundSigDigits(state.dataWeatherManager->DataPeriods(1).StYear); + StDate += format("/{}", state.dataWeatherManager->DataPeriods(1).StYear); } else { StDate += "/"; } if (state.dataWeatherManager->DataPeriods(1).EnYear > 0) { - EnDate += "/" + General::RoundSigDigits(state.dataWeatherManager->DataPeriods(1).EnYear); + EnDate += format("/{}", state.dataWeatherManager->DataPeriods(1).EnYear); } else { EnDate += "/"; } @@ -772,8 +773,8 @@ namespace WeatherManager { StDate = format(DateFormat, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay); EnDate = format(DateFormat, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndMonth, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndDay); if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodWeather) { - StDate += "/" + General::RoundSigDigits(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear); - EnDate += "/" + General::RoundSigDigits(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndYear); + StDate += format("/{}", state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear); + EnDate += format("/{}", state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndYear); } DataEnvironment::EnvironmentStartEnd = StDate + " - " + EnDate; @@ -794,7 +795,7 @@ namespace WeatherManager { StDate, EnDate, ValidDayNames(TWeekDay), - General::RoundSigDigits(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).TotalDays), + fmt::to_string(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).TotalDays), "Use RunPeriod Specified Day", AlpUseDST, AlpUseSpec, @@ -1006,14 +1007,16 @@ namespace WeatherManager { state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn) = state.dataWeatherManager->Environment(i); // copy over seed data from current array element state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).SeedEnvrnNum = i; state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; - state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).Title = state.dataWeatherManager->Environment(i).Title + " HVAC Sizing Pass " + General::RoundSigDigits(HVACSizingIterCount); + state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).Title = + format("{} HVAC Sizing Pass {}", state.dataWeatherManager->Environment(i).Title, HVACSizingIterCount); state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).HVACSizingIterationNum = HVACSizingIterCount; } else if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodDesign) { state.dataWeatherManager->Environment.redimension(++ state.dataWeatherManager->NumOfEnvrn); state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn) = state.dataWeatherManager->Environment(i); // copy over seed data state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).SeedEnvrnNum = i; state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign; - state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).Title = state.dataWeatherManager->Environment(i).Title + " HVAC Sizing Pass " + General::RoundSigDigits(HVACSizingIterCount); + state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).Title = + format("{} HVAC Sizing Pass {}", state.dataWeatherManager->Environment(i).Title, HVACSizingIterCount); state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).HVACSizingIterationNum = HVACSizingIterCount; } } // for each loop over Environment data strucure @@ -2181,9 +2184,10 @@ namespace WeatherManager { LiquidPrecip); } else if (WeatherDataLine.eof) { if (NumRewinds > 0) { - std::string date = std::to_string(state.dataWeatherManager->Environment(Environ).StartMonth) + '/' + std::to_string(state.dataWeatherManager->Environment(Environ).StartDay); + std::string date = fmt::to_string(state.dataWeatherManager->Environment(Environ).StartMonth) + '/' + + fmt::to_string(state.dataWeatherManager->Environment(Environ).StartDay); if (state.dataWeatherManager->Environment(Environ).MatchYear) { - date += '/' + std::to_string(state.dataWeatherManager->Environment(Environ).StartYear); + date += '/' + fmt::to_string(state.dataWeatherManager->Environment(Environ).StartYear); } ShowSevereError(state, "Multiple rewinds on EPW while searching for first day " + date); } else { @@ -2264,7 +2268,7 @@ namespace WeatherManager { (DryBulb >= -90.0), "<= 70", (DryBulb <= 70.0), - General::RoundSigDigits(DryBulb, 2), + format("{:.2R}", DryBulb), DataEnvironment::WeatherFileLocationTitle); if (DewPoint < 99.9) inputProcessor->rangeCheck(state, @@ -2276,7 +2280,7 @@ namespace WeatherManager { (DewPoint >= -90.0), "<= 70", (DewPoint <= 70.0), - General::RoundSigDigits(DewPoint, 2), + format("{:.2R}", DewPoint), DataEnvironment::WeatherFileLocationTitle); if (RelHum < 999.0) inputProcessor->rangeCheck(state, @@ -2288,7 +2292,7 @@ namespace WeatherManager { (RelHum >= 0.0), "<= 110", (RelHum <= 110.0), - General::RoundSigDigits(RelHum, 0), + format("{:.0R}", RelHum), DataEnvironment::WeatherFileLocationTitle); if (AtmPress < 999999.0) inputProcessor->rangeCheck(state, @@ -2300,7 +2304,7 @@ namespace WeatherManager { (AtmPress > 31000.0), "<=120000", (AtmPress <= 120000.0), - General::RoundSigDigits(AtmPress, 0), + format("{:.0R}", AtmPress), DataEnvironment::WeatherFileLocationTitle); if (DirectRad < 9999.0) inputProcessor->rangeCheck(state, @@ -2336,7 +2340,7 @@ namespace WeatherManager { (WindDir >= 0.0), "<=360", (WindDir <= 360.0), - General::RoundSigDigits(WindDir, 0), + format("{:.0R}", WindDir), DataEnvironment::WeatherFileLocationTitle); if (WindSpeed < 999.0) inputProcessor->rangeCheck(state, @@ -2348,7 +2352,7 @@ namespace WeatherManager { (WindSpeed >= 0.0), "<=40", (WindSpeed <= 40.0), - General::RoundSigDigits(WindSpeed, 2), + format("{:.2R}", WindSpeed), DataEnvironment::WeatherFileLocationTitle); if (ErrorsFound) { ShowSevereError(state, "Out of Range errors found with initial day of WeatherFile"); @@ -3139,8 +3143,7 @@ namespace WeatherManager { } if (DateInError) { - ShowSevereError(state, "Reading Weather Data Line, Invalid Date, Year=" + General::RoundSigDigits(WYear) + - ", Month=" + General::RoundSigDigits(WMonth) + ", Day=" + General::RoundSigDigits(WDay)); + ShowSevereError(state, format("Reading Weather Data Line, Invalid Date, Year={}, Month={}, Day={}", WYear, WMonth, WDay)); ShowFatalError(state, "Program terminates due to previous condition."); } @@ -3425,8 +3428,10 @@ namespace WeatherManager { if (state.dataWeatherManager->DesDayInput(EnvrnNum).PressureEntered) { if (std::abs((state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom - DataEnvironment::StdBaroPress) / DataEnvironment::StdBaroPress) > 0.1) { // 10% off ShowWarningError(state, - "SetUpDesignDay: Entered DesignDay Barometric Pressure=" + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom, 0) + - " differs by more than 10% from Standard Barometric Pressure=" + General::RoundSigDigits(DataEnvironment::StdBaroPress, 0) + '.'); + format("SetUpDesignDay: Entered DesignDay Barometric Pressure={:.0R} differs by more than 10% from Standard " + "Barometric Pressure={:.0R}.", + state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom, + DataEnvironment::StdBaroPress)); ShowContinueError(state, "...occurs in DesignDay=" + DataEnvironment::EnvironmentName + ", Standard Pressure (based on elevation) will be used."); state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom = DataEnvironment::StdBaroPress; @@ -3498,21 +3503,22 @@ namespace WeatherManager { // Hum Ind Type, Hum Ind Value at Max Temp, Hum Ind Units if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WetBulb) { - StringOut = "Wetbulb," + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, 2) + ",{C},"; + StringOut = format("Wetbulb,{:.2R},{{C}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::DewPoint) { - StringOut = "Dewpoint," + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, 2) + ",{C},"; + StringOut = format("Dewpoint,{:.2R},{{C}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::Enthalpy) { - StringOut = "Enthalpy," + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, 2) + ",{J/kgDryAir},"; + StringOut = format("Enthalpy,{:.2R},{{J/kgDryAir}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::HumRatio) { - StringOut = "HumidityRatio," + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, 4) + ",{kgWater/kgDryAir},"; + StringOut = format("HumidityRatio,{:.4R},{{kgWater/kgDryAir}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::RelHumSch) { StringOut = "Schedule,,{percent},"; } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDef) { - StringOut = "WetBulbProfileDefaultMultipliers," + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Envrn).HumIndValue, 2) + ",{C},"; + StringOut = format("WetBulbProfileDefaultMultipliers,{:.2R},{{C}},", + state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Envrn).HumIndValue); } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDif) { - StringOut = "WetBulbProfileDifferenceSchedule," + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, 2) + ",{C},"; + StringOut = format("WetBulbProfileDifferenceSchedule,{:.2R},{{C}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfMul) { - StringOut = "WetBulbProfileMultiplierSchedule," + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, 2) + ",{C},"; + StringOut = format("WetBulbProfileMultiplierSchedule,{:.2R},{{C}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); } print(state.files.eio, "{}", StringOut); print(state.files.eio, "{:.0R},", state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); @@ -4358,16 +4364,17 @@ namespace WeatherManager { ShowWarningError(state, "Weather file location will be used rather than entered (IDF) Location object."); ShowContinueError(state, "..Location object=" + state.dataWeatherManager->LocationTitle); ShowContinueError(state, "..Weather File Location=" + DataEnvironment::WeatherFileLocationTitle); - ShowContinueError(state, "..due to location differences, Latitude difference=[" + - General::RoundSigDigits(std::abs(DataEnvironment::Latitude - state.dataWeatherManager->WeatherFileLatitude), 2) + - "] degrees, Longitude difference=[" + - General::RoundSigDigits(std::abs(DataEnvironment::Longitude - state.dataWeatherManager->WeatherFileLongitude), 2) + "] degrees."); + ShowContinueError( + state, + format("..due to location differences, Latitude difference=[{:.2R}] degrees, Longitude difference=[{:.2R}] degrees.", + std::abs(DataEnvironment::Latitude - state.dataWeatherManager->WeatherFileLatitude), + std::abs(DataEnvironment::Longitude - state.dataWeatherManager->WeatherFileLongitude))); ShowContinueError(state, - "..Time Zone difference=[" + General::RoundSigDigits(std::abs(DataEnvironment::TimeZoneNumber - state.dataWeatherManager->WeatherFileTimeZone), 1) + - "] hour(s), Elevation difference=[" + - General::RoundSigDigits( - std::abs((DataEnvironment::Elevation - state.dataWeatherManager->WeatherFileElevation) / max(DataEnvironment::Elevation, 1.0)) * 100.0, 2) + - "] percent, [" + General::RoundSigDigits(std::abs(DataEnvironment::Elevation - state.dataWeatherManager->WeatherFileElevation), 2) + "] meters."); + format("..Time Zone difference=[{:.1R}] hour(s), Elevation difference=[{:.2R}] percent, [{:.2R}] meters.", + std::abs(DataEnvironment::TimeZoneNumber - state.dataWeatherManager->WeatherFileTimeZone), + std::abs((DataEnvironment::Elevation - state.dataWeatherManager->WeatherFileElevation) / + max(DataEnvironment::Elevation, 1.0) * 100.0), + std::abs(DataEnvironment::Elevation - state.dataWeatherManager->WeatherFileElevation))); } } @@ -4427,17 +4434,17 @@ namespace WeatherManager { } if ((DataEnvironment::Latitude < -90.0) || (DataEnvironment::Latitude > 90.0)) { - ShowSevereError(state, "Latitude must be between -90 and 90; Entered=" + General::RoundSigDigits(DataEnvironment::Latitude, 2)); + ShowSevereError(state, format("Latitude must be between -90 and 90; Entered={:.2R}", DataEnvironment::Latitude)); LocationError = true; } if ((DataEnvironment::Longitude < -180.0) || (DataEnvironment::Longitude > 180.0)) { - ShowSevereError(state, "Longitude must be between -180 and 180; Entered=" + General::RoundSigDigits(DataEnvironment::Longitude, 2)); + ShowSevereError(state, format("Longitude must be between -180 and 180; Entered={:.2R}", DataEnvironment::Longitude)); LocationError = true; } if ((DataEnvironment::TimeZoneNumber < -12.00) || (DataEnvironment::TimeZoneNumber > 14.00)) { - ShowSevereError(state, "Time Zone must be between -12 and +14; Entered=" + General::RoundSigDigits(DataEnvironment::TimeZoneNumber, 2)); + ShowSevereError(state, format("Time Zone must be between -12 and +14; Entered={:.2R}", DataEnvironment::TimeZoneNumber)); LocationError = true; } @@ -4455,12 +4462,11 @@ namespace WeatherManager { Real64 const DiffCalc = std::abs(DataEnvironment::TimeZoneNumber - StdTimeMerid); if (DiffCalc > 1.0 && DiffCalc < 24.0) { if (DiffCalc < 3.0) { - ShowWarningError(state, "Standard Time Meridian and Time Zone differ by more than 1, Difference=\"" + - General::RoundSigDigits(DiffCalc, 1) + "\""); + ShowWarningError(state, + format("Standard Time Meridian and Time Zone differ by more than 1, Difference=\"{:.1R}\"", DiffCalc)); ShowContinueError(state, "Solar Positions may be incorrect"); } else { - ShowSevereError(state, "Standard Time Meridian and Time Zone differ by more than 2, Difference=\"" + - General::RoundSigDigits(DiffCalc, 1) + "\""); + ShowSevereError(state, format("Standard Time Meridian and Time Zone differ by more than 2, Difference=\"{:.1R}\"", DiffCalc)); ShowContinueError(state, "Solar Positions will be incorrect"); // LocationError=.TRUE. } @@ -4552,37 +4558,37 @@ namespace WeatherManager { if (state.dataWeatherManager->EnvironmentReportNbr != 1) { // problem ShowFatalError(state, "ReportOutputFileHeaders: Assigned report number for Environment title is not 1. Contact Support."); } - state.dataWeatherManager->EnvironmentReportChr = std::to_string(state.dataWeatherManager->EnvironmentReportNbr); + state.dataWeatherManager->EnvironmentReportChr = fmt::to_string(state.dataWeatherManager->EnvironmentReportNbr); strip(state.dataWeatherManager->EnvironmentReportChr); print(state.files.eso, "{}{}\n", state.dataWeatherManager->EnvironmentReportChr, EnvironmentString); print(state.files.mtr, "{}{}\n", state.dataWeatherManager->EnvironmentReportChr, EnvironmentString); AssignReportNumber(OutputProcessor::TimeStepStampReportNbr); - OutputProcessor::TimeStepStampReportChr = std::to_string(OutputProcessor::TimeStepStampReportNbr); + OutputProcessor::TimeStepStampReportChr = fmt::to_string(OutputProcessor::TimeStepStampReportNbr); strip(OutputProcessor::TimeStepStampReportChr); print(state.files.eso, "{}{}\n", OutputProcessor::TimeStepStampReportChr, TimeStepString); print(state.files.mtr, "{}{}\n", OutputProcessor::TimeStepStampReportChr, TimeStepString); AssignReportNumber(OutputProcessor::DailyStampReportNbr); - OutputProcessor::DailyStampReportChr = std::to_string(OutputProcessor::DailyStampReportNbr); + OutputProcessor::DailyStampReportChr = fmt::to_string(OutputProcessor::DailyStampReportNbr); strip(OutputProcessor::DailyStampReportChr); print(state.files.eso, "{}{}{}\n", OutputProcessor::DailyStampReportChr, DailyString, "Report Variables Requested"); print(state.files.mtr, "{}{}{}\n", OutputProcessor::DailyStampReportChr, DailyString, "Meters Requested"); AssignReportNumber(OutputProcessor::MonthlyStampReportNbr); - OutputProcessor::MonthlyStampReportChr = std::to_string(OutputProcessor::MonthlyStampReportNbr); + OutputProcessor::MonthlyStampReportChr = fmt::to_string(OutputProcessor::MonthlyStampReportNbr); strip(OutputProcessor::MonthlyStampReportChr); print(state.files.eso, "{}{}{}\n", OutputProcessor::MonthlyStampReportChr, MonthlyString, "Report Variables Requested"); print(state.files.mtr, "{}{}{}\n", OutputProcessor::MonthlyStampReportChr, MonthlyString, "Meters Requested"); AssignReportNumber(OutputProcessor::RunPeriodStampReportNbr); - OutputProcessor::RunPeriodStampReportChr = std::to_string(OutputProcessor::RunPeriodStampReportNbr); + OutputProcessor::RunPeriodStampReportChr = fmt::to_string(OutputProcessor::RunPeriodStampReportNbr); strip(OutputProcessor::RunPeriodStampReportChr); print(state.files.eso, "{}{}{}\n", OutputProcessor::RunPeriodStampReportChr, RunPeriodString, "Report Variables Requested"); print(state.files.mtr, "{}{}{}\n", OutputProcessor::RunPeriodStampReportChr, RunPeriodString, "Meters Requested"); AssignReportNumber(OutputProcessor::YearlyStampReportNbr); - OutputProcessor::YearlyStampReportChr = std::to_string(OutputProcessor::YearlyStampReportNbr); + OutputProcessor::YearlyStampReportChr = fmt::to_string(OutputProcessor::YearlyStampReportNbr); strip(OutputProcessor::YearlyStampReportChr); print(state.files.eso, "{}{}{}\n", OutputProcessor::YearlyStampReportChr, YearlyString, "Report Variables Requested"); print(state.files.mtr, "{}{}{}\n", OutputProcessor::YearlyStampReportChr, YearlyString, "Meters Requested"); @@ -4870,15 +4876,21 @@ namespace WeatherManager { ErrorsFound = true; } } else if (state.dataWeatherManager->RunPeriodInput(i).startYear < 1583) { // Bail on the proleptic Gregorian calendar - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + ", start year (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).startYear) + ") is too early, please choose a date after 1582."); + ShowSevereError(state, + format("{}: object={}, start year ({}) is too early, please choose a date after 1582.", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + state.dataWeatherManager->RunPeriodInput(i).startYear)); ErrorsFound = true; } if (state.dataWeatherManager->RunPeriodInput(i).endYear != 0 && state.dataWeatherManager->RunPeriodInput(i).startYear > state.dataWeatherManager->RunPeriodInput(i).endYear) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + ", start year (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).startYear) + ") is after the end year (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).endYear) + ")."); + ShowSevereError(state, + format("{}: object={}, start year ({}) is after the end year ({}).", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + state.dataWeatherManager->RunPeriodInput(i).startYear, + state.dataWeatherManager->RunPeriodInput(i).endYear)); ErrorsFound = true; } @@ -4914,17 +4926,23 @@ namespace WeatherManager { } } else { // Have an input start year if (!isLeapYear(state.dataWeatherManager->RunPeriodInput(i).startYear)) { // Start year is not a leap year - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + ", start year (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).startYear) + ") is not a leap year but the requested start date is 2/29."); + ShowSevereError(state, + format("{}: object={}, start year ({}) is not a leap year but the requested start date is 2/29.", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + state.dataWeatherManager->RunPeriodInput(i).startYear)); ErrorsFound = true; } else { // Start year is a leap year WeekDay weekday = calculateDayOfWeek(state.dataWeatherManager->RunPeriodInput(i).startYear, state.dataWeatherManager->RunPeriodInput(i).startMonth, state.dataWeatherManager->RunPeriodInput(i).startDay); if (inputWeekday) { // Check for correctness of input if (weekday != state.dataWeatherManager->RunPeriodInput(i).startWeekDay) { - ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + ", start weekday (" + - DataIPShortCuts::cAlphaArgs(2) + ") does not match the start year (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).startYear) + "), corrected to " + - DaysOfWeek(static_cast(weekday)) + "."); + ShowWarningError(state, + format("{}: object={}, start weekday ({}) does not match the start year ({}), corrected to {}.", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + DataIPShortCuts::cAlphaArgs(2), + state.dataWeatherManager->RunPeriodInput(i).startYear, + DaysOfWeek(static_cast(weekday)))); state.dataWeatherManager->RunPeriodInput(i).startWeekDay = weekday; } } else { // Set the weekday if it was not input @@ -4935,9 +4953,12 @@ namespace WeatherManager { } else { // Non leap-day start date if (!validMonthDay(state.dataWeatherManager->RunPeriodInput(i).startMonth, state.dataWeatherManager->RunPeriodInput(i).startDay)) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + - ", Invalid input start month/day (" + General::TrimSigDigits(state.dataWeatherManager->RunPeriodInput(i).startMonth) + '/' + - General::TrimSigDigits(state.dataWeatherManager->RunPeriodInput(i).startDay) + ')'); + ShowSevereError(state, + format("{}: object={}, Invalid input start month/day ({}/{})", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + state.dataWeatherManager->RunPeriodInput(i).startMonth, + state.dataWeatherManager->RunPeriodInput(i).startDay)); ErrorsFound = true; } else { // Month/day is valid if (state.dataWeatherManager->RunPeriodInput(i).startYear == 0) { // No input starting year @@ -4954,10 +4975,13 @@ namespace WeatherManager { WeekDay weekday = calculateDayOfWeek(state.dataWeatherManager->RunPeriodInput(i).startYear, state.dataWeatherManager->RunPeriodInput(i).startMonth, state.dataWeatherManager->RunPeriodInput(i).startDay); if (inputWeekday) { // Check for correctness of input if (weekday != state.dataWeatherManager->RunPeriodInput(i).startWeekDay) { - ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + ", start weekday (" + - DataIPShortCuts::cAlphaArgs(2) + ") does not match the start year (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).startYear) + "), corrected to " + - DaysOfWeek(static_cast(weekday)) + "."); + ShowWarningError(state, + format("{}: object={}, start weekday ({}) does not match the start year ({}), corrected to {}.", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + DataIPShortCuts::cAlphaArgs(2), + state.dataWeatherManager->RunPeriodInput(i).startYear, + DaysOfWeek(static_cast(weekday)))); state.dataWeatherManager->RunPeriodInput(i).startWeekDay = weekday; } } else { // Set the weekday if it was not input @@ -4989,16 +5013,22 @@ namespace WeatherManager { } } else { // Have an input end year if (!isLeapYear(state.dataWeatherManager->RunPeriodInput(i).endYear)) { // End year is not a leap year - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + ", end year (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).startYear) + ") is not a leap year but the requested end date is 2/29."); + ShowSevereError(state, + format("{}: object={}, end year ({}) is not a leap year but the requested end date is 2/29.", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + state.dataWeatherManager->RunPeriodInput(i).startYear)); ErrorsFound = true; } else { state.dataWeatherManager->RunPeriodInput(i).endJulianDate = computeJulianDate(state.dataWeatherManager->RunPeriodInput(i).endYear, state.dataWeatherManager->RunPeriodInput(i).endMonth, state.dataWeatherManager->RunPeriodInput(i).endDay); if (state.dataWeatherManager->RunPeriodInput(i).startJulianDate > state.dataWeatherManager->RunPeriodInput(i).endJulianDate) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + ", start Julian date (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).startJulianDate) + ") is after the end Julian date (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).endJulianDate) + ")."); + ShowSevereError(state, + format("{}: object={}, start Julian date ({}) is after the end Julian date ({}).", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + state.dataWeatherManager->RunPeriodInput(i).startJulianDate, + state.dataWeatherManager->RunPeriodInput(i).endJulianDate)); ErrorsFound = true; } } @@ -5006,9 +5036,12 @@ namespace WeatherManager { } else { // Non leap-day end date if (!validMonthDay(state.dataWeatherManager->RunPeriodInput(i).endMonth, state.dataWeatherManager->RunPeriodInput(i).endDay)) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + - ", Invalid input end month/day (" + General::TrimSigDigits(state.dataWeatherManager->RunPeriodInput(i).startMonth) + '/' + - General::TrimSigDigits(state.dataWeatherManager->RunPeriodInput(i).startDay) + ')'); + ShowSevereError(state, + format("{}: object={}, Invalid input end month/day ({}/{})", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + state.dataWeatherManager->RunPeriodInput(i).startMonth, + state.dataWeatherManager->RunPeriodInput(i).startDay)); ErrorsFound = true; } else { // Month/day is valid if (state.dataWeatherManager->RunPeriodInput(i).endYear == 0) { // No input end year @@ -5024,9 +5057,12 @@ namespace WeatherManager { state.dataWeatherManager->RunPeriodInput(i).endJulianDate = computeJulianDate(state.dataWeatherManager->RunPeriodInput(i).endYear, state.dataWeatherManager->RunPeriodInput(i).endMonth, state.dataWeatherManager->RunPeriodInput(i).endDay); if (state.dataWeatherManager->RunPeriodInput(i).startJulianDate > state.dataWeatherManager->RunPeriodInput(i).endJulianDate) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodInput(i).title + ", start Julian date (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).startJulianDate) + ") is after the end Julian date (" + - std::to_string(state.dataWeatherManager->RunPeriodInput(i).endJulianDate) + ")."); + ShowSevereError(state, + format("{}: object={}, start Julian date ({}) is after the end Julian date ({}).", + DataIPShortCuts::cCurrentModuleObject, + state.dataWeatherManager->RunPeriodInput(i).title, + state.dataWeatherManager->RunPeriodInput(i).startJulianDate, + state.dataWeatherManager->RunPeriodInput(i).endJulianDate)); ErrorsFound = true; } } @@ -5213,9 +5249,12 @@ namespace WeatherManager { case 10: case 12: if (state.dataWeatherManager->RunPeriodDesignInput(Count).startDay > 31) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodDesignInput(Count).title + ' ' + - DataIPShortCuts::cNumericFieldNames(2) + " invalid (Day of Month) [" + - General::TrimSigDigits(state.dataWeatherManager->RunPeriodDesignInput(Count).startDay) + ']'); + ShowSevereError(state, + DataIPShortCuts::cCurrentModuleObject + + ": object=" + state.dataWeatherManager->RunPeriodDesignInput(Count).title + ' ' + + format("{} invalid (Day of Month) [{}]", + DataIPShortCuts::cNumericFieldNames(2), + state.dataWeatherManager->RunPeriodDesignInput(Count).startDay)); ErrorsFound = true; } break; @@ -5224,24 +5263,33 @@ namespace WeatherManager { case 9: case 11: if (state.dataWeatherManager->RunPeriodDesignInput(Count).startDay > 30) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodDesignInput(Count).title + ' ' + - DataIPShortCuts::cNumericFieldNames(2) + " invalid (Day of Month) [" + - General::TrimSigDigits(state.dataWeatherManager->RunPeriodDesignInput(Count).startDay) + ']'); + ShowSevereError(state, + DataIPShortCuts::cCurrentModuleObject + + ": object=" + state.dataWeatherManager->RunPeriodDesignInput(Count).title + ' ' + + format("{} invalid (Day of Month) [{}]", + DataIPShortCuts::cNumericFieldNames(2), + state.dataWeatherManager->RunPeriodDesignInput(Count).startDay)); ErrorsFound = true; } break; case 2: if (state.dataWeatherManager->RunPeriodDesignInput(Count).startDay > 28 + state.dataWeatherManager->LeapYearAdd) { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodDesignInput(Count).title + ' ' + - DataIPShortCuts::cNumericFieldNames(2) + " invalid (Day of Month) [" + - General::TrimSigDigits(state.dataWeatherManager->RunPeriodDesignInput(Count).startDay) + ']'); + ShowSevereError(state, + DataIPShortCuts::cCurrentModuleObject + + ": object=" + state.dataWeatherManager->RunPeriodDesignInput(Count).title + ' ' + + format("{} invalid (Day of Month) [{}]", + DataIPShortCuts::cNumericFieldNames(2), + state.dataWeatherManager->RunPeriodDesignInput(Count).startDay)); ErrorsFound = true; } break; default: - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodDesignInput(Count).title + ' ' + - DataIPShortCuts::cNumericFieldNames(1) + " invalid (Month) [" + - General::TrimSigDigits(state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth) + ']'); + ShowSevereError(state, + DataIPShortCuts::cCurrentModuleObject + ": object=" + state.dataWeatherManager->RunPeriodDesignInput(Count).title + + ' ' + + format("{} invalid (Month) [{}]", + DataIPShortCuts::cNumericFieldNames(1), + state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth)); ErrorsFound = true; break; } @@ -5519,8 +5567,12 @@ namespace WeatherManager { if (Duration(1) > 0) { state.dataWeatherManager->SpecialDays(Count).Duration = int(Duration(1)); } else { - ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + ": " + AlphArray(1) + " Invalid " + DataIPShortCuts::cNumericFieldNames(1) + - '=' + General::TrimSigDigits(Duration(1), 0)); + ShowSevereError(state, + format("{}: {} Invalid {}={:.0T}", + DataIPShortCuts::cCurrentModuleObject, + AlphArray(1), + DataIPShortCuts::cNumericFieldNames(1), + Duration(1))); ErrorsFound = true; } @@ -5969,10 +6021,12 @@ namespace WeatherManager { Real64 testval = maxval(state.dataWeatherManager->DDDBRngModifier(_, _, EnvrnNum)); if (MaxDryBulbEntered) { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + state.dataWeatherManager->DesDayInput(EnvrnNum).Title + "\", data override."); - ShowContinueError(state, ".." + DataIPShortCuts::cNumericFieldNames(3) + "=[" + - General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb, 2) + "] will be overwritten."); + ShowContinueError(state, + format("..{}=[{:.2R}] will be overwritten.", + DataIPShortCuts::cNumericFieldNames(3), + state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb)); ShowContinueError(state, ".." + DataIPShortCuts::cAlphaFieldNames(3) + "=\"" + DataIPShortCuts::cAlphaArgs(3) + "\"."); - ShowContinueError(state, "..with max value=[" + General::RoundSigDigits(testval, 2) + "]."); + ShowContinueError(state, format("..with max value=[{:.2R}].", testval)); } state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb = testval; } @@ -6269,8 +6323,9 @@ namespace WeatherManager { if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue > state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb) { ShowWarningError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + state.dataWeatherManager->DesDayInput(EnvrnNum).Title + "\", range check data."); ShowContinueError(state, - "..Humidity Indicator Temperature at Max Temperature=" + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, 1) + - " > Max DryBulb=" + General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb, 1)); + format("..Humidity Indicator Temperature at Max Temperature={:.1R} > Max DryBulb={:.1R}", + state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, + state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb)); ShowContinueError(state, ".." + DataIPShortCuts::cAlphaFieldNames(5) + "=\"" + DataIPShortCuts::cAlphaArgs(5) + "\"."); ShowContinueError(state, "..Conditions for day will be set to Relative Humidity = 100%"); if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::DewPoint) { @@ -6402,9 +6457,11 @@ namespace WeatherManager { case 12: if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth > 31) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + state.dataWeatherManager->DesDayInput(EnvrnNum).Title + "\", invalid data."); - ShowContinueError(state, ".. invalid field: " + DataIPShortCuts::cNumericFieldNames(2) + "=[" + - General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth) + "], Month=[" + - General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).Month) + "]."); + ShowContinueError(state, + format(".. invalid field: {}=[{}], Month=[{}].", + DataIPShortCuts::cNumericFieldNames(2), + state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth, + state.dataWeatherManager->DesDayInput(EnvrnNum).Month)); ErrorsFound = true; } break; @@ -6414,25 +6471,31 @@ namespace WeatherManager { case 11: if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth > 30) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + state.dataWeatherManager->DesDayInput(EnvrnNum).Title + "\", invalid data."); - ShowContinueError(state, ".. invalid " + DataIPShortCuts::cNumericFieldNames(2) + "=[" + - General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth) + "], Month=[" + - General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).Month) + "]."); + ShowContinueError(state, + format(".. invalid {}=[{}], Month=[{}].", + DataIPShortCuts::cNumericFieldNames(2), + state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth, + state.dataWeatherManager->DesDayInput(EnvrnNum).Month)); ErrorsFound = true; } break; case 2: if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth > 28) { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + state.dataWeatherManager->DesDayInput(EnvrnNum).Title + "\", invalid data."); - ShowContinueError(state, ".. invalid " + DataIPShortCuts::cNumericFieldNames(2) + "=[" + - General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth) + "], Month=[" + - General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).Month) + "]."); + ShowContinueError(state, + format(".. invalid {}=[{}], Month=[{}].", + DataIPShortCuts::cNumericFieldNames(2), + state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth, + state.dataWeatherManager->DesDayInput(EnvrnNum).Month)); ErrorsFound = true; } break; default: ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + "=\"" + state.dataWeatherManager->DesDayInput(EnvrnNum).Title + "\", invalid data."); - ShowContinueError(state, ".. invalid " + DataIPShortCuts::cNumericFieldNames(1) + " invalid (Month) [" + - General::RoundSigDigits(state.dataWeatherManager->DesDayInput(EnvrnNum).Month) + "]."); + ShowContinueError(state, + format(".. invalid {} invalid (Month) [{}].", + DataIPShortCuts::cNumericFieldNames(1), + state.dataWeatherManager->DesDayInput(EnvrnNum).Month)); ErrorsFound = true; break; } @@ -7439,7 +7502,7 @@ namespace WeatherManager { Line.erase(0, Pos + 1); } else { ShowWarningError(state, "ProcessEPWHeader: Invalid Typical/Extreme Periods Header(WeatherFile)=" + Line.substr(0, Pos)); - ShowContinueError(state, "...on processing Typical/Extreme period #" + General::RoundSigDigits(i)); + ShowContinueError(state, format("...on processing Typical/Extreme period #{}", i)); state.dataWeatherManager->NumEPWTypExtSets = i - 1; break; } @@ -7516,7 +7579,7 @@ namespace WeatherManager { } else { ShowWarningError(state, "ProcessEPWHeader: Invalid Typical/Extreme Periods Header(WeatherFile)=" + state.dataWeatherManager->TypicalExtremePeriods(i).Title + " " + Line.substr(0, Pos)); - ShowContinueError(state, "...on processing Typical/Extreme period #" + General::RoundSigDigits(i)); + ShowContinueError(state, format("...on processing Typical/Extreme period #{}", i)); state.dataWeatherManager->NumEPWTypExtSets = i - 1; break; } @@ -7533,7 +7596,7 @@ namespace WeatherManager { } } else { ShowSevereError(state, "ProcessEPWHeader: Invalid Typical/Extreme Periods Start Date Field(WeatherFile)=" + Line.substr(0, Pos)); - ShowContinueError(state, "...on processing Typical/Extreme period #" + General::RoundSigDigits(i)); + ShowContinueError(state, format("...on processing Typical/Extreme period #{}", i)); ErrorsFound = true; } Line.erase(0, Pos + 1); @@ -7548,7 +7611,7 @@ namespace WeatherManager { } } else { ShowSevereError(state, "ProcessEPWHeader: Invalid Typical/Extreme Periods End Date Field(WeatherFile)=" + Line.substr(0, Pos)); - ShowContinueError(state, "...on processing Typical/Extreme period #" + General::RoundSigDigits(i)); + ShowContinueError(state, format("...on processing Typical/Extreme period #{}", i)); ErrorsFound = true; } Line.erase(0, Pos + 1); @@ -8633,8 +8696,8 @@ namespace WeatherManager { case WaterMainsTempCalcMethod::Schedule: *eiostream << "Site Water Mains Temperature Information,"; *eiostream << calcMethodMap.at(state.dataWeatherManager->WaterMainsTempsMethod) << "," << state.dataWeatherManager->WaterMainsTempsScheduleName << ","; - *eiostream << General::RoundSigDigits(state.dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp, 2) << "," - << General::RoundSigDigits(state.dataWeatherManager->WaterMainsTempsMaxDiffAirTemp, 2) << ","; + *eiostream << format("{:.2R}", state.dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp) << "," + << format("{:.2R}", state.dataWeatherManager->WaterMainsTempsMaxDiffAirTemp) << ","; *eiostream << "NA\n"; break; case WaterMainsTempCalcMethod::Correlation: @@ -8642,8 +8705,8 @@ namespace WeatherManager { *eiostream << calcMethodMap.at(state.dataWeatherManager->WaterMainsTempsMethod) << "," << "NA" << ","; - *eiostream << General::RoundSigDigits(state.dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp, 2) << "," - << General::RoundSigDigits(state.dataWeatherManager->WaterMainsTempsMaxDiffAirTemp, 2) << ","; + *eiostream << format("{:.2R}", state.dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp) << "," + << format("{:.2R}", state.dataWeatherManager->WaterMainsTempsMaxDiffAirTemp) << ","; *eiostream << "NA\n"; break; case WaterMainsTempCalcMethod::CorrelationFromWeatherFile: @@ -8652,8 +8715,8 @@ namespace WeatherManager { *eiostream << calcMethodMap.at(state.dataWeatherManager->WaterMainsTempsMethod) << "," << "NA" << ","; - *eiostream << General::RoundSigDigits(state.dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp, 2) << "," - << General::RoundSigDigits(state.dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff, 2) << "," + *eiostream << format("{:.2R}", state.dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp) << "," + << format("{:.2R}", state.dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff) << "," << "NA\n"; } else { *eiostream << "Site Water Mains Temperature Information,"; @@ -8664,7 +8727,7 @@ namespace WeatherManager { << "NA" << "," << "NA" - << "," << General::RoundSigDigits(10.0, 1) << '\n'; + << "," << format("{:.1R}", 10.0) << '\n'; } break; default: @@ -8676,7 +8739,7 @@ namespace WeatherManager { << "NA" << "," << "NA" - << "," << General::RoundSigDigits(10.0, 1) << '\n'; + << "," << format("{:.1R}", 10.0) << '\n'; break; } diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc index 92be57cf103..e1b49b33495 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -114,7 +114,6 @@ namespace WindTurbine { // This drivers manages the calls to all of the other drivers and simulation algorithms. // Using/Aliasing - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int WindTurbineNum; @@ -134,12 +133,18 @@ namespace WindTurbine { } else { WindTurbineNum = GeneratorIndex; if (WindTurbineNum > state.dataWindTurbine->NumWindTurbines || WindTurbineNum < 1) { - ShowFatalError(state, "SimWindTurbine: Invalid GeneratorIndex passed=" + TrimSigDigits(WindTurbineNum) + - ", Number of Wind Turbine Generators=" + TrimSigDigits(state.dataWindTurbine->NumWindTurbines) + ", Generator name=" + GeneratorName); + ShowFatalError(state, + format("SimWindTurbine: Invalid GeneratorIndex passed={}, Number of Wind Turbine Generators={}, Generator name={}", + WindTurbineNum, + state.dataWindTurbine->NumWindTurbines, + GeneratorName)); } if (GeneratorName != state.dataWindTurbine->WindTurbineSys(WindTurbineNum).Name) { - ShowFatalError(state, "SimMWindTurbine: Invalid GeneratorIndex passed=" + TrimSigDigits(WindTurbineNum) + - ", Generator name=" + GeneratorName + ", stored Generator Name for that index=" + state.dataWindTurbine->WindTurbineSys(WindTurbineNum).Name); + ShowFatalError(state, + format("SimMWindTurbine: Invalid GeneratorIndex passed={}, Generator name={}, stored Generator Name for that index={}", + WindTurbineNum, + GeneratorName, + state.dataWindTurbine->WindTurbineSys(WindTurbineNum).Name)); } } @@ -190,7 +195,7 @@ namespace WindTurbine { // and stores it in the wind turbine data structure. // Using/Aliasing - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; // SUBROUTINE PARAMETER DEFINITIONS: @@ -294,8 +299,12 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(1) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(1) + "=[" + - RoundSigDigits(rNumericArgs(1), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(1), + rNumericArgs(1))); } ErrorsFound = true; } @@ -306,8 +315,12 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(2) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(2) + "=[" + - RoundSigDigits(rNumericArgs(2), 1) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.1R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(2), + rNumericArgs(2))); } ErrorsFound = true; } @@ -318,16 +331,24 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(3) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(3) + "=[" + - RoundSigDigits(rNumericArgs(3), 1) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.1R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(3), + rNumericArgs(3))); } ErrorsFound = true; } state.dataWindTurbine->WindTurbineSys(WindTurbineNum).NumOfBlade = rNumericArgs(4); // Total number of blade if (state.dataWindTurbine->WindTurbineSys(WindTurbineNum).NumOfBlade == 0) { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(4) + "=[" + - RoundSigDigits(rNumericArgs(4), 0) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.0R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(4), + rNumericArgs(4))); ErrorsFound = true; } @@ -337,8 +358,12 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(5) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(5) + "=[" + - RoundSigDigits(rNumericArgs(5), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(5), + rNumericArgs(5))); } ErrorsFound = true; } @@ -349,8 +374,12 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(6) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(6) + "=[" + - RoundSigDigits(rNumericArgs(6), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(6), + rNumericArgs(6))); } ErrorsFound = true; } @@ -361,8 +390,12 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(7) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(7) + "=[" + - RoundSigDigits(rNumericArgs(7), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(7), + rNumericArgs(7))); } ErrorsFound = true; } @@ -370,15 +403,24 @@ namespace WindTurbine { state.dataWindTurbine->WindTurbineSys(WindTurbineNum).CutOutSpeed = rNumericArgs(8); // Minimum wind speed for system operation if (state.dataWindTurbine->WindTurbineSys(WindTurbineNum).CutOutSpeed == 0.0) { if (lNumericBlanks(8)) { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(8) + - " is required but input is blank."); + ShowSevereError( + state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(8) + " is required but input is blank."); } else if (state.dataWindTurbine->WindTurbineSys(WindTurbineNum).CutOutSpeed <= state.dataWindTurbine->WindTurbineSys(WindTurbineNum).RatedWindSpeed) { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(8) + "=[" + - RoundSigDigits(rNumericArgs(8), 2) + "] must be greater than " + cNumericFields(6) + "=[" + - RoundSigDigits(rNumericArgs(6), 2) + "]."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than {}=[{:.2R}].", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(8), + rNumericArgs(8), + cNumericFields(6), + rNumericArgs(6))); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(8) + "=[" + - RoundSigDigits(rNumericArgs(8), 2) + "] must be greater than zero"); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(8), + rNumericArgs(8))); } ErrorsFound = true; } @@ -386,9 +428,9 @@ namespace WindTurbine { state.dataWindTurbine->WindTurbineSys(WindTurbineNum).SysEfficiency = rNumericArgs(9); // Overall wind turbine system efficiency if (lNumericBlanks(9) || state.dataWindTurbine->WindTurbineSys(WindTurbineNum).SysEfficiency == 0.0 || state.dataWindTurbine->WindTurbineSys(WindTurbineNum).SysEfficiency > 1.0) { state.dataWindTurbine->WindTurbineSys(WindTurbineNum).SysEfficiency = SysEffDefault; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(9) + "=[" + - RoundSigDigits(rNumericArgs(9), 2) + "]."); - ShowContinueError(state, "...The default value of " + RoundSigDigits(SysEffDefault, 3) + " for " + cNumericFields(9) + " was assumed."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(9), rNumericArgs(9))); + ShowContinueError(state, format("...The default value of {:.3R} was assumed. for {}", SysEffDefault, cNumericFields(9))); } state.dataWindTurbine->WindTurbineSys(WindTurbineNum).MaxTipSpeedRatio = rNumericArgs(10); // Maximum tip speed ratio @@ -397,16 +439,20 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(10) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(10) + "=[" + - RoundSigDigits(rNumericArgs(10), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(10), + rNumericArgs(10))); } ErrorsFound = true; } if (state.dataWindTurbine->WindTurbineSys(WindTurbineNum).SysEfficiency > MaxTSR) { state.dataWindTurbine->WindTurbineSys(WindTurbineNum).SysEfficiency = MaxTSR; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(10) + "=[" + - RoundSigDigits(rNumericArgs(10), 2) + "]."); - ShowContinueError(state, "...The default value of " + RoundSigDigits(MaxTSR, 1) + " for " + cNumericFields(10) + " was assumed."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(10), rNumericArgs(10))); + ShowContinueError(state, format("...The default value of {:.1R} was assumed. for {}", MaxTSR, cNumericFields(10))); } state.dataWindTurbine->WindTurbineSys(WindTurbineNum).MaxPowerCoeff = rNumericArgs(11); // Maximum power coefficient @@ -415,16 +461,20 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(11) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(11) + "=[" + - RoundSigDigits(rNumericArgs(11), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(11), + rNumericArgs(11))); } ErrorsFound = true; } if (state.dataWindTurbine->WindTurbineSys(WindTurbineNum).MaxPowerCoeff > MaxPowerCoeff) { state.dataWindTurbine->WindTurbineSys(WindTurbineNum).MaxPowerCoeff = DefaultPC; - ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(11) + "=[" + - RoundSigDigits(rNumericArgs(11), 2) + "]."); - ShowContinueError(state, "...The default value of " + RoundSigDigits(DefaultPC, 2) + " for " + cNumericFields(11) + " will be used."); + ShowWarningError(state, + format("{}=\"{}\" invalid {}=[{:.2R}].", CurrentModuleObject, cAlphaArgs(1), cNumericFields(11), rNumericArgs(11))); + ShowContinueError(state, format("...The default value of {:.2R} will be used. for {}", DefaultPC, cNumericFields(11))); } state.dataWindTurbine->WindTurbineSys(WindTurbineNum).LocalAnnualAvgWS = rNumericArgs(12); // Local wind speed annually averaged @@ -433,8 +483,12 @@ namespace WindTurbine { ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(12) + " is necessary for accurate prediction but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(12) + "=[" + - RoundSigDigits(rNumericArgs(12), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(12), + rNumericArgs(12))); ErrorsFound = true; } } @@ -448,10 +502,14 @@ namespace WindTurbine { if (lNumericBlanks(13)) { ShowWarningError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(13) + " is necessary for accurate prediction but input is blank."); - ShowContinueError(state, "...The default value of " + RoundSigDigits(DefaultH, 2) + " for " + cNumericFields(13) + " will be used."); + ShowContinueError(state, format("...The default value of {:.2R} will be used. for {}", DefaultH, cNumericFields(13))); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(13) + "=[" + - RoundSigDigits(rNumericArgs(13), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(13), + rNumericArgs(13))); ErrorsFound = true; } } @@ -463,8 +521,12 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(14) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(14) + "=[" + - RoundSigDigits(rNumericArgs(14), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(14), + rNumericArgs(14))); } ErrorsFound = true; } @@ -475,8 +537,12 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(15) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(15) + "=[" + - RoundSigDigits(rNumericArgs(15), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(15), + rNumericArgs(15))); } ErrorsFound = true; } @@ -487,8 +553,12 @@ namespace WindTurbine { ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(16) + " is required but input is blank."); } else { - ShowSevereError(state, CurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid " + cNumericFields(16) + "=[" + - RoundSigDigits(rNumericArgs(16), 2) + "] must be greater than zero."); + ShowSevereError(state, + format("{}=\"{}\" invalid {}=[{:.2R}] must be greater than zero.", + CurrentModuleObject, + cAlphaArgs(1), + cNumericFields(16), + rNumericArgs(16))); } ErrorsFound = true; } diff --git a/src/EnergyPlus/WindowAC.cc b/src/EnergyPlus/WindowAC.cc index f8289481483..26b5a3eace8 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -152,7 +152,6 @@ namespace WindowAC { using DataHeatBalFanSys::TempControlType; using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::TrimSigDigits; int WindACNum; // index of window AC unit being simulated Real64 QZnReq; // zone load (W) @@ -174,13 +173,19 @@ namespace WindowAC { } else { WindACNum = CompIndex; if (WindACNum > state.dataWindowAC->NumWindAC || WindACNum < 1) { - ShowFatalError(state, "SimWindowAC: Invalid CompIndex passed=" + TrimSigDigits(WindACNum) + - ", Number of Units=" + TrimSigDigits(state.dataWindowAC->NumWindAC) + ", Entered Unit name=" + CompName); + ShowFatalError(state, + format("SimWindowAC: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + WindACNum, + state.dataWindowAC->NumWindAC, + CompName)); } if (state.dataWindowAC->CheckEquipName(WindACNum)) { if (CompName != state.dataWindowAC->WindAC(WindACNum).Name) { - ShowFatalError(state, "SimWindowAC: Invalid CompIndex passed=" + TrimSigDigits(WindACNum) + ", Unit name=" + CompName + - ", stored Unit Name for that index=" + state.dataWindowAC->WindAC(WindACNum).Name); + ShowFatalError(state, + format("SimWindowAC: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + WindACNum, + CompName, + state.dataWindowAC->WindAC(WindACNum).Name)); } state.dataWindowAC->CheckEquipName(WindACNum) = false; } @@ -232,7 +237,7 @@ namespace WindowAC { using Fans::GetFanIndex; using Fans::GetFanType; using Fans::GetFanVolFlow; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; auto &GetDXCoilOutletNode(DXCoils::GetCoilOutletNode); auto &GetDXHXAsstdCoilOutletNode(HVACHXAssistedCoolingCoil::GetCoilOutletNode); @@ -377,10 +382,13 @@ namespace WindowAC { FanVolFlow = HVACFan::fanObjs[state.dataWindowAC->WindAC(WindACNum).FanIndex]->designAirVolFlowRate; if (FanVolFlow != AutoSize) { if (FanVolFlow < state.dataWindowAC->WindAC(WindACNum).MaxAirVolFlow) { - ShowWarningError(state, "Air flow rate = " + TrimSigDigits(FanVolFlow, 7) + " in fan object " + - state.dataWindowAC->WindAC(WindACNum).FanName + " is less than the maximum supply air flow rate (" + - TrimSigDigits(state.dataWindowAC->WindAC(WindACNum).MaxAirVolFlow, 7) + ") in the " + - CurrentModuleObject + " object."); + ShowWarningError(state, + format("Air flow rate = {:.7T} in fan object {} is less than the maximum supply air flow rate ({:.7T}) " + "in the {} object.", + FanVolFlow, + state.dataWindowAC->WindAC(WindACNum).FanName, + state.dataWindowAC->WindAC(WindACNum).MaxAirVolFlow, + CurrentModuleObject)); ShowContinueError(state, " The fan flow rate must be >= to the " + cNumericFields(1) + " in the " + CurrentModuleObject + " object."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + state.dataWindowAC->WindAC(WindACNum).Name); @@ -413,11 +421,13 @@ namespace WindowAC { GetFanVolFlow(state.dataWindowAC->WindAC(WindACNum).FanIndex, FanVolFlow); if (FanVolFlow != AutoSize) { if (FanVolFlow < state.dataWindowAC->WindAC(WindACNum).MaxAirVolFlow) { - ShowWarningError(state, "Air flow rate = " + TrimSigDigits(FanVolFlow, 7) + " in fan object " + - state.dataWindowAC->WindAC(WindACNum).FanName + - " is less than the maximum supply air flow rate (" + - TrimSigDigits(state.dataWindowAC->WindAC(WindACNum).MaxAirVolFlow, 7) + ") in the " + - CurrentModuleObject + " object."); + ShowWarningError(state, + format("Air flow rate = {:.7T} in fan object {} is less than the maximum supply air flow " + "rate ({:.7T}) in the {} object.", + FanVolFlow, + state.dataWindowAC->WindAC(WindACNum).FanName, + state.dataWindowAC->WindAC(WindACNum).MaxAirVolFlow, + CurrentModuleObject)); ShowContinueError(state, " The fan flow rate must be >= to the " + cNumericFields(1) + " in the " + CurrentModuleObject + " object."); ShowContinueError(state, " Occurs in " + CurrentModuleObject + " = " + state.dataWindowAC->WindAC(WindACNum).Name); @@ -923,7 +933,6 @@ namespace WindowAC { using namespace DataSizing; using DataHeatBalance::Zone; using DataHVACGlobals::CoolingCapacitySizing; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("SizeWindowAC: "); // include trailing blank space @@ -1412,8 +1421,6 @@ namespace WindowAC { // METHODOLOGY EMPLOYED: // Linear interpolation between max and min outputs - using General::TrimSigDigits; - int const MaxIter(50); // maximum number of iterations Real64 const MinPLF(0.0); // minimum part load factor allowed @@ -1505,7 +1512,7 @@ namespace WindowAC { ShowWarningMessage(state, "ZoneHVAC:WindowAirConditioner=\"" + state.dataWindowAC->WindAC(WindACNum).Name + "\" -- Exceeded max iterations while adjusting compressor sensible runtime to meet the zone load within the " "cooling convergence tolerance."); - ShowContinueErrorTimeStamp(state, "Iterations=" + TrimSigDigits(MaxIter)); + ShowContinueErrorTimeStamp(state, format("Iterations={}", MaxIter)); } ShowRecurringWarningErrorAtEnd(state, "ZoneHVAC:WindowAirConditioner=\"" + state.dataWindowAC->WindAC(WindACNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -1552,7 +1559,7 @@ namespace WindowAC { ShowWarningMessage(state, "ZoneHVAC:WindowAirConditioner=\"" + state.dataWindowAC->WindAC(WindACNum).Name + "\" -- Exceeded max iterations while adjusting compressor latent runtime to meet the zone load within the " "cooling convergence tolerance."); - ShowContinueErrorTimeStamp(state, "Iterations=" + TrimSigDigits(MaxIter)); + ShowContinueErrorTimeStamp(state, format("Iterations={}", MaxIter)); } ShowRecurringWarningErrorAtEnd(state, "ZoneHVAC:WindowAirConditioner=\"" + state.dataWindowAC->WindAC(WindACNum).Name + "\" -- Exceeded max iterations error (latent runtime) continues...", diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index d7649421768..4dbbd64298d 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -125,7 +125,6 @@ namespace WindowEquivalentLayer { using namespace DataSurfaces; using DataEnvironment::DayOfMonth; using DataEnvironment::Month; - using General::TrimSigDigits; void InitEquivalentLayerWindowCalculations(EnergyPlusData &state) { @@ -445,7 +444,7 @@ namespace WindowEquivalentLayer { } if (!CFSURated) { ShowWarningMessage(state, RoutineName + "Fenestration U-Value calculation failed for " + FS.Name); - ShowContinueError(state, "...Calculated U-value = " + TrimSigDigits(U, 4)); + ShowContinueError(state, format("...Calculated U-value = {:.4T}", U)); ShowContinueError(state, "...Check consistency of inputs"); } UNFRC = U; @@ -557,8 +556,8 @@ namespace WindowEquivalentLayer { if (!CFSSHGC) { ShowWarningMessage(state, RoutineName + "Solar heat gain coefficient calculation failed for " + FS.Name); - ShowContinueError(state, "...Calculated SHGC = " + TrimSigDigits(SHGC, 4)); - ShowContinueError(state, "...Calculated U-Value = " + TrimSigDigits(UCG, 4)); + ShowContinueError(state, format("...Calculated SHGC = {:.4T}", SHGC)); + ShowContinueError(state, format("...Calculated U-Value = {:.4T}", UCG)); ShowContinueError(state, "...Check consistency of inputs."); return; } @@ -973,7 +972,7 @@ namespace WindowEquivalentLayer { if (P < -0.05 || P > 1.05) { ShowWarningMessage(state, RoutineName + "property value should have been between 0 and 1"); - ShowContinueError(state, WHAT + "=: property value is =" + TrimSigDigits(P, 4)); + ShowContinueError(state, format("{}=: property value is ={:.4T}", WHAT, P)); if (P < 0.0) { ShowContinueError(state, "property value is reset to 0.0"); } else if (P > 1.0) { @@ -1098,9 +1097,9 @@ namespace WindowEquivalentLayer { if (RHO_DD + TAU_DD > 1.0) { SumRefAndTran = RHO_DD + TAU_DD; ShowWarningMessage(state, RoutineName + "Roller blind diffuse-diffuse properties are inconsistent"); - ShowContinueError(state, "...The diffuse-diffuse reflectance = " + TrimSigDigits(RHO_DD, 4)); - ShowContinueError(state, "...The diffuse-diffuse tansmittance = " + TrimSigDigits(TAU_DD, 4)); - ShowContinueError(state, "...Sum of diffuse reflectance and tansmittance = " + TrimSigDigits(SumRefAndTran, 4)); + ShowContinueError(state, format("...The diffuse-diffuse reflectance = {:.4T}", RHO_DD)); + ShowContinueError(state, format("...The diffuse-diffuse tansmittance = {:.4T}", TAU_DD)); + ShowContinueError(state, format("...Sum of diffuse reflectance and tansmittance = {:.4T}", SumRefAndTran)); ShowContinueError(state, "...This sum cannot be > 1.0. Transmittance will be reset to 1 minus reflectance"); TAU_DD = 1.0 - RHO_DD; } @@ -1234,9 +1233,9 @@ namespace WindowEquivalentLayer { if (RHO_DD + TAU_DD > 1.0) { SumRefAndTran = RHO_DD + TAU_DD; ShowWarningMessage(state, RoutineName + "Calculated insect screen diffuse-diffuse properties are inconsistent"); - ShowContinueError(state, "...The diffuse-diffuse reflectance = " + TrimSigDigits(RHO_DD, 4)); - ShowContinueError(state, "...The diffuse-diffuse tansmittance = " + TrimSigDigits(TAU_DD, 4)); - ShowContinueError(state, "...Sum of diffuse reflectance and tansmittance = " + TrimSigDigits(SumRefAndTran, 4)); + ShowContinueError(state, format("...The diffuse-diffuse reflectance = {:.4T}", RHO_DD)); + ShowContinueError(state, format("...The diffuse-diffuse tansmittance = {:.4T}", TAU_DD)); + ShowContinueError(state, format("...Sum of diffuse reflectance and tansmittance = {:.4T}", SumRefAndTran)); ShowContinueError(state, "...This sum cannot be > 1.0. Transmittance will be reset to 1 minus reflectance"); TAU_DD = 1.0 - RHO_DD; } @@ -1419,9 +1418,9 @@ namespace WindowEquivalentLayer { if (RHO_DD + TAU_DD > 1.0) { SumRefAndTran = RHO_DD + TAU_DD; ShowWarningMessage(state, RoutineName + "Calculated drape fabric diffuse-diffuse properties are inconsistent"); - ShowContinueError(state, "...The diffuse-diffuse reflectance = " + TrimSigDigits(RHO_DD, 4)); - ShowContinueError(state, "...The diffuse-diffuse tansmittance = " + TrimSigDigits(TAU_DD, 4)); - ShowContinueError(state, "...Sum of diffuse reflectance and tansmittance = " + TrimSigDigits(SumRefAndTran, 4)); + ShowContinueError(state, format("...The diffuse-diffuse reflectance = {:.4T}", RHO_DD)); + ShowContinueError(state, format("...The diffuse-diffuse tansmittance = {:.4T}", TAU_DD)); + ShowContinueError(state, format("...Sum of diffuse reflectance and tansmittance = {:.4T}", SumRefAndTran)); ShowContinueError(state, "...This sum cannot be > 1.0. Transmittance will be reset to 1 minus reflectance"); TAU_DD = 1.0 - RHO_DD; } @@ -4787,8 +4786,8 @@ namespace WindowEquivalentLayer { ++FS.WEQLSolverErrorIndex; ShowSevereError(state, "CONSTRUCTION:WINDOWEQUIVALENTLAYER = \"" + FS.Name + "\""); ShowContinueError(state, RoutineName + "Net radiation analysis did not converge"); - ShowContinueError(state, "...Maximum error is = " + TrimSigDigits(MAXERR, 6)); - ShowContinueError(state, "...Convergence tolerance is = " + TrimSigDigits(TOL, 6)); + ShowContinueError(state, format("...Maximum error is = {:.6T}", MAXERR)); + ShowContinueError(state, format("...Convergence tolerance is = {:.6T}", TOL)); ShowContinueErrorTimeStamp(state, ""); } else { ShowRecurringWarningErrorAtEnd(state, "CONSTRUCTION:WINDOWEQUIVALENTLAYER = \"" + FS.Name + "\"; " + RoutineName + @@ -5263,8 +5262,8 @@ namespace WindowEquivalentLayer { // ++FS.WEQLSolverErrorIndex; // ShowSevereError(state, "CONSTRUCTION:WINDOWEQUIVALENTLAYER = \"" + FS.Name + "\""); // ShowContinueError(state, RoutineName + "Net radiation analysis did not converge"); - // ShowContinueError(state, "...Maximum error is = " + TrimSigDigits(MAXERR, 6)); - // ShowContinueError(state, "...Convergence tolerance is = " + TrimSigDigits(TOL, 6)); + // ShowContinueError(state, format("...Maximum error is = {:.6T}", MAXERR)); + // ShowContinueError(state, format("...Convergence tolerance is = {:.6T}", TOL)); // ShowContinueErrorTimeStamp(state, ""); // } else { // ShowRecurringWarningErrorAtEnd(state, "CONSTRUCTION:WINDOWEQUIVALENTLAYER = \"" + FS.Name + "\"; " + RoutineName + diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index b420c5df809..06b5445bbf5 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -171,7 +171,7 @@ namespace WindowManager { // Using/Aliasing using namespace Vectors; - using General::TrimSigDigits; + using WindowEquivalentLayer::InitEquivalentLayerWindowCalculations; int CoefNum; // Polynomial coefficient number @@ -601,10 +601,13 @@ namespace WindowManager { } // End of loop over glass layers in the construction for front calculation if (TotalIPhi > state.dataWindowManager->MaxNumOfIncidentAngles) { - ShowSevereError(state, "WindowManage::InitGlassOpticalCalculations = " + state.dataConstruction->Construct(ConstrNum).Name + - ", Invalid maximum value of common incidet angles = " + TrimSigDigits(TotalIPhi) + "."); - ShowContinueError(state, "The maximum number of incident angles for each construct is " + TrimSigDigits(state.dataWindowManager->MaxNumOfIncidentAngles) + - ". Please rearrange the dataset."); + ShowSevereError(state, + format("WindowManage::InitGlassOpticalCalculations = {}, Invalid maximum value of common incidet angles = {}.", + state.dataConstruction->Construct(ConstrNum).Name, + TotalIPhi)); + ShowContinueError(state, + format("The maximum number of incident angles for each construct is {}. Please rearrange the dataset.", + state.dataWindowManager->MaxNumOfIncidentAngles)); ShowFatalError(state, "Errors found getting inputs. Previous error(s) cause program termination."); } @@ -1518,8 +1521,6 @@ namespace WindowManager { { // Initializes variables used in the window optical and thermal calculation. - using General::RoundSigDigits; - int ConstrNum; // Construction number int SurfNum; // Surface number int IPhi; // Angle of incidence counter @@ -1656,11 +1657,13 @@ namespace WindowManager { if (DifOverrideCount > 0) { if (!state.dataGlobal->DisplayExtraWarnings) { - ShowWarningError(state, "W5InitGlassParameters: " + RoundSigDigits(DifOverrideCount) + - " Windows had Solar Diffusing=Yes overridden by presence of Window Shading Device."); + ShowWarningError(state, + format("W5InitGlassParameters: {} Windows had Solar Diffusing=Yes overridden by presence of Window Shading Device.", + DifOverrideCount)); } else { - ShowMessage(state, "W5InitGlassParameters: " + RoundSigDigits(DifOverrideCount) + - " Windows had Solar Diffusing=Yes overridden by presence of Window Shading Device."); + ShowMessage(state, + format("W5InitGlassParameters: {} Windows had Solar Diffusing=Yes overridden by presence of Window Shading Device.", + DifOverrideCount)); } } @@ -2851,8 +2854,7 @@ namespace WindowManager { using ConvectionCoefficients::CalcISO15099WindowIntConvCoeff; using General::InterpSlatAng; using General::InterpSw; - using General::RoundSigDigits; - using General::TrimSigDigits; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -3412,7 +3414,9 @@ namespace WindowManager { } } else { - ShowFatalError(state, "SolveForWindowTemperatures: Invalid number of Glass Layers=" + TrimSigDigits(state.dataWindowManager->ngllayer) + ", up to 4 allowed."); + ShowFatalError( + state, + format("SolveForWindowTemperatures: Invalid number of Glass Layers={}, up to 4 allowed.", state.dataWindowManager->ngllayer)); } } @@ -3573,9 +3577,11 @@ namespace WindowManager { if (state.dataGlobal->DisplayExtraWarnings) { // report out temperatures for (i = 1; i <= state.dataWindowManager->nglfacep; ++i) { - ShowContinueError(state, "Glazing face index = " + RoundSigDigits(i) + - " ; new temperature =" + RoundSigDigits(state.dataWindowManager->thetas(i) - DataGlobalConstants::KelvinConv(), 4) + - "C ; previous temperature = " + RoundSigDigits(state.dataWindowManager->thetasPrev(i) - DataGlobalConstants::KelvinConv(), 4) + 'C'); + ShowContinueError(state, + format("Glazing face index = {} ; new temperature ={:.4R}C ; previous temperature = {:.4R}C", + i, + state.dataWindowManager->thetas(i) - DataGlobalConstants::KelvinConv(), + state.dataWindowManager->thetasPrev(i) - DataGlobalConstants::KelvinConv())); } } @@ -6789,7 +6795,7 @@ namespace WindowManager { using DataBSDFWindow::summerCondition; using DataBSDFWindow::winterCondition; using General::POLYF; - using General::RoundSigDigits; + using General::ScanForReports; // InterpBlind ! Blind profile angle interpolation function using WindowComplexManager::CalcComplexWindowThermal; @@ -7461,8 +7467,6 @@ namespace WindowManager { // Loop through all surfaces to determine which window has an exterior screen. Static // variables are defined here, dynamic variables are calculated in CalcScreenTransmittance. - using General::RoundSigDigits; - // Locals // SUBROUTINE PARAMETER DEFINITIONS: int const M(18); diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index c2fb60b0aeb..0ec4678aa63 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -105,7 +104,6 @@ namespace ZoneAirLoopEquipmentManager { // (water-air, refrigerant-air, steam-air, electric-electric, // water-water, etc) - using General::TrimSigDigits; int AirDistUnitNum; @@ -123,12 +121,18 @@ namespace ZoneAirLoopEquipmentManager { } else { AirDistUnitNum = CompIndex; if (AirDistUnitNum > NumAirDistUnits || AirDistUnitNum < 1) { - ShowFatalError(state, "ManageZoneAirLoopEquipment: Invalid CompIndex passed=" + TrimSigDigits(AirDistUnitNum) + - ", Number of Units=" + TrimSigDigits(NumAirDistUnits) + ", Entered Unit name=" + ZoneAirLoopEquipName); + ShowFatalError(state, + format("ManageZoneAirLoopEquipment: Invalid CompIndex passed={}, Number of Units={}, Entered Unit name={}", + AirDistUnitNum, + NumAirDistUnits, + ZoneAirLoopEquipName)); } if (ZoneAirLoopEquipName != AirDistUnit(AirDistUnitNum).Name) { - ShowFatalError(state, "ManageZoneAirLoopEquipment: Invalid CompIndex passed=" + TrimSigDigits(AirDistUnitNum) + - ", Unit name=" + ZoneAirLoopEquipName + ", stored Unit Name for that index=" + AirDistUnit(AirDistUnitNum).Name); + ShowFatalError(state, + format("ManageZoneAirLoopEquipment: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}", + AirDistUnitNum, + ZoneAirLoopEquipName, + AirDistUnit(AirDistUnitNum).Name)); } } DataSizing::CurTermUnitSizingNum = AirDistUnit(AirDistUnitNum).TermUnitSizingNum; diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index ee8b9513739..8742c24f726 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -182,8 +182,7 @@ namespace ZoneContaminantPredictorCorrector { using DataSurfaces::ExternalEnvironment; using DataSurfaces::Surface; using General::FindNumberInList; - using General::RoundSigDigits; - using General::TrimSigDigits; + using ScheduleManager::CheckScheduleValue; using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; @@ -292,15 +291,13 @@ namespace ZoneContaminantPredictorCorrector { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -325,15 +322,13 @@ namespace ZoneContaminantPredictorCorrector { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(4) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(4) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(4), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(4) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(4) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(4), SchMax)); ErrorsFound = true; } } @@ -428,15 +423,13 @@ namespace ZoneContaminantPredictorCorrector { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -446,7 +439,7 @@ namespace ZoneContaminantPredictorCorrector { if (IHGNumbers(1) < 0.0) { ShowSevereError(state, RoutineName + "Negative values are not allowed for " + cNumericFieldNames(1) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(1), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(1))); ErrorsFound = true; } @@ -454,13 +447,13 @@ namespace ZoneContaminantPredictorCorrector { if (IHGNumbers(2) <= 0.0) { ShowSevereError(state, RoutineName + "Negative or zero value is not allowed for " + cNumericFieldNames(2) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(2), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(2))); ErrorsFound = true; } if (IHGNumbers(2) > 1.0) { ShowSevereError(state, RoutineName + "The value greater than 1.0 is not allowed for " + cNumericFieldNames(2) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(2), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(2))); ErrorsFound = true; } @@ -547,15 +540,13 @@ namespace ZoneContaminantPredictorCorrector { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -567,13 +558,13 @@ namespace ZoneContaminantPredictorCorrector { if (IHGNumbers(1) < 0.0) { ShowSevereError(state, RoutineName + "Negative values are not allowed for " + cNumericFieldNames(1) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(1), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(1))); ErrorsFound = true; } if (IHGNumbers(2) <= 0.0) { ShowSevereError(state, RoutineName + "Negative values or zero are not allowed for " + cNumericFieldNames(2) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(2), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(2))); ErrorsFound = true; } @@ -655,15 +646,13 @@ namespace ZoneContaminantPredictorCorrector { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -675,13 +664,13 @@ namespace ZoneContaminantPredictorCorrector { if (IHGNumbers(1) < 0.0) { ShowSevereError(state, RoutineName + "Negative values are not allowed for " + cNumericFieldNames(1) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(1), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(1))); ErrorsFound = true; } if (IHGNumbers(2) <= 0.0) { ShowSevereError(state, RoutineName + "Negative values or zero are not allowed for " + cNumericFieldNames(2) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(2), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(2))); ErrorsFound = true; } @@ -769,15 +758,13 @@ namespace ZoneContaminantPredictorCorrector { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -788,13 +775,13 @@ namespace ZoneContaminantPredictorCorrector { if (IHGNumbers(1) < 0.0) { ShowSevereError(state, RoutineName + "Negative values are not allowed for " + cNumericFieldNames(1) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(1), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(1))); ErrorsFound = true; } if (IHGNumbers(2) <= 0.0) { ShowSevereError(state, RoutineName + "Negative values or zero are not allowed for " + cNumericFieldNames(2) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(2), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(2))); ErrorsFound = true; } @@ -884,15 +871,13 @@ namespace ZoneContaminantPredictorCorrector { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -902,7 +887,7 @@ namespace ZoneContaminantPredictorCorrector { if (IHGNumbers(1) < 0.0) { ShowSevereError(state, RoutineName + "Negative values are not allowed for " + cNumericFieldNames(1) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(1), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(1))); ErrorsFound = true; } @@ -984,15 +969,13 @@ namespace ZoneContaminantPredictorCorrector { if (SchMin < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", minimum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Minimum is [" + RoundSigDigits(SchMin, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMin)); ErrorsFound = true; } if (SchMax < 0.0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", " + cAlphaFieldNames(3) + ", maximum is < 0.0"); - ShowContinueError(state, "Schedule=\"" + AlphaName(3) + "\". Maximum is [" + RoundSigDigits(SchMax, 1) + - "]. Values must be >= 0.0."); + ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", AlphaName(3), SchMax)); ErrorsFound = true; } } @@ -1003,7 +986,7 @@ namespace ZoneContaminantPredictorCorrector { if (IHGNumbers(1) < 0.0) { ShowSevereError(state, RoutineName + "Negative values are not allowed for " + cNumericFieldNames(1) + " in " + CurrentModuleObject + " = " + AlphaName(1)); - ShowContinueError(state, "The input value is " + RoundSigDigits(IHGNumbers(1), 2)); + ShowContinueError(state, format("The input value is {:.2R}", IHGNumbers(1))); ErrorsFound = true; } @@ -1065,7 +1048,7 @@ namespace ZoneContaminantPredictorCorrector { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; + using ScheduleManager::CheckScheduleValue; using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; @@ -1662,7 +1645,7 @@ namespace ZoneContaminantPredictorCorrector { // Using/Aliasing using DataLoopNode::Node; - using General::RoundSigDigits; + using ScheduleManager::GetCurrentScheduleValue; static std::string const RoutineName("PredictZoneContaminants"); diff --git a/src/EnergyPlus/ZoneDehumidifier.cc b/src/EnergyPlus/ZoneDehumidifier.cc index 1de55812f41..236656aadb7 100644 --- a/src/EnergyPlus/ZoneDehumidifier.cc +++ b/src/EnergyPlus/ZoneDehumidifier.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -111,7 +110,7 @@ namespace ZoneDehumidifier { using namespace DataLoopNode; using DataEnvironment::OutBaroPress; using DataEnvironment::StdBaroPress; - using General::TrimSigDigits; + using namespace ScheduleManager; void SimZoneDehumidifier(EnergyPlusData &state, @@ -159,13 +158,19 @@ namespace ZoneDehumidifier { } else { ZoneDehumidNum = CompIndex; if (ZoneDehumidNum > state.dataZoneDehumidifier->NumDehumidifiers || ZoneDehumidNum < 1) { - ShowFatalError(state, "SimZoneDehumidifier: Invalid CompIndex passed= " + TrimSigDigits(ZoneDehumidNum) + - ", Number of Units= " + TrimSigDigits(state.dataZoneDehumidifier->NumDehumidifiers) + ", Entered Unit name= " + CompName); + ShowFatalError(state, + format("SimZoneDehumidifier: Invalid CompIndex passed= {}, Number of Units= {}, Entered Unit name= {}", + ZoneDehumidNum, + state.dataZoneDehumidifier->NumDehumidifiers, + CompName)); } if (state.dataZoneDehumidifier->CheckEquipName(ZoneDehumidNum)) { if (CompName != state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidNum).Name) { - ShowFatalError(state, "SimZoneDehumidifier: Invalid CompIndex passed=" + TrimSigDigits(ZoneDehumidNum) + ", Unit name= " + CompName + - ", stored Unit Name for that index= " + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidNum).Name); + ShowFatalError(state, + format("SimZoneDehumidifier: Invalid CompIndex passed={}, Unit name= {}, stored Unit Name for that index= {}", + ZoneDehumidNum, + CompName, + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidNum).Name)); } state.dataZoneDehumidifier->CheckEquipName(ZoneDehumidNum) = false; } @@ -283,7 +288,7 @@ namespace ZoneDehumidifier { state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).RatedWaterRemoval = Numbers(1); if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).RatedWaterRemoval <= 0.0) { ShowSevereError(state, cNumericFields(1) + " must be greater than zero."); - ShowContinueError(state, "Value specified = " + TrimSigDigits(Numbers(1), 5)); + ShowContinueError(state, format("Value specified = {:.5T}", Numbers(1))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).Name); ErrorsFound = true; } @@ -292,7 +297,7 @@ namespace ZoneDehumidifier { state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).RatedEnergyFactor = Numbers(2); if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).RatedEnergyFactor <= 0.0) { ShowSevereError(state, cNumericFields(2) + " must be greater than zero."); - ShowContinueError(state, "Value specified = " + TrimSigDigits(Numbers(2), 5)); + ShowContinueError(state, format("Value specified = {:.5T}", Numbers(2))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).Name); ErrorsFound = true; } @@ -301,7 +306,7 @@ namespace ZoneDehumidifier { state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).RatedAirVolFlow = Numbers(3); if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).RatedAirVolFlow <= 0.0) { ShowSevereError(state, cNumericFields(3) + " must be greater than zero."); - ShowContinueError(state, "Value specified = " + TrimSigDigits(Numbers(3), 5)); + ShowContinueError(state, format("Value specified = {:.5T}", Numbers(3))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).Name); ErrorsFound = true; } @@ -331,7 +336,7 @@ namespace ZoneDehumidifier { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, cAlphaFields(5) + " output is not equal to 1.0"); ShowContinueError(state, "(+ or -10%) at rated conditions for " + CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -361,7 +366,7 @@ namespace ZoneDehumidifier { if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, cAlphaFields(6) + " output is not equal to 1.0"); ShowContinueError(state, "(+ or -10%) at rated conditions for " + CurrentModuleObject + " = " + Alphas(1)); - ShowContinueError(state, "Curve output at rated conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError(state, format("Curve output at rated conditions = {:.3T}", CurveVal)); } } } @@ -394,8 +399,8 @@ namespace ZoneDehumidifier { if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).MinInletAirTemp >= state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).MaxInletAirTemp) { ShowSevereError(state, cNumericFields(5) + " must be greater than " + cNumericFields(4)); - ShowContinueError(state, cNumericFields(5) + " specified = " + TrimSigDigits(Numbers(5), 1)); - ShowContinueError(state, cNumericFields(4) + " specified = " + TrimSigDigits(Numbers(4), 1)); + ShowContinueError(state, format("{} specified = {:.1T}", cNumericFields(5), Numbers(5))); + ShowContinueError(state, format("{} specified = {:.1T}", cNumericFields(4), Numbers(4))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).Name); ErrorsFound = true; } @@ -405,7 +410,7 @@ namespace ZoneDehumidifier { if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).OffCycleParasiticLoad < 0.0) { ShowSevereError(state, cNumericFields(6) + " must be >= zero."); - ShowContinueError(state, "Value specified = " + TrimSigDigits(Numbers(6), 2)); + ShowContinueError(state, format("Value specified = {:.2T}", Numbers(6))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).Name); ErrorsFound = true; } @@ -775,9 +780,13 @@ namespace ZoneDehumidifier { if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).WaterRemovalCurveErrorCount < 1) { ++state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).WaterRemovalCurveErrorCount; ShowWarningError(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + "\":"); - ShowContinueError(state, " Water Removal Rate Curve output is <= 0.0 (" + TrimSigDigits(WaterRemovalRateFactor, 5) + ")."); - ShowContinueError(state, " Negative value occurs using an inlet air dry-bulb temperature of " + TrimSigDigits(InletAirTemp, 2) + - " and an inlet air relative humidity of " + TrimSigDigits(InletAirRH, 1) + '.'); + ShowContinueError(state, format(" Water Removal Rate Curve output is <= 0.0 ({:.5T}).", WaterRemovalRateFactor)); + ShowContinueError( + state, + format( + " Negative value occurs using an inlet air dry-bulb temperature of {:.2T} and an inlet air relative humidity of {:.1T}.", + InletAirTemp, + InletAirRH)); ShowContinueErrorTimeStamp(state, " Dehumidifier turned off for this time step but simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + @@ -809,9 +818,13 @@ namespace ZoneDehumidifier { if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).EnergyFactorCurveErrorCount < 1) { ++state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).EnergyFactorCurveErrorCount; ShowWarningError(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + "\":"); - ShowContinueError(state, " Energy Factor Curve output is <= 0.0 (" + TrimSigDigits(EnergyFactorAdjFactor, 5) + ")."); - ShowContinueError(state, " Negative value occurs using an inlet air dry-bulb temperature of " + TrimSigDigits(InletAirTemp, 2) + - " and an inlet air relative humidity of " + TrimSigDigits(InletAirRH, 1) + '.'); + ShowContinueError(state, format(" Energy Factor Curve output is <= 0.0 ({:.5T}).", EnergyFactorAdjFactor)); + ShowContinueError( + state, + format( + " Negative value occurs using an inlet air dry-bulb temperature of {:.2T} and an inlet air relative humidity of {:.1T}.", + InletAirTemp, + InletAirRH)); ShowContinueErrorTimeStamp(state, " Dehumidifier turned off for this time step but simulation continues."); } else { ShowRecurringWarningErrorAtEnd(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + @@ -837,8 +850,8 @@ namespace ZoneDehumidifier { if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).LowPLFErrorCount < 1) { ++state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).LowPLFErrorCount; ShowWarningError(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + "\":"); - ShowContinueError(state, " The Part Load Fraction Correlation Curve output is (" + TrimSigDigits(PLF, 2) + - ") at a part-load ratio =" + TrimSigDigits(PLR, 3)); + ShowContinueError( + state, format(" The Part Load Fraction Correlation Curve output is ({:.2T}) at a part-load ratio ={:.3T}", PLF, PLR)); ShowContinueErrorTimeStamp(state, " PLF curve values must be >= 0.7. PLF has been reset to 0.7 and simulation is continuing."); } else { ShowRecurringWarningErrorAtEnd(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + @@ -854,8 +867,8 @@ namespace ZoneDehumidifier { if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).HighPLFErrorCount < 1) { ++state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).HighPLFErrorCount; ShowWarningError(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + "\":"); - ShowContinueError(state, " The Part Load Fraction Correlation Curve output is (" + TrimSigDigits(PLF, 2) + - ") at a part-load ratio =" + TrimSigDigits(PLR, 3)); + ShowContinueError( + state, format(" The Part Load Fraction Correlation Curve output is ({:.2T}) at a part-load ratio ={:.3T}", PLF, PLR)); ShowContinueErrorTimeStamp(state, " PLF curve values must be < 1.0. PLF has been reset to 1.0 and simulation is continuing."); } else { ShowRecurringWarningErrorAtEnd(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + @@ -873,8 +886,11 @@ namespace ZoneDehumidifier { if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).PLFPLRErrorCount < 1) { ++state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).PLFPLRErrorCount; ShowWarningError(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + "\":"); - ShowContinueError(state, "The part load fraction was less than the part load ratio calculated for this time step [PLR=" + - TrimSigDigits(PLR, 4) + ", PLF=" + TrimSigDigits(PLF, 4) + "]."); + ShowContinueError( + state, + format("The part load fraction was less than the part load ratio calculated for this time step [PLR={:.4T}, PLF={:.4T}].", + PLR, + PLF)); ShowContinueError(state, "Runtime fraction reset to 1 and the simulation will continue."); ShowContinueErrorTimeStamp(state, ""); } else { @@ -889,8 +905,7 @@ namespace ZoneDehumidifier { if (state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).HighRTFErrorCount < 1) { ++state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).HighRTFErrorCount; ShowWarningError(state, state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + "\":"); - ShowContinueError(state, "The runtime fraction for this zone dehumidifier exceeded 1.0 [" + TrimSigDigits(RunTimeFraction, 4) + - "]."); + ShowContinueError(state, format("The runtime fraction for this zone dehumidifier exceeded 1.0 [{:.4T}].", RunTimeFraction)); ShowContinueError(state, "Runtime fraction reset to 1 and the simulation will continue."); ShowContinueErrorTimeStamp(state, ""); } else { diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 49da159534d..ca3e97bfb99 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -443,7 +443,6 @@ namespace ZoneEquipmentManager { using DataLoopNode::Node; using DataZoneEnergyDemands::DeadBandOrSetback; using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::RoundSigDigits; // Parameters static std::string const RoutineName("SizeZoneEquipment"); @@ -1421,7 +1420,6 @@ namespace ZoneEquipmentManager { using DataHVACGlobals::SmallTempDiff; using EMSManager::ManageEMS; using General::MovingAvg; - using General::RoundSigDigits; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1859,33 +1857,30 @@ namespace ZoneEquipmentManager { } ShowContinueError(state, "...check zone thermostat set point and design supply air temperatures"); ShowContinueError(state, "...zone name = " + CalcFinalZoneSizing(I).ZoneName); - ShowContinueError(state, "...design sensible cooling load = " + RoundSigDigits(CalcFinalZoneSizing(I).DesCoolLoad, 2) + - " W"); - ShowContinueError(state, "...thermostat set point temp = " + RoundSigDigits(CalcFinalZoneSizing(I).CoolTstatTemp, 3) + - " C"); + ShowContinueError(state, format("...design sensible cooling load = {:.2R} W", CalcFinalZoneSizing(I).DesCoolLoad)); + ShowContinueError(state, format("...thermostat set point temp = {:.3R} C", CalcFinalZoneSizing(I).CoolTstatTemp)); ShowContinueError(state, - "...zone temperature = " + RoundSigDigits(CalcFinalZoneSizing(I).ZoneTempAtCoolPeak, 3) + " C"); - ShowContinueError(state, "...supply air temperature = " + RoundSigDigits(SupplyTemp, 3) + " C"); - ShowContinueError(state, "...temperature difference = " + RoundSigDigits(DeltaTemp, 5) + " C"); - ShowContinueError(state, "...calculated volume flow rate = " + RoundSigDigits((CalcFinalZoneSizing(I).DesCoolVolFlow), 5) + - " m3/s"); - ShowContinueError(state, "...calculated mass flow rate = " + RoundSigDigits((CalcFinalZoneSizing(I).DesCoolMassFlow), 5) + - " kg/s"); + format("...zone temperature = {:.3R} C", CalcFinalZoneSizing(I).ZoneTempAtCoolPeak)); + ShowContinueError(state, format("...supply air temperature = {:.3R} C", SupplyTemp)); + ShowContinueError(state, format("...temperature difference = {:.5R} C", DeltaTemp)); + ShowContinueError(state, + format("...calculated volume flow rate = {:.5R} m3/s", (CalcFinalZoneSizing(I).DesCoolVolFlow))); + ShowContinueError(state, + format("...calculated mass flow rate = {:.5R} kg/s", (CalcFinalZoneSizing(I).DesCoolMassFlow))); if (SupplyTemp > CalcFinalZoneSizing(I).ZoneTempAtCoolPeak) ShowContinueError(state, "...Note: supply air temperature should be less than zone temperature during cooling air flow calculations"); } else if (std::abs(DeltaTemp) > SmallTempDiff && SupplyTemp > CalcFinalZoneSizing(I).ZoneTempAtCoolPeak) { ShowSevereError(state, "UpdateZoneSizing: Supply air temperature is greater than zone temperature during cooling air flow calculations"); - ShowContinueError(state, "...calculated volume flow rate = " + RoundSigDigits((CalcFinalZoneSizing(I).DesCoolVolFlow), 5) + - " m3/s"); - ShowContinueError(state, "...calculated mass flow rate = " + RoundSigDigits((CalcFinalZoneSizing(I).DesCoolMassFlow), 5) + - " kg/s"); - ShowContinueError(state, "...thermostat set point temp = " + RoundSigDigits(CalcFinalZoneSizing(I).CoolTstatTemp, 3) + - " C"); - ShowContinueError(state, "...zone temperature = " + RoundSigDigits(CalcFinalZoneSizing(I).ZoneTempAtCoolPeak, 3) + - " C"); - ShowContinueError(state, "...supply air temperature = " + RoundSigDigits(SupplyTemp, 3) + " C"); + ShowContinueError(state, + format("...calculated volume flow rate = {:.5R} m3/s", (CalcFinalZoneSizing(I).DesCoolVolFlow))); + ShowContinueError(state, + format("...calculated mass flow rate = {:.5R} kg/s", (CalcFinalZoneSizing(I).DesCoolMassFlow))); + ShowContinueError(state, format("...thermostat set point temp = {:.3R} C", CalcFinalZoneSizing(I).CoolTstatTemp)); + ShowContinueError(state, + format("...zone temperature = {:.3R} C", CalcFinalZoneSizing(I).ZoneTempAtCoolPeak)); + ShowContinueError(state, format("...supply air temperature = {:.3R} C", SupplyTemp)); ShowContinueError(state, "...occurs in zone = " + CalcFinalZoneSizing(I).ZoneName); ShowContinueError(state, "...Note: supply air temperature should be less than zone temperature during cooling air flow calculations"); @@ -1910,32 +1905,32 @@ namespace ZoneEquipmentManager { } ShowContinueError(state, "...check zone thermostat set point and design supply air temperatures"); ShowContinueError(state, "...zone name = " + CalcFinalZoneSizing(I).ZoneName); - ShowContinueError(state, "...design heating load = " + RoundSigDigits(CalcFinalZoneSizing(I).DesHeatLoad, 2) + " W"); - ShowContinueError(state, "...thermostat set point temp = " + RoundSigDigits(CalcFinalZoneSizing(I).HeatTstatTemp, 3) + - " C"); - ShowContinueError(state, "...zone temperature = " + RoundSigDigits(CalcFinalZoneSizing(I).ZoneTempAtHeatPeak, 3) + - " C"); - ShowContinueError(state, "...supply air temperature = " + RoundSigDigits(SupplyTemp, 3) + " C"); - ShowContinueError(state, "...temperature difference = " + RoundSigDigits(DeltaTemp, 5) + " C"); - ShowContinueError(state, "...calculated volume flow rate = " + RoundSigDigits((CalcFinalZoneSizing(I).DesHeatVolFlow), 5) + - " m3/s"); - ShowContinueError(state, "...calculated mass flow rate = " + RoundSigDigits((CalcFinalZoneSizing(I).DesHeatMassFlow), 5) + - " kg/s"); + ShowContinueError(state, format("...design heating load = {:.2R} W", CalcFinalZoneSizing(I).DesHeatLoad)); + ShowContinueError(state, format("...thermostat set point temp = {:.3R} C", CalcFinalZoneSizing(I).HeatTstatTemp)); + ShowContinueError(state, + format("...zone temperature = {:.3R} C", CalcFinalZoneSizing(I).ZoneTempAtHeatPeak)); + ShowContinueError(state, format("...supply air temperature = {:.3R} C", SupplyTemp)); + ShowContinueError(state, format("...temperature difference = {:.5R} C", DeltaTemp)); + ShowContinueError(state, + format("...calculated volume flow rate = {:.5R} m3/s", (CalcFinalZoneSizing(I).DesHeatVolFlow))); + ShowContinueError(state, + format("...calculated mass flow rate = {:.5R} kg/s", (CalcFinalZoneSizing(I).DesHeatMassFlow))); if (SupplyTemp < CalcFinalZoneSizing(I).ZoneTempAtHeatPeak) ShowContinueError(state, "...Note: supply air temperature should be greater than zone temperature during heating air " "flow calculations"); } else if (std::abs(DeltaTemp) > SmallTempDiff && SupplyTemp < CalcFinalZoneSizing(I).ZoneTempAtHeatPeak) { ShowSevereError(state, "UpdateZoneSizing: Supply air temperature is less than zone temperature during heating air flow calculations"); - ShowContinueError(state, "...calculated design heating volume flow rate = " + - RoundSigDigits((CalcFinalZoneSizing(I).DesHeatVolFlow), 5) + " m3/s"); - ShowContinueError(state, "...calculated design heating mass flow rate = " + - RoundSigDigits((CalcFinalZoneSizing(I).DesHeatMassFlow), 5) + " kg/s"); - ShowContinueError(state, "...thermostat set piont temp = " + RoundSigDigits(CalcFinalZoneSizing(I).HeatTstatTemp, 3) + - " C"); - ShowContinueError(state, "...zone temperature = " + RoundSigDigits(CalcFinalZoneSizing(I).ZoneTempAtHeatPeak, 3) + - " C"); - ShowContinueError(state, "...supply air temperature = " + RoundSigDigits(SupplyTemp, 3) + " C"); + ShowContinueError( + state, + format("...calculated design heating volume flow rate = {:.5R} m3/s", (CalcFinalZoneSizing(I).DesHeatVolFlow))); + ShowContinueError( + state, + format("...calculated design heating mass flow rate = {:.5R} kg/s", (CalcFinalZoneSizing(I).DesHeatMassFlow))); + ShowContinueError(state, format("...thermostat set piont temp = {:.3R} C", CalcFinalZoneSizing(I).HeatTstatTemp)); + ShowContinueError(state, + format("...zone temperature = {:.3R} C", CalcFinalZoneSizing(I).ZoneTempAtHeatPeak)); + ShowContinueError(state, format("...supply air temperature = {:.3R} C", SupplyTemp)); ShowContinueError(state, "...occurs in zone = " + CalcFinalZoneSizing(I).ZoneName); ShowContinueError(state, "...Note: supply air temperature should be greater than zone temperature during heating air " "flow calculations"); @@ -4156,18 +4151,21 @@ namespace ZoneEquipmentManager { " there is unbalanced air flow. Load due to induced outdoor air is neglected."); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, - " Flows [m3/s]: Inlets: " + - General::RoundSigDigits(thisZoneEquip.TotInletAirMassFlowRate / DataEnvironment::StdRhoAir, 6) + - " Unbalanced exhausts: " + General::RoundSigDigits(sysUnbalExhaust / DataEnvironment::StdRhoAir, 6) + - " Returns: " + General::RoundSigDigits(totalZoneReturnMassFlow / DataEnvironment::StdRhoAir, 6)); + format(" Flows [m3/s]: Inlets: {:.6R} Unbalanced exhausts: {:.6R} Returns: {:.6R}", + thisZoneEquip.TotInletAirMassFlowRate / DataEnvironment::StdRhoAir, + sysUnbalExhaust / DataEnvironment::StdRhoAir, + totalZoneReturnMassFlow / DataEnvironment::StdRhoAir)); ShowContinueError(state, - " Infiltration: " + General::RoundSigDigits(DataHeatBalFanSys::OAMFL(actualZone) / rhoZone, 6) + - " Zone Ventilation: " + General::RoundSigDigits(DataHeatBalFanSys::VAMFL(actualZone) / rhoZone, 6) + - " Mixing (incoming): " + - General::RoundSigDigits(DataHeatBalFanSys::MixingMassFlowZone(actualZone) / rhoZone, 6)); - ShowContinueError(state, " Imbalance (excess outflow): " + General::RoundSigDigits(unbalancedVolFlow, 6) + - " Total system OA flow (for all airloops serving this zone): " + - General::RoundSigDigits(thisZoneEquip.TotAvailAirLoopOA / DataEnvironment::StdRhoAir, 6)); + format(" Infiltration: {:.6R} Zone Ventilation: {:.6R} Mixing (incoming): {:.6R}", + DataHeatBalFanSys::OAMFL(actualZone) / rhoZone, + DataHeatBalFanSys::VAMFL(actualZone) / rhoZone, + DataHeatBalFanSys::MixingMassFlowZone(actualZone) / rhoZone)); + ShowContinueError( + state, + format( + " Imbalance (excess outflow): {:.6R} Total system OA flow (for all airloops serving this zone): {:.6R}", + unbalancedVolFlow, + thisZoneEquip.TotAvailAirLoopOA / DataEnvironment::StdRhoAir)); ShowContinueError(state, " This error will only be reported once per zone."); thisZoneEquip.FlowError = true; } @@ -5766,7 +5764,6 @@ namespace ZoneEquipmentManager { // This subroutine writes the DOAS Sizing:Zone input for 1 zone to the eio file // Using/Aliasing - using General::RoundSigDigits; // Formats static constexpr auto Format_990( diff --git a/src/EnergyPlus/ZonePlenum.cc b/src/EnergyPlus/ZonePlenum.cc index 89aabc67368..8bc5c435583 100644 --- a/src/EnergyPlus/ZonePlenum.cc +++ b/src/EnergyPlus/ZonePlenum.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -119,7 +118,6 @@ namespace ZonePlenum { // Using/Aliasing using DataZoneEquipment::ZoneReturnPlenum_Type; using DataZoneEquipment::ZoneSupplyPlenum_Type; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ZonePlenumNum; // The ZonePlenum that you are currently loading input into @@ -141,15 +139,22 @@ namespace ZonePlenum { } else { ZonePlenumNum = CompIndex; if (ZonePlenumNum > state.dataZonePlenum->NumZoneReturnPlenums || ZonePlenumNum < 1) { - ShowFatalError(state, "SimAirZonePlenum: Invalid CompIndex passed=" + TrimSigDigits(ZonePlenumNum) + - ", Number of AirLoopHVAC:ReturnPlenum=" + TrimSigDigits(state.dataZonePlenum->NumZoneReturnPlenums) + - ", AirLoopHVAC:ReturnPlenum name=" + CompName); + ShowFatalError( + state, + format( + "SimAirZonePlenum: Invalid CompIndex passed={}, Number of AirLoopHVAC:ReturnPlenum={}, AirLoopHVAC:ReturnPlenum name={}", + ZonePlenumNum, + state.dataZonePlenum->NumZoneReturnPlenums, + CompName)); } if (state.dataZonePlenum->CheckRetEquipName(ZonePlenumNum)) { if (CompName != state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).ZonePlenumName) { - ShowFatalError(state, "SimAirZonePlenum: Invalid CompIndex passed=" + TrimSigDigits(ZonePlenumNum) + - ", AirLoopHVAC:ReturnPlenum name=" + CompName + - ", stored AirLoopHVAC:ReturnPlenum Name for that index=" + state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).ZonePlenumName); + ShowFatalError(state, + format("SimAirZonePlenum: Invalid CompIndex passed={}, AirLoopHVAC:ReturnPlenum name={}, stored " + "AirLoopHVAC:ReturnPlenum Name for that index={}", + ZonePlenumNum, + CompName, + state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).ZonePlenumName)); } state.dataZonePlenum->CheckRetEquipName(ZonePlenumNum) = false; } @@ -172,15 +177,22 @@ namespace ZonePlenum { } else { ZonePlenumNum = CompIndex; if (ZonePlenumNum > state.dataZonePlenum->NumZoneSupplyPlenums || ZonePlenumNum < 1) { - ShowFatalError(state, "SimAirZonePlenum: Invalid CompIndex passed=" + TrimSigDigits(ZonePlenumNum) + - ", Number of AirLoopHVAC:SupplyPlenum=" + TrimSigDigits(state.dataZonePlenum->NumZoneReturnPlenums) + - ", AirLoopHVAC:SupplyPlenum name=" + CompName); + ShowFatalError( + state, + format( + "SimAirZonePlenum: Invalid CompIndex passed={}, Number of AirLoopHVAC:SupplyPlenum={}, AirLoopHVAC:SupplyPlenum name={}", + ZonePlenumNum, + state.dataZonePlenum->NumZoneReturnPlenums, + CompName)); } if (state.dataZonePlenum->CheckSupEquipName(ZonePlenumNum)) { if (CompName != state.dataZonePlenum->ZoneSupPlenCond(ZonePlenumNum).ZonePlenumName) { - ShowFatalError(state, "SimAirZonePlenum: Invalid CompIndex passed=" + TrimSigDigits(ZonePlenumNum) + - ", AirLoopHVAC:SupplyPlenum name=" + CompName + - ", stored AirLoopHVAC:SupplyPlenum Name for that index=" + state.dataZonePlenum->ZoneSupPlenCond(ZonePlenumNum).ZonePlenumName); + ShowFatalError(state, + format("SimAirZonePlenum: Invalid CompIndex passed={}, AirLoopHVAC:SupplyPlenum name={}, stored " + "AirLoopHVAC:SupplyPlenum Name for that index={}", + ZonePlenumNum, + CompName, + state.dataZonePlenum->ZoneSupPlenCond(ZonePlenumNum).ZonePlenumName)); } state.dataZonePlenum->CheckSupEquipName(ZonePlenumNum) = false; } @@ -194,7 +206,7 @@ namespace ZonePlenum { } else { ShowSevereError(state, "SimAirZonePlenum: Errors in Plenum=" + CompName); - ShowContinueError(state, "ZonePlenum: Unhandled plenum type found:" + TrimSigDigits(iCompType)); + ShowContinueError(state, format("ZonePlenum: Unhandled plenum type found:{}", iCompType)); ShowFatalError(state, "Preceding conditions cause termination."); } } @@ -670,6 +682,7 @@ namespace ZonePlenum { // Check that all ADUs with leakage found a return plenum for (ADUNum = 1; ADUNum <= NumAirDistUnits; ++ADUNum) { auto &thisADU(AirDistUnit(ADUNum)); + // TODO: this is comparing the same thing twice if ((thisADU.DownStreamLeak || thisADU.DownStreamLeak) && (thisADU.RetPlenumNum == 0)) { ShowWarningError(state, "No return plenum found for simple duct leakage for ZoneHVAC:AirDistributionUnit=" + thisADU.Name + " in Zone=" + ZoneEquipConfig(thisADU.ZoneEqNum).ZoneName); diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 544593cb042..4ac20077a37 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -255,8 +255,7 @@ namespace ZoneTempPredictorCorrector { using namespace DataIPShortCuts; using General::CheckCreatedZoneItemName; using General::FindNumberInList; - using General::RoundSigDigits; - using General::TrimSigDigits; + using ScheduleManager::CheckScheduleValue; using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; @@ -517,8 +516,9 @@ namespace ZoneTempPredictorCorrector { TempControlledZone(TempControlledZoneNum).DeltaTCutSet = rNumericArgs(1); if (rNumericArgs(1) > 0.0) state.dataZoneTempPredictorCorrector->NumOnOffCtrZone++; } else { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 0) + "]."); + ShowSevereError( + state, + format("{}=\"{} invalid {}=[{:.0T}].", cCurrentModuleObject, cAlphaArgs(1), cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, "..Allowable values must be greater or equal to 0"); ErrorsFound = true; } @@ -824,9 +824,11 @@ namespace ZoneTempPredictorCorrector { } } else { - ShowSevereError(state, "GetZoneAirSetpoints: Illegal control type for Zone=" + Zone(ActualZoneNum).Name + - ", Found value=" + TrimSigDigits(ControlTypeNum) + - ", in Schedule=" + TempControlledZone(TempControlledZoneNum).ControlTypeSchedName); + ShowSevereError(state, + format("GetZoneAirSetpoints: Illegal control type for Zone={}, Found value={}, in Schedule={}", + Zone(ActualZoneNum).Name, + ControlTypeNum, + TempControlledZone(TempControlledZoneNum).ControlTypeSchedName)); ShowContinueError(state, "..valid range values are [0,4]."); ErrorsFound = true; } @@ -1148,8 +1150,9 @@ namespace ZoneTempPredictorCorrector { if (NumNums > 0) { ComfortControlledZone(ComfortControlledZoneNum).TdbMinSetPoint = rNumericArgs(1); if (rNumericArgs(1) > 50 || rNumericArgs(1) < 0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 0) + "]."); + ShowSevereError( + state, + format("{}=\"{} invalid {}=[{:.0T}].", cCurrentModuleObject, cAlphaArgs(1), cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, "..Allowable values must be between 0 C and 50 C"); ErrorsFound = true; } @@ -1157,8 +1160,9 @@ namespace ZoneTempPredictorCorrector { if (NumNums > 1) { ComfortControlledZone(ComfortControlledZoneNum).TdbMaxSetPoint = rNumericArgs(2); if (rNumericArgs(2) > 50 || rNumericArgs(2) < 0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " invalid " + cNumericFieldNames(2) + "=[" + - TrimSigDigits(rNumericArgs(2), 0) + "]."); + ShowSevereError( + state, + format("{}=\"{} invalid {}=[{:.0T}].", cCurrentModuleObject, cAlphaArgs(1), cNumericFieldNames(2), rNumericArgs(2))); ShowContinueError(state, "..Allowable values must be between 0 C and 50 C"); ErrorsFound = true; } @@ -1168,7 +1172,7 @@ namespace ZoneTempPredictorCorrector { ComfortControlledZone(ComfortControlledZoneNum).TdbMaxSetPoint) { ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1)); ShowContinueError(state, ".." + cNumericFieldNames(1) + " > " + cNumericFieldNames(2)); - ShowContinueError(state, "..[" + TrimSigDigits(rNumericArgs(1), 0) + "] > [" + TrimSigDigits(rNumericArgs(2), 0) + "]."); + ShowContinueError(state, format("..[{:.0T}] > [{:.0T}].", rNumericArgs(1), rNumericArgs(2))); ErrorsFound = true; } // If MaxTemp = MinTemp, no thermal comfort control @@ -1576,9 +1580,11 @@ namespace ZoneTempPredictorCorrector { // CASE KSU } else { - ShowSevereError(state, "GetZoneAirSetpoints: Illegal control type for Zone=" + Zone(ActualZoneNum).Name + - ", Found value=" + TrimSigDigits(ControlTypeNum) + - ", in Schedule=" + ComfortControlledZone(ComfortControlledZoneNum).ControlTypeSchedName); + ShowSevereError(state, + format("GetZoneAirSetpoints: Illegal control type for Zone={}, Found value={}, in Schedule={}", + Zone(ActualZoneNum).Name, + ControlTypeNum, + ComfortControlledZone(ComfortControlledZoneNum).ControlTypeSchedName)); ShowContinueError(state, "..valid range values are [0,4]."); ErrorsFound = true; } @@ -1805,14 +1811,22 @@ namespace ZoneTempPredictorCorrector { // check validity of fixed radiative fraction if ((TempControlledZone(TempControlledZoneNum).FixedRadiativeFraction < 0.0) && (!(TempControlledZone(TempControlledZoneNum).OpTempCntrlModeScheduled))) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 2) + "\" cannot be negative."); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot be negative.", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ErrorsFound = true; } if ((TempControlledZone(TempControlledZoneNum).FixedRadiativeFraction >= 0.9) && (!(TempControlledZone(TempControlledZoneNum).OpTempCntrlModeScheduled))) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 2) + "\" cannot >= .9."); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot >= .9.", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ErrorsFound = true; } @@ -1892,16 +1906,24 @@ namespace ZoneTempPredictorCorrector { if (Item == 1) { if ((TempControlledZone(TempControlledZoneNum).FixedRadiativeFraction < 0.0) && (!(TempControlledZone(TempControlledZoneNum).OpTempCntrlModeScheduled))) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 2) + "\" cannot be negative."); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot be negative.", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ErrorsFound = true; } } if (Item == 1) { if ((TempControlledZone(TempControlledZoneNum).FixedRadiativeFraction >= 0.9) && (!(TempControlledZone(TempControlledZoneNum).OpTempCntrlModeScheduled))) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 2) + "\" cannot >= .9."); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot >= .9.", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ErrorsFound = true; } } @@ -2020,14 +2042,22 @@ namespace ZoneTempPredictorCorrector { // check validity of zone Overcool constant range if ((TempControlledZone(TempControlledZoneNum).ZoneOvercoolConstRange < 0.0) && (!(TempControlledZone(TempControlledZoneNum).OvercoolCntrlModeScheduled))) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 2) + "\" cannot be negative."); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot be negative.", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ErrorsFound = true; } if ((TempControlledZone(TempControlledZoneNum).ZoneOvercoolConstRange > 3.0) && (!(TempControlledZone(TempControlledZoneNum).OvercoolCntrlModeScheduled))) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 2) + "\" cannot be > 3.0"); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot be > 3.0", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ErrorsFound = true; } @@ -2045,8 +2075,12 @@ namespace ZoneTempPredictorCorrector { // check Overcool Control Ratio limits TempControlledZone(TempControlledZoneNum).ZoneOvercoolControlRatio = rNumericArgs(2); if (TempControlledZone(TempControlledZoneNum).ZoneOvercoolControlRatio < 0.0) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(2) + " invalid " + cNumericFieldNames(2) + "=[" + - TrimSigDigits(rNumericArgs(2), 2) + "\" cannot be negative."); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot be negative.", + cCurrentModuleObject, + cAlphaArgs(2), + cNumericFieldNames(2), + rNumericArgs(2))); ErrorsFound = true; } } @@ -2089,16 +2123,24 @@ namespace ZoneTempPredictorCorrector { if (Item == 1) { if ((TempControlledZone(TempControlledZoneNum).ZoneOvercoolConstRange < 0.0) && (!(TempControlledZone(TempControlledZoneNum).OvercoolCntrlModeScheduled))) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 2) + "\" cannot be negative."); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot be negative.", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ErrorsFound = true; } } if (Item == 1) { if ((TempControlledZone(TempControlledZoneNum).ZoneOvercoolConstRange > 3.0) && (!(TempControlledZone(TempControlledZoneNum).OvercoolCntrlModeScheduled))) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(1) + " invalid " + cNumericFieldNames(1) + "=[" + - TrimSigDigits(rNumericArgs(1), 2) + "\" cannot > 3.0"); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot > 3.0", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ErrorsFound = true; } } @@ -2119,8 +2161,12 @@ namespace ZoneTempPredictorCorrector { // check Overcool Control Ratio limits if (Item == 1) { if (TempControlledZone(TempControlledZoneNum).ZoneOvercoolControlRatio < 0.0) { - ShowSevereError(state, cCurrentModuleObject + '=' + cAlphaArgs(2) + " invalid " + cNumericFieldNames(2) + "=[" + - TrimSigDigits(rNumericArgs(2), 2) + "\" cannot be negative."); + ShowSevereError(state, + format("{}={} invalid {}=[{:.2T}\" cannot be negative.", + cCurrentModuleObject, + cAlphaArgs(2), + cNumericFieldNames(2), + rNumericArgs(2))); ErrorsFound = true; } } @@ -2244,8 +2290,12 @@ namespace ZoneTempPredictorCorrector { StageControlledZone(StageControlledZoneNum).NumOfHeatStages = rNumericArgs(1); if (rNumericArgs(1) < 1 || rNumericArgs(1) > 4) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid range " + cNumericFieldNames(1) + "=\"" + - RoundSigDigits(rNumericArgs(1), 0) + "\""); + ShowSevereError(state, + format("{}=\"{}\" invalid range {}=\"{:.0R}\"", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(1), + rNumericArgs(1))); ShowContinueError(state, "..contains values outside of range [1,4]."); ErrorsFound = true; } @@ -2262,8 +2312,11 @@ namespace ZoneTempPredictorCorrector { StageControlledZone(StageControlledZoneNum).HeatThroRange = rNumericArgs(2); if (rNumericArgs(1) < 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" negative value is found at " + cNumericFieldNames(2) + - "=\"" + RoundSigDigits(rNumericArgs(2), 1) + "\""); + ShowSevereError(state, + format("{}=\"" + cAlphaArgs(1) + "\" negative value is found at {}=\"{:.1R}\"", + cCurrentModuleObject, + cNumericFieldNames(2), + rNumericArgs(2))); ShowContinueError(state, ".. The minumum value is 0."); ErrorsFound = true; } @@ -2273,8 +2326,9 @@ namespace ZoneTempPredictorCorrector { for (i = 1; i <= StageControlledZone(StageControlledZoneNum).NumOfHeatStages; ++i) { StageControlledZone(StageControlledZoneNum).HeatTOffset(i) = rNumericArgs(2 + i); if (rNumericArgs(2 + i) > 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" positive value is found at " + - cNumericFieldNames(2 + i) + "=\"" + RoundSigDigits(rNumericArgs(2 + i), 1) + "\""); + ShowSevereError(state, + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" positive value is found at " + + format("{}=\"{:.1R}\"", cNumericFieldNames(2 + i), rNumericArgs(2 + i))); ShowContinueError(state, ".. The maximum value is 0."); ErrorsFound = true; } @@ -2285,9 +2339,13 @@ namespace ZoneTempPredictorCorrector { } if (i > 1) { if (rNumericArgs(2 + i) >= rNumericArgs(1 + i)) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" The value at " + cNumericFieldNames(2 + i) + - "=\"" + RoundSigDigits(rNumericArgs(2 + i), 1) + "\" has to be less than "); - ShowContinueError(state, cNumericFieldNames(1 + i) + "=\"" + RoundSigDigits(rNumericArgs(1 + i), 1)); + ShowSevereError(state, + format("{}=\"{}\" The value at {}=\"{:.1R}\" has to be less than ", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(2 + i), + rNumericArgs(2 + i))); + ShowContinueError(state, format("{}=\"{:.1R}", cNumericFieldNames(1 + i), rNumericArgs(1 + i))); ErrorsFound = true; } } @@ -2296,8 +2354,12 @@ namespace ZoneTempPredictorCorrector { StageControlledZone(StageControlledZoneNum).NumOfCoolStages = rNumericArgs(7); if (rNumericArgs(7) < 1 || rNumericArgs(7) > 4) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" invalid range " + cNumericFieldNames(7) + "=\"" + - RoundSigDigits(rNumericArgs(7), 0) + "\""); + ShowSevereError(state, + format("{}=\"{}\" invalid range {}=\"{:.0R}\"", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(7), + rNumericArgs(7))); ShowContinueError(state, "..contains values outside of range [1,4]."); ErrorsFound = true; } @@ -2314,8 +2376,12 @@ namespace ZoneTempPredictorCorrector { StageControlledZone(StageControlledZoneNum).CoolThroRange = rNumericArgs(8); if (rNumericArgs(8) < 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" negative value is found at " + cNumericFieldNames(8) + - "=\"" + RoundSigDigits(rNumericArgs(8), 1) + "\""); + ShowSevereError(state, + format("{}=\"{}\" negative value is found at {}=\"{:.1R}\"", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(8), + rNumericArgs(8))); ShowContinueError(state, ".. The minumum value is 0."); ErrorsFound = true; } @@ -2325,8 +2391,12 @@ namespace ZoneTempPredictorCorrector { for (i = 1; i <= StageControlledZone(StageControlledZoneNum).NumOfCoolStages; ++i) { StageControlledZone(StageControlledZoneNum).CoolTOffset(i) = rNumericArgs(8 + i); if (rNumericArgs(8 + i) < 0.0) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" negative value is found at " + - cNumericFieldNames(8 + i) + "=\"" + RoundSigDigits(rNumericArgs(8 + i), 1) + "\""); + ShowSevereError(state, + format("{}=\"{}\" negative value is found at {}=\"{:.1R}\"", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(8 + i), + rNumericArgs(8 + i))); ShowContinueError(state, ".. The minimum value is 0."); ErrorsFound = true; } @@ -2337,9 +2407,13 @@ namespace ZoneTempPredictorCorrector { } if (i > 1) { if (rNumericArgs(8 + i) <= rNumericArgs(7 + i)) { - ShowSevereError(state, cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" The value at " + cNumericFieldNames(8 + i) + - "=\"" + RoundSigDigits(rNumericArgs(8 + i), 1) + "\" has to be greater than "); - ShowContinueError(state, cNumericFieldNames(7 + i) + "=\"" + RoundSigDigits(rNumericArgs(7 + i), 1)); + ShowSevereError(state, + format("{}=\"{}\" The value at {}=\"{:.1R}\" has to be greater than ", + cCurrentModuleObject, + cAlphaArgs(1), + cNumericFieldNames(8 + i), + rNumericArgs(8 + i))); + ShowContinueError(state, format("{}=\"{:.1R}", cNumericFieldNames(7 + i), rNumericArgs(7 + i))); ErrorsFound = true; } } @@ -3193,8 +3267,7 @@ namespace ZoneTempPredictorCorrector { using DataRoomAirModel::ZTM1OC; using DataRoomAirModel::ZTMX; using DataRoomAirModel::ZTOC; - using General::RoundSigDigits; - using General::TrimSigDigits; + using InternalHeatGains::SumAllInternalConvectionGainsExceptPeople; using RoomAirModelAirflowNetwork::LoadPredictionRoomAirModelAirflowNetwork; using ScheduleManager::GetCurrentScheduleValue; @@ -3410,8 +3483,8 @@ namespace ZoneTempPredictorCorrector { "DualSetPointWithDeadBand: When Temperature Difference Between Cutout And Setpoint is applied, the heating " "setpoint is greater than the cooling setpoint. "); ShowContinueErrorTimeStamp(state, "occurs in Zone=" + Zone(ZoneNum).Name); - ShowContinueError(state, "Zone Heating ThermostatSetPoint=" + RoundSigDigits(ZoneThermostatSetPointLo(ZoneNum), 2)); - ShowContinueError(state, "Zone Cooling ThermostatSetPoint=" + RoundSigDigits(ZoneThermostatSetPointHi(ZoneNum), 2)); + ShowContinueError(state, format("Zone Heating ThermostatSetPoint={:.2R}", ZoneThermostatSetPointLo(ZoneNum))); + ShowContinueError(state, format("Zone Cooling ThermostatSetPoint={:.2R}", ZoneThermostatSetPointHi(ZoneNum))); ShowFatalError(state, "Program terminates due to above conditions."); } } @@ -3706,7 +3779,7 @@ namespace ZoneTempPredictorCorrector { // Using/Aliasing using DataZoneControls::OccRoomTSetPointCool; using DataZoneControls::OccRoomTSetPointHeat; - using General::TrimSigDigits; + using ScheduleManager::GetCurrentScheduleValue; using ScheduleManager::GetScheduleValuesForDay; @@ -3876,9 +3949,11 @@ namespace ZoneTempPredictorCorrector { AdjustCoolingSetPointforTempAndHumidityControl(state, RelativeZoneNum, ActualZoneNum); } else { - ShowSevereError(state, "CalcZoneAirTempSetpoints: Illegal control type for Zone=" + Zone(ActualZoneNum).Name + - ", Found value=" + TrimSigDigits(TempControlType(ActualZoneNum)) + - ", in Schedule=" + TempControlledZone(RelativeZoneNum).ControlTypeSchedName); + ShowSevereError(state, + format("CalcZoneAirTempSetpoints: Illegal control type for Zone={}, Found value={}, in Schedule={}", + Zone(ActualZoneNum).Name, + TempControlType(ActualZoneNum), + TempControlledZone(RelativeZoneNum).ControlTypeSchedName)); } } @@ -3932,7 +4007,7 @@ namespace ZoneTempPredictorCorrector { // Using/Aliasing using DataLoopNode::Node; - using General::RoundSigDigits; + using ScheduleManager::GetCurrentScheduleValue; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -4062,11 +4137,11 @@ namespace ZoneTempPredictorCorrector { ShowSevereError(state, "SingleHeatCoolSetPoint: Effective heating set-point higher than effective cooling set-point - use " "DualSetPointWithDeadBand if using unmixed air model"); ShowContinueErrorTimeStamp(state, "occurs in Zone=" + Zone(ZoneNum).Name); - ShowContinueError(state, "LoadToHeatingSetPoint=" + RoundSigDigits(LoadToHeatingSetPoint, 3) + - ", LoadToCoolingSetPoint=" + RoundSigDigits(LoadToCoolingSetPoint, 3)); - ShowContinueError(state, "Zone TempDepZnLd=" + RoundSigDigits(state.dataZoneTempPredictorCorrector->TempDepZnLd(ZoneNum), 2)); - ShowContinueError(state, "Zone TempIndZnLd=" + RoundSigDigits(state.dataZoneTempPredictorCorrector->TempIndZnLd(ZoneNum), 2)); - ShowContinueError(state, "Zone ThermostatSetPoint=" + RoundSigDigits(TempZoneThermostatSetPoint(ZoneNum), 2)); + ShowContinueError( + state, format("LoadToHeatingSetPoint={:.3R}, LoadToCoolingSetPoint={:.3R}", LoadToHeatingSetPoint, LoadToCoolingSetPoint)); + ShowContinueError(state, format("Zone TempDepZnLd={:.2R}", state.dataZoneTempPredictorCorrector->TempDepZnLd(ZoneNum))); + ShowContinueError(state, format("Zone TempIndZnLd={:.2R}", state.dataZoneTempPredictorCorrector->TempIndZnLd(ZoneNum))); + ShowContinueError(state, format("Zone ThermostatSetPoint={:.2R}", TempZoneThermostatSetPoint(ZoneNum))); ShowFatalError(state, "Program terminates due to above conditions."); } @@ -4086,11 +4161,11 @@ namespace ZoneTempPredictorCorrector { ShowSevereError(state, "SingleHeatCoolSetPoint: Unanticipated combination of heating and cooling loads - report to EnergyPlus Development Team"); ShowContinueErrorTimeStamp(state, "occurs in Zone=" + Zone(ZoneNum).Name); - ShowContinueError(state, "LoadToHeatingSetPoint=" + RoundSigDigits(LoadToHeatingSetPoint, 3) + - ", LoadToCoolingSetPoint=" + RoundSigDigits(LoadToCoolingSetPoint, 3)); - ShowContinueError(state, "Zone TempDepZnLd=" + RoundSigDigits(state.dataZoneTempPredictorCorrector->TempDepZnLd(ZoneNum), 2)); - ShowContinueError(state, "Zone TempIndZnLd=" + RoundSigDigits(state.dataZoneTempPredictorCorrector->TempIndZnLd(ZoneNum), 2)); - ShowContinueError(state, "Zone ThermostatSetPoint=" + RoundSigDigits(TempZoneThermostatSetPoint(ZoneNum), 2)); + ShowContinueError( + state, format("LoadToHeatingSetPoint={:.3R}, LoadToCoolingSetPoint={:.3R}", LoadToHeatingSetPoint, LoadToCoolingSetPoint)); + ShowContinueError(state, format("Zone TempDepZnLd={:.2R}", state.dataZoneTempPredictorCorrector->TempDepZnLd(ZoneNum))); + ShowContinueError(state, format("Zone TempIndZnLd={:.2R}", state.dataZoneTempPredictorCorrector->TempIndZnLd(ZoneNum))); + ShowContinueError(state, format("Zone ThermostatSetPoint={:.2R}", TempZoneThermostatSetPoint(ZoneNum))); ShowFatalError(state, "Program terminates due to above conditions."); } @@ -4137,12 +4212,12 @@ namespace ZoneTempPredictorCorrector { ShowSevereError(state, "DualSetPointWithDeadBand: Effective heating set-point higher than effective cooling set-point - increase " "deadband if using unmixed air model"); ShowContinueErrorTimeStamp(state, "occurs in Zone=" + Zone(ZoneNum).Name); - ShowContinueError(state, "LoadToHeatingSetPoint=" + RoundSigDigits(LoadToHeatingSetPoint, 3) + - ", LoadToCoolingSetPoint=" + RoundSigDigits(LoadToCoolingSetPoint, 3)); - ShowContinueError(state, "Zone TempDepZnLd=" + RoundSigDigits(state.dataZoneTempPredictorCorrector->TempDepZnLd(ZoneNum), 2)); - ShowContinueError(state, "Zone TempIndZnLd=" + RoundSigDigits(state.dataZoneTempPredictorCorrector->TempIndZnLd(ZoneNum), 2)); - ShowContinueError(state, "Zone Heating ThermostatSetPoint=" + RoundSigDigits(ZoneThermostatSetPointLo(ZoneNum), 2)); - ShowContinueError(state, "Zone Cooling ThermostatSetPoint=" + RoundSigDigits(ZoneThermostatSetPointHi(ZoneNum), 2)); + ShowContinueError( + state, format("LoadToHeatingSetPoint={:.3R}, LoadToCoolingSetPoint={:.3R}", LoadToHeatingSetPoint, LoadToCoolingSetPoint)); + ShowContinueError(state, format("Zone TempDepZnLd={:.2R}", state.dataZoneTempPredictorCorrector->TempDepZnLd(ZoneNum))); + ShowContinueError(state, format("Zone TempIndZnLd={:.2R}", state.dataZoneTempPredictorCorrector->TempIndZnLd(ZoneNum))); + ShowContinueError(state, format("Zone Heating ThermostatSetPoint={:.2R}", ZoneThermostatSetPointLo(ZoneNum))); + ShowContinueError(state, format("Zone Cooling ThermostatSetPoint={:.2R}", ZoneThermostatSetPointHi(ZoneNum))); ShowFatalError(state, "Program terminates due to above conditions."); } @@ -4165,13 +4240,13 @@ namespace ZoneTempPredictorCorrector { ShowSevereError(state, "DualSetPointWithDeadBand: Unanticipated combination of heating and cooling loads - report to EnergyPlus Development Team"); ShowContinueErrorTimeStamp(state, "occurs in Zone=" + Zone(ZoneNum).Name); - ShowContinueError(state, "LoadToHeatingSetPoint=" + RoundSigDigits(LoadToHeatingSetPoint, 3) + - ", LoadToCoolingSetPoint=" + RoundSigDigits(LoadToCoolingSetPoint, 3)); - ShowContinueError(state, "Zone Heating Set-point=" + RoundSigDigits(ZoneThermostatSetPointLo(ZoneNum), 2)); - ShowContinueError(state, "Zone Cooling Set-point=" + RoundSigDigits(ZoneThermostatSetPointHi(ZoneNum), 2)); - ShowContinueError(state, "Zone TempDepZnLd=" + RoundSigDigits(state.dataZoneTempPredictorCorrector->TempDepZnLd(ZoneNum), 2)); - ShowContinueError(state, "Zone TempIndZnLd=" + RoundSigDigits(state.dataZoneTempPredictorCorrector->TempIndZnLd(ZoneNum), 2)); - ShowContinueError(state, "Zone ThermostatSetPoint=" + RoundSigDigits(TempZoneThermostatSetPoint(ZoneNum), 2)); + ShowContinueError( + state, format("LoadToHeatingSetPoint={:.3R}, LoadToCoolingSetPoint={:.3R}", LoadToHeatingSetPoint, LoadToCoolingSetPoint)); + ShowContinueError(state, format("Zone Heating Set-point={:.2R}", ZoneThermostatSetPointLo(ZoneNum))); + ShowContinueError(state, format("Zone Cooling Set-point={:.2R}", ZoneThermostatSetPointHi(ZoneNum))); + ShowContinueError(state, format("Zone TempDepZnLd={:.2R}", state.dataZoneTempPredictorCorrector->TempDepZnLd(ZoneNum))); + ShowContinueError(state, format("Zone TempIndZnLd={:.2R}", state.dataZoneTempPredictorCorrector->TempIndZnLd(ZoneNum))); + ShowContinueError(state, format("Zone ThermostatSetPoint={:.2R}", TempZoneThermostatSetPoint(ZoneNum))); ShowFatalError(state, "Program terminates due to above conditions."); } @@ -4319,7 +4394,7 @@ namespace ZoneTempPredictorCorrector { using DataSurfaces::HeatTransferModel_EMPD; using DataSurfaces::HeatTransferModel_HAMT; using DataSurfaces::Surface; - using General::RoundSigDigits; + using ScheduleManager::GetCurrentScheduleValue; // SUBROUTINE PARAMETER DEFINITIONS: @@ -4616,10 +4691,11 @@ namespace ZoneTempPredictorCorrector { ShowSevereError(state, "Humidistat: Unanticipated combination of humidifying and dehumidifying loads - report to EnergyPlus Development Team"); ShowContinueErrorTimeStamp(state, "occurs in Zone=" + Zone(ZoneNum).Name); - ShowContinueError(state, "LoadToHumidifySetPoint=" + RoundSigDigits(LoadToHumidifySetPoint, 5) + - ", LoadToDehumidifySetPoint=" + RoundSigDigits(LoadToDehumidifySetPoint, 5)); - ShowContinueError(state, "Zone RH Humidifying Set-point=" + RoundSigDigits(ZoneRHHumidifyingSetPoint, 1)); - ShowContinueError(state, "Zone RH Dehumidifying Set-point=" + RoundSigDigits(ZoneRHDehumidifyingSetPoint, 2)); + ShowContinueError( + state, + format("LoadToHumidifySetPoint={:.5R}, LoadToDehumidifySetPoint={:.5R}", LoadToHumidifySetPoint, LoadToDehumidifySetPoint)); + ShowContinueError(state, format("Zone RH Humidifying Set-point={:.1R}", ZoneRHHumidifyingSetPoint)); + ShowContinueError(state, format("Zone RH Dehumidifying Set-point={:.2R}", ZoneRHDehumidifyingSetPoint)); ShowFatalError(state, "Program terminates due to above conditions."); } } @@ -4712,7 +4788,7 @@ namespace ZoneTempPredictorCorrector { using DataRoomAirModel::ZTM1OC; using DataRoomAirModel::ZTMX; using DataRoomAirModel::ZTOC; - using General::TrimSigDigits; + using RoomAirModelManager::ManageAirModel; // HybridModel @@ -6407,7 +6483,7 @@ namespace ZoneTempPredictorCorrector { using DataDefineEquip::AirDistUnit; using DataLoopNode::Node; using DataZoneEquipment::ZoneEquipConfig; - using General::RoundSigDigits; + using InternalHeatGains::SumAllInternalConvectionGains; using InternalHeatGains::SumAllReturnAirConvectionGains; //using ZonePlenum::ZoneRetPlenCond; @@ -6686,7 +6762,7 @@ namespace ZoneTempPredictorCorrector { if ((std::abs(imBalance) > Threshold) && (!state.dataGlobal->WarmupFlag) && (!state.dataGlobal->DoingSizing)) { // air balance is out by more than threshold if (Zone(ZoneNum).AirHBimBalanceErrIndex == 0) { ShowWarningMessage(state, "Zone Air Heat Balance is out of balance for zone named " + Zone(ZoneNum).Name); - ShowContinueError(state, "Zone Air Heat Balance Deviation Rate is more than " + RoundSigDigits(Threshold, 1) + " {W}"); + ShowContinueError(state, format("Zone Air Heat Balance Deviation Rate is more than {:.1R} {{W}}", Threshold)); if (TurnFansOn) { ShowContinueError(state, "Night cycle fan operation may be causing above error"); } @@ -7019,7 +7095,7 @@ namespace ZoneTempPredictorCorrector { // obtained from thermal comfort models. // Using/Aliasing - using General::TrimSigDigits; + using ScheduleManager::GetCurrentScheduleValue; using ThermalComfort::ManageThermalComfort; @@ -7119,9 +7195,12 @@ namespace ZoneTempPredictorCorrector { } } else { - ShowSevereError(state, "CalcZoneAirTempSetpoints: Illegal thermal control control type for Zone=" + Zone(ActualZoneNum).Name + - ", Found value=" + TrimSigDigits(ComfortControlType(ActualZoneNum)) + - ", in Schedule=" + ComfortControlledZone(RelativeZoneNum).ControlTypeSchedName); + ShowSevereError( + state, + format("CalcZoneAirTempSetpoints: Illegal thermal control control type for Zone={}, Found value={}, in Schedule={}", + Zone(ActualZoneNum).Name, + ComfortControlType(ActualZoneNum), + ComfortControlledZone(RelativeZoneNum).ControlTypeSchedName)); } } @@ -7348,9 +7427,12 @@ namespace ZoneTempPredictorCorrector { TempControlType(ActualZoneNum) = DualSetPointWithDeadBand; } else { - ShowSevereError(state, "CalcZoneAirComfortSetpoints: Illegal thermal control control type for Zone=" + Zone(ActualZoneNum).Name + - ", Found value=" + TrimSigDigits(ComfortControlType(ActualZoneNum)) + - ", in Schedule=" + ComfortControlledZone(ActualZoneNum).ControlTypeSchedName); + ShowSevereError( + state, + format("CalcZoneAirComfortSetpoints: Illegal thermal control control type for Zone={}, Found value={}, in Schedule={}", + Zone(ActualZoneNum).Name, + ComfortControlType(ActualZoneNum), + ComfortControlledZone(ActualZoneNum).ControlTypeSchedName)); } } } diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index f28650277d0..381fdce9295 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -212,7 +212,7 @@ Real64 getVariableValue(EnergyPlusState state, const int handle) { } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return zero - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Index error in getVariableValue; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: Index error in getVariableValue; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); } EnergyPlus::PluginManagement::apiErrorFlag = true; @@ -242,7 +242,7 @@ Real64 getMeterValue(EnergyPlusState state, int handle) { } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return zero - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Index error in getMeterValue; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: Index error in getMeterValue; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getMeterValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); } EnergyPlus::PluginManagement::apiErrorFlag = true; @@ -276,8 +276,10 @@ int getActuatorHandle(EnergyPlusState state, const char* componentType, const ch + usedActuator.Name + "'."); EnergyPlus::ShowContinueError(*thisState, "Occurred for componentType='" + typeUC + "', controlType='" + controlUC + "', uniqueKey='" + keyUC + "'."); - EnergyPlus::ShowContinueError(*thisState, "The getActuatorHandle function will still return the handle (= " + std::to_string(handle) - + ") but caller should take note that there is a risk of overwritting."); + EnergyPlus::ShowContinueError(*thisState, + fmt::format("The getActuatorHandle function will still return the handle (= {}) but caller " + "should take note that there is a risk of overwritting.", + handle)); foundActuator = true; break; } @@ -286,9 +288,10 @@ int getActuatorHandle(EnergyPlusState state, const char* componentType, const ch EnergyPlus::ShowWarningError(*thisState, "Data Exchange API: You seem to already have tried to get an Actuator Handle on this one."); EnergyPlus::ShowContinueError(*thisState, "Occurred for componentType='" + typeUC + "', controlType='" + controlUC + "', uniqueKey='" + keyUC + "'."); - EnergyPlus::ShowContinueError(*thisState, "The getActuatorHandle function will still return the handle (= " + std::to_string(handle) - + ") but caller should take note that there is a risk of overwritting."); - + EnergyPlus::ShowContinueError(*thisState, + fmt::format("The getActuatorHandle function will still return the handle (= {}) but caller should " + "take note that there is a risk of overwritting.", + handle)); } } ++availActuator.handleCount; @@ -311,7 +314,7 @@ void resetActuator(EnergyPlusState state, int handle) { } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: index error in resetActuator; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in resetActuator; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The resetActuator function will return to allow the plugin to finish, then EnergyPlus will abort"); } EnergyPlus::PluginManagement::apiErrorFlag = true; @@ -337,7 +340,7 @@ void setActuatorValue(EnergyPlusState state, const int handle, const Real64 valu } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: index error in setActuatorValue; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in setActuatorValue; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The setActuatorValue function will return to allow the plugin to finish, then EnergyPlus will abort"); } EnergyPlus::PluginManagement::apiErrorFlag = true; @@ -366,7 +369,7 @@ Real64 getActuatorValue(EnergyPlusState state, const int handle) { } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return 0 - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: index error in getActuatorValue; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in getActuatorValue; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getActuatorValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); } EnergyPlus::PluginManagement::apiErrorFlag = true; @@ -410,7 +413,8 @@ Real64 getInternalVariableValue(EnergyPlusState state, int handle) { } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return 0 - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: index error in getInternalVariableValue; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError(*thisState, + fmt::format("Data Exchange API: index error in getInternalVariableValue; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getInternalVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); } EnergyPlus::PluginManagement::apiErrorFlag = true; @@ -429,7 +433,8 @@ Real64 getPluginGlobalVariableValue(EnergyPlusState state, int handle) { if (handle < 0 || handle > EnergyPlus::PluginManagement::pluginManager->maxGlobalVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return 0 - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- index error in getPluginGlobalVariableValue; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginGlobalVariableValue; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getPluginGlobalVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -442,7 +447,8 @@ void setPluginGlobalVariableValue(EnergyPlusState state, int handle, Real64 valu if (handle < 0 || handle > EnergyPlus::PluginManagement::pluginManager->maxGlobalVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- index error in setPluginGlobalVariableValue; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in setPluginGlobalVariableValue; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getPluginGlobalVariableValue function will return to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; } @@ -458,7 +464,8 @@ Real64 getPluginTrendVariableValue(EnergyPlusState state, int handle, int timeIn if (handle < 0 || handle > EnergyPlus::PluginManagement::pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- index error in getPluginTrendVariableValue; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableValue; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableValue function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -466,7 +473,10 @@ Real64 getPluginTrendVariableValue(EnergyPlusState state, int handle, int timeIn if (timeIndex < 1 || timeIndex > ((int)EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(handle))) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableValue; received value: " + std::to_string(timeIndex)); + EnergyPlus::ShowSevereError( + *thisState, + fmt::format("Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableValue; received value: {}", + timeIndex)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableValue function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -479,7 +489,8 @@ Real64 getPluginTrendVariableAverage(EnergyPlusState state, int handle, int coun if (handle < 0 || handle > EnergyPlus::PluginManagement::pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- index error in getPluginTrendVariableAverage; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableAverage; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableAverage function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -487,7 +498,11 @@ Real64 getPluginTrendVariableAverage(EnergyPlusState state, int handle, int coun if (count < 2 || count > ((int)EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(handle))) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableAverage; received value: " + std::to_string(count)); + EnergyPlus::ShowSevereError( + *thisState, + fmt::format( + "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableAverage; received value: {}", + count)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableAverage function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -500,7 +515,8 @@ Real64 getPluginTrendVariableMin(EnergyPlusState state, int handle, int count) { if (handle < 0 || handle > EnergyPlus::PluginManagement::pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- index error in getPluginTrendVariableMin; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableMin; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableMin function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -508,7 +524,10 @@ Real64 getPluginTrendVariableMin(EnergyPlusState state, int handle, int count) { if (count < 2 || count > ((int)EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(handle))) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableMin; received value: " + std::to_string(count)); + EnergyPlus::ShowSevereError( + *thisState, + fmt::format("Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableMin; received value: {}", + count)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableMin function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -521,7 +540,8 @@ Real64 getPluginTrendVariableMax(EnergyPlusState state, int handle, int count) { if (handle < 0 || handle > EnergyPlus::PluginManagement::pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- index error in getPluginTrendVariableMax; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableMax; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableMax function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -529,7 +549,10 @@ Real64 getPluginTrendVariableMax(EnergyPlusState state, int handle, int count) { if (count < 2 || count > ((int)EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(handle))) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableMax; received value: " + std::to_string(count)); + EnergyPlus::ShowSevereError( + *thisState, + fmt::format("Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableMax; received value: {}", + count)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableMax function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -542,7 +565,8 @@ Real64 getPluginTrendVariableSum(EnergyPlusState state, int handle, int count) { if (handle < 0 || handle > EnergyPlus::PluginManagement::pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- index error in getPluginTrendVariableSum; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableSum; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableSum function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -550,7 +574,10 @@ Real64 getPluginTrendVariableSum(EnergyPlusState state, int handle, int count) { if (count < 2 || count > ((int)EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(handle))) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableSum; received value: " + std::to_string(count)); + EnergyPlus::ShowSevereError( + *thisState, + fmt::format("Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableSum; received value: {}", + count)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableSum function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -563,7 +590,8 @@ Real64 getPluginTrendVariableDirection(EnergyPlusState state, int handle, int co if (handle < 0 || handle > EnergyPlus::PluginManagement::pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- index error in getPluginTrendVariableDirection; received handle: " + std::to_string(handle)); + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableDirection; received handle: {}", handle)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableDirection function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; @@ -571,7 +599,11 @@ Real64 getPluginTrendVariableDirection(EnergyPlusState state, int handle, int co if (count < 2 || count > ((int)EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(handle))) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableDirection; received value: " + std::to_string(count)); + EnergyPlus::ShowSevereError( + *thisState, + fmt::format( + "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableDirection; received value: {}", + count)); EnergyPlus::ShowContinueError(*thisState, "The getPluginTrendVariableDirection function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); EnergyPlus::PluginManagement::apiErrorFlag = true; return 0; diff --git a/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc index b7a2a16a5d4..aa9e6253255 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc @@ -9589,14 +9589,14 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_BasicAdvancedSingleSided) for (unsigned i = 0; i <= 36; i++) { Real64 angle = i * 10.0; Real64 value = CurveManager::CurveValue(state, 7, angle); - EXPECT_NEAR(valsForLeftWindow[i], value, 1.0e-12) << ("Issue at index: " + std::to_string(i)); + EXPECT_NEAR(valsForLeftWindow[i], value, 1.0e-12) << (format("Issue at index: {}", i)); } // Check the curve values for the left window, taken from v8.6.0 on Windows for (unsigned i = 0; i <= 36; i++) { Real64 angle = i * 10.0; Real64 value = CurveManager::CurveValue(state, 6, angle); - EXPECT_NEAR(valsForRightWindow[i], value, 1.0e-12) << ("Issue at index: " + std::to_string(i)); + EXPECT_NEAR(valsForRightWindow[i], value, 1.0e-12) << (format("Issue at index: {}", i)); } } diff --git a/tst/EnergyPlus/unit/DaylightingManager.unit.cc b/tst/EnergyPlus/unit/DaylightingManager.unit.cc index 78967cf466a..90fd19bdbed 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -1582,8 +1582,7 @@ TEST_F(EnergyPlusFixture, DaylightingManager_GetInputDaylightingControls_Roundin for (auto frac: fractions) { sum += frac; EXPECT_EQ(i, DataDaylighting::ZoneDaylight(1).DaylRefPtNum(i)); - EXPECT_EQ("WEST ZONE_DAYLREFPT" + std::to_string(i), - DataDaylighting::DaylRefPt(DataDaylighting::ZoneDaylight(1).DaylRefPtNum(i)).Name); + EXPECT_EQ(format("WEST ZONE_DAYLREFPT{}", i), DataDaylighting::DaylRefPt(DataDaylighting::ZoneDaylight(1).DaylRefPtNum(i)).Name); EXPECT_EQ(frac, DataDaylighting::ZoneDaylight(1).FracZoneDaylit(i)); EXPECT_EQ(200., DataDaylighting::ZoneDaylight(1).IllumSetPoint(i)); ++i; diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index 22ee9b87250..05146cd478b 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -105,7 +105,7 @@ using namespace EnergyPlus::WaterCoils; using DataHeatBalFanSys::TempControlType; using DataZoneEnergyDemands::CurDeadBandOrSetback; using DataZoneEnergyDemands::ZoneSysEnergyDemand; -using General::TrimSigDigits; + using MixedAir::OAMixer; namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index c3f8e6355df..2241077403e 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -1332,8 +1332,9 @@ TEST_F(LowTempRadiantSystemTest, InitLowTempRadiantSystemCFloPump) InitLowTempRadiantSystem(state, false, RadSysNum, SystemType, InitErrorFound); actualEfficiencyPercentage = CFloRadSys(RadSysNum).PumpEffic * 100.0; std::string const error_string02 = - delimited_string({" ** Warning ** Check input. Calc Pump Efficiency=" + General::RoundSigDigits(actualEfficiencyPercentage, 5) + - "% which is less than 50%, for pump in radiant system " + CFloRadSys(RadSysNum).Name}); + delimited_string({format(" ** Warning ** Check input. Calc Pump Efficiency={:.5R}% which is less than 50%, for pump in radiant system {}", + actualEfficiencyPercentage, + CFloRadSys(RadSysNum).Name)}); EXPECT_EQ(CFloRadSys(RadSysNum).WaterVolFlowMax, CFloRadSys(RadSysNum).PumpEffic); EXPECT_TRUE(compare_err_stream(error_string02, true)); EXPECT_EQ(InitErrorFound, false); @@ -1370,8 +1371,9 @@ TEST_F(LowTempRadiantSystemTest, InitLowTempRadiantSystemCFloPump) InitLowTempRadiantSystem(state, false, RadSysNum, SystemType, InitErrorFound); actualEfficiencyPercentage = CFloRadSys(RadSysNum).PumpEffic * 100.0; std::string const error_string03 = - delimited_string({" ** Warning ** Check input. Calc Pump Efficiency=" + General::RoundSigDigits(actualEfficiencyPercentage, 5) + - "% is approaching 100%, for pump in radiant system " + CFloRadSys(RadSysNum).Name}); + delimited_string({format(" ** Warning ** Check input. Calc Pump Efficiency={:.5R}% is approaching 100%, for pump in radiant system {}", + actualEfficiencyPercentage, + CFloRadSys(RadSysNum).Name)}); EXPECT_EQ(CFloRadSys(RadSysNum).WaterVolFlowMax, CFloRadSys(RadSysNum).PumpEffic); EXPECT_TRUE(compare_err_stream(error_string03, true)); EXPECT_EQ(InitErrorFound, false); @@ -1407,9 +1409,10 @@ TEST_F(LowTempRadiantSystemTest, InitLowTempRadiantSystemCFloPump) CFloRadSys(RadSysNum).WaterVolFlowMax = 1.23; // because of how other parameters are set, this value is equal to the pump efficiency InitLowTempRadiantSystem(state, false, RadSysNum, SystemType, InitErrorFound); actualEfficiencyPercentage = CFloRadSys(RadSysNum).PumpEffic * 100.0; - std::string const error_string04 = - delimited_string({" ** Severe ** Check input. Calc Pump Efficiency=" + General::RoundSigDigits(actualEfficiencyPercentage, 5) + - "% which is bigger than 100%, for pump in radiant system " + CFloRadSys(RadSysNum).Name}); + std::string const error_string04 = delimited_string( + {format(" ** Severe ** Check input. Calc Pump Efficiency={:.5R}% which is bigger than 100%, for pump in radiant system {}", + actualEfficiencyPercentage, + CFloRadSys(RadSysNum).Name)}); EXPECT_EQ(CFloRadSys(RadSysNum).WaterVolFlowMax, CFloRadSys(RadSysNum).PumpEffic); EXPECT_TRUE(compare_err_stream(error_string04, true)); EXPECT_EQ(InitErrorFound, true); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index e0f815f8030..90bc5adc26b 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -108,7 +108,6 @@ using namespace EnergyPlus::OutputReportPredefined; using namespace EnergyPlus::OutputReportTabular; using namespace EnergyPlus::OutputProcessor; using namespace SimulationManager; -using namespace ObjexxFCL; TEST_F(EnergyPlusFixture, OutputReportTabularTest_ConfirmSetUnitsStyleFromString) { @@ -7421,11 +7420,11 @@ TEST_F(EnergyPlusFixture, AzimuthToCardinal) if (i % 2 == 1) { // It's a wall DataSurfaces::Surface(i).Class = DataSurfaces::SurfaceClass::Wall; - DataSurfaces::Surface(i).Name = "ExtWall_" + std::to_string(i) + "_" + std::to_string(entryIndex); + DataSurfaces::Surface(i).Name = format("ExtWall_{}_{}", i, entryIndex); } else { // It's a window DataSurfaces::Surface(i).Class = DataSurfaces::SurfaceClass::Window; - DataSurfaces::Surface(i).Name = "ExtWindow_" + std::to_string(i) + "_" + std::to_string(entryIndex); + DataSurfaces::Surface(i).Name = format("ExtWindow_{}_{}", i, entryIndex); // Window references the previous wall DataSurfaces::Surface(i).BaseSurf = i - 1; } @@ -7459,8 +7458,7 @@ TEST_F(EnergyPlusFixture, AzimuthToCardinal) std::string cardinalDir = expectedAzimuthToCard.second; // Internal: Just to ensure that we gets the same one with round - EXPECT_EQ(General::RoundSigDigits(round(oriAzimuth * 100.0) / 100.0, 2), - General::RoundSigDigits(oriAzimuth, 2)); + EXPECT_EQ(format("{:.2R}", round(oriAzimuth * 100.0) / 100.0), format("{:.2R}", oriAzimuth)); /**************************************************************************** * Wall (odd entries) * @@ -7470,9 +7468,9 @@ TEST_F(EnergyPlusFixture, AzimuthToCardinal) EXPECT_EQ(oriAzimuth, DataSurfaces::Surface(i).Azimuth) << "Surface Name = " << DataSurfaces::Surface(i).Name; // Check that the azimuth entry is the rounded version indeed - EXPECT_EQ(OutputReportPredefined::RetrievePreDefTableEntry(OutputReportPredefined::pdchOpAzimuth, - DataSurfaces::Surface(i).Name), - General::RoundSigDigits(expectedAzimuthToCard.first, 2)) << "Surface Name = " << DataSurfaces::Surface(i).Name; + EXPECT_EQ(OutputReportPredefined::RetrievePreDefTableEntry(OutputReportPredefined::pdchOpAzimuth, DataSurfaces::Surface(i).Name), + format("{:.2R}", expectedAzimuthToCard.first)) + << "Surface Name = " << DataSurfaces::Surface(i).Name; // Check that we do get the expected cardinal direction EXPECT_EQ(OutputReportPredefined::RetrievePreDefTableEntry(OutputReportPredefined::pdchOpDir, DataSurfaces::Surface(i).Name), @@ -7487,9 +7485,9 @@ TEST_F(EnergyPlusFixture, AzimuthToCardinal) EXPECT_EQ(oriAzimuth, DataSurfaces::Surface(i+1).Azimuth) << "Surface Name = " << DataSurfaces::Surface(i+1).Name; // Check that the azimuth entry is the rounded version indeed - EXPECT_EQ(OutputReportPredefined::RetrievePreDefTableEntry(OutputReportPredefined::pdchFenAzimuth, - DataSurfaces::Surface(i+1).Name), - General::RoundSigDigits(expectedAzimuthToCard.first, 2)) << "Surface Name = " << DataSurfaces::Surface(i+1).Name; + EXPECT_EQ(OutputReportPredefined::RetrievePreDefTableEntry(OutputReportPredefined::pdchFenAzimuth, DataSurfaces::Surface(i + 1).Name), + format("{:.2R}", expectedAzimuthToCard.first)) + << "Surface Name = " << DataSurfaces::Surface(i + 1).Name; // Check that we do get the expected cardinal direction EXPECT_EQ(OutputReportPredefined::RetrievePreDefTableEntry(OutputReportPredefined::pdchFenDir, DataSurfaces::Surface(i+1).Name), @@ -7527,12 +7525,12 @@ TEST_F(EnergyPlusFixture, InteriorSurfaceEnvelopeSummaryReport) DataSurfaces::Surface(i).Construction = 1; // odd number - wall, even number - door if (i % 2 == 1) { - DataSurfaces::Surface(i).Name = "Interzonal_Wall_" + std::to_string((i + 1) / 2); + DataSurfaces::Surface(i).Name = "Interzonal_Wall_" + fmt::to_string((i + 1) / 2); DataSurfaces::Surface(i).GrossArea = 200.; DataSurfaces::Surface(i).Class = DataSurfaces::SurfaceClass::Wall; DataSurfaces::AllSurfaceListReportOrder.push_back(i); }else{ - DataSurfaces::Surface(i).Name = "Interzonal_Door_" + std::to_string((i + 1) / 2); + DataSurfaces::Surface(i).Name = "Interzonal_Door_" + fmt::to_string((i + 1) / 2); DataSurfaces::Surface(i).BaseSurfName = DataSurfaces::Surface(i - 1).Name; DataSurfaces::Surface(i).BaseSurf = i - 1; DataSurfaces::Surface(i).GrossArea = 50.; diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index cc0796eb5f9..c46cabdc9eb 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -3959,7 +3959,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ConfirmUnitarySystemSizingTest) if (iSizingType == DataSizing::FractionOfAutosizedHeatingAirflow) continue; // not allowed for cooling air flow - thisSys.Name = "UnitarySystem:CoolingOnly #" + General::TrimSigDigits(iSizingType); + thisSys.Name = format("UnitarySystem:CoolingOnly #{}", iSizingType); thisSys.m_CoolingSAFMethod = SizingTypes(iSizingType); thisSys.m_DesignCoolingCapacity = DataSizing::AutoSize; thisSys.m_MaxCoolAirVolFlow = DataSizing::AutoSize; @@ -4019,7 +4019,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ConfirmUnitarySystemSizingTest) if (iSizingType == DataSizing::FractionOfAutosizedCoolingAirflow) continue; // not allowed for heating air flow if (iSizingType == DataSizing::FlowPerCoolingCapacity) continue; // not allowed for heating air flow - thisSys.Name = "UnitarySystem:HeatingOnly #" + General::TrimSigDigits(iSizingType); + thisSys.Name = format("UnitarySystem:HeatingOnly #{}", iSizingType); thisSys.m_HeatingSAFMethod = SizingTypes(iSizingType); thisSys.m_DesignHeatingCapacity = DataSizing::AutoSize; thisSys.m_MaxCoolAirVolFlow = DataSizing::AutoSize; @@ -4085,7 +4085,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ConfirmUnitarySystemSizingTest) if (iSizingType == DataSizing::FractionOfAutosizedHeatingAirflow) iCoolingSizingType = DataSizing::FractionOfAutosizedCoolingAirflow; if (iSizingType == DataSizing::FlowPerCoolingCapacity) iHeatingSizingType = DataSizing::FlowPerHeatingCapacity; if (iSizingType == DataSizing::FlowPerHeatingCapacity) iCoolingSizingType = DataSizing::FlowPerCoolingCapacity; - thisSys.Name = "UnitarySystem:CoolingAndHeating #" + General::TrimSigDigits(iSizingType); + thisSys.Name = format("UnitarySystem:CoolingAndHeating #{}", iSizingType); thisSys.m_CoolingSAFMethod = SizingTypes(iCoolingSizingType); thisSys.m_HeatingSAFMethod = SizingTypes(iHeatingSizingType); thisSys.m_DesignCoolingCapacity = DataSizing::AutoSize; diff --git a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc index 0c70b3f7616..a92873525aa 100644 --- a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc +++ b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc @@ -399,7 +399,7 @@ TEST_F(EnergyPlusFixture, HPWHWrappedDummyNodeConfig) " 0, !- Minimum Value of x", " 1; !- Maximum Value of x"}); for (int i = 1; i <= 2; ++i) { - std::string const i_str = std::to_string(i); + std::string const i_str = fmt::to_string(i); idf_lines.push_back("Coil:WaterHeating:AirToWaterHeatPump:Wrapped,"); idf_lines.push_back(" HPWH Coil " + i_str + ", !- Name"); idf_lines.push_back(" 2349.6, !- Rated Heating Capacity {W}"); diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc index 83e1b8e1a9a..db9f046e8e7 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc @@ -71,7 +71,6 @@ using namespace EnergyPlus::DataPlant; using namespace EnergyPlus::DataSizing; using namespace EnergyPlus::Psychrometrics; using namespace EnergyPlus::WaterToAirHeatPump; -using General::RoundSigDigits; TEST_F(EnergyPlusFixture, WaterToAirHeatPumpTest_SimWaterToAir) { diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc index b8156423704..dd62edcb911 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc @@ -71,7 +71,6 @@ using namespace EnergyPlus::DataPlant; using namespace EnergyPlus::DataSizing; using namespace EnergyPlus::Psychrometrics; using namespace EnergyPlus::WaterToAirHeatPumpSimple; -using General::RoundSigDigits; TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) { @@ -139,8 +138,10 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) EXPECT_GE(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens); if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal != 0.0) { - ShowMessage(state, "SizeHVACWaterToAir: Rated Sensible Heat Ratio = " + - RoundSigDigits(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens / state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal, 2) + " [-]"); + ShowMessage(state, + format("SizeHVACWaterToAir: Rated Sensible Heat Ratio = {:.2R} [-]", + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens / + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal)); } }