From 16efb275ee66224903c462810e91ed4dcce2d594 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Thu, 12 Nov 2020 17:17:30 -0700 Subject: [PATCH] Remove RoundSigDigits and TrimSigDigits, use libfmt * Remove the RoundSigDigits and TrimSigDigits functions * They were over used and misused for integer->string conversions * Merge any string concatenations that used Round/Trim functions into libfmt operations * Overall binary is ~2% smaller * Diff set still needs to be formatted --- src/EnergyPlus/AirLoopHVACDOAS.cc | 10 +- .../AirflowNetwork/src/Properties.cpp | 9 +- .../AirflowNetworkBalanceManager.cc | 122 +- .../Autosizing/All_Simple_Sizing.cc | 26 +- src/EnergyPlus/Autosizing/Base.cc | 12 +- .../Autosizing/CoolingAirFlowSizing.cc | 218 +-- .../Autosizing/CoolingCapacitySizing.cc | 61 +- src/EnergyPlus/Autosizing/CoolingSHRSizing.cc | 4 +- .../CoolingWaterDesAirOutletHumRatSizing.cc | 17 +- .../CoolingWaterDesAirOutletTempSizing.cc | 12 +- .../Autosizing/HeatingAirFlowSizing.cc | 2 +- .../Autosizing/HeatingCapacitySizing.cc | 48 +- .../Autosizing/SystemAirFlowSizing.cc | 332 +---- .../Autosizing/WaterHeatingCapacitySizing.cc | 14 +- .../Autosizing/WaterHeatingCoilUASizing.cc | 106 +- src/EnergyPlus/BaseboardElectric.cc | 21 +- src/EnergyPlus/BaseboardRadiator.cc | 41 +- src/EnergyPlus/BoilerSteam.cc | 15 +- src/EnergyPlus/Boilers.cc | 41 +- src/EnergyPlus/BranchInputManager.cc | 63 +- src/EnergyPlus/BranchNodeConnections.cc | 4 +- src/EnergyPlus/CMakeLists.txt | 2 +- src/EnergyPlus/CTElectricGenerator.cc | 2 +- src/EnergyPlus/ChilledCeilingPanelSimple.cc | 83 +- src/EnergyPlus/ChillerAbsorption.cc | 45 +- src/EnergyPlus/ChillerElectricEIR.cc | 64 +- src/EnergyPlus/ChillerExhaustAbsorption.cc | 35 +- src/EnergyPlus/ChillerGasAbsorption.cc | 23 +- src/EnergyPlus/ChillerIndirectAbsorption.cc | 54 +- src/EnergyPlus/ChillerReformulatedEIR.cc | 127 +- .../Coils/CoilCoolingDXCurveFitSpeed.cc | 19 +- src/EnergyPlus/CommandLineInterface.cc | 2 +- src/EnergyPlus/CondenserLoopTowers.cc | 141 +- src/EnergyPlus/Construction.cc | 20 +- src/EnergyPlus/ConvectionCoefficients.cc | 111 +- src/EnergyPlus/CoolTower.cc | 72 +- src/EnergyPlus/CurveManager.cc | 117 +- src/EnergyPlus/DElightManagerF.cc | 11 +- src/EnergyPlus/DXCoils.cc | 775 ++++------- src/EnergyPlus/DataEnvironment.cc | 16 +- src/EnergyPlus/DataHeatBalance.cc | 21 +- src/EnergyPlus/DataRuntimeLanguage.cc | 4 +- src/EnergyPlus/DataSurfaceLists.cc | 5 +- src/EnergyPlus/DataTimings.cc | 19 + src/EnergyPlus/DataZoneEquipment.cc | 53 +- src/EnergyPlus/DaylightingDevices.cc | 25 +- src/EnergyPlus/DaylightingManager.cc | 178 +-- src/EnergyPlus/DemandManager.cc | 5 +- src/EnergyPlus/DesiccantDehumidifiers.cc | 43 +- src/EnergyPlus/DualDuct.cc | 19 +- src/EnergyPlus/EMSManager.cc | 4 +- src/EnergyPlus/EarthTube.cc | 49 +- src/EnergyPlus/EcoRoofManager.cc | 16 +- src/EnergyPlus/EconomicLifeCycleCost.cc | 33 +- src/EnergyPlus/EconomicTariff.cc | 15 +- src/EnergyPlus/ElectricBaseboardRadiator.cc | 47 +- src/EnergyPlus/ElectricPowerServiceManager.cc | 24 +- src/EnergyPlus/EvaporativeCoolers.cc | 104 +- src/EnergyPlus/EvaporativeFluidCoolers.cc | 103 +- src/EnergyPlus/ExteriorEnergyUse.cc | 14 +- src/EnergyPlus/ExternalInterface.cc | 79 +- src/EnergyPlus/FanCoilUnits.cc | 126 +- src/EnergyPlus/Fans.cc | 31 +- src/EnergyPlus/FluidCoolers.cc | 101 +- src/EnergyPlus/FluidProperties.cc | 148 +- src/EnergyPlus/FuelCellElectricGenerator.cc | 9 +- src/EnergyPlus/Furnaces.cc | 179 +-- src/EnergyPlus/General.cc | 32 +- src/EnergyPlus/General.hh | 12 - src/EnergyPlus/GeneralRoutines.cc | 21 +- src/EnergyPlus/GeneratorFuelSupply.cc | 4 +- src/EnergyPlus/GroundHeatExchangers.cc | 35 +- src/EnergyPlus/HVACControllers.cc | 87 +- src/EnergyPlus/HVACCooledBeam.cc | 11 +- src/EnergyPlus/HVACDXHeatPumpSystem.cc | 28 +- src/EnergyPlus/HVACDXSystem.cc | 96 +- src/EnergyPlus/HVACDuct.cc | 11 +- src/EnergyPlus/HVACFan.cc | 3 +- src/EnergyPlus/HVACHXAssistedCoolingCoil.cc | 26 +- src/EnergyPlus/HVACManager.cc | 146 +- src/EnergyPlus/HVACMultiSpeedHeatPump.cc | 80 +- src/EnergyPlus/HVACSingleDuctInduc.cc | 55 +- src/EnergyPlus/HVACSizingSimulationManager.cc | 7 +- src/EnergyPlus/HVACStandAloneERV.cc | 51 +- src/EnergyPlus/HVACUnitaryBypassVAV.cc | 117 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 1188 ++++++++++------- src/EnergyPlus/HWBaseboardRadiator.cc | 100 +- src/EnergyPlus/HeatBalFiniteDiffManager.cc | 79 +- src/EnergyPlus/HeatBalanceAirManager.cc | 141 +- src/EnergyPlus/HeatBalanceHAMTManager.cc | 24 +- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 17 +- src/EnergyPlus/HeatBalanceKivaManager.cc | 24 +- src/EnergyPlus/HeatBalanceManager.cc | 422 +++--- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 87 +- src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc | 12 +- src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc | 14 +- src/EnergyPlus/HeatPumpWaterToWaterSimple.cc | 90 +- src/EnergyPlus/HeatRecovery.cc | 371 +++-- src/EnergyPlus/HeatingCoils.cc | 57 +- src/EnergyPlus/HighTempRadiantSystem.cc | 40 +- src/EnergyPlus/Humidifiers.cc | 33 +- src/EnergyPlus/HybridEvapCoolingModel.cc | 21 +- .../HybridUnitaryAirConditioners.cc | 27 +- src/EnergyPlus/ICEngineElectricGenerator.cc | 10 +- src/EnergyPlus/IceThermalStorage.cc | 21 +- src/EnergyPlus/InputProcessing/IdfParser.cc | 17 +- src/EnergyPlus/IntegratedHeatPump.cc | 61 +- src/EnergyPlus/InternalHeatGains.cc | 162 +-- src/EnergyPlus/LowTempRadiantSystem.cc | 116 +- src/EnergyPlus/MicroCHPElectricGenerator.cc | 4 +- .../MicroturbineElectricGenerator.cc | 190 ++- src/EnergyPlus/MixedAir.cc | 78 +- src/EnergyPlus/MixerComponent.cc | 17 +- src/EnergyPlus/NodeInputManager.cc | 25 +- src/EnergyPlus/OutdoorAirUnit.cc | 38 +- src/EnergyPlus/OutputProcessor.cc | 31 +- src/EnergyPlus/OutputReportTabular.cc | 72 +- src/EnergyPlus/OutputReports.cc | 114 +- src/EnergyPlus/OutsideEnergySources.cc | 5 +- src/EnergyPlus/PVWatts.cc | 20 +- src/EnergyPlus/PackagedTerminalHeatPump.cc | 166 +-- src/EnergyPlus/PackagedThermalStorageCoil.cc | 28 +- .../PhotovoltaicThermalCollectors.cc | 14 +- src/EnergyPlus/Photovoltaics.cc | 30 +- src/EnergyPlus/PipeHeatTransfer.cc | 19 +- src/EnergyPlus/Plant/Loop.cc | 10 +- src/EnergyPlus/Plant/LoopSide.cc | 27 +- src/EnergyPlus/Plant/PlantManager.cc | 17 +- src/EnergyPlus/PlantCentralGSHP.cc | 117 +- src/EnergyPlus/PlantChillers.cc | 153 +-- .../PlantComponentTemperatureSources.cc | 6 +- src/EnergyPlus/PlantCondLoopOperation.cc | 16 +- .../PlantHeatExchangerFluidToFluid.cc | 12 +- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 20 +- src/EnergyPlus/PlantPipingSystemsManager.cc | 13 +- src/EnergyPlus/PlantPressureSystem.cc | 2 +- src/EnergyPlus/PlantUtilities.cc | 93 +- src/EnergyPlus/PlantValves.cc | 2 +- src/EnergyPlus/PluginManager.cc | 31 +- src/EnergyPlus/PondGroundHeatExchanger.cc | 34 +- src/EnergyPlus/PoweredInductionUnits.cc | 47 +- src/EnergyPlus/Psychrometrics.cc | 95 +- src/EnergyPlus/Pumps.cc | 55 +- src/EnergyPlus/PurchasedAirManager.cc | 64 +- src/EnergyPlus/RefrigeratedCase.cc | 109 +- src/EnergyPlus/ReportCoilSelection.cc | 62 +- src/EnergyPlus/ReportCoilSelection.hh | 2 +- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 6 +- src/EnergyPlus/RoomAirModelManager.cc | 31 +- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 12 +- src/EnergyPlus/RootFinder.cc | 77 +- src/EnergyPlus/RuntimeLanguageProcessor.cc | 38 +- src/EnergyPlus/SQLiteProcedures.cc | 12 +- src/EnergyPlus/SZVAVModel.cc | 21 +- src/EnergyPlus/ScheduleManager.cc | 99 +- src/EnergyPlus/SetPointManager.cc | 102 +- src/EnergyPlus/SimAirServingZones.cc | 12 +- src/EnergyPlus/SimulationManager.cc | 71 +- src/EnergyPlus/SingleDuct.cc | 79 +- src/EnergyPlus/SizingAnalysisObjects.cc | 6 +- src/EnergyPlus/SizingManager.cc | 165 +-- src/EnergyPlus/SolarCollectors.cc | 15 +- src/EnergyPlus/SolarShading.cc | 79 +- src/EnergyPlus/SplitterComponent.cc | 17 +- src/EnergyPlus/StandardRatings.cc | 47 +- src/EnergyPlus/SteamBaseboardRadiator.cc | 77 +- src/EnergyPlus/SteamCoils.cc | 25 +- src/EnergyPlus/SurfaceGeometry.cc | 546 +++----- src/EnergyPlus/SurfaceGroundHeatExchanger.cc | 30 +- src/EnergyPlus/SystemAvailabilityManager.cc | 55 +- src/EnergyPlus/SystemReports.cc | 4 +- src/EnergyPlus/ThermalChimney.cc | 39 +- src/EnergyPlus/ThermalComfort.cc | 12 +- src/EnergyPlus/TranspiredCollector.cc | 24 +- src/EnergyPlus/UFADManager.cc | 6 +- src/EnergyPlus/UnitHeater.cc | 32 +- src/EnergyPlus/UnitVentilator.cc | 57 +- src/EnergyPlus/UnitarySystem.cc | 137 +- src/EnergyPlus/UserDefinedComponents.cc | 23 +- src/EnergyPlus/UtilityRoutines.cc | 36 +- src/EnergyPlus/VariableSpeedCoils.cc | 309 +++-- src/EnergyPlus/VentilatedSlab.cc | 88 +- src/EnergyPlus/WaterCoils.cc | 127 +- src/EnergyPlus/WaterManager.cc | 15 +- src/EnergyPlus/WaterThermalTanks.cc | 215 +-- src/EnergyPlus/WaterToAirHeatPump.cc | 24 +- src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 80 +- src/EnergyPlus/WeatherManager.cc | 203 ++- src/EnergyPlus/WindTurbine.cc | 80 +- src/EnergyPlus/WindowAC.cc | 29 +- src/EnergyPlus/WindowEquivalentLayer.cc | 36 +- src/EnergyPlus/WindowManager.cc | 30 +- src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 10 +- .../ZoneContaminantPredictorCorrector.cc | 78 +- src/EnergyPlus/ZoneDehumidifier.cc | 47 +- src/EnergyPlus/ZoneEquipmentManager.cc | 84 +- src/EnergyPlus/ZonePlenum.cc | 21 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 176 ++- src/EnergyPlus/api/datatransfer.cc | 46 +- .../unit/AirflowNetworkBalanceManager.unit.cc | 4 +- .../unit/DaylightingManager.unit.cc | 2 +- tst/EnergyPlus/unit/FanCoilUnits.unit.cc | 2 +- .../unit/LowTempRadiantSystem.unit.cc | 9 +- .../unit/OutputReportTabular.unit.cc | 17 +- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 6 +- tst/EnergyPlus/unit/WaterThermalTanks.unit.cc | 2 +- .../unit/WaterToAirHeatPump.unit.cc | 2 +- .../unit/WaterToAirHeatPumpSimple.unit.cc | 4 +- 208 files changed, 5610 insertions(+), 8273 deletions(-) diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index bcfefb1fe83..113c39f19bf 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -442,7 +442,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") { @@ -461,7 +461,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") { @@ -743,8 +743,7 @@ 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; } @@ -1022,8 +1021,7 @@ 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(loop.Name + diff --git a/src/EnergyPlus/AirflowNetwork/src/Properties.cpp b/src/EnergyPlus/AirflowNetwork/src/Properties.cpp index 642432207f5..c801a487857 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Properties.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Properties.cpp @@ -73,18 +73,15 @@ namespace AirflowNetwork { if (lowerLimitErrIdx == 0) { ShowWarningMessage(state, "Air temperature below lower limit of -20C for conductivity calculation"); } - ShowRecurringWarningErrorAtEnd("Air temperature below lower limit of -20C for conductivity calculation. " - "Air temperature of " + General::RoundSigDigits(LowerLimit, 1) + - " used for conductivity calculation.", + ShowRecurringWarningErrorAtEnd(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("Air temperature below lower limit of 70C for conductivity calculation. " - "Air temperature of " + General::RoundSigDigits(UpperLimit, 1) + - " used for conductivity calculation.", + ShowRecurringWarningErrorAtEnd(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 e0d5d372660..783b8dc2939 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -186,7 +186,7 @@ namespace AirflowNetworkBalanceManager { using Fans::GetFanOutletNode; using Fans::GetFanType; using Fans::GetFanVolFlow; - using General::RoundSigDigits; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -385,8 +385,7 @@ 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) { @@ -882,7 +881,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) { @@ -897,7 +896,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 @@ -909,7 +908,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; } } @@ -1253,8 +1252,8 @@ 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; } @@ -1675,16 +1674,14 @@ 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; } @@ -1732,8 +1729,7 @@ 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; } @@ -1744,8 +1740,7 @@ 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; } } @@ -1753,8 +1748,7 @@ 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; } @@ -2158,7 +2152,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; } @@ -2167,20 +2161,19 @@ 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; } @@ -2188,21 +2181,19 @@ 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; } @@ -2267,7 +2258,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 @@ -2398,7 +2389,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 @@ -2816,8 +2807,7 @@ 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; } } @@ -2907,22 +2897,19 @@ 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; } @@ -2943,22 +2930,19 @@ 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; } @@ -3030,8 +3014,7 @@ 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."); } } @@ -4684,7 +4667,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) { @@ -4692,7 +4675,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; } } @@ -5851,7 +5834,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("AirFlowNetwork: " + MultizoneSurfaceData(i).SurfName + @@ -5941,8 +5924,7 @@ 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(AirflowNetworkNodeData(PressureControllerData(1).AFNNodeNum).Name + @@ -5963,8 +5945,7 @@ 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( @@ -5985,7 +5966,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(PressureControllerData(1).Name + @@ -6020,8 +6001,7 @@ 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(AirflowNetworkNodeData(PressureControllerData(1).AFNNodeNum).Name + @@ -6043,8 +6023,7 @@ 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( @@ -6064,7 +6043,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(PressureControllerData(1).Name + @@ -6378,7 +6357,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 @@ -6456,14 +6435,14 @@ 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 @@ -8920,9 +8899,7 @@ namespace AirflowNetworkBalanceManager { 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)); + 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; } } @@ -8953,8 +8930,7 @@ 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; } } @@ -10356,8 +10332,8 @@ 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; } @@ -10675,11 +10651,7 @@ 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 30e7b1417a8..d122b6122a0 100644 --- a/src/EnergyPlus/Autosizing/Base.cc +++ b/src/EnergyPlus/Autosizing/Base.cc @@ -402,10 +402,10 @@ void BaseSizer::selectSizerOutput(EnergyPlusData &state, bool &errorsFound) this->addErrorMessage(msg); ShowMessage(state, msg); msg = - "User-Specified " + this->sizingStringScalable + this->sizingString + " = " + General::RoundSigDigits(this->originalValue, 5); + 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 +421,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; @@ -528,10 +528,10 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro this->addErrorMessage(msg); ShowMessage(state, msg); msg = - "User-Specified " + this->sizingStringScalable + this->sizingString + " = " + General::RoundSigDigits(this->originalValue, 5); + 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 +547,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 f1e770c2c0b..adcff4fa29b 100644 --- a/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc @@ -91,9 +91,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else { if (DataSizing::ZoneCoolingOnlyFan) { @@ -102,11 +100,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -114,11 +108,7 @@ 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(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(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 +116,7 @@ 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(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(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 +124,7 @@ 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(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(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 +134,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -180,24 +152,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -209,9 +171,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -219,9 +179,7 @@ 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(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(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 +187,7 @@ 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(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(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 +195,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -253,11 +207,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -265,11 +215,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -282,11 +228,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -294,11 +236,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -309,9 +247,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -319,9 +255,7 @@ 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(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(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 +263,7 @@ 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(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(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 +271,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -353,11 +283,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -365,11 +291,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -382,11 +304,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -394,11 +312,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -409,9 +323,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -419,9 +331,7 @@ 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(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(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 +339,7 @@ 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(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(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 +347,7 @@ 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(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(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 +357,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -477,22 +375,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -503,9 +393,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (DataSizing::ZoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -513,9 +401,7 @@ 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(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(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 +409,7 @@ 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(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(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 +417,7 @@ 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(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(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 +427,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -571,22 +445,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -658,7 +524,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 42bf7ee3263..0ede14a8e80 100644 --- a/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc @@ -220,31 +220,25 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->dataDesAccountForFanHeat = true; // reset for next water coil if (DataGlobals::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 +439,17 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->dataDesAccountForFanHeat = true; // reset for next water coil if (DataGlobals::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 +461,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 +486,10 @@ 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 +497,17 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = DesVolFlow / DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT); if (!this->dataEMSOverride && DataGlobals::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 && DataGlobals::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 +515,7 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = DesVolFlow / DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT); if (!this->dataEMSOverride && DataGlobals::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..217a67e2591 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,23 @@ 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 3f437faa0d6..e1a25980914 100644 --- a/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc @@ -193,16 +193,15 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, } if (DataGlobals::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 +365,14 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = NominalCapacityDes * this->dataHeatSizeRatio * this->dataFracOfAutosizedHeatingCapacity; if (DataGlobals::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 +384,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 +409,10 @@ 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 +420,17 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = DesVolFlow / DataHVACGlobals::MinRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT); if (!this->dataEMSOverride && DataGlobals::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 && DataGlobals::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 +438,7 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = DesVolFlow / DataHVACGlobals::MaxRatedVolFlowPerRatedTotCap(DataHVACGlobals::DXCT); if (!this->dataEMSOverride && DataGlobals::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 80955bfacea..9a6a99587d2 100644 --- a/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc @@ -87,22 +87,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).AirVolFlow) { DDNameFanPeak = "Unknown"; @@ -114,11 +106,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -126,11 +114,7 @@ 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(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(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 +122,7 @@ 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(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(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 +130,7 @@ 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(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(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 +140,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -192,24 +158,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -221,9 +177,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -231,9 +185,7 @@ 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(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(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 +193,7 @@ 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(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(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 +201,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -265,11 +213,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -277,11 +221,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -294,11 +234,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -306,11 +242,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -321,9 +253,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -331,9 +261,7 @@ 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(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(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 +269,7 @@ 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(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(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 +277,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -365,11 +289,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -377,11 +297,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -394,11 +310,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -406,11 +318,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -421,9 +329,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -431,9 +337,7 @@ 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(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(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 +345,7 @@ 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(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(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 +353,7 @@ 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(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(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 +363,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -489,22 +381,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -515,9 +399,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; @@ -525,9 +407,7 @@ 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(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(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 +415,7 @@ 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(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(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 +423,7 @@ 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(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(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 +433,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -583,22 +451,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -609,9 +469,7 @@ 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(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(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 +477,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -631,22 +487,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -660,11 +508,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; @@ -672,11 +516,7 @@ 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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else { this->autoSizedValue = max(this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow, @@ -686,24 +526,14 @@ 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(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(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(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(this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -763,15 +593,9 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo 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) + - " " + - coilSelectionReportObj->getTimeText( + format("{}/{} {}", state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month, state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth, coilSelectionReportObj->getTimeText( 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 +603,7 @@ 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(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(this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } } else if (this->unitarySysEqSizing(this->curSysNum).CoolingAirFlow) { @@ -792,15 +612,9 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo 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) + - " " + - coilSelectionReportObj->getTimeText( + format("{}/{} {}", state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month, state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth, coilSelectionReportObj->getTimeText( 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 +622,7 @@ 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(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(this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else { @@ -820,26 +632,16 @@ 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(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(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) + - " " + - coilSelectionReportObj->getTimeText( + format("{}/{} {}", state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month, state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth, coilSelectionReportObj->getTimeText( DataSizing::SysSizPeakDDNum(this->curSysNum) - .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD)); + .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD))); } } } @@ -850,24 +652,16 @@ 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(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(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) + - " " + - coilSelectionReportObj->getTimeText( + format("{}/{} {}", state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).Month, state.dataWeatherManager->DesDayInput(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD).DayOfMonth, coilSelectionReportObj->getTimeText( DataSizing::SysSizPeakDDNum(this->curSysNum) - .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD)); + .TimeStepAtCoolFlowPk(DataSizing::SysSizPeakDDNum(this->curSysNum).CoolFlowPeakDD))); } } } @@ -882,7 +676,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 6ab22d6276b..9b3e87fe844 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..755b64556df 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"; + 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"; + 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 62460d8cf6d..3ae5f7b1401 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -100,7 +100,7 @@ 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 @@ -122,13 +122,11 @@ 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; } @@ -172,7 +170,7 @@ 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 @@ -259,8 +257,7 @@ 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 { @@ -276,8 +273,7 @@ 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); @@ -297,8 +293,7 @@ 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 { @@ -449,7 +444,7 @@ 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 02b0c650cfe..608d4eea98e 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -131,7 +131,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 @@ -157,13 +157,11 @@ 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; } @@ -261,7 +259,7 @@ 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 @@ -351,8 +349,7 @@ 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 { @@ -368,8 +365,7 @@ 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); @@ -389,8 +385,7 @@ 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 { @@ -641,7 +636,7 @@ namespace BaseboardRadiator { using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; using DataLoopNode::Node; - using General::RoundSigDigits; + using General::SolveRoot; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -785,10 +780,8 @@ 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."); } @@ -926,9 +919,8 @@ 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 @@ -938,9 +930,8 @@ 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)); } } @@ -966,8 +957,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 7513e463b20..8ebb857d7ec 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -237,15 +237,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, @@ -517,9 +515,8 @@ namespace BoilerSteam { if (DataGlobals::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."); } @@ -609,8 +606,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("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 6c5c3658f1d..6e967328525 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -222,8 +222,7 @@ namespace 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; } @@ -234,8 +233,7 @@ namespace 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; } @@ -595,9 +593,8 @@ namespace Boilers { if (DataGlobals::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."); } @@ -647,10 +644,8 @@ namespace Boilers { if (DataGlobals::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."); } @@ -850,18 +845,16 @@ namespace 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("Boiler:HotWater \"" + this->Name + @@ -882,18 +875,16 @@ namespace 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("Boiler:HotWater \"" + this->Name + diff --git a/src/EnergyPlus/BranchInputManager.cc b/src/EnergyPlus/BranchInputManager.cc index d49a4aea7d8..9b2b39c0706 100644 --- a/src/EnergyPlus/BranchInputManager.cc +++ b/src/EnergyPlus/BranchInputManager.cc @@ -143,7 +143,7 @@ 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) @@ -177,7 +177,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 = ""; @@ -251,7 +251,7 @@ 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 @@ -271,7 +271,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."); } @@ -386,7 +386,7 @@ 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; @@ -404,7 +404,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) { @@ -420,7 +420,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; } } @@ -613,7 +613,7 @@ 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 @@ -695,8 +695,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; @@ -756,7 +755,7 @@ 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 @@ -842,8 +841,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; @@ -1088,7 +1086,7 @@ namespace BranchInputManager { { // Using using CurveManager::GetPressureCurveTypeAndIndex; - using General::RoundSigDigits; + // Locals int PressureCurveType; @@ -1128,8 +1126,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; } @@ -1260,7 +1257,7 @@ namespace BranchInputManager { // \object-list Branches // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetBranchListInput: "); @@ -1358,7 +1355,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; } } @@ -1669,7 +1666,7 @@ namespace BranchInputManager { // \object-list Branches // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; // Used to retrieve names from IDF @@ -1750,9 +1747,8 @@ 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; } } @@ -1765,15 +1761,15 @@ 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; } } @@ -1896,7 +1892,7 @@ namespace BranchInputManager { // \object-list Branches // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; // Used to retrieve names from IDF @@ -1979,8 +1975,7 @@ 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; } } @@ -1993,15 +1988,15 @@ 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; } } @@ -2355,7 +2350,7 @@ namespace BranchInputManager { // Using/Aliasing using DataErrorTracking::TotalSevereErrors; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumDanglingCount; // when mustprint not true, count and report @@ -2403,7 +2398,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."); } @@ -2423,7 +2418,7 @@ 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 b662222de15..de3b11df740 100644 --- a/src/EnergyPlus/BranchNodeConnections.cc +++ b/src/EnergyPlus/BranchNodeConnections.cc @@ -55,7 +55,6 @@ #include #include #include -#include #include namespace EnergyPlus { @@ -300,7 +299,6 @@ namespace BranchNodeConnections { // Needs description, as appropriate. // Using/Aliasing - using General::RoundSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Loop1; @@ -617,7 +615,7 @@ namespace BranchNodeConnections { 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 316c728e1e3..6693dfd88c9 100644 --- a/src/EnergyPlus/CMakeLists.txt +++ b/src/EnergyPlus/CMakeLists.txt @@ -765,7 +765,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 8964fdbac4e..21fab720fc3 100644 --- a/src/EnergyPlus/CTElectricGenerator.cc +++ b/src/EnergyPlus/CTElectricGenerator.cc @@ -186,7 +186,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 18b85f66970..7e2ede456b4 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -129,7 +129,7 @@ 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 @@ -152,13 +152,11 @@ 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; } @@ -189,7 +187,7 @@ 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."); } } @@ -226,8 +224,8 @@ 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; @@ -334,12 +332,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; } @@ -347,12 +345,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; } @@ -360,7 +358,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; } @@ -370,7 +368,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 { @@ -388,7 +386,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); @@ -408,7 +406,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 { @@ -427,12 +425,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; } @@ -489,13 +487,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; } @@ -514,13 +512,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; } @@ -528,7 +526,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 } @@ -565,13 +563,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) { @@ -591,13 +589,11 @@ 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, 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, - "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("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; @@ -902,7 +898,7 @@ namespace CoolingPanelSimple { using DataHeatBalance::Zone; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -1063,10 +1059,8 @@ 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."); } @@ -1181,7 +1175,7 @@ namespace CoolingPanelSimple { using DataZoneEnergyDemands::CurDeadBandOrSetback; using DataZoneEnergyDemands::ZoneSysEnergyDemand; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyTdpFnWPb; using ScheduleManager::GetCurrentScheduleValue; @@ -1273,11 +1267,10 @@ 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(cCMO_CoolingPanel_Simple + " [" + this->EquipID + "] condensation shut-off occurrence continues.", this->CondErrIndex, @@ -1604,7 +1597,7 @@ 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) @@ -1639,16 +1632,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 bb5dc323915..1a33341bc0d 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -171,10 +171,7 @@ 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 +278,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 +454,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 +957,8 @@ namespace ChillerAbsorption { if (DataGlobals::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 +1008,8 @@ namespace ChillerAbsorption { if (DataGlobals::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 +1053,8 @@ 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 +1126,8 @@ 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 +1198,8 @@ 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 +1255,8 @@ 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 f38f86597a6..01d553fe115 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -454,15 +454,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); @@ -485,9 +483,7 @@ 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; } @@ -495,7 +491,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 " + @@ -506,7 +502,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 " + @@ -520,7 +516,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; @@ -644,7 +640,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)); } } @@ -656,7 +652,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)); } } @@ -667,7 +663,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)); } } @@ -1279,10 +1275,8 @@ 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."); } @@ -1346,9 +1340,8 @@ namespace ChillerElectricEIR { if (DataGlobals::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."); } @@ -1413,10 +1406,8 @@ 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."); } @@ -1498,10 +1489,8 @@ 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."); } @@ -1804,10 +1793,8 @@ namespace ChillerElectricEIR { !DataGlobals::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 && !DataGlobals::WarmupFlag) { ++this->ChillerCapFTError; @@ -2094,10 +2081,8 @@ namespace ChillerElectricEIR { !DataGlobals::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 && !DataGlobals::WarmupFlag) { ++this->ChillerEIRFTError; @@ -2116,9 +2101,8 @@ namespace ChillerElectricEIR { !DataGlobals::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 && !DataGlobals::WarmupFlag) { ++this->ChillerEIRFPLRError; @@ -2149,7 +2133,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 0728bb879b6..3fa49305995 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -978,9 +978,8 @@ namespace ChillerExhaustAbsorption { if (DataGlobals::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,8 @@ 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 +1114,8 @@ 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 +1195,8 @@ 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 +1595,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 +1884,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 e90dcc17f40..0e8a2659294 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -970,9 +970,8 @@ namespace ChillerGasAbsorption { if (DataGlobals::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,8 @@ 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 +1105,8 @@ 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 +1187,8 @@ 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 4345991ca0e..e3e3f34abbb 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -165,10 +165,7 @@ 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)); } } @@ -267,8 +264,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; } @@ -1048,9 +1044,8 @@ namespace ChillerIndirectAbsorption { if (DataGlobals::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."); } @@ -1104,9 +1099,8 @@ namespace ChillerIndirectAbsorption { if (DataGlobals::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."); } @@ -1151,10 +1145,8 @@ 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."); } @@ -1235,10 +1227,8 @@ 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."); } @@ -1322,10 +1312,8 @@ 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."); } @@ -1397,10 +1385,8 @@ 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."); } @@ -1534,10 +1520,8 @@ 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("Entering condenser water temperature below specified minimum error continues.", @@ -1555,10 +1539,8 @@ 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("Entering generator fluid temperature below specified minimum error continues.", diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 20525be5a26..de3eaf525a5 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -409,16 +409,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; } @@ -426,9 +424,7 @@ 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; } @@ -450,9 +446,7 @@ 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; } @@ -460,7 +454,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 " + @@ -471,7 +465,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 " + @@ -484,7 +478,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; @@ -1057,10 +1051,8 @@ 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."); } @@ -1135,9 +1127,8 @@ namespace ChillerReformulatedEIR { if (DataGlobals::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."); } @@ -1207,10 +1198,8 @@ 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."); } @@ -1270,10 +1259,8 @@ 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."); } @@ -1322,7 +1309,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, @@ -1336,7 +1323,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, @@ -1355,7 +1342,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) { @@ -1375,15 +1362,13 @@ 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; @@ -2319,13 +2304,8 @@ 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("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTXIterIndex, @@ -2343,13 +2323,8 @@ 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( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Electric Input to Cooling Output Ratio Function of Temp curve error continues.", @@ -2400,13 +2375,8 @@ 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("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTYIterIndex, @@ -2424,13 +2394,8 @@ 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( "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.", @@ -2451,13 +2416,8 @@ 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( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", @@ -2478,13 +2438,8 @@ 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( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The part-load ratio range in Electric Input to Cooling Output Ratio Function of PLRatio curve error continues.", @@ -2536,10 +2491,8 @@ namespace ChillerReformulatedEIR { if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::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 && !DataGlobals::WarmupFlag) { ++this->ChillerCapFTError; @@ -2557,10 +2510,8 @@ namespace ChillerReformulatedEIR { if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::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 && !DataGlobals::WarmupFlag) { ++this->ChillerEIRFTError; @@ -2600,10 +2551,8 @@ namespace ChillerReformulatedEIR { if (this->ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::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 && !DataGlobals::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 115cbfd2089..a502c2bcfb5 100644 --- a/src/EnergyPlus/CommandLineInterface.cc +++ b/src/EnergyPlus/CommandLineInterface.cc @@ -232,7 +232,7 @@ namespace CommandLineInterface { DisplayString("ERROR: Multiple input files specified:"); for (size_type i = 0; i < opt.lastArgs.size(); ++i) { std::string const &arg(*opt.lastArgs[i]); - DisplayString(" Input file #" + std::to_string(i + 1) + ": " + arg); + DisplayString(format(" Input file #{}: {}", i + 1, arg)); } DisplayString(errorFollowUp); exit(EXIT_FAILURE); diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index eae95756861..6d0dd1923e6 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -2243,9 +2243,8 @@ 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; @@ -2255,10 +2254,8 @@ 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)); } } } @@ -2456,17 +2453,11 @@ 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, 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, - "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 + '.'); } @@ -2544,28 +2535,20 @@ 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 + '.'); } @@ -2879,19 +2862,16 @@ 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."); @@ -3144,9 +3124,8 @@ 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; @@ -3156,9 +3135,8 @@ 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)); } } } @@ -3231,9 +3209,8 @@ namespace CondenserLoopTowers { if (DataGlobals::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."); } @@ -3270,10 +3247,8 @@ namespace CondenserLoopTowers { if (DataGlobals::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."); } @@ -3314,10 +3289,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."); } @@ -3360,10 +3333,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."); } @@ -3399,10 +3370,8 @@ 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."); } @@ -3945,8 +3914,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."); } @@ -5043,9 +5012,8 @@ 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( @@ -5062,7 +5030,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( @@ -5522,9 +5490,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; } @@ -5538,7 +5506,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(this->VSTower).TwbBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + General::CreateSysTimeIntervalString(); - 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 { @@ -5549,9 +5517,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; } @@ -5565,7 +5533,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(this->VSTower).TrBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + General::CreateSysTimeIntervalString(); - 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 { @@ -5576,9 +5544,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; } @@ -5592,7 +5560,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(this->VSTower).TaBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + General::CreateSysTimeIntervalString(); - 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 { @@ -5608,9 +5576,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; } @@ -5624,7 +5592,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(this->VSTower).WFRRBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + General::CreateSysTimeIntervalString(); - 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 { @@ -5903,9 +5871,8 @@ 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( diff --git a/src/EnergyPlus/Construction.cc b/src/EnergyPlus/Construction.cc index 12c4fb83836..01da726da32 100644 --- a/src/EnergyPlus/Construction.cc +++ b/src/EnergyPlus/Construction.cc @@ -232,17 +232,12 @@ 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 +270,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 +950,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 4b0bc71178d..b4845a9d02a 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -112,7 +112,7 @@ 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 +1273,8 @@ 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 +1350,8 @@ 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 +1480,8 @@ 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 +1559,8 @@ 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 +1648,7 @@ 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 +1659,7 @@ 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 +1686,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 (!DisplayExtraWarnings) { @@ -1858,7 +1848,7 @@ namespace ConvectionCoefficients { // type to that surface. // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int SurfNum; @@ -1905,10 +1895,10 @@ namespace ConvectionCoefficients { } if (!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 +1940,10 @@ namespace ConvectionCoefficients { } if (!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 +1985,10 @@ namespace ConvectionCoefficients { } if (!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 +2030,10 @@ namespace ConvectionCoefficients { } if (!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 +2075,10 @@ namespace ConvectionCoefficients { } if (!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 +2119,10 @@ namespace ConvectionCoefficients { } if (!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 +2164,10 @@ namespace ConvectionCoefficients { } if (!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 +2209,10 @@ namespace ConvectionCoefficients { } if (!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 +2254,10 @@ namespace ConvectionCoefficients { } if (!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 +2299,10 @@ namespace ConvectionCoefficients { } if (!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 +3246,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 +3387,7 @@ namespace ConvectionCoefficients { // for adaptive convection algorithm // Using/Aliasing - using General::RoundSigDigits; + using General::ScanForReports; using Vectors::CreateNewellAreaVector; using Vectors::CreateNewellSurfaceNormalVector; @@ -4238,7 +4228,7 @@ 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 +4241,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 +4982,7 @@ namespace ConvectionCoefficients { // RE-ENGINEERED na // Using/Aliasing - using General::RoundSigDigits; + { auto const SELECT_CASE_var(Surface(SurfNum).OutConvClassification); @@ -5035,8 +5025,7 @@ 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)); } } } @@ -7441,7 +7430,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"); } @@ -7454,7 +7443,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"); } @@ -7516,7 +7505,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"); } @@ -7527,7 +7516,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"); } @@ -7578,7 +7567,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"); } @@ -7656,7 +7645,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"); } @@ -7673,7 +7662,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"); } @@ -7904,7 +7893,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"); } @@ -8008,7 +7997,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"); } @@ -8066,7 +8055,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"); } @@ -8158,7 +8147,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 c5d3a85f7c2..2f545b921cf 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -134,7 +134,7 @@ namespace CoolTower { // and stores it in the Cooltower data structure. // Using/Aliasing - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using WaterManager::SetupTankDemandComponent; @@ -257,99 +257,85 @@ 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 82c3109824a..1d63859bd73 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,7 @@ 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 +377,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 +516,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 +571,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 +624,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 +682,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 +750,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 +812,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 +874,12 @@ 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 +968,17 @@ 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 +1050,22 @@ 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 +1184,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 +1235,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 +1292,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 +1347,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 +1402,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 +1457,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 +1564,7 @@ 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 +1572,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 +1627,8 @@ 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 +2071,10 @@ 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 +2116,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 +2490,13 @@ 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 +2638,7 @@ 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 +2654,7 @@ 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; } } @@ -2950,7 +2919,7 @@ namespace CurveManager { // Trans. ASIVIE, J. of Fluids Engineering 103: 89-90. // Using/Aliasing - using General::RoundSigDigits; + // Return value Real64 CalculateMoodyFrictionFactor; @@ -2981,8 +2950,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."); @@ -3025,7 +2994,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 068aedbf506..88c438bfd87 100644 --- a/src/EnergyPlus/DElightManagerF.cc +++ b/src/EnergyPlus/DElightManagerF.cc @@ -133,7 +133,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; @@ -580,20 +580,17 @@ 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 7a8c2f71d95..167c7c475c6 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -268,7 +268,7 @@ 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 @@ -290,13 +290,11 @@ 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; } @@ -394,7 +392,7 @@ namespace DXCoils { // Manages the simulation of a multi speed DX coil. // Using/Aliasing - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -425,13 +423,11 @@ 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; } @@ -511,7 +507,7 @@ 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"); @@ -574,13 +570,11 @@ 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; } @@ -854,7 +848,7 @@ namespace DXCoils { using DataHeatBalance::Zone; using DataSizing::AutoSize; using EMSManager::ManageEMS; - using General::TrimSigDigits; + using GlobalNames::VerifyUniqueCoilName; using NodeInputManager::GetOnlySingleNode; using OutAirNodeManager::CheckOutAirNodeNumber; @@ -1063,7 +1057,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; } @@ -1229,8 +1223,7 @@ 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, _); } @@ -1238,8 +1231,7 @@ 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); } @@ -1302,7 +1294,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; } @@ -1310,7 +1302,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; } @@ -1318,7 +1310,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; } @@ -1327,7 +1319,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; } @@ -1372,7 +1364,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; } @@ -1384,7 +1376,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))); } } @@ -1516,7 +1508,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; } @@ -1528,8 +1520,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; } @@ -1538,8 +1530,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; } @@ -1760,8 +1752,7 @@ 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, _); } @@ -1769,8 +1760,7 @@ 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); } @@ -1825,7 +1815,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; } @@ -1833,7 +1823,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; } @@ -1842,7 +1832,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; } @@ -1898,8 +1888,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; @@ -1952,7 +1941,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; } @@ -1964,7 +1953,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))); } } @@ -2199,8 +2188,7 @@ 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, _); } @@ -2208,8 +2196,7 @@ 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); } @@ -2296,7 +2283,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; } @@ -2617,8 +2604,7 @@ 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, _); } @@ -2626,8 +2612,7 @@ 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); } @@ -2743,7 +2728,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; } @@ -2751,7 +2736,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; } @@ -2759,7 +2744,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; } @@ -2767,7 +2752,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; } @@ -2775,7 +2760,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; } @@ -2783,7 +2768,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; } @@ -2823,7 +2808,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; } @@ -2835,7 +2820,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))); } } @@ -2977,21 +2962,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; } @@ -2999,21 +2984,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; } @@ -3021,7 +3006,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; } } @@ -3031,7 +3016,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 @@ -3041,8 +3026,7 @@ 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))); } } @@ -3079,14 +3063,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; } @@ -3114,14 +3098,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; } @@ -3357,8 +3341,7 @@ 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, _); } @@ -3366,8 +3349,7 @@ 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); } @@ -3423,21 +3405,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; } @@ -3445,21 +3427,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; } @@ -3467,7 +3449,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; } } @@ -3513,14 +3495,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; } @@ -3704,8 +3686,7 @@ 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, _); } @@ -3713,8 +3694,7 @@ 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); } @@ -3856,7 +3836,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; } @@ -3889,7 +3869,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; } @@ -3901,7 +3881,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))); } } @@ -3929,7 +3909,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; } @@ -4124,8 +4104,7 @@ 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, _); } @@ -4134,8 +4113,7 @@ 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); } @@ -4146,29 +4124,25 @@ 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; } @@ -4193,7 +4167,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)); } } } @@ -4202,24 +4176,21 @@ 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; } } @@ -4307,7 +4278,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; } @@ -4409,7 +4380,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; } @@ -4615,8 +4586,7 @@ 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, _); @@ -4625,8 +4595,7 @@ 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); } @@ -6028,7 +5997,7 @@ namespace DXCoils { // Using/Aliasing using DataHeatBalFanSys::ZoneAirHumRat; using DataHeatBalFanSys::ZT; - using General::TrimSigDigits; + // SUBROUTINE PARAMETER DEFINITIONS: static Real64 SmallDifferenceTest(0.00000001); @@ -6075,9 +6044,7 @@ 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); @@ -6204,10 +6171,7 @@ 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))); } } @@ -6318,10 +6282,7 @@ 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) = @@ -6369,10 +6330,7 @@ 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))); } } @@ -6450,10 +6408,7 @@ 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 = @@ -6479,13 +6434,11 @@ 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) { @@ -6495,13 +6448,8 @@ 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) * @@ -6531,13 +6479,8 @@ 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))); } } } @@ -6635,8 +6578,8 @@ namespace DXCoils { // Using/Aliasing using namespace DataSizing; using CurveManager::CurveValue; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using namespace OutputReportPredefined; using StandardRatings::CalcDXCoilStandardRating; @@ -7105,10 +7048,8 @@ 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."); } @@ -7222,16 +7163,14 @@ 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."); } @@ -7239,8 +7178,7 @@ 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."); } @@ -7248,8 +7186,7 @@ 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."); } } @@ -7367,10 +7304,8 @@ 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."); } } @@ -7456,11 +7391,8 @@ 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."); } } @@ -7524,25 +7456,23 @@ namespace DXCoils { DXCoil(DXCoilNum).MSEvapCondAirFlow(Mode) = MSEvapCondAirFlowDes; 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, 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 (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."); } @@ -7554,11 +7484,8 @@ 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."); } } @@ -7582,8 +7509,7 @@ namespace DXCoils { DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower(Mode) = MSEvapCondPumpElecNomPowerDes; 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) { @@ -7591,19 +7517,17 @@ namespace DXCoils { 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, - "User-Specified Speed " + TrimSigDigits(Mode) + " Rated Evaporative Condenser Pump Power Consumption [W]", + format("User-Specified Speed {} Rated Evaporative Condenser Pump Power Consumption [W]", Mode), MSEvapCondPumpElecNomPowerUser); if (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."); } @@ -7615,11 +7539,8 @@ 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."); } } @@ -7689,10 +7610,8 @@ 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."); } } @@ -7709,25 +7628,23 @@ namespace DXCoils { DXCoil(DXCoilNum).MSSecCoilAirFlow(Mode) = SecCoilAirFlowDes; 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, 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 (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."); } @@ -7823,11 +7740,8 @@ 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."); } } @@ -7860,10 +7774,8 @@ 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."); } @@ -8013,7 +7925,7 @@ namespace DXCoils { using DataHVACGlobals::DXCoilTotalCapacity; using DataHVACGlobals::HPWHInletDBTemp; using DataHVACGlobals::HPWHInletWBTemp; - using General::TrimSigDigits; + // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcHPWHDXCoil"); @@ -8090,13 +8002,11 @@ 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."); } @@ -8125,13 +8035,11 @@ 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."); } @@ -8157,9 +8065,8 @@ 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( @@ -8181,9 +8088,8 @@ 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( @@ -8205,9 +8111,8 @@ 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( @@ -8229,9 +8134,8 @@ 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( @@ -8403,8 +8307,8 @@ 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: "); @@ -8630,8 +8534,7 @@ 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."); } @@ -8686,12 +8589,9 @@ 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."); } @@ -8706,12 +8606,9 @@ 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."); } @@ -8745,9 +8642,7 @@ 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(); } @@ -8758,9 +8653,7 @@ 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(); } @@ -8788,18 +8681,14 @@ 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."); } @@ -8818,12 +8707,11 @@ 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( @@ -8892,14 +8780,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 + "]."); } @@ -8928,15 +8814,13 @@ 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, ""); @@ -9008,10 +8892,7 @@ 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(); } @@ -9161,17 +9042,14 @@ 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."); } @@ -9190,12 +9068,11 @@ 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( @@ -9392,8 +9269,8 @@ 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 @@ -9594,8 +9471,7 @@ 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."); } @@ -9640,28 +9516,23 @@ namespace DXCoils { if (!FirstHVACIteration && !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( DXCoil(DXCoilNum).DXCoilType + " \"" + DXCoil(DXCoilNum).Name + @@ -9691,10 +9562,7 @@ 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(); } @@ -9706,8 +9574,7 @@ 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(); } @@ -9725,12 +9592,10 @@ 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."); } @@ -9751,12 +9616,11 @@ 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( @@ -9814,8 +9678,7 @@ 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]."); } @@ -9828,8 +9691,7 @@ 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, ""); @@ -9877,10 +9739,7 @@ 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(); } @@ -10045,7 +9904,7 @@ namespace DXCoils { using CurveManager::CurveValue; using DataHeatBalFanSys::ZoneAirHumRat; using DataHeatBalFanSys::ZT; - using General::RoundSigDigits; + // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcDXHeatingCoil"); @@ -10176,12 +10035,9 @@ 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."); } @@ -10231,8 +10087,7 @@ 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 + " ]."); @@ -10348,8 +10203,7 @@ 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 + " ]."); @@ -10377,8 +10231,7 @@ 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, ""); @@ -10390,8 +10243,7 @@ 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, ""); @@ -11099,7 +10951,7 @@ 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 @@ -11153,18 +11005,17 @@ 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, ""); @@ -11176,8 +11027,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; @@ -11189,18 +11040,17 @@ 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, ""); @@ -11215,19 +11065,18 @@ 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, ""); @@ -11279,7 +11128,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"); @@ -11718,8 +11567,6 @@ namespace DXCoils { using DataHVACGlobals::MSHPMassFlowRateHigh; using DataHVACGlobals::MSHPMassFlowRateLow; using DataHVACGlobals::MSHPWasteHeat; - using General::RoundSigDigits; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -11858,15 +11705,12 @@ 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) { @@ -11874,7 +11718,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."); } @@ -11915,21 +11759,14 @@ 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( - 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...", + 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); @@ -11942,21 +11779,14 @@ 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( - 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...", + 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); @@ -12237,21 +12067,14 @@ 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( - 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...", + 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); @@ -12308,8 +12131,7 @@ 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, ""); } @@ -12549,8 +12371,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) @@ -12644,15 +12464,12 @@ 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) { @@ -12660,7 +12477,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."); } @@ -12726,21 +12543,14 @@ 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( - 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...", + 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); @@ -12753,21 +12563,14 @@ 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( - 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...", + 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); @@ -12875,8 +12678,7 @@ 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, ""); @@ -12888,8 +12690,7 @@ 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, ""); @@ -12992,10 +12793,7 @@ 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."); } @@ -13104,8 +12902,7 @@ 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, ""); } @@ -13118,8 +12915,7 @@ 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, ""); @@ -13131,8 +12927,7 @@ 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, ""); @@ -13427,7 +13222,7 @@ namespace DXCoils { // Using/Aliasing using CurveManager::CurveValue; using DataEnvironment::OutBaroPress; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; using namespace OutputReportPredefined; @@ -15004,7 +14799,7 @@ 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) { @@ -15013,8 +14808,7 @@ 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; } @@ -15687,8 +15481,8 @@ 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; @@ -15863,8 +15657,7 @@ 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."); } @@ -15993,8 +15786,7 @@ 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]."); } @@ -16007,8 +15799,7 @@ 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, ""); @@ -16044,10 +15835,8 @@ 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(); } @@ -16135,7 +15924,7 @@ namespace DXCoils { // Using/Aliasing using CurveManager::CurveValue; - using General::RoundSigDigits; + using HVACVariableRefrigerantFlow::OACompOffMassFlow; using HVACVariableRefrigerantFlow::OACompOnMassFlow; using namespace HVACVariableRefrigerantFlow; @@ -16321,8 +16110,7 @@ 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, ""); @@ -16334,8 +16122,7 @@ 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 f70378bb5f5..dc77d9d7fc8 100644 --- a/src/EnergyPlus/DataEnvironment.cc +++ b/src/EnergyPlus/DataEnvironment.cc @@ -370,7 +370,7 @@ 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 +393,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 +419,7 @@ 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 +442,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 +469,7 @@ 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 +492,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 +589,10 @@ 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 cd148323bce..6f9be3f7922 100644 --- a/src/EnergyPlus/DataHeatBalance.cc +++ b/src/EnergyPlus/DataHeatBalance.cc @@ -1783,7 +1783,7 @@ namespace DataHeatBalance { // na // Using/Aliasing - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1829,8 +1829,7 @@ 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 +1838,15 @@ 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 +1854,8 @@ 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 a50788be642..59ae716444d 100644 --- a/src/EnergyPlus/DataSurfaceLists.cc +++ b/src/EnergyPlus/DataSurfaceLists.cc @@ -125,7 +125,7 @@ namespace DataSurfaceLists { // Using/Aliasing using namespace DataSurfaces; using DataHeatBalance::Zone; - using General::RoundSigDigits; + // SUBROUTINE PARAMETER DEFINITIONS: static std::string const CurrentModuleObject1("ZoneHVAC:LowTemperatureRadiant:SurfaceGroup"); @@ -239,8 +239,7 @@ namespace 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 7174dc8a833..cf7157da847 100644 --- a/src/EnergyPlus/DataTimings.cc +++ b/src/EnergyPlus/DataTimings.cc @@ -266,6 +266,25 @@ 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 b0dc4db5b82..b0c7593de79 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -283,8 +282,8 @@ namespace DataZoneEquipment { using BranchNodeConnections::SetUpCompSets; using namespace DataLoopNode; using DataGlobals::NumOfZones; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using namespace ScheduleManager; // SUBROUTINE PARAMETER DEFINITIONS: @@ -402,15 +401,13 @@ namespace DataZoneEquipment { UniqueZoneEquipListNames.reserve(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 > NumOfZones) { - ShowSevereError(state, RoutineName + "Number of Controlled Zone objects [" + TrimSigDigits(NumOfControlledZones) + - "] greater than Number of Zones [" + TrimSigDigits(NumOfZones) + ']'); + ShowSevereError(state, format("{}Number of Controlled Zone objects [{}] greater than Number of Zones [{}]", RoutineName, NumOfControlledZones, NumOfZones)); ShowFatalError(state, RoutineName + "Too many ZoneHVAC:EquipmentConnections objects."); } @@ -558,8 +555,7 @@ 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; } @@ -604,11 +600,10 @@ 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; } @@ -616,11 +611,10 @@ 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; } @@ -772,24 +766,20 @@ 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)); } } @@ -1380,8 +1370,7 @@ 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) { @@ -1489,7 +1478,7 @@ namespace DataZoneEquipment { using DataSizing::ZOAM_IAQP; using DataSizing::ZOAM_ProportionalControlDesOcc; using DataSizing::ZOAM_ProportionalControlSchOcc; - using General::RoundSigDigits; + using ScheduleManager::GetCurrentScheduleValue; using ScheduleManager::GetScheduleMaxValue; @@ -1706,11 +1695,7 @@ 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, ""); @@ -1726,11 +1711,7 @@ 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 e8ea187b416..c864e2875b1 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -223,7 +223,7 @@ namespace DaylightingDevices { // Using/Aliasing using DataHeatBalance::IntGainTypeOf_DaylightingDeviceTubular; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: na @@ -432,10 +432,8 @@ 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 @@ -484,7 +482,7 @@ namespace DaylightingDevices { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using General::SafeDivide; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -603,8 +601,7 @@ 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; } @@ -613,13 +610,11 @@ 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)); } } @@ -670,13 +665,11 @@ 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 e84debb50f1..8fd8f5b561d 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -62,7 +62,6 @@ #include // EnergyPlus Headers -#include #include #include #include @@ -522,7 +521,7 @@ namespace DaylightingManager { using DataSystemVariables::DetailedSolarTimestepIntegration; using DaylightingDevices::TransTDD; using General::BlindBeamBeamTrans; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -869,7 +868,7 @@ namespace DaylightingManager { // Using/Aliasing using DaylightingDevices::TransTDD; using General::BlindBeamBeamTrans; - using General::RoundSigDigits; + using General::SafeDivide; // Locals @@ -955,7 +954,7 @@ namespace DaylightingManager { // Using/Aliasing using DaylightingDevices::TransTDD; using General::BlindBeamBeamTrans; - using General::RoundSigDigits; + using General::SafeDivide; using DataEnvironment::SunIsUp; using DataSystemVariables::DetailedSolarTimestepIntegration; @@ -1353,7 +1352,7 @@ namespace DaylightingManager { // Using/Aliasing using DaylightingDevices::TransTDD; using General::BlindBeamBeamTrans; - using General::RoundSigDigits; + using General::SafeDivide; using DataEnvironment::SunIsUp; using DataSystemVariables::DetailedSolarTimestepIntegration; @@ -1788,7 +1787,7 @@ namespace DaylightingManager { using DataSystemVariables::DetailedSolarTimestepIntegration; using General::BlindBeamBeamTrans; using General::POLYF; - using General::RoundSigDigits; + using General::SafeDivide; // Locals @@ -1964,10 +1963,8 @@ 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) { @@ -1975,9 +1972,7 @@ 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; } } @@ -1986,8 +1981,7 @@ 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; } } @@ -4519,13 +4513,13 @@ 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", @@ -4662,8 +4656,7 @@ namespace DaylightingManager { using DataStringGlobals::CharComma; using DataStringGlobals::CharSpace; using DataStringGlobals::CharTab; - using General::RoundSigDigits; - using General::TrimSigDigits; + Array1D_int ZoneMapCount; int MapNum; @@ -4747,8 +4740,7 @@ 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); @@ -4762,8 +4754,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); @@ -4774,10 +4767,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 @@ -4860,8 +4857,7 @@ 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; } @@ -4950,49 +4946,34 @@ 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)); } } } @@ -5044,7 +5025,7 @@ 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; @@ -5202,25 +5183,25 @@ 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", @@ -5237,12 +5218,10 @@ 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; } @@ -5267,8 +5246,7 @@ 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; @@ -5374,43 +5352,31 @@ 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 @@ -5493,7 +5459,7 @@ namespace DaylightingManager { using DataDaylighting::ZoneDaylight; using DataHeatBalance::Zone; using namespace DataDaylightingDevices; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -5591,7 +5557,7 @@ namespace DaylightingManager { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -5657,8 +5623,7 @@ 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) { @@ -6676,7 +6641,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); @@ -6721,7 +6686,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); @@ -6841,7 +6806,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); @@ -6956,7 +6921,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); @@ -9924,7 +9889,7 @@ namespace DaylightingManager { using DataStringGlobals::CharComma; using DataStringGlobals::CharSpace; using DataStringGlobals::CharTab; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -9995,7 +9960,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, @@ -10040,11 +10005,8 @@ 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; } @@ -10054,14 +10016,13 @@ 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; @@ -10132,7 +10093,6 @@ namespace DaylightingManager { using DataStringGlobals::CharComma; using DataStringGlobals::CharSpace; using DataStringGlobals::CharTab; - using General::TrimSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -10240,7 +10200,7 @@ 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; diff --git a/src/EnergyPlus/DemandManager.cc b/src/EnergyPlus/DemandManager.cc index f31d1936f88..cd72d8d65e9 100644 --- a/src/EnergyPlus/DemandManager.cc +++ b/src/EnergyPlus/DemandManager.cc @@ -662,7 +662,7 @@ namespace DemandManager { using DataHeatBalance::ZoneElectricObjects; using DataZoneControls::TempControlledZone; using DataZoneControls::TStatObjects; - using General::RoundSigDigits; + using MixedAir::GetOAController; using ScheduleManager::GetScheduleIndex; @@ -1190,8 +1190,7 @@ namespace 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 267abd630cc..7ee39a2b3b8 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -150,8 +150,8 @@ namespace DesiccantDehumidifiers { using namespace CurveManager; using namespace Psychrometrics; using FluidProperties::GetSatDensityRefrig; - using General::RoundSigDigits; - using General::TrimSigDigits; + + // Data // MODULE PARAMETER DEFINITIONS @@ -235,12 +235,10 @@ 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)); } } @@ -686,14 +684,12 @@ 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 @@ -997,8 +993,7 @@ 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); @@ -1142,8 +1137,7 @@ 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); @@ -2079,7 +2073,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"); } @@ -2335,8 +2329,7 @@ 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 @@ -2449,8 +2442,7 @@ 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; @@ -3232,7 +3224,7 @@ namespace DesiccantDehumidifiers { // Using/Aliasing using DataHVACGlobals::SmallLoad; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; @@ -3304,12 +3296,9 @@ 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("CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + DesicDehum(DesicDehumNum).DehumType + - "=\"" + DesicDehum(DesicDehumNum).Name + "\"", + ShowRecurringWarningErrorAtEnd(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) { @@ -3317,8 +3306,8 @@ namespace DesiccantDehumidifiers { 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("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 518727c246c..86109c4e525 100644 --- a/src/EnergyPlus/DualDuct.cc +++ b/src/EnergyPlus/DualDuct.cc @@ -56,7 +56,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -174,7 +173,7 @@ 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 @@ -197,13 +196,11 @@ 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; } @@ -269,7 +266,7 @@ 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 @@ -773,11 +770,9 @@ 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; } } @@ -1584,7 +1579,7 @@ 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 0d8800e1531..2765cb3b279 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -845,7 +845,7 @@ 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 + "'."); @@ -1219,7 +1219,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 3486389a768..3bbcc0193b5 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -162,7 +162,7 @@ namespace EarthTube { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleValuesForDay; @@ -226,19 +226,15 @@ 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; } @@ -261,30 +257,26 @@ 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; } @@ -292,29 +284,32 @@ 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 fcd4b811018..ae50852a2e9 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 { @@ -98,7 +96,6 @@ namespace EcoRoofManager { // Using/Aliasing using namespace DataSurfaces; using namespace DataGlobals; - using namespace DataLoopNode; using namespace DataHeatBalance; Real64 CumRunoff(0.0); // Cumulative runoff, updated each time step (m) mult by roof area to get volume @@ -160,7 +157,6 @@ namespace EcoRoofManager { using namespace DataHeatBalance; using namespace DataHeatBalSurface; using namespace DataSurfaces; - using namespace Psychrometrics; using ConvectionCoefficients::InitExteriorConvectionCoeff; using ConvectionCoefficients::SetExtConvectionCoeff; using ConvectionCoefficients::SetIntConvectionCoeff; @@ -706,7 +702,6 @@ namespace EcoRoofManager { using namespace DataGlobals; using namespace DataEnvironment; using namespace DataSurfaces; - using General::RoundSigDigits; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -807,16 +802,12 @@ namespace EcoRoofManager { ShowWarningError(state, "CalcEcoRoof: Too few time steps per hour for stability."); if (ceil(60 * index1 / MinutesPerTimeStep) <= 60) { - ShowContinueError(state, "...Entered Timesteps per hour=[" + RoundSigDigits(NumOfTimeStepInHour) + - "], Change to some value greater than or equal to [" + RoundSigDigits(60 * index1 / MinutesPerTimeStep) + - "] for assured stability."); + ShowContinueError(state, format("...Entered Timesteps per hour=[{}], Change to some value greater than or equal to [{}] for assured stability.", NumOfTimeStepInHour, 60 * index1 / 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(NumOfTimeStepInHour) + - "], however the required frequency for stability [" + RoundSigDigits(60 * index1 / 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.", NumOfTimeStepInHour, 60 * index1 / 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."); @@ -954,8 +945,7 @@ 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 c5fa00094a0..398a66bc1be 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,12 @@ 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); + tableBody(jObj, 2) = format("{} {}", MonthNames(UsePriceEscalation(jObj).escalationStartMonth), UsePriceEscalation(jObj).escalationStartYear); } for (jObj = 1; jObj <= numUsePriceEscalation; ++jObj) { for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { @@ -2274,7 +2273,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 +2308,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 +2356,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 +2399,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 +2454,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 +2501,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 +2554,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 +2618,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 +2651,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 +2838,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 +2881,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 90f9da241e3..6fa16be9abe 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -382,7 +382,7 @@ 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 @@ -716,15 +716,13 @@ 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(NumOfTimeStepInHour) + "]."); + ShowContinueError(state, format("Demand window of QuarterHour is not consistent with number of timesteps per hour [{}].", 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(NumOfTimeStepInHour) + "]."); + ShowContinueError(state, format("Demand window of QuarterHour is not consistent with number of timesteps per hour [{}].", 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; @@ -738,8 +736,7 @@ 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(NumOfTimeStepInHour) + "]."); + ShowContinueError(state, format("Demand window of HalfHour is not consistent with number of timesteps per hour [{}].", 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)) { @@ -3296,9 +3293,7 @@ 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 e7e233e48d2..7dca88b402b 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -165,7 +165,7 @@ namespace ElectricBaseboardRadiator { // Water baseboard module // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int BaseboardNum; // Index of unit in baseboard array @@ -185,13 +185,11 @@ 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; } @@ -232,7 +230,7 @@ namespace ElectricBaseboardRadiator { // Using/Aliasing using DataSurfaces::Surface; - using General::RoundSigDigits; + using GlobalNames::VerifyUniqueBaseboardName; using ScheduleManager::GetScheduleIndex; using namespace DataIPShortCuts; @@ -240,7 +238,7 @@ 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 @@ -321,8 +319,7 @@ 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 { @@ -338,8 +335,7 @@ 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); @@ -359,8 +355,7 @@ 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 { @@ -380,13 +375,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; } @@ -405,19 +400,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.') @@ -426,7 +421,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 } @@ -467,13 +462,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) { @@ -692,7 +687,7 @@ namespace ElectricBaseboardRadiator { using namespace DataSizing; using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; + // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("SizeElectricBaseboard"); @@ -1049,7 +1044,7 @@ 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) @@ -1081,16 +1076,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 229ef8de992..501b2e5ec75 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(typeOfName + " named " + name + " is producing negative electric power ", @@ -3768,15 +3768,14 @@ 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 +4008,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 +4025,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 a7b9d91f775..0d492013f43 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -203,7 +203,7 @@ 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 @@ -226,13 +226,11 @@ 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; } @@ -1105,7 +1103,7 @@ namespace EvaporativeCoolers { using namespace DataSizing; using DataAirSystems::PrimaryAirSystem; using Fans::SetFanData; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool CoolerOnOApath(false); @@ -1266,9 +1264,8 @@ 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."); } @@ -1345,10 +1342,10 @@ 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 + // 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, "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." ); + // ) + " [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." ); //} //} @@ -1426,8 +1423,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."); } @@ -1465,8 +1462,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."); } @@ -1557,8 +1554,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."); } @@ -1594,8 +1591,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."); } @@ -1661,7 +1658,7 @@ namespace EvaporativeCoolers { // na // Using/Aliasing - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1708,8 +1705,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; @@ -2466,7 +2463,7 @@ namespace EvaporativeCoolers { using DataEnvironment::OutBaroPress; using DataEnvironment::OutDryBulbTemp; using DataHVACGlobals::SmallLoad; - using General::RoundSigDigits; + using General::SolveRoot; using Psychrometrics::PsyHfgAirFnWTdb; @@ -2554,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( @@ -2571,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("Secondary air mass flow control failed in Indirect Evaporative Cooler Research Special = " + @@ -2616,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( @@ -2633,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("Secondary air mass flow control failed in Indirect Evaporative Cooler Research Special = " + @@ -2665,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( @@ -2682,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("Secondary air mass flow control failed in Indirect Evaporative Cooler Research Special = " + @@ -2737,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( @@ -2754,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("Secondary air mass flow control failed in Indirect Evaporative Cooler Research Special = " + @@ -3592,7 +3585,7 @@ namespace EvaporativeCoolers { // public simulation routine for managing zone hvac evaporative cooler unit // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CompNum; @@ -3612,13 +3605,11 @@ 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; } @@ -3654,7 +3645,7 @@ namespace EvaporativeCoolers { using Fans::GetFanOutletNode; using Fans::GetFanType; using Fans::GetFanVolFlow; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; // SUBROUTINE PARAMETER DEFINITIONS: @@ -4102,7 +4093,7 @@ namespace EvaporativeCoolers { using DataZoneEquipment::ZoneEquipInputsFilled; using DataZoneEquipment::ZoneEvaporativeCoolerUnit_Num; using Fans::GetFanVolFlow; - using General::TrimSigDigits; + // Locals @@ -4153,9 +4144,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, format("...fan volumetric flow rate = {:.5T} m3/s.", ZoneEvapUnit(UnitNum).ActualFanVolFlowRate)); ShowContinueError(state, - "...evap cooler unit volumetric flow rate = " + TrimSigDigits(ZoneEvapUnit(UnitNum).DesignAirVolumeFlowRate, 5) + " m3/s."); + 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 @@ -4292,7 +4283,7 @@ namespace EvaporativeCoolers { using DataSizing::CurZoneEqNum; using DataSizing::FinalZoneSizing; using DataSizing::ZoneSizingRunDone; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4676,12 +4667,10 @@ 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("Zone Evaporative Cooler unit part load ratio control failed (iteration limit [" + - General::RoundSigDigits(MaxIte) + "]) for ZoneHVAC:EvaporativeCoolerUnit =\"" + - ZoneEvapUnit(UnitNum).Name, + ShowRecurringWarningErrorAtEnd(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) { @@ -4754,7 +4743,7 @@ namespace EvaporativeCoolers { using DataGlobals::WarmupFlag; using DataHVACGlobals::ZoneCompTurnFansOff; using DataHVACGlobals::ZoneCompTurnFansOn; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; @@ -4837,11 +4826,10 @@ 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("Zone Evaporative Cooler unit control failed (iteration limit [" + RoundSigDigits(MaxIte) + - "]) for ZoneHVAC:EvaporativeCoolerUnit =\"" + ZoneEvapUnit(UnitNum).Name, + ShowRecurringWarningErrorAtEnd(format("Zone Evaporative Cooler unit control failed (iteration limit [{}]) for ZoneHVAC:EvaporativeCoolerUnit =\"{}", MaxIte, ZoneEvapUnit(UnitNum).Name), ZoneEvapUnit(UnitNum).UnitVSControlMaxIterErrorIndex); } else if (SolFla == -2) { diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 50a408058c9..94593b8814a 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -1248,9 +1248,7 @@ 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 +1417,7 @@ 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 +1455,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 +1473,17 @@ 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 +1556,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 +1627,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 +1645,17 @@ 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 +1760,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 +1826,15 @@ 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 +2452,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( @@ -2521,7 +2494,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(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 51f77a501e9..9ff603fa60a 100644 --- a/src/EnergyPlus/ExteriorEnergyUse.cc +++ b/src/EnergyPlus/ExteriorEnergyUse.cc @@ -111,7 +111,7 @@ namespace ExteriorEnergyUse { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMaxValue; using ScheduleManager::GetScheduleMinValue; @@ -183,13 +183,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; } } @@ -340,13 +340,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; } } @@ -393,13 +393,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 c63be1d22ee..fef1745c795 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -519,7 +519,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; @@ -557,7 +557,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 { @@ -645,9 +645,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; } @@ -670,8 +670,8 @@ namespace ExternalInterface { } StopExternalInterfaceIfError(state); - DisplayString("Number of outputs in ExternalInterface = " + TrimSigDigits(nOutVal)); - DisplayString("Number of inputs in ExternalInterface = " + TrimSigDigits(nInpVar)); + DisplayString(format("Number of outputs in ExternalInterface = {}", nOutVal)); + DisplayString(format("Number of inputs in ExternalInterface = {}", nInpVar)); InitExternalInterfacefirstCall = false; @@ -734,7 +734,7 @@ namespace ExternalInterface { // Using/Aliasing using DataGlobals::WarmupFlag; using EMSManager::ManageEMS; - using General::TrimSigDigits; + using RuntimeLanguageProcessor::ExternalInterfaceSetErlVariable; using RuntimeLanguageProcessor::FindEMSVariable; using RuntimeLanguageProcessor::isExternalInterfaceErlVariable; @@ -793,7 +793,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); } @@ -824,7 +824,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); } @@ -855,7 +855,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); } @@ -918,7 +918,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); } @@ -931,7 +931,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); } @@ -959,7 +959,7 @@ namespace ExternalInterface { // This routine instantiates and initializes FMUs. // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int i, j; // Loop counters @@ -993,7 +993,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); } @@ -1013,7 +1013,7 @@ namespace ExternalInterface { // This routine reinitializes FMUs. // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int i, j; // Loop counters @@ -1027,7 +1027,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); } @@ -1089,7 +1089,7 @@ namespace ExternalInterface { using DataStringGlobals::CurrentWorkingFolder; using DataStringGlobals::pathChar; using DataSystemVariables::CheckForActualFileName; - using General::TrimSigDigits; + using RuntimeLanguageProcessor::FindEMSVariable; using RuntimeLanguageProcessor::isExternalInterfaceErlVariable; using ScheduleManager::GetDayScheduleIndex; @@ -1493,20 +1493,18 @@ 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."); } } @@ -1823,27 +1821,23 @@ 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("Number of inputs in instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\" = \"" + - TrimSigDigits(FMU(i).Instance(j).NumInputVariablesInIDF) + "\"."); - DisplayString("Number of outputs in instance \"" + FMU(i).Instance(j).Name + "\" of FMU \"" + FMU(i).Name + "\" = \"" + - TrimSigDigits(FMU(i).Instance(j).NumOutputVariablesInIDF) + "\"."); + DisplayString(format("Number of inputs in instance \"{}\" of FMU \"{}\" = \"{}\".", FMU(i).Instance(j).Name, FMU(i).Name, FMU(i).Instance(j).NumInputVariablesInIDF)); + DisplayString(format("Number of outputs in instance \"{}\" of FMU \"{}\" = \"{}\".", FMU(i).Instance(j).Name, FMU(i).Name, FMU(i).Instance(j).NumOutputVariablesInIDF)); } } StopExternalInterfaceIfError(state); @@ -1989,7 +1983,7 @@ namespace ExternalInterface { using DataGlobals::WarmupFlag; using DataSystemVariables::UpdateDataDuringWarmupExternalInterface; using EMSManager::ManageEMS; - using General::TrimSigDigits; + using RuntimeLanguageProcessor::ExternalInterfaceSetErlVariable; using RuntimeLanguageProcessor::FindEMSVariable; using RuntimeLanguageProcessor::isExternalInterfaceErlVariable; @@ -2118,8 +2112,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); } @@ -2176,7 +2169,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); } @@ -2289,7 +2282,7 @@ namespace ExternalInterface { using DataGlobals::MinutesPerTimeStep; using DataGlobals::SimTimeSteps; using EMSManager::ManageEMS; - using General::TrimSigDigits; + using RuntimeLanguageProcessor::ExternalInterfaceSetErlVariable; using ScheduleManager::ExternalInterfaceSetSchedule; // using DataPrecisionGlobals; @@ -2323,8 +2316,7 @@ 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; } @@ -2385,8 +2377,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); } @@ -2400,7 +2391,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 2b24a3106a9..c655ab4547e 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -66,7 +66,6 @@ #include #include #include -#include #include #include #include @@ -241,7 +240,7 @@ 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 @@ -264,13 +263,11 @@ 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; } @@ -320,9 +317,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); @@ -467,9 +463,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; @@ -690,9 +685,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; } @@ -729,9 +724,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; } @@ -757,8 +752,7 @@ 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."); @@ -913,8 +907,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; } } @@ -1397,8 +1391,8 @@ 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; @@ -1671,9 +1665,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; } @@ -1687,10 +1681,8 @@ 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."); } @@ -1711,9 +1703,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; } @@ -1755,10 +1747,8 @@ 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."); } @@ -1918,10 +1908,8 @@ 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."); } @@ -2089,10 +2077,8 @@ 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."); } @@ -2234,7 +2220,7 @@ namespace FanCoilUnits { using DataHeatBalFanSys::TempControlType; using DataZoneEquipment::CalcDesignSpecificationOutdoorAir; using General::SolveRoot; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -2439,11 +2425,9 @@ 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("Cold water flow Iteration limit exceeded in fan coil unit " + @@ -2585,11 +2569,9 @@ 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("Hot water flow Iteration limit exceeded in fan coil unit " + @@ -2818,11 +2800,9 @@ 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("Part-load ratio cooling iteration limit exceeded in fan coil unit " + @@ -2834,7 +2814,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("Part-load ratio cooling control failed in fan coil unit " + FanCoil(FanCoilNum).Name, @@ -2929,11 +2909,9 @@ 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("Part-load ratio heating iteration limit exceeded in fan coil unit " + @@ -2945,7 +2923,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("Part-load ratio heating control failed in fan coil unit " + FanCoil(FanCoilNum).Name, @@ -3263,7 +3241,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("ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -3314,9 +3292,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("ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -4248,7 +4226,7 @@ namespace FanCoilUnits { // Using/Aliasing using namespace DataZoneEnergyDemands; using DataHeatBalFanSys::TempControlType; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; // Locals @@ -4347,7 +4325,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("ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -4478,7 +4456,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("ZoneHVAC:FourPipeFanCoil=\"" + FanCoil(FanCoilNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -4506,10 +4484,8 @@ 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("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 f3613180502..fa8f43bcb81 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -192,7 +191,7 @@ namespace Fans { // This subroutine manages Fan component simulation. // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int FanNum; // current fan number @@ -214,13 +213,11 @@ 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; } @@ -1191,7 +1188,7 @@ namespace Fans { using namespace OutputReportPredefined; using CurveManager::CurveValue; using CurveManager::GetCurveIndex; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1324,7 +1321,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] @@ -1340,7 +1337,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 @@ -1382,7 +1379,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 @@ -1423,7 +1420,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; //[-] @@ -1907,7 +1904,7 @@ namespace Fans { // Using/Aliasing using CurveManager::CurveValue; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2020,8 +2017,7 @@ namespace Fans { if (Fan(FanNum).OneTimePowerRatioCheck && !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:"); @@ -2035,8 +2031,7 @@ namespace Fans { if (Fan(FanNum).OneTimeEffRatioCheck && !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:"); @@ -2241,7 +2236,7 @@ namespace Fans { using DataEnvironment::CurMnDy; using DataEnvironment::EnvironmentName; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -3069,7 +3064,7 @@ 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 6eb832d7084..29c782f3b46 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -855,9 +855,7 @@ 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 " @@ -903,10 +901,7 @@ 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 " @@ -976,10 +971,7 @@ 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 " @@ -1041,10 +1033,7 @@ 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 " @@ -1078,7 +1067,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); @@ -1095,21 +1084,16 @@ 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; @@ -1187,7 +1171,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); @@ -1204,23 +1188,18 @@ 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); } @@ -1337,8 +1316,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); @@ -1355,21 +1333,16 @@ 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; @@ -1774,8 +1747,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( @@ -1816,7 +1789,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(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 a6c084c0579..5df16676d70 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -109,7 +109,7 @@ namespace FluidProperties { // USE STATEMENTS // Using/Aliasing using DataGlobals::WarmupFlag; - using General::RoundSigDigits; + // Data // MODULE PARAMETER DEFINITIONS @@ -738,9 +738,11 @@ 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; } @@ -794,8 +796,7 @@ 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 } @@ -867,8 +868,7 @@ 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 } @@ -942,8 +942,7 @@ 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 } @@ -1013,8 +1012,7 @@ 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 } @@ -1088,8 +1086,7 @@ 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 } @@ -1159,8 +1156,7 @@ 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 } @@ -1234,8 +1230,7 @@ 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 } @@ -1347,7 +1342,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 ********** @@ -1437,8 +1432,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); @@ -1481,9 +1475,11 @@ 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; } @@ -1524,8 +1520,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); @@ -1605,7 +1600,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; @@ -1613,7 +1608,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) { @@ -4892,14 +4887,12 @@ 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); @@ -4997,14 +4990,12 @@ 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, _); @@ -5802,7 +5793,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)); @@ -6068,11 +6059,8 @@ 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(RoutineName + "Saturation temperature is out of range for refrigerant [" + @@ -6190,11 +6178,8 @@ 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(RoutineName + "Saturation pressure is out of range for refrigerant [" + @@ -6271,7 +6256,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."); } @@ -6364,7 +6349,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."); } @@ -6429,11 +6414,8 @@ 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(RoutineName + "Saturation temperature is out of range for refrigerant [" + @@ -6511,7 +6493,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."); } @@ -6728,9 +6710,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(RoutineName + "Refrigerant [" + RefrigErrorTracking(RefrigNum).Name + @@ -7035,9 +7017,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) { @@ -7473,9 +7455,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) { @@ -7630,8 +7612,7 @@ 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(RoutineName + "Temperature out of range (too low) for fluid [" + glycol_data.Name + @@ -7649,8 +7630,7 @@ 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(RoutineName + "Temperature out of range (too high) for fluid [" + glycol_data.Name + @@ -7810,9 +7790,7 @@ 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) { @@ -7829,9 +7807,7 @@ 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) { @@ -7975,9 +7951,7 @@ 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) { @@ -7994,9 +7968,7 @@ 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) { @@ -8140,9 +8112,7 @@ 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) { @@ -8159,9 +8129,7 @@ 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) { @@ -8669,8 +8637,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("GetInterpolatedSatProp: Refrigerant temperature for interpolation out of range error", TempRangeErrIndex, @@ -8804,8 +8772,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 6286734e117..1062ea8484e 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; } @@ -1557,8 +1557,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; } @@ -1675,7 +1674,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 f821a4ab2d7..43d288053bd 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -323,7 +323,7 @@ namespace Furnaces { using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; using namespace DataZoneEnergyDemands; using DataHeatBalFanSys::TempControlType; - using General::TrimSigDigits; + using IntegratedHeatPump::IntegratedHeatPumps; using WaterToAirHeatPumpSimple::SimWatertoAirHPSimple; @@ -365,13 +365,11 @@ 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; } @@ -902,8 +900,8 @@ 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; @@ -1551,8 +1549,7 @@ 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; } @@ -1561,7 +1558,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; } } @@ -2686,21 +2683,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; } @@ -2736,16 +2733,14 @@ 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; @@ -3559,21 +3554,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; } @@ -3626,16 +3621,14 @@ 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; @@ -4409,15 +4402,14 @@ 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; } } @@ -4802,8 +4794,8 @@ 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); @@ -4950,13 +4942,12 @@ 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; @@ -5229,10 +5220,8 @@ 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; @@ -5525,9 +5514,7 @@ 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); @@ -5542,9 +5529,7 @@ 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); } @@ -5552,9 +5537,7 @@ 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); @@ -5569,9 +5552,7 @@ 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); } @@ -5579,9 +5560,7 @@ 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); @@ -5903,7 +5882,7 @@ namespace Furnaces { // na // Using/Aliasing - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -6061,7 +6040,7 @@ namespace Furnaces { // Using/Aliasing using namespace DataSizing; using EMSManager::ManageEMS; - using General::TrimSigDigits; + using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; using IntegratedHeatPump::IntegratedHeatPumps; using IntegratedHeatPump::SizeIHP; @@ -6443,7 +6422,7 @@ namespace Furnaces { using HeatingCoils::SimulateHeatingCoilComponents; using namespace ScheduleManager; using DataHeatBalFanSys::MAT; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -6635,9 +6614,7 @@ 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(cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -6745,7 +6722,7 @@ namespace Furnaces { using DXCoils::DXCoil; using DXCoils::DXCoilPartLoadRatio; using General::SolveRoot; - using General::TrimSigDigits; + using TempSolveRoot::SolveRoot; // Locals @@ -7037,9 +7014,7 @@ namespace Furnaces { 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."); + 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( cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7054,8 +7029,7 @@ 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( cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7306,9 +7280,7 @@ 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(cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7323,8 +7295,7 @@ 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( cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7526,9 +7497,7 @@ 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(cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7545,7 +7514,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( cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7806,12 +7775,9 @@ namespace Furnaces { 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)); + 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( cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -7826,10 +7792,8 @@ 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( cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -8060,7 +8024,7 @@ namespace Furnaces { // Using/Aliasing using DataHeatBalFanSys::MAT; using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using TempSolveRoot::SolveRoot; @@ -8277,9 +8241,7 @@ 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(cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + "\" - Iteration limit exceeded in calculating sensible cooling part-load ratio error " @@ -8309,11 +8271,9 @@ 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( cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -8467,9 +8427,7 @@ 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( cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + @@ -8498,11 +8456,9 @@ 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(cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + " \"" + Furnace(FurnaceNum).Name + "\" - Heating sensible part-load ratio out of range error continues.", @@ -9674,7 +9630,7 @@ namespace Furnaces { // Using/Aliasing using DataHVACGlobals::SmallLoad; - using General::RoundSigDigits; + using General::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; @@ -9767,12 +9723,9 @@ 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("CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + - cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + "=\"" + Furnace(FurnaceNum).Name, + ShowRecurringWarningErrorAtEnd(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) { @@ -9780,8 +9733,8 @@ namespace Furnaces { 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("CalcNonDXHeatingCoils: Hot water coil control failed (flow limits) for " + cFurnaceTypes(Furnace(FurnaceNum).FurnaceType_Num) + "=\"" + Furnace(FurnaceNum).Name + @@ -10265,9 +10218,9 @@ namespace Furnaces { // Using/Aliasing using DataGlobals::WarmupFlag; - using General::RoundSigDigits; + using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using IntegratedHeatPump::GetCurWorkMode; using IntegratedHeatPump::GetMaxSpeedNumIHP; @@ -10440,7 +10393,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( @@ -10509,8 +10462,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( @@ -10582,8 +10534,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(Furnace(FurnaceNum).Name + @@ -11777,7 +11728,7 @@ 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 b6d47ca4ee6..f1d60dda098 100644 --- a/src/EnergyPlus/General.cc +++ b/src/EnergyPlus/General.cc @@ -1587,29 +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, - Optional_int_const EP_UNUSED(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, - Optional_int_const EP_UNUSED(SigDigits) // ignored - ) - { - return format("{}", IntegerValue); - } std::string RemoveTrailingZeros(std::string const &InputString) { @@ -3598,10 +3575,8 @@ 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; } @@ -3610,8 +3585,7 @@ 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 8147140ddb9..a26ee946b4d 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 ef972648b99..13de8c80c72 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -162,8 +162,8 @@ void ControlCompOutput(EnergyPlusData &state, std::string const &CompName, using DataBranchAirLoopPlant::MassFlowTolerance; using DataGlobals::WarmupFlag; using FanCoilUnits::Calc4PipeFanCoil; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using HWBaseboardRadiator::CalcHWBaseboard; using OutdoorAirUnit::CalcOAUnitCoilComps; using PlantUtilities::SetActuatedBranchFlowRate; @@ -312,8 +312,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."); } @@ -496,7 +495,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)); } } @@ -594,7 +593,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; } @@ -629,12 +628,12 @@ void ControlCompOutput(EnergyPlusData &state, std::string const &CompName, if ((Iter > MaxIter) && (!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("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 cda3fa1a7f2..0ca1a3ae1a3 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -122,7 +122,7 @@ namespace GroundHeatExchangers { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using namespace DataLoopNode; - using General::TrimSigDigits; + using namespace GroundTemperatureManager; // MODULE PARAMETER DEFINITIONS @@ -263,7 +263,7 @@ namespace GroundHeatExchangers { 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) + ")"; + format("{} BH {} loc: ({}, {})", thisRF->name, bhCounter, xLoc, yLoc); thisBH->props = GetVertProps(arrayObjectPtr->props->name); thisBH->xLoc = xLoc; thisBH->yLoc = yLoc; @@ -287,11 +287,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; @@ -1018,7 +1018,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; } @@ -1137,12 +1137,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) { @@ -1734,7 +1734,7 @@ namespace GroundHeatExchangers { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -2023,7 +2023,7 @@ namespace GroundHeatExchangers { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; + using PlantUtilities::SafeCopyPlantNode; // SUBROUTINE ARGUMENT DEFINITIONS @@ -2048,8 +2048,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; } } @@ -2148,8 +2147,8 @@ namespace GroundHeatExchangers { // Using/Aliasing using BranchNodeConnections::TestCompSet; using DataEnvironment::MaxNumberSimYears; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using NodeInputManager::GetOnlySingleNode; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -2744,7 +2743,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); @@ -2764,8 +2763,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; @@ -2787,8 +2786,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 5d292ab2fdf..3bc8bc0bd02 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -307,7 +307,7 @@ namespace HVACControllers { using namespace DataSystemVariables; using DataPlant::FlowLocked; using DataPlant::PlantLoop; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -341,13 +341,11 @@ 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; } @@ -465,7 +463,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)); } } @@ -1460,7 +1458,7 @@ namespace HVACControllers { // na // Using/Aliasing - using General::TrimSigDigits; + using RootFinder::CheckRootFinderCandidate; using RootFinder::InitializeRootFinder; @@ -1549,16 +1547,16 @@ namespace HVACControllers { ShowSevereError(state, "CalcSimpleController: Root finder failed at " + CreateHVACStepFullString()); 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()); 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."); } @@ -1593,7 +1591,7 @@ namespace HVACControllers { // REFERENCES: // Using/Aliasing - using General::TrimSigDigits; + using RootFinder::CheckRootFinderCandidate; using RootFinder::IterateRootFinder; @@ -1702,10 +1700,9 @@ namespace HVACControllers { } else if (SELECT_CASE_var == iStatusErrorRange) { ShowSevereError(state, "FindRootSimpleController: Root finder failed at " + CreateHVACStepFullString()); 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 @@ -1713,13 +1710,12 @@ namespace HVACControllers { ShowSevereError(state, "FindRootSimpleController: Root finder failed at " + CreateHVACStepFullString()); 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."); @@ -1769,36 +1765,26 @@ 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"); @@ -1823,7 +1809,7 @@ namespace HVACControllers { // Should never happen ShowSevereError(state, "FindRootSimpleController: Root finder failed at " + CreateHVACStepFullString()); 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."); } } @@ -1852,7 +1838,7 @@ namespace HVACControllers { // REFERENCES: // Using/Aliasing - using General::TrimSigDigits; + using RootFinder::CheckRootFinderConvergence; // Locals @@ -2548,7 +2534,7 @@ namespace HVACControllers { // Using/Aliasing using namespace DataAirSystems; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2696,7 +2682,7 @@ namespace HVACControllers { // Using/Aliasing using DataAirSystems::PrimaryAirSystem; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2860,7 +2846,7 @@ namespace HVACControllers { using DataGlobals::ZoneSizingCalc; using DataHVACGlobals::FirstTimeStepSysFlag; using General::LogicalToInteger; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2917,7 +2903,7 @@ namespace HVACControllers { // na // Using/Aliasing - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -3032,7 +3018,7 @@ namespace HVACControllers { // Using/Aliasing using DataEnvironment::CurEnvirNum; using General::LogicalToInteger; - using General::TrimSigDigits; + using RootFinder::WriteRootFinderTrace; // Locals @@ -3169,8 +3155,7 @@ 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 15437a60245..738e7c004ba 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -170,9 +169,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 @@ -192,13 +188,11 @@ 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; } @@ -933,7 +927,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 9ed2619f569..6168e145905 100644 --- a/src/EnergyPlus/HVACDXHeatPumpSystem.cc +++ b/src/EnergyPlus/HVACDXHeatPumpSystem.cc @@ -164,7 +164,7 @@ namespace HVACDXHeatPumpSystem { // Using/Aliasing using DXCoils::SimDXCoil; - using General::TrimSigDigits; + using VariableSpeedCoils::SimVariableSpeedCoils; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -198,13 +198,11 @@ 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; } @@ -594,7 +592,7 @@ namespace HVACDXHeatPumpSystem { using DXCoils::DXCoilOutletTemp; using DXCoils::SimDXCoil; using FaultsManager::FaultsCoilSATSensor; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; using Psychrometrics::PsyHFnTdbW; @@ -739,8 +737,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 { @@ -762,7 +760,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 { @@ -945,8 +943,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 { @@ -968,7 +966,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 { @@ -1012,8 +1010,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 { @@ -1035,7 +1033,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 2c2c7ea4b7d..001e48d1bec 100644 --- a/src/EnergyPlus/HVACDXSystem.cc +++ b/src/EnergyPlus/HVACDXSystem.cc @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include //coil report @@ -205,7 +204,7 @@ namespace HVACDXSystem { using DXCoils::SimDXCoil; using DXCoils::SimDXCoilMultiMode; using DXCoils::SimDXCoilMultiSpeed; - using General::TrimSigDigits; + using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; using PackagedThermalStorageCoil::SimTESCoil; using VariableSpeedCoils::SimVariableSpeedCoils; @@ -242,13 +241,11 @@ 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; } @@ -385,7 +382,6 @@ namespace HVACDXSystem { using NodeInputManager::GetOnlySingleNode; using PackagedThermalStorageCoil::GetTESCoilIndex; using VariableSpeedCoils::GetCoilIndexVariableSpeed; - using namespace DataIPShortCuts; using DXCoils::GetDXCoilIndex; using DXCoils::SetCoilSystemCoolingData; using DXCoils::SetDXCoilTypeData; @@ -1029,7 +1025,7 @@ namespace HVACDXSystem { using DXCoils::SimDXCoilMultiMode; using DXCoils::SimDXCoilMultiSpeed; using FaultsManager::FaultsCoilSATSensor; - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; using HVACHXAssistedCoolingCoil::HXAssistedCoilOutletHumRat; @@ -1203,8 +1199,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:"); } @@ -1226,7 +1222,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:"); } @@ -1285,8 +1281,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:"); } @@ -1312,7 +1308,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:"); } @@ -1461,8 +1457,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:"); } @@ -1483,7 +1479,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:"); } @@ -1506,7 +1502,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:"); } @@ -1589,8 +1585,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:"); } @@ -1611,7 +1607,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:"); } @@ -1706,9 +1702,8 @@ 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:"); } @@ -1730,7 +1725,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:"); } @@ -1752,7 +1747,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:"); } @@ -1794,7 +1789,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:"); } @@ -1827,7 +1822,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:"); } @@ -1885,7 +1880,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:"); } @@ -1918,7 +1913,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:"); } @@ -1989,8 +1984,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:"); } @@ -2076,8 +2071,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:"); } @@ -2114,8 +2109,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:"); } @@ -2177,8 +2172,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:"); } @@ -2305,9 +2300,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((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:"); } @@ -2328,7 +2322,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:"); } @@ -2413,8 +2407,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:"); } @@ -2435,7 +2429,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:"); } @@ -2538,8 +2532,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:"); } @@ -2560,7 +2554,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:"); } @@ -2594,8 +2588,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:"); } @@ -2616,7 +2610,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 2046a2f2b9c..81534580ca5 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,11 @@ 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 4f75d1c9b65..1616936b227 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,7 @@ 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 59254f83475..358d77b51bd 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 @@ -186,9 +184,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) @@ -218,14 +213,11 @@ 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; } @@ -881,9 +873,7 @@ namespace HVACHXAssistedCoolingCoil { // Using/Aliasing using DXCoils::SimDXCoil; - using General::TrimSigDigits; using HeatRecovery::SimHeatRecovery; - using Psychrometrics::PsyHFnTdbW; using WaterCoils::SimulateWaterCoilComponents; // Locals @@ -1003,8 +993,7 @@ 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(HXAssistedCoil(HXAssistedCoilNum).HXAssistedCoilType + " \"" + HXAssistedCoil(HXAssistedCoilNum).Name + @@ -1072,9 +1061,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 +1087,10 @@ 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 95a3f7ffb87..7400e6258b0 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -706,7 +706,7 @@ namespace HVACManager { using DataPlant::TotNumLoops; using EMSManager::ManageEMS; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + using NonZoneEquipmentManager::ManageNonZoneEquipment; using PlantCondLoopOperation::SetupPlantEMSActuators; using PlantManager::GetPlantInput; @@ -995,8 +995,7 @@ 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()); + ShowWarningError(state, format("SimHVAC: Maximum iterations ({}) exceeded for all HVAC loops, at {}, {} {}", MaxIter, EnvironmentName, CurMnDy, CreateSysTimeIntervalString())); if (SimAirLoopsFlag) { ShowContinueError(state, "The solution for one or more of the Air Loop HVAC systems did not appear to converge"); } @@ -1026,14 +1025,14 @@ 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) + ','; + format("{:.6R},", AirLoopConvergence(AirSysNum).HVACFlowSupplyDeck1ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 1 mass flow rate check value iteration history trace: " + HistoryTrace); @@ -1042,7 +1041,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACFlowSupplyDeck2ToDemandTolValue(StackDepth), 6) + ','; + format("{:.6R},", AirLoopConvergence(AirSysNum).HVACFlowSupplyDeck2ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 2 mass flow rate check value iteration history trace: " + HistoryTrace); @@ -1056,12 +1055,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); @@ -1070,7 +1069,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACHumSupplyDeck2ToDemandTolValue(StackDepth), 6) + ','; + format("{:.6R},", AirLoopConvergence(AirSysNum).HVACHumSupplyDeck2ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 2 humidity ratio check value iteration history trace: " + HistoryTrace); @@ -1083,13 +1082,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).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) + ','; + format("{:.6R},", AirLoopConvergence(AirSysNum).HVACTempSupplyDeck1ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 1 temperature check value iteration history trace: " + HistoryTrace); @@ -1097,7 +1096,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { HistoryTrace += - RoundSigDigits(AirLoopConvergence(AirSysNum).HVACTempSupplyDeck1ToDemandTolValue(StackDepth), 6) + ','; + format("{:.6R},", AirLoopConvergence(AirSysNum).HVACTempSupplyDeck1ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 2 temperature check value iteration history trace: " + HistoryTrace); @@ -1109,13 +1108,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).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) + ','; + format("{:.6R},", AirLoopConvergence(AirSysNum).HVACEnergySupplyDeck1ToDemandTolValue(StackDepth)); } ShowContinueError(state, "Supply-to-demand interface deck 1 energy check value iteration history trace: " + HistoryTrace); @@ -1123,7 +1122,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); } @@ -1150,9 +1149,7 @@ 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; } } @@ -1174,9 +1171,7 @@ 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; @@ -1189,9 +1184,7 @@ 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 @@ -1202,7 +1195,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { HistoryTrace += - RoundSigDigits(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).HumidityRatio(StackDepth), 6) + ','; + format("{:.6R},", ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).HumidityRatio(StackDepth)); } ShowContinueError(state, "Node named " + NodeID(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).NodeNum) + @@ -1224,9 +1217,7 @@ 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; } } @@ -1247,9 +1238,7 @@ 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; @@ -1262,9 +1251,7 @@ 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 @@ -1275,7 +1262,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { HistoryTrace += - RoundSigDigits(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).MassFlowRate(StackDepth), 6) + ','; + 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); @@ -1296,9 +1283,7 @@ 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; } } @@ -1319,9 +1304,7 @@ 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; @@ -1334,9 +1317,7 @@ 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 @@ -1347,7 +1328,7 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= ConvergLogStackDepth; ++StackDepth) { HistoryTrace += - RoundSigDigits(ZoneInletConvergence(ZoneNum).InletNode(NodeIndex).Temperature(StackDepth), 6) + ','; + 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); @@ -1364,12 +1345,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); @@ -1390,9 +1371,7 @@ namespace HVACManager { 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)); + 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; } } @@ -1415,9 +1394,7 @@ 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; @@ -1430,9 +1407,7 @@ 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 @@ -1442,8 +1417,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); @@ -1465,9 +1439,7 @@ namespace HVACManager { 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)); + 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; } } @@ -1491,9 +1463,7 @@ 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; @@ -1506,9 +1476,7 @@ 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 @@ -1518,8 +1486,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); @@ -1535,12 +1502,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); @@ -1561,9 +1528,7 @@ namespace HVACManager { 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)); + 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; } } @@ -1586,9 +1551,7 @@ 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; @@ -1601,9 +1564,7 @@ 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 @@ -1613,8 +1574,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); @@ -1636,9 +1596,7 @@ namespace HVACManager { 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)); + 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; } } @@ -1661,9 +1619,7 @@ 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; @@ -1676,9 +1632,7 @@ 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 @@ -1688,8 +1642,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); @@ -3114,11 +3067,8 @@ namespace HVACManager { ShowSevereError(state, "CheckAirLoopFlowBalance: AirLoopHVAC " + DataAirSystems::PrimaryAirSystem(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 a0549bb57b8..719adab6e52 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -258,7 +258,7 @@ 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 @@ -282,13 +282,11 @@ 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; } @@ -569,7 +567,7 @@ namespace HVACMultiSpeedHeatPump { using Fans::GetFanType; using Fans::GetFanVolFlow; using FluidProperties::FindGlycol; - using General::RoundSigDigits; + using NodeInputManager::GetOnlySingleNode; using BranchNodeConnections::SetUpCompSets; using DXCoils::GetDXCoilIndex; @@ -1343,7 +1341,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; } @@ -1424,14 +1422,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; } @@ -1806,8 +1804,8 @@ 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; @@ -2267,10 +2265,7 @@ 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); @@ -2278,28 +2273,21 @@ 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); } @@ -2307,10 +2295,7 @@ 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); @@ -2506,7 +2491,7 @@ 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(MSHeatPump(MSHeatPumpNum).Name + ": Cooling coil is still not available ...", @@ -2531,7 +2516,7 @@ 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(MSHeatPump(MSHeatPumpNum).Name + ": Heating coil is still not available ...", @@ -2701,7 +2686,7 @@ namespace HVACMultiSpeedHeatPump { using namespace DataSizing; using DataAirSystems::PrimaryAirSystem; using DataZoneEquipment::ZoneEquipConfig; - using General::TrimSigDigits; + using PlantUtilities::RegisterPlantCompDesignFlow; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -2759,7 +2744,7 @@ namespace HVACMultiSpeedHeatPump { } 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)); } } @@ -2795,7 +2780,7 @@ namespace HVACMultiSpeedHeatPump { } 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)); } } @@ -2897,9 +2882,9 @@ namespace HVACMultiSpeedHeatPump { // Using/Aliasing using DataGlobals::WarmupFlag; - using General::RoundSigDigits; + using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using Psychrometrics::PsyCpAirFnW; using TempSolveRoot::SolveRoot; @@ -3192,7 +3177,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( @@ -3256,8 +3241,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( @@ -3302,7 +3286,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( @@ -3359,8 +3343,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( @@ -4354,7 +4337,7 @@ namespace HVACMultiSpeedHeatPump { // Using/Aliasing using DataHVACGlobals::SmallLoad; - using General::RoundSigDigits; + using General::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; @@ -4466,12 +4449,9 @@ 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("CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + CurrentModuleObject + "=\"" + - MSHeatPump(MSHeatPumpNum).Name, + ShowRecurringWarningErrorAtEnd(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) { @@ -4479,8 +4459,8 @@ namespace HVACMultiSpeedHeatPump { 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("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 c82f233dca2..e94e9da0b34 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 @@ -188,7 +185,6 @@ namespace HVACSingleDuctInduc { // Using/Aliasing using DataSizing::TermUnitIU; - using General::TrimSigDigits; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int IUNum; // index of terminal unit being simulated @@ -209,13 +205,11 @@ 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; } @@ -278,7 +272,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; @@ -768,7 +761,7 @@ namespace HVACSingleDuctInduc { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; using WaterCoils::GetCoilWaterInletNode; using WaterCoils::GetCoilWaterOutletNode; @@ -851,10 +844,8 @@ 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."); } @@ -951,10 +942,8 @@ 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."); } @@ -1043,10 +1032,8 @@ 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."); } @@ -1112,7 +1099,7 @@ namespace HVACSingleDuctInduc { // Using/Aliasing using namespace DataZoneEnergyDemands; using DataPlant::PlantLoop; - using General::RoundSigDigits; + using General::SolveRoot; using PlantUtilities::SetComponentFlowRate; using TempSolveRoot::SolveRoot; @@ -1254,12 +1241,9 @@ 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("SimFourPipeIndUnit: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + IndUnit(IUNum).UnitType + "=\"" + - IndUnit(IUNum).Name + "\"", + ShowRecurringWarningErrorAtEnd(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) { @@ -1267,8 +1251,8 @@ namespace HVACSingleDuctInduc { 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("SimFourPipeIndUnit: Hot water coil control failed (flow limits) for " + IndUnit(IUNum).UnitType + "=\"" + IndUnit(IUNum).Name + "\"", @@ -1303,12 +1287,9 @@ 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("SimFourPipeIndUnit: Cold water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + IndUnit(IUNum).UnitType + "=\"" + - IndUnit(IUNum).Name, + ShowRecurringWarningErrorAtEnd(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) { @@ -1316,8 +1297,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("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 f19fdb2ea0b..ae042002a40 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -223,7 +222,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; @@ -319,10 +318,10 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) if (WarmupFlag) { ++NumOfWarmupDays; - cWarmupDay = TrimSigDigits(NumOfWarmupDays); + cWarmupDay = fmt::to_string(NumOfWarmupDays); DisplayString("Warming up {" + cWarmupDay + '}'); } else if (state.dataGlobal->DayOfSim == 1) { - DisplayString("Starting HVAC Sizing Simulation at " + CurMnDy + " for " + EnvironmentName); + DisplayString(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 df6dfae0b09..024524e204e 100644 --- a/src/EnergyPlus/HVACStandAloneERV.cc +++ b/src/EnergyPlus/HVACStandAloneERV.cc @@ -193,7 +193,7 @@ namespace HVACStandAloneERV { // Manages the simulation of a Stand Alone ERV unit. Called from SimZoneEquipment // Using/Aliasing - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -219,13 +219,11 @@ 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; } @@ -266,7 +264,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); @@ -672,9 +670,7 @@ 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; } @@ -683,7 +679,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 { @@ -706,9 +702,7 @@ 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; } @@ -717,7 +711,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 { @@ -1043,15 +1037,13 @@ 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."); } } @@ -1061,15 +1053,13 @@ 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."); } } @@ -1402,7 +1392,7 @@ namespace HVACStandAloneERV { using DataZoneEquipment::ZoneEquipConfig; using Fans::SetFanData; using Fans::SimulateFanComponents; - using General::RoundSigDigits; + using HeatRecovery::SetHeatExchangerData; using MixedAir::OAController; using ScheduleManager::GetScheduleMaxValue; @@ -1561,9 +1551,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."); } @@ -1617,7 +1606,7 @@ namespace HVACStandAloneERV { using DataHeatBalance::ZoneAirMassFlow; using DataZoneEquipment::ZoneEquipConfig; using Fans::SimulateFanComponents; - using General::RoundSigDigits; + using HeatRecovery::SimHeatRecovery; using MixedAir::OAController; @@ -1781,8 +1770,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 470bb71b170..0a12378248e 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -235,13 +235,11 @@ 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 +452,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 +460,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 +468,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 +476,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 +484,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 +492,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 +695,13 @@ 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 +904,7 @@ 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 +1641,21 @@ namespace HVACUnitaryBypassVAV { if (!DataGlobals::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 +1663,21 @@ 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 +2280,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 +2301,7 @@ 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( CBVAV(CBVAVNum).Name + ", Part-load ratio calculation failed for HX assisted DX unit error continues.", @@ -2373,7 +2349,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 +2369,7 @@ 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(CBVAV(CBVAVNum).Name + ", Part-load ratio calculation failed for DX unit error continues.", @@ -2591,7 +2566,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 +2585,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 +2613,8 @@ 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 +2634,7 @@ 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 +2704,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 +2724,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 +2774,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 +2797,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 +2859,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 +2882,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 +3059,13 @@ namespace HVACUnitaryBypassVAV { if (SolFla == -1 && !DataGlobals::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 && !DataGlobals::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 +3274,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 +3333,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 +3354,7 @@ 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,12 +4033,9 @@ 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("CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit [" + - General::RoundSigDigits(SolveMaxIter) + "]) for " + CBVAV(CBVAVNum).UnitType + "=\"" + - CBVAV(CBVAVNum).Name, + ShowRecurringWarningErrorAtEnd(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) { @@ -4076,8 +4043,8 @@ namespace HVACUnitaryBypassVAV { 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("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 e2e61256c88..0052e73485b 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,11 @@ 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; } @@ -428,7 +424,8 @@ namespace HVACVariableRefrigerantFlow { bool EP_UNUSED(RunFlag)) { if (calledFromLocation.loopNum == this->SourceLoopNum) { // condenser loop - PlantUtilities::UpdateChillerComponentCondenserSide(state, this->SourceLoopNum, + PlantUtilities::UpdateChillerComponentCondenserSide(state, + this->SourceLoopNum, this->SourceLoopSideNum, TypeOf_HeatPumpVRF, this->CondenserNodeNum, @@ -466,7 +463,7 @@ namespace HVACVariableRefrigerantFlow { using DXCoils::DXCoilHeatInletAirDBTemp; using DXCoils::DXCoilHeatInletAirWBTemp; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using Psychrometrics::RhoH2O; @@ -712,10 +709,12 @@ namespace HVACVariableRefrigerantFlow { if (!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( @@ -733,10 +732,12 @@ namespace HVACVariableRefrigerantFlow { if (!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( @@ -763,10 +764,12 @@ namespace HVACVariableRefrigerantFlow { if (!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( @@ -783,10 +786,12 @@ namespace HVACVariableRefrigerantFlow { if (!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( @@ -860,16 +865,20 @@ namespace HVACVariableRefrigerantFlow { if (!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 } @@ -889,18 +898,21 @@ namespace HVACVariableRefrigerantFlow { if (!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 { } } @@ -954,11 +966,13 @@ namespace HVACVariableRefrigerantFlow { if (!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(ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + VRF(VRFCond).Name + @@ -1426,7 +1440,7 @@ namespace HVACVariableRefrigerantFlow { using Fans::GetFanInletNode; using Fans::GetFanOutletNode; using Fans::GetFanType; - using General::TrimSigDigits; + using MixedAir::GetOAMixerNodeNumbers; using NodeInputManager::GetOnlySingleNode; using ScheduleManager::CheckScheduleValueMinMax; @@ -1671,7 +1685,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 @@ -1679,7 +1694,7 @@ namespace HVACVariableRefrigerantFlow { cAlphaFieldNames(3)); // Field Name if (!ErrorsFound) { - checkCurveIsNormalizedToOne( state, + checkCurveIsNormalizedToOne(state, RoutineName + cCurrentModuleObject, VRF(VRFNum).Name, VRF(VRFNum).CoolCapFT, @@ -1693,7 +1708,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 @@ -1704,7 +1720,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 @@ -1715,7 +1732,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 @@ -1726,7 +1744,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 @@ -1737,7 +1756,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 @@ -1748,7 +1768,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 @@ -1759,7 +1780,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 @@ -1770,7 +1792,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 @@ -1781,7 +1804,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 @@ -1807,8 +1831,7 @@ 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, _); } @@ -1816,8 +1839,7 @@ 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); } @@ -1834,15 +1856,18 @@ 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 @@ -1851,7 +1876,7 @@ namespace HVACVariableRefrigerantFlow { if (!ErrorsFound) { if (UtilityRoutines::SameString(cAlphaArgs(19), "WETBULBTEMPERATURE")) { - checkCurveIsNormalizedToOne( state, + checkCurveIsNormalizedToOne(state, RoutineName + cCurrentModuleObject, VRF(VRFNum).Name, VRF(VRFNum).HeatCapFT, @@ -1860,7 +1885,7 @@ namespace HVACVariableRefrigerantFlow { RatedInletAirTempHeat, RatedOutdoorWetBulbTempHeat); } else if (UtilityRoutines::SameString(cAlphaArgs(19), "DRYBULBTEMPERATURE")) { - checkCurveIsNormalizedToOne( state, + checkCurveIsNormalizedToOne(state, RoutineName + cCurrentModuleObject, VRF(VRFNum).Name, VRF(VRFNum).HeatCapFT, @@ -1875,7 +1900,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 @@ -1886,7 +1912,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 @@ -1897,7 +1924,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 @@ -1908,7 +1936,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 @@ -1919,7 +1948,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 @@ -1941,7 +1971,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 @@ -1952,7 +1983,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 @@ -1963,7 +1995,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 @@ -1973,7 +2006,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 @@ -1999,8 +2033,7 @@ 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, _); } @@ -2008,8 +2041,7 @@ 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); } @@ -2021,37 +2053,39 @@ 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)); } } @@ -2115,7 +2149,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 @@ -2128,7 +2163,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 @@ -2171,7 +2207,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 @@ -2230,7 +2267,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, @@ -2245,7 +2283,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, @@ -2259,7 +2298,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, @@ -2294,7 +2334,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, @@ -2333,7 +2374,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)); @@ -2352,13 +2394,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)) { @@ -2368,20 +2410,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 @@ -2395,7 +2438,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 @@ -2412,7 +2456,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 @@ -2429,7 +2474,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 @@ -2513,14 +2559,18 @@ 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; } @@ -2547,14 +2597,18 @@ 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; } @@ -2677,7 +2731,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 @@ -2747,7 +2802,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."); @@ -2758,7 +2813,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 @@ -2773,8 +2829,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."); @@ -2785,7 +2842,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 @@ -2878,43 +2936,49 @@ 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 @@ -2937,14 +3001,18 @@ 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; } @@ -3083,7 +3151,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 @@ -3143,7 +3212,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."); @@ -3154,7 +3223,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 @@ -3169,8 +3239,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."); @@ -3181,7 +3252,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 @@ -3261,7 +3333,8 @@ namespace HVACVariableRefrigerantFlow { } } - VRFTU(VRFTUNum).VRFTUInletNodeNum = GetOnlySingleNode(state, cAlphaArgs(3), + VRFTU(VRFTUNum).VRFTUInletNodeNum = GetOnlySingleNode(state, + cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, VRFTU(VRFTUNum).Name, @@ -3270,7 +3343,8 @@ namespace HVACVariableRefrigerantFlow { 1, ObjectIsParent); - VRFTU(VRFTUNum).VRFTUOutletNodeNum = GetOnlySingleNode(state, cAlphaArgs(4), + VRFTU(VRFTUNum).VRFTUOutletNodeNum = GetOnlySingleNode(state, + cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, VRFTU(VRFTUNum).Name, @@ -4079,9 +4153,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, @@ -4285,17 +4361,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); @@ -4303,7 +4382,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); @@ -4563,8 +4643,7 @@ 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 + @@ -4584,13 +4663,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", @@ -4601,37 +4682,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", @@ -4639,13 +4726,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", @@ -4656,44 +4745,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", @@ -4710,25 +4806,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", @@ -4739,13 +4839,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", @@ -4758,86 +4860,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", @@ -4846,13 +4972,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", @@ -4862,13 +4990,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", @@ -4880,13 +5010,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", @@ -4899,29 +5031,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", @@ -4932,34 +5082,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", @@ -4973,7 +5133,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", @@ -4984,13 +5145,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", @@ -5003,13 +5166,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", @@ -5023,25 +5188,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", @@ -5087,8 +5256,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; @@ -5213,7 +5381,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); @@ -5411,7 +5580,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; @@ -5483,7 +5653,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 { @@ -5497,7 +5668,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 { @@ -5953,9 +6125,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, @@ -6002,7 +6176,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; } } @@ -6124,10 +6299,10 @@ 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; @@ -6137,10 +6312,10 @@ 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; @@ -6151,10 +6326,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; } @@ -6163,10 +6338,10 @@ 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; @@ -6176,10 +6351,10 @@ 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; @@ -6190,10 +6365,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; } @@ -6203,10 +6378,10 @@ 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; @@ -6308,16 +6483,15 @@ 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( @@ -6335,15 +6509,12 @@ 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(cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + " \"" + VRF(VRFCond).Name + @@ -6380,16 +6551,14 @@ 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( @@ -6407,14 +6576,12 @@ 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(cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + " \"" + VRF(VRFCond).Name + @@ -6761,11 +6928,9 @@ 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."); } @@ -6817,7 +6982,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(cVRFTypes(VRF(VRFCond).VRFSystemTypeNum) + " \"" + VRF(VRFCond).Name + @@ -6995,7 +7160,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 @@ -7494,10 +7659,10 @@ 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."); } @@ -7557,10 +7722,10 @@ 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."); } @@ -7628,10 +7793,11 @@ 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."); } @@ -7666,8 +7832,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) { @@ -7782,10 +7948,9 @@ 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."); } @@ -7826,10 +7991,8 @@ 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."); } @@ -7848,7 +8011,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 = @@ -7868,7 +8032,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 = @@ -7955,10 +8120,9 @@ 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."); } @@ -7966,9 +8130,8 @@ 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."); } @@ -8006,10 +8169,9 @@ 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."); } @@ -8043,10 +8205,10 @@ 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."); } @@ -8080,10 +8242,10 @@ 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."); } @@ -8170,8 +8332,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, @@ -8507,7 +8672,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 @@ -8518,8 +8683,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(DataHVACGlobals::cVRFTUTypes(this->VRFTUType_Num) + " \"" + this->Name + "\" -- Terminal unit Iteration limit exceeded error continues...", this->IterLimitExceeded); @@ -9306,7 +9470,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 @@ -10157,7 +10322,7 @@ namespace HVACVariableRefrigerantFlow { using FluidProperties::GetSupHeatTempRefrig; using FluidProperties::RefrigData; using General::SolveRoot; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using Psychrometrics::RhoH2O; using TempSolveRoot::SolveRoot; @@ -10448,8 +10613,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); @@ -10471,10 +10637,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:; @@ -10508,7 +10675,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), @@ -10531,7 +10699,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), @@ -10544,10 +10713,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 @@ -10620,7 +10796,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; @@ -10646,7 +10823,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 @@ -10672,16 +10850,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:; @@ -10696,12 +10876,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); @@ -10711,13 +10892,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)); @@ -10730,12 +10912,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); } @@ -10746,7 +10930,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); @@ -10759,10 +10944,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 @@ -10819,7 +11013,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), @@ -10847,7 +11042,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); @@ -10894,8 +11090,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; @@ -10911,7 +11111,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, @@ -10930,7 +11131,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, @@ -10944,7 +11146,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 @@ -10957,7 +11160,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), @@ -10992,8 +11196,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; @@ -11167,11 +11378,13 @@ namespace HVACVariableRefrigerantFlow { if (!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(ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + this->Name + @@ -11333,7 +11546,7 @@ namespace HVACVariableRefrigerantFlow { this->TotalHeatingCapacity = TotalCondHeatingCapacity * HeatingPLR; if (this->MinPLR > 0.0) { - if (this->VRFCondPLR < this->MinPLR && this->VRFCondPLR > 0.0) { + if (this->VRFCondPLRMinPLR &&this->VRFCondPLR> 0.0) { this->VRFCondPLR = this->MinPLR; } } @@ -11481,9 +11694,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; @@ -11694,12 +11907,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(DataHVACGlobals::cVRFTUTypes(this->VRFTUType_Num) + " \"" + this->Name + "\" -- Terminal unit Iteration limit exceeded error continues...", this->IterLimitExceeded); @@ -12292,7 +12505,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] @@ -12307,9 +12519,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; @@ -12325,9 +12537,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; @@ -12376,7 +12588,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] @@ -12392,7 +12603,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."); } @@ -12405,7 +12616,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."); } @@ -12461,7 +12672,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] @@ -12540,7 +12750,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] @@ -12557,7 +12766,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."); } @@ -12575,7 +12784,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."); } @@ -12661,7 +12870,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 @@ -12802,14 +13012,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; @@ -12893,8 +13104,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 @@ -13078,8 +13295,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 @@ -13258,8 +13481,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, @@ -13269,7 +13492,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' @@ -13310,8 +13533,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), @@ -13334,8 +13557,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), @@ -13355,8 +13578,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)) { @@ -13401,8 +13624,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 * @@ -13533,10 +13761,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++) { @@ -13593,7 +13830,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), @@ -13609,8 +13847,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)) { @@ -13691,7 +13929,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 @@ -13961,7 +14199,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, @@ -14154,11 +14393,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; @@ -14189,9 +14432,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; @@ -14316,10 +14560,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; @@ -14331,15 +14576,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 3d12d19df6a..c0deda503ee 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -179,7 +179,7 @@ namespace HWBaseboardRadiator { // Using/Aliasing using DataLoopNode::Node; using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::TrimSigDigits; + using ScheduleManager::GetCurrentScheduleValue; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -204,13 +204,11 @@ 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; } @@ -258,7 +256,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."); } } @@ -301,8 +299,8 @@ 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; @@ -399,12 +397,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; } @@ -413,7 +411,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; } @@ -425,8 +423,7 @@ 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 { @@ -442,8 +439,7 @@ 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); @@ -463,8 +459,7 @@ 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 { @@ -483,12 +478,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; } @@ -497,7 +492,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; } @@ -505,13 +500,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; } @@ -530,28 +525,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 } @@ -592,13 +587,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) { @@ -950,7 +945,7 @@ namespace HWBaseboardRadiator { using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; using DataLoopNode::Node; - using General::RoundSigDigits; + using PlantUtilities::RegisterPlantCompDesignFlow; // Locals @@ -1122,10 +1117,8 @@ 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."); } @@ -1164,19 +1157,17 @@ 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; @@ -1220,19 +1211,17 @@ 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; @@ -1589,7 +1578,7 @@ namespace HWBaseboardRadiator { using DataHeatBalFanSys::QHWBaseboardSurf; using DataHeatBalFanSys::QHWBaseboardToPerson; using DataSurfaces::Surface; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1631,16 +1620,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"); @@ -1790,7 +1779,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: @@ -1807,17 +1796,14 @@ 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 (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 9a05c4a4d25..e550f6af461 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -239,7 +239,7 @@ 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 @@ -354,8 +354,7 @@ 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); @@ -382,8 +381,7 @@ 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; @@ -396,8 +394,7 @@ 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; } @@ -444,8 +441,7 @@ 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); @@ -472,8 +468,7 @@ 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; } } @@ -615,8 +610,8 @@ namespace HeatBalFiniteDiffManager { using DataHeatBalance::HighDiffusivityThreshold; using DataHeatBalance::ThinMaterialLayerThreshold; using DataSurfaces::HeatTransferModel_CondFD; - using General::RoundSigDigits; - using General::TrimSigDigits; + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Lay; @@ -793,16 +788,12 @@ 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."); } @@ -946,44 +937,44 @@ 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 (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", @@ -1205,7 +1196,7 @@ namespace HeatBalFiniteDiffManager { // Using/Aliasing using DataHeatBalance::CondFDRelaxFactorInput; using DataHeatBalance::MaxAllowedDelTempCondFD; - using General::RoundSigDigits; + using General::ScanForReports; // SUBROUTINE PARAMETER DEFINITIONS: @@ -2244,7 +2235,7 @@ namespace HeatBalFiniteDiffManager { // Use methodology similar to HBSurfaceManager // Using/Aliasing - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ZoneNum; @@ -2255,20 +2246,18 @@ namespace HeatBalFiniteDiffManager { if (!WarmupFlag || WarmupSurfTemp > 10 || 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."); } @@ -2299,20 +2288,18 @@ 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."); } @@ -2355,7 +2342,7 @@ 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 8848ad42fc5..380eb9f3221 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -356,7 +356,7 @@ namespace HeatBalanceAirManager { // Using/Aliasing using DataGlobals::NumOfZones; using General::CheckCreatedZoneItemName; - using General::RoundSigDigits; + using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMinValue; @@ -652,8 +652,7 @@ 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; } @@ -928,8 +927,7 @@ 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; } } @@ -948,8 +946,7 @@ 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; } } @@ -967,8 +964,7 @@ 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; } } @@ -987,8 +983,7 @@ 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; } } @@ -1413,8 +1408,7 @@ 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; } } @@ -1433,8 +1427,7 @@ 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; } } @@ -1454,8 +1447,7 @@ 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; } } @@ -1556,7 +1548,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; } } @@ -1580,18 +1572,14 @@ 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..."); } } @@ -1628,18 +1616,14 @@ 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..."); } } @@ -1669,9 +1653,7 @@ 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..."); } } @@ -1679,15 +1661,13 @@ 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..."); } } @@ -1722,17 +1702,12 @@ 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..."); } } @@ -1767,15 +1742,12 @@ 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..."); } } @@ -2026,15 +1998,12 @@ 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..."); } @@ -2065,15 +2034,12 @@ 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..."); } @@ -2097,14 +2063,11 @@ 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..."); } @@ -2136,15 +2099,12 @@ 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..."); } @@ -2174,15 +2134,12 @@ 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..."); } @@ -2374,8 +2331,7 @@ 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; } } @@ -2393,8 +2349,7 @@ 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; } } @@ -2412,8 +2367,7 @@ 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; } } @@ -2451,14 +2405,11 @@ 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..."); } @@ -2751,7 +2702,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]; @@ -2815,8 +2766,7 @@ 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; } } @@ -2837,8 +2787,7 @@ 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; } } @@ -2858,8 +2807,7 @@ 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; } } @@ -2898,14 +2846,11 @@ 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..."); } @@ -4095,7 +4040,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 e94ee437f33..367ab5dc902 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.cc +++ b/src/EnergyPlus/HeatBalanceHAMTManager.cc @@ -719,9 +719,9 @@ namespace HeatBalanceHAMTManager { // na // Using/Aliasing - using General::RoundSigDigits; + using General::ScanForReports; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1043,7 +1043,7 @@ 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", @@ -1051,7 +1051,7 @@ 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", @@ -1059,7 +1059,7 @@ 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", @@ -1103,7 +1103,7 @@ namespace HeatBalanceHAMTManager { using DataHeatBalSurface::SurfQAdditionalHeatSourceInside; using DataSurfaces::OSCM; using DataSurfaces::OtherSideCondModeledExt; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1380,8 +1380,7 @@ namespace HeatBalanceHAMTManager { if (tempmax > MaxSurfaceTempLimit) { if (!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("HAMT: Temperature Temperature (high) out of bounds; Surface=" + Surface(sid).Name, @@ -1395,8 +1394,7 @@ namespace HeatBalanceHAMTManager { } if (tempmax > MaxSurfaceTempLimitBeforeFatal) { if (!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."); } @@ -1404,8 +1402,7 @@ namespace HeatBalanceHAMTManager { if (tempmin < MinSurfaceTempLimit) { if (!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("HAMT: Temperature Temperature (high) out of bounds; Surface=" + Surface(sid).Name, @@ -1419,8 +1416,7 @@ namespace HeatBalanceHAMTManager { } if (tempmin < MinSurfaceTempLimitBeforeFatal) { if (!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 877812e077e..d0dfe0a5857 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -505,7 +505,7 @@ namespace HeatBalanceIntRadExchange { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using General::ScanForReports; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1123,7 +1123,7 @@ namespace HeatBalanceIntRadExchange { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; + // Argument array dimensioning F.dim(N, N); @@ -1160,8 +1160,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; } @@ -1310,7 +1309,7 @@ namespace HeatBalanceIntRadExchange { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; + // Argument array dimensioning F.dim(N, N); @@ -1352,8 +1351,7 @@ 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; @@ -1542,7 +1540,7 @@ namespace HeatBalanceIntRadExchange { // na // Using/Aliasing - using General::RoundSigDigits; + // Argument array dimensioning EP_SIZE_CHECK(A, N); @@ -1715,8 +1713,7 @@ 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 f75f207c9ab..1da0699053e 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,7 @@ 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 +288,7 @@ 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 +765,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 +962,8 @@ 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 +1134,8 @@ namespace HeatBalanceKivaManager { } } - gp.createFrame(std::to_string(DataEnvironment::Month) + "/" + std::to_string(DataEnvironment::DayOfMonth) + " " + - std::to_string(DataGlobals::HourOfDay) + ":00"); + gp.createFrame(fmt::to_string(DataEnvironment::Month) + "/" + fmt::to_string(DataEnvironment::DayOfMonth) + " " + + fmt::to_string(DataGlobals::HourOfDay) + ":00"); #ifndef NDEBUG diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index d82fcc5a3d8..635b4b146d9 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 { @@ -501,7 +498,7 @@ namespace HeatBalanceManager { // Counts or details unused constructions. // Using/Aliasing - using General::RoundSigDigits; + using namespace DataIPShortCuts; // SUBROUTINE PARAMETER DEFINITIONS: @@ -552,10 +549,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 (!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; @@ -689,7 +686,7 @@ namespace HeatBalanceManager { // Using/Aliasing using DataHVACGlobals::HVACSystemRootFinding; using DataSystemVariables::lMinimalShadowing; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -780,15 +777,13 @@ 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 @@ -821,8 +816,7 @@ 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 { @@ -832,17 +826,14 @@ 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; } @@ -1012,9 +1003,7 @@ namespace HeatBalanceManager { DataHeatBalance::AnyCondFD = true; DataHeatBalance::AllCTF = false; if (NumOfTimeStepInHour < 20) { - ShowSevereError(state, "GetSolutionAlgorithm: " + CurrentModuleObject + ' ' + cAlphaFieldNames(1) + - " is Conduction Finite Difference but Number of TimeSteps in Hour < 20, Value is " + - RoundSigDigits(NumOfTimeStepInHour) + '.'); + ShowSevereError(state, format("GetSolutionAlgorithm: {} {} is Conduction Finite Difference but Number of TimeSteps in Hour < 20, Value is {}.", CurrentModuleObject, cAlphaFieldNames(1), NumOfTimeStepInHour)); ShowContinueError(state, "...Suggested minimum number of time steps in hour for Conduction Finite Difference solutions is 20. " "Errors or inaccurate calculations may occur."); } @@ -1024,9 +1013,7 @@ namespace HeatBalanceManager { DataHeatBalance::AnyHAMT = true; DataHeatBalance::AllCTF = false; if (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(NumOfTimeStepInHour) + '.'); + ShowSevereError(state, format("GetSolutionAlgorithm: {} {} is Combined Heat and Moisture Finite Element but Number of TimeSteps in Hour < 20, Value is {}.", CurrentModuleObject, cAlphaFieldNames(1), 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 " @@ -1415,7 +1402,7 @@ namespace HeatBalanceManager { // Reads the input data for the SITE ATMOSPHERIC VARIATION object. // Using/Aliasing - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumObjects; @@ -1500,9 +1487,9 @@ 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()) { @@ -1751,7 +1738,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; @@ -2105,29 +2092,25 @@ 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)); } @@ -2154,29 +2137,25 @@ 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)); } @@ -2203,29 +2182,25 @@ 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)); } @@ -2509,8 +2484,7 @@ 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; } } @@ -2630,8 +2604,7 @@ 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; } } @@ -3216,8 +3189,7 @@ 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)); } } } @@ -3323,8 +3295,7 @@ 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."); } @@ -3452,15 +3423,11 @@ 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)); } } @@ -3599,35 +3566,30 @@ 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; } @@ -3736,10 +3698,9 @@ 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; } @@ -3950,7 +3911,7 @@ namespace HeatBalanceManager { // na // Using/Aliasing - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4010,17 +3971,14 @@ 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; @@ -4050,17 +4008,14 @@ 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 @@ -4069,25 +4024,20 @@ 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))); } } } @@ -5562,7 +5512,7 @@ namespace HeatBalanceManager { // Using/Aliasing using DataSystemVariables::ReportDetailedWarmupConvergence; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ZoneNum; @@ -5644,7 +5594,7 @@ namespace HeatBalanceManager { // na // Using/Aliasing - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -5724,8 +5674,7 @@ namespace HeatBalanceManager { if (state.dataGlobal->DayOfSim >= MaxNumberOfWarmupDays && 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 && !DoingSizing) { ShowContinueError(state, "See Warmup Convergence Information in .eio file for details."); WarmupConvergenceWarning = true; @@ -5739,18 +5688,10 @@ 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)))); } } @@ -5774,10 +5715,8 @@ namespace HeatBalanceManager { if ((state.dataGlobal->DayOfSim >= MaxNumberOfWarmupDays) && 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)); } } @@ -5816,7 +5755,7 @@ namespace HeatBalanceManager { // na // Using/Aliasing - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -6205,7 +6144,7 @@ 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"}); @@ -6358,8 +6297,7 @@ 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; @@ -6378,38 +6316,28 @@ 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; @@ -6427,15 +6355,13 @@ 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; } } @@ -6461,7 +6387,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) { @@ -6515,9 +6441,8 @@ 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)); @@ -6525,39 +6450,37 @@ 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; } } @@ -6864,25 +6787,23 @@ 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; } } @@ -6893,58 +6814,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; @@ -7158,7 +7069,7 @@ namespace HeatBalanceManager { // Using/Aliasing using namespace DataStringGlobals; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7256,19 +7167,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; } @@ -7279,7 +7190,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 @@ -7293,7 +7204,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; } @@ -7341,13 +7252,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; } @@ -7358,7 +7269,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 @@ -7376,7 +7287,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; } @@ -7515,7 +7426,7 @@ namespace HeatBalanceManager { using DataSurfaces::TotFenLayAbsSSG; using DataSurfaces::TotSurfaces; using DataSurfaces::TotSurfIncSolSSG; - using General::TrimSigDigits; + using ScheduleManager::GetScheduleIndex; // SUBROUTINE PARAMETER DEFINITIONS: @@ -7543,8 +7454,7 @@ 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; } @@ -7678,8 +7588,7 @@ 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; } @@ -7834,7 +7743,7 @@ namespace HeatBalanceManager { // Using/Aliasing using namespace DataStringGlobals; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7884,7 +7793,7 @@ 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; @@ -8110,7 +8019,7 @@ namespace HeatBalanceManager { // na // Using/Aliasing - using General::RoundSigDigits; + // SUBROUTINE ARGUMENT DEFINITIONS: @@ -8158,14 +8067,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))); } } @@ -8199,7 +8108,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))); } } @@ -8238,7 +8147,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); @@ -8246,7 +8155,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)) { @@ -8365,70 +8274,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) { @@ -8436,43 +8345,42 @@ 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))); } } @@ -8502,7 +8410,7 @@ namespace HeatBalanceManager { using namespace DataIPShortCuts; using namespace MatrixDataManager; using namespace DataBSDFWindow; - using General::RoundSigDigits; + // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("SetupComlexFenestrationStateInput: "); @@ -8566,7 +8474,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))); } { @@ -8629,7 +8537,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); @@ -8637,7 +8545,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); @@ -8645,7 +8553,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))); } } @@ -8942,19 +8850,15 @@ 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; @@ -8963,8 +8867,7 @@ 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); @@ -8981,19 +8884,15 @@ 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); @@ -9001,8 +8900,7 @@ 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); @@ -9196,19 +9094,15 @@ 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; @@ -9218,8 +9112,7 @@ 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); @@ -9236,19 +9129,15 @@ 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); @@ -9257,8 +9146,7 @@ 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 f7598ce998e..eb3a906c94d 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -609,7 +609,7 @@ namespace HeatBalanceSurfaceManager { elOpened = false; } // IF (iwriteStatus /= 0) THEN - // CALL ShowFatalError('InitSurfaceHeatBalance: Could not open file "eplusout.delighteldmp" for output (readwrite).') + // CALL ShowFatalError(state, 'InitSurfaceHeatBalance: Could not open file "eplusout.delighteldmp" for output (readwrite).') // ENDIF // Open(unit=iDElightErrorFile, file='eplusout.delighteldmp', action='READ') @@ -4499,7 +4499,6 @@ namespace HeatBalanceSurfaceManager { // Using/Aliasing using DataRuntimeLanguage::EMSConstructActuatorChecked; using DataRuntimeLanguage::EMSConstructActuatorIsOkay; - using General::TrimSigDigits; using HeatBalFiniteDiffManager::ConstructFD; // Locals @@ -4554,12 +4553,9 @@ 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)); + format("Construction named = {} has CTF timesteps = {}", state.dataConstruction->Construct(Surface(SurfNum).Construction).Name, 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("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"); } @@ -4568,13 +4564,9 @@ 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, format("Construction named = {} has number of CTF terms = {}", state.dataConstruction->Construct(Surface(SurfNum).Construction).Name, 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("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"); @@ -4608,12 +4600,9 @@ 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"); @@ -7074,14 +7063,10 @@ 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 { @@ -7772,8 +7757,7 @@ 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("Inside surface heat balance convergence problem continues", @@ -7850,26 +7834,25 @@ namespace HeatBalanceSurfaceManager { void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, SurfaceData &surface, ZoneData &zone, int WarmupSurfTemp) { - using General::RoundSigDigits; + if ((TH12 > MaxSurfaceTempLimit) || (TH12 < MinSurfaceTempLimit)) { if (WarmupFlag) ++WarmupSurfTemp; if (!WarmupFlag || WarmupSurfTemp > 10 || 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."); } @@ -7898,19 +7881,18 @@ 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."); } @@ -7952,20 +7934,18 @@ namespace HeatBalanceSurfaceManager { if ((TH12 > MaxSurfaceTempLimitBeforeFatal) || (TH12 < MinSurfaceTempLimitBeforeFatal)) { if (!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."); } @@ -7978,20 +7958,18 @@ 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."); } @@ -8006,8 +7984,7 @@ 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 989f81be1dd..b0f8b28144d 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc @@ -792,16 +792,14 @@ 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."); } @@ -812,16 +810,14 @@ 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 85f5708ab2f..612e52a9527 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc @@ -560,7 +560,7 @@ namespace HeatPumpWaterToWaterHEATING { using namespace FluidProperties; using DataBranchAirLoopPlant::MassFlowTolerance; using DataPlant::PlantLoop; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; // SUBROUTINE PARAMETER DEFINITIONS: @@ -734,14 +734,12 @@ 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."); } @@ -752,14 +750,12 @@ 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 03de32be46b..624cb928b66 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -106,7 +106,7 @@ namespace HeatPumpWaterToWaterSimple { using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; - using General::TrimSigDigits; + using namespace DataLoopNode; // MODULE PARAMETER DEFINITIONS @@ -1028,9 +1028,8 @@ namespace HeatPumpWaterToWaterSimple { if (DataGlobals::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."); } @@ -1074,10 +1073,8 @@ 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."); } @@ -1193,10 +1190,8 @@ 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."); } @@ -1238,9 +1233,8 @@ namespace HeatPumpWaterToWaterSimple { if (DataGlobals::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."); } @@ -1365,9 +1359,8 @@ namespace HeatPumpWaterToWaterSimple { if (DataGlobals::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."); } @@ -1411,10 +1404,8 @@ 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."); } @@ -1529,10 +1520,8 @@ 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."); } @@ -1574,9 +1563,8 @@ namespace HeatPumpWaterToWaterSimple { if (DataGlobals::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."); } @@ -1719,12 +1707,11 @@ 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(HPEqFitCooling + " \"" + this->Name + @@ -1738,12 +1725,11 @@ 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(HPEqFitCooling + " \"" + this->Name + @@ -1898,12 +1884,11 @@ 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(HPEqFitHeating + " \"" + this->Name + @@ -1917,12 +1902,11 @@ 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(HPEqFitHeating + " \"" + this->Name + diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index 4d4daef3158..328a8718eab 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 @@ -123,7 +120,7 @@ namespace HeatRecovery { // Use statements for access to subroutines in other modules using namespace ScheduleManager; - using General::RoundSigDigits; + using General::SolveRoot; using namespace Psychrometrics; @@ -241,7 +238,7 @@ 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 @@ -266,13 +263,11 @@ 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; } @@ -732,7 +727,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; } @@ -743,7 +738,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); @@ -751,7 +746,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; } @@ -772,22 +767,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 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; } @@ -797,8 +792,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; } @@ -808,22 +803,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; } @@ -833,8 +828,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; } @@ -844,8 +839,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; } @@ -855,8 +850,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; } @@ -866,22 +861,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 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; } @@ -891,22 +886,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; } @@ -927,22 +922,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 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; } @@ -952,8 +947,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; } @@ -963,22 +958,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; } @@ -988,8 +983,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; } @@ -999,8 +994,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; } @@ -1010,22 +1005,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; } @@ -1035,22 +1030,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 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; } @@ -1060,22 +1055,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; } } @@ -1276,7 +1271,7 @@ namespace HeatRecovery { // Using/Aliasing using DXCoils::DXCoilFullLoadOutAirHumRat; using DXCoils::DXCoilFullLoadOutAirTemp; - using General::RoundSigDigits; + // USE DataZoneEquipment, ONLY: ZoneEquipInputsFilled,CheckZoneEquipmentList using DataGlobals::AnyEnergyManagementSystemInModel; using EMSManager::CheckIfNodeSetPointManagedByEMS; @@ -1374,58 +1369,54 @@ 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"); } @@ -2138,7 +2129,7 @@ namespace HeatRecovery { 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) + '.'); + format("...HX Supply air to Exhaust air flow ratio = {:.5R}.", HXSupAirVolFlowRate / HXSecAirVolFlowRate)); } else { ShowRecurringWarningErrorAtEnd( cHXTypes(ExchCond(ExNum).ExchTypeNum) + " \"" + ExchCond(ExNum).Name + @@ -2160,7 +2151,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( cHXTypes(ExchCond(ExNum).ExchTypeNum) + " \"" + ExchCond(ExNum).Name + @@ -2209,19 +2200,15 @@ 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; } } @@ -2232,19 +2219,15 @@ 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; } } @@ -2340,19 +2323,15 @@ 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; } } @@ -2363,19 +2342,15 @@ 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; } } @@ -3407,7 +3382,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 @@ -3434,7 +3409,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)); } } } @@ -3543,7 +3518,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)); } } } @@ -3704,7 +3679,7 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -3856,9 +3831,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; } @@ -3875,7 +3850,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_RegenInTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(); - 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 { @@ -3888,9 +3863,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; } @@ -3907,7 +3882,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_RegenInHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(); - 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 { @@ -3920,9 +3895,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; } @@ -3942,7 +3917,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_ProcInTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ',' + CurMnDy + ' ' + CreateSysTimeIntervalString(); - 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 { @@ -3955,9 +3930,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; } @@ -3977,7 +3952,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_ProcInHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(); - 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 { @@ -3990,9 +3965,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; } @@ -4009,7 +3984,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).T_FaceVelBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(); - 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 { @@ -4055,7 +4030,7 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4207,9 +4182,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; } @@ -4226,7 +4201,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_RegenInTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + " , " + CreateSysTimeIntervalString(); - 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 { @@ -4239,9 +4214,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; } @@ -4258,7 +4233,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_RegenInHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(); - 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 { @@ -4271,9 +4246,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; } @@ -4293,7 +4268,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_ProcInTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(); - 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 { @@ -4306,9 +4281,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; } @@ -4328,7 +4303,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_ProcInHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(); - 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 { @@ -4341,9 +4316,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; } @@ -4361,7 +4336,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).H_FaceVelBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(); - 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 { @@ -4404,7 +4379,7 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4484,8 +4459,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 @@ -4498,7 +4473,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutTempFailedBuffer2 = "...Regen inlet air temperature = " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(); - 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 { @@ -4513,9 +4488,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; } @@ -4531,7 +4506,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutTempBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(); - 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 { @@ -4574,7 +4549,7 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -4653,8 +4628,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 @@ -4667,7 +4642,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutHumRatFailedBuffer2 = "...Regen inlet air humidity ratio = " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(); - 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 { @@ -4682,9 +4657,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; } @@ -4700,7 +4675,7 @@ namespace HeatRecovery { BalDesDehumPerfData(ExchCond(ExchNum).PerfDataIndex).RegenOutHumRatBuffer2 = "...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ", " + CreateSysTimeIntervalString(); - 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 { @@ -4745,7 +4720,7 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + using Psychrometrics::PsyRhFnTdbWPb; // Locals @@ -4860,9 +4835,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 = @@ -4881,9 +4856,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 = @@ -4933,7 +4908,7 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + using Psychrometrics::PsyRhFnTdbWPb; // Locals @@ -5049,9 +5024,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 = @@ -5070,9 +5045,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 = @@ -5115,7 +5090,7 @@ namespace HeatRecovery { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -5179,8 +5154,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 = @@ -5462,7 +5437,7 @@ 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 762c3c6dec8..9ee05bfd857 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -208,7 +207,7 @@ namespace HeatingCoils { // This subroutine manages HeatingCoil component simulation. // Using/Aliasing - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -239,13 +238,11 @@ 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; } @@ -1502,8 +1499,8 @@ namespace HeatingCoils { // Using/Aliasing using namespace DataSizing; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using namespace OutputReportPredefined; // Locals @@ -1619,9 +1616,8 @@ namespace HeatingCoils { if (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."); } @@ -1641,11 +1637,7 @@ 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."); } } @@ -1889,8 +1881,8 @@ 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; @@ -2105,7 +2097,7 @@ namespace HeatingCoils { using DataGlobals::WarmupFlag; using DataHVACGlobals::TempControlTol; using FaultsManager::FaultsCoilSATSensor; - using General::TrimSigDigits; + // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2228,8 +2220,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 { @@ -2247,7 +2238,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 { @@ -2322,8 +2313,8 @@ 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; @@ -2524,8 +2515,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 { @@ -2543,7 +2533,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 { @@ -2978,7 +2968,7 @@ namespace HeatingCoils { // the heating coil is scheduled to be on. // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CoilNum; @@ -3006,12 +2996,10 @@ 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."); @@ -3586,7 +3574,7 @@ 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); @@ -3594,8 +3582,7 @@ 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 c51a7e3aef1..f67b054de95 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 @@ -203,7 +203,7 @@ 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 @@ -227,13 +227,11 @@ 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; } @@ -279,7 +277,7 @@ namespace HighTempRadiantSystem { using DataSizing::CapacityPerFloorArea; using DataSizing::FractionOfAutosizedHeatingCapacity; using DataSizing::HeatingDesignCapacity; - using General::TrimSigDigits; + using ScheduleManager::GetScheduleIndex; using namespace DataIPShortCuts; @@ -372,8 +370,7 @@ 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 { @@ -389,8 +386,7 @@ 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); @@ -410,8 +406,7 @@ 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 { @@ -603,12 +598,11 @@ 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; @@ -794,7 +788,7 @@ namespace HighTempRadiantSystem { using namespace DataSizing; using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1329,7 +1323,7 @@ namespace HighTempRadiantSystem { using DataHeatBalFanSys::SumConvHTRadSys; using DataHeatBalFanSys::SumLatentHTRadSys; using DataSurfaces::Surface; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1379,16 +1373,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 94f08b7d9ff..5414dbff557 100644 --- a/src/EnergyPlus/Humidifiers.cc +++ b/src/EnergyPlus/Humidifiers.cc @@ -169,7 +169,7 @@ 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 @@ -190,13 +190,11 @@ 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; } @@ -224,7 +222,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."); } @@ -735,7 +733,7 @@ namespace Humidifiers { using FluidProperties::FindRefrigerant; using FluidProperties::GetSatEnthalpyRefrig; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::RhoH2O; @@ -879,9 +877,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."); } @@ -912,11 +909,9 @@ 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; @@ -949,8 +944,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."); } @@ -958,8 +953,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 9729e1352bc..c7289c13642 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,13 @@ namespace HybridEvapCoolingModel { // day, so report", but that doesn't seem to exist. if ((TimeElapsed > 24) && WarnOnceFlag && !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 5ff7ca9c6fa..e0fe8dab35e 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,11 @@ 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 +150,19 @@ 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 +1172,31 @@ 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 9ce4a2eca46..fe218ee9d5c 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,8 @@ 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)); } } @@ -578,8 +577,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("CalcICEngineGeneratorModel: " + this->TypeOf + "=\"" + this->Name + diff --git a/src/EnergyPlus/IceThermalStorage.cc b/src/EnergyPlus/IceThermalStorage.cc index ca81079c15a..59906d61f7a 100644 --- a/src/EnergyPlus/IceThermalStorage.cc +++ b/src/EnergyPlus/IceThermalStorage.cc @@ -769,8 +769,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; } @@ -869,8 +868,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; } @@ -985,8 +983,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; @@ -1013,32 +1010,28 @@ 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..32538f1bfd8 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) + " - \"" + + 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,7 +250,7 @@ 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) + + 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; @@ -383,8 +383,7 @@ 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 +523,7 @@ 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 0e8465d61c6..bdcc54225f8 100644 --- a/src/EnergyPlus/IntegratedHeatPump.cc +++ b/src/EnergyPlus/IntegratedHeatPump.cc @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -74,7 +73,6 @@ namespace IntegratedHeatPump { // Using/Aliasing using namespace DataLoopNode; using namespace DataGlobals; - 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,10 @@ 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 +1095,6 @@ namespace IntegratedHeatPump { using BranchNodeConnections::SetUpCompSets; using BranchNodeConnections::TestCompSet; using GlobalNames::VerifyUniqueCoilName; - using General::TrimSigDigits; using VariableSpeedCoils::GetCoilIndexVariableSpeed; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1922,7 +1916,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 +1930,7 @@ 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 +2033,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 +2040,7 @@ 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 +2063,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 +2075,7 @@ 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 +2184,6 @@ namespace IntegratedHeatPump { using DataEnvironment::OutDryBulbTemp; using DataHVACGlobals::SmallLoad; using DataHVACGlobals::TimeStepSys; - using General::TrimSigDigits; using WaterThermalTanks::GetWaterThermalTankInput; Real64 MyLoad(0.0); @@ -2211,8 +2197,7 @@ 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 +2314,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 +2327,7 @@ 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 +2353,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 +2361,7 @@ 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 +2658,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 +2668,7 @@ 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 +2705,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 +2713,7 @@ 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 +2756,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 +2768,7 @@ 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); @@ -2889,8 +2860,6 @@ namespace IntegratedHeatPump { bool const EP_UNUSED(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); @@ -2901,8 +2870,7 @@ 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); @@ -2965,8 +2933,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); @@ -2980,8 +2946,7 @@ 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 16543e2f774..3d4e759f01c 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -220,7 +220,7 @@ namespace InternalHeatGains { using namespace DataIPShortCuts; using namespace ScheduleManager; using General::CheckCreatedZoneItemName; - using General::RoundSigDigits; + using namespace OutputReportPredefined; using namespace DataLoopNode; using CurveManager::GetCurveIndex; @@ -505,8 +505,7 @@ 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; } } @@ -514,8 +513,7 @@ 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; } } @@ -541,8 +539,7 @@ 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; } } @@ -560,8 +557,7 @@ 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; } } @@ -592,8 +588,7 @@ 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; } } @@ -610,8 +605,7 @@ 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; } @@ -635,8 +629,7 @@ 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; } } @@ -644,8 +637,7 @@ 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; } } @@ -654,8 +646,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)); } } } @@ -809,8 +800,7 @@ 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; } } @@ -818,8 +808,7 @@ 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; } } @@ -828,8 +817,7 @@ 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)); } } } @@ -861,8 +849,7 @@ 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; } } @@ -870,8 +857,7 @@ 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; } } @@ -880,8 +866,7 @@ 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)); } } } @@ -936,8 +921,7 @@ 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; } } @@ -945,8 +929,7 @@ 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; } } @@ -1098,10 +1081,9 @@ 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) { @@ -1117,10 +1099,9 @@ 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)); } @@ -1252,8 +1233,7 @@ 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; } } @@ -1261,8 +1241,7 @@ 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; } } @@ -1288,8 +1267,7 @@ 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; } } @@ -1307,8 +1285,7 @@ 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; } } @@ -1701,15 +1678,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; } } @@ -1734,8 +1709,7 @@ 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; } } @@ -1753,8 +1727,7 @@ 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; } } @@ -2099,8 +2072,7 @@ 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; } } @@ -2108,8 +2080,7 @@ 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; } } @@ -2135,8 +2106,7 @@ 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; } } @@ -2154,8 +2124,7 @@ 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; } } @@ -2186,13 +2155,11 @@ 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 @@ -2495,15 +2462,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; } } @@ -2528,8 +2493,7 @@ 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; } } @@ -2547,8 +2511,7 @@ 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; } } @@ -2889,15 +2852,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; } } @@ -2922,8 +2883,7 @@ 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; } } @@ -2941,8 +2901,7 @@ 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; } } @@ -3376,13 +3335,11 @@ 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; } @@ -3660,8 +3617,7 @@ 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; } } @@ -3696,15 +3652,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; } } @@ -3728,15 +3682,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; } } @@ -4402,15 +4354,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; } } @@ -4597,15 +4547,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 7d3785e9e22..078ed83ef08 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -275,7 +275,7 @@ 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 @@ -310,13 +310,11 @@ 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; } @@ -373,7 +371,7 @@ namespace LowTempRadiantSystem { using DataSizing::FractionOfAutosizedHeatingCapacity; using DataSizing::HeatingDesignCapacity; using FluidProperties::FindGlycol; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; using ScheduleManager::GetScheduleIndex; using namespace DataLoopNode; @@ -597,7 +595,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 { @@ -615,7 +613,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); @@ -635,7 +633,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 { @@ -688,7 +686,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 { @@ -706,7 +704,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); @@ -726,7 +724,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 { @@ -1145,8 +1143,7 @@ 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 { @@ -1163,8 +1160,7 @@ 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); @@ -1185,8 +1181,7 @@ 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 { @@ -1716,7 +1711,7 @@ namespace LowTempRadiantSystem { using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::ZoneEquipInputsFilled; using FluidProperties::GetDensityGlycol; - using General::RoundSigDigits; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; @@ -2433,7 +2428,7 @@ namespace LowTempRadiantSystem { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -2717,10 +2712,8 @@ 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."); } @@ -2877,10 +2870,8 @@ 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."); } @@ -2920,9 +2911,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."); } @@ -3072,9 +3062,8 @@ 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."); } @@ -3120,9 +3109,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."); } @@ -3391,7 +3379,7 @@ namespace LowTempRadiantSystem { using DataSurfaces::HeatTransferModel_CondFD; using DataSurfaces::HeatTransferModel_CTF; using DataSurfaces::Surface; - using General::RoundSigDigits; + using PlantUtilities::SetComponentFlowRate; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -3644,13 +3632,10 @@ 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(cHydronicSystem + " [" + this->Name + "] condensation shut-off occurrence continues.", @@ -3810,13 +3795,10 @@ 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(cHydronicSystem + " [" + this->Name + "] condensation shut-off occurrence continues.", @@ -3884,7 +3866,7 @@ namespace LowTempRadiantSystem { using DataHVACGlobals::SmallLoad; using DataLoopNode::Node; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using ScheduleManager::GetCurrentScheduleValue; @@ -4337,7 +4319,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; } @@ -4396,7 +4378,7 @@ namespace LowTempRadiantSystem { using DataSurfaces::HeatTransferModel_CTF; using DataSurfaces::Surface; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::SetComponentFlowRate; // SUBROUTINE PARAMETER DEFINITIONS: @@ -4743,13 +4725,10 @@ 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(cConstantFlowSystem + " [" + this->Name + "] condensation shut-off occurrence continues.", @@ -4804,13 +4783,10 @@ 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(cConstantFlowSystem + " [" + this->Name + @@ -5205,7 +5181,7 @@ 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 @@ -5223,8 +5199,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."); } @@ -5239,8 +5215,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 4349ddf10d4..8e0e8e96b9c 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -231,14 +231,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 9b6d930381b..fa20fb0d691 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,7 @@ 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 +214,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 +234,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 +264,9 @@ 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 +288,8 @@ 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 +310,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 +335,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 +351,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 +367,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 +393,11 @@ 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 +478,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 +507,8 @@ 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 +525,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 +543,8 @@ 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 +562,8 @@ 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 +662,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 +681,8 @@ 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 +699,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 +719,8 @@ 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 +737,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)); } } } @@ -1165,11 +1152,9 @@ 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("GENERATOR:MICROTURBINE \"" + this->Name + @@ -1227,10 +1212,8 @@ 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( @@ -1250,9 +1233,8 @@ 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( @@ -1290,10 +1272,8 @@ 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( @@ -1324,8 +1304,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("GENERATOR:MICROTURBINE \"" + this->Name + @@ -1357,11 +1337,9 @@ 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("GENERATOR:MICROTURBINE \"" + this->Name + @@ -1385,9 +1363,8 @@ 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( @@ -1410,10 +1387,8 @@ 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( @@ -1441,9 +1416,8 @@ 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( @@ -1499,9 +1473,8 @@ 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( @@ -1516,9 +1489,8 @@ 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( @@ -1548,10 +1520,8 @@ 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( @@ -1574,9 +1544,8 @@ 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("GENERATOR:MICROTURBINE \"" + this->Name + @@ -1613,10 +1582,8 @@ 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("GENERATOR:MICROTURBINE \"" + this->Name + @@ -1639,9 +1606,8 @@ 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("GENERATOR:MICROTURBINE \"" + this->Name + @@ -1690,8 +1656,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("GENERATOR:MICROTURBINE \"" + this->Name + @@ -1706,10 +1672,8 @@ 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( diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index d90dfbd1edd..471252bb8be 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 @@ -1372,8 +1370,8 @@ 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; @@ -2266,8 +2264,8 @@ 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; @@ -2527,10 +2525,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)); } } } @@ -2678,7 +2676,7 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); using DataHeatBalance::ZoneList; using Psychrometrics::PsyRhoAirFnPbTdbW; - using General::RoundSigDigits; + using namespace OutputReportPredefined; using DataAirSystems::PrimaryAirSystem; using EMSManager::CheckIfNodeSetPointManagedByEMS; @@ -2849,8 +2847,7 @@ 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; @@ -2861,8 +2858,7 @@ 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=" + PrimaryAirSystem(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 @@ -2871,8 +2867,7 @@ 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=" + PrimaryAirSystem(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 @@ -3564,8 +3559,7 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); using CurveManager::CurveValue; using DataGlobals::DoingSizing; using DataGlobals::WarmupFlag; - using DataHeatBalFanSys::ZoneAirHumRat; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS @@ -3692,8 +3686,7 @@ 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("Controller:OutdoorAir=\"" + this->Name + "\": Min OA fraction > Mechanical ventilation OA fraction, continues...", @@ -3875,7 +3868,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: "); @@ -4152,11 +4145,7 @@ 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, ""); @@ -4197,12 +4186,7 @@ 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..."); @@ -4219,12 +4203,7 @@ 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..."); @@ -4241,11 +4220,7 @@ 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, ""); @@ -4908,7 +4883,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; @@ -5004,10 +4979,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)); } } } @@ -5520,7 +5495,7 @@ CurrentModuleObjects(CMO_SysAvailMgrList), AvailManagerListName); // na // Using/Aliasing - using General::TrimSigDigits; + // Return value int ReliefNodeNumber; // Relief Node Number @@ -5546,8 +5521,7 @@ 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 3c6b2e51959..dd4f5e067ce 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,11 @@ 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 +207,6 @@ namespace MixerComponent { // Uses the status flags to trigger events. // Using/Aliasing - using General::TrimSigDigits; using NodeInputManager::GetOnlySingleNode; // SUBROUTINE PARAMETER DEFINITIONS: @@ -327,7 +320,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 +328,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 36eb45f36c5..8dede1c43c5 100644 --- a/src/EnergyPlus/NodeInputManager.cc +++ b/src/EnergyPlus/NodeInputManager.cc @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -89,7 +88,6 @@ namespace NodeInputManager { // OTHER NOTES: using DataGlobals::DisplayAdvancedReportVariables; - using General::TrimSigDigits; using namespace DataLoopNode; using namespace BranchNodeConnections; @@ -219,7 +217,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."); } @@ -261,7 +259,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 @@ -633,7 +631,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; } } @@ -646,9 +644,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; } } @@ -660,8 +661,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; @@ -720,7 +720,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."); } @@ -870,7 +870,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) @@ -1119,7 +1119,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 e51881a857d..dcd8cb9ce05 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 @@ -133,7 +128,7 @@ 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"); @@ -241,7 +236,7 @@ namespace OutdoorAirUnit { // Standard EnergyPlus methodology. // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int OAUnitNum; // index of outdoor air unit being simulated @@ -263,13 +258,11 @@ 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; } @@ -327,7 +320,6 @@ namespace OutdoorAirUnit { using SteamCoils::GetSteamCoilIndex; using WaterCoils::CheckWaterCoilSchedule; using namespace DataLoopNode; - using namespace DataSurfaceLists; using OutAirNodeManager::CheckAndAddAirNodeNumber; using WaterCoils::GetCoilWaterInletNode; using WaterCoils::GetWaterCoilIndex; @@ -555,8 +547,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 @@ -1468,7 +1459,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; @@ -1549,9 +1540,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."); } @@ -1593,9 +1583,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."); } @@ -1718,7 +1707,6 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); // USE STATEMENTS: // Using/Aliasing - using namespace DataZoneEnergyDemands; using DataEnvironment::CurMnDy; using DataEnvironment::EnvironmentName; using DataEnvironment::OutBaroPress; @@ -1890,8 +1878,7 @@ 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; } } @@ -2140,7 +2127,6 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); // USE STATEMENTS: // Using/Aliasing - using namespace DataZoneEnergyDemands; using DataEnvironment::CurMnDy; using DataEnvironment::EnvironmentName; using DataEnvironment::OutBaroPress; @@ -2150,7 +2136,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 d04ba0feb7a..6df70b2f33b 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4143,8 +4143,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; @@ -5468,7 +5467,7 @@ void SetupOutputVariable(EnergyPlusData &state, // Using/Aliasing using namespace OutputProcessor; - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CV; @@ -5710,7 +5709,7 @@ void SetupOutputVariable(EnergyPlusData &state, // Using/Aliasing using namespace OutputProcessor; - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CV; @@ -6999,7 +6998,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, // Using/Aliasing using namespace OutputProcessor; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7063,7 +7062,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, @@ -7117,7 +7116,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, @@ -7171,7 +7170,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, @@ -7225,7 +7224,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, @@ -7279,7 +7278,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, @@ -7333,7 +7332,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, @@ -7725,11 +7724,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 @@ -7737,11 +7735,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 e5290ba90e3..78b27692885 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -122,7 +122,6 @@ #include #include #include -#include #include #include #include @@ -1955,7 +1954,7 @@ namespace OutputReportTabular { using DataStringGlobals::CharComma; using DataStringGlobals::CharSpace; using DataStringGlobals::CharTab; - using General::RoundSigDigits; + using OutputProcessor::EndUseCategory; using OutputProcessor::MaxNumSubcategories; using OutputReportPredefined::numReportName; @@ -2237,8 +2236,7 @@ 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. } } @@ -2506,7 +2504,7 @@ namespace OutputReportTabular { // Using/Aliasing using namespace DataOutputs; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2590,14 +2588,13 @@ 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."); } @@ -6421,7 +6418,7 @@ namespace OutputReportTabular { using DataOutputs::iTotalAutoCalculatableFields; using DataOutputs::iTotalAutoSizableFields; using DataOutputs::iTotalFieldsWithDefaults; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleName; using ScheduleManager::ScheduleAverageHoursPerWeek; @@ -7310,7 +7307,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 @@ -7590,26 +7587,26 @@ namespace OutputReportTabular { collapsedTotal(13) = gatherTotalsBEPS(7); // water if (DataGlobals::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, "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]", - General::RoundSigDigits(state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillate, 2)); + format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillate)); UtilityRoutines::appendPerfLog(state, "Facility Any Zone Oscillating Temperatures During Occupancy Time [hours]", - General::RoundSigDigits(state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateDuringOccupancy, 2)); + format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateDuringOccupancy)); UtilityRoutines::appendPerfLog(state, "Facility Any Zone Oscillating Temperatures in Deadband Time [hours]", - General::RoundSigDigits(state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateInDeadband, 2)); + format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateInDeadband)); } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { @@ -10198,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); @@ -10295,7 +10292,7 @@ namespace OutputReportTabular { using DataSurfaces::SurfaceClass_Wall; using DataSurfaces::SurfaceClass_Window; using DataSurfaces::TotSurfaces; - using General::RoundSigDigits; + using General::SafeDivide; using ScheduleManager::GetScheduleName; using ScheduleManager::ScheduleAverageHoursPerWeek; @@ -10497,7 +10494,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); @@ -10880,8 +10877,7 @@ 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=['// & @@ -12098,7 +12094,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 @@ -13674,9 +13670,7 @@ 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(timeOfMax); + compLoad.peakDateHrMin = format("{}/{} {}", state.dataWeatherManager->DesDayInput(desDaySelected).Month, state.dataWeatherManager->DesDayInput(desDaySelected).DayOfMonth, coilSelectionReportObj->getTimeText(timeOfMax)); } else { compLoad.peakDateHrMin = CoolPeakDateHrMin(zoneIndex); } @@ -13727,9 +13721,7 @@ 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(timeOfMax); + compLoad.peakDateHrMin = format("{}/{} {}", state.dataWeatherManager->DesDayInput(desDaySelected).Month, state.dataWeatherManager->DesDayInput(desDaySelected).DayOfMonth, coilSelectionReportObj->getTimeText(timeOfMax)); } else { compLoad.peakDateHrMin = HeatPeakDateHrMin(zoneIndex); } @@ -14385,7 +14377,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 7110960dfba..75144cd23dd 100644 --- a/src/EnergyPlus/OutputReports.cc +++ b/src/EnergyPlus/OutputReports.cc @@ -227,7 +227,7 @@ void LinesOut(EnergyPlusData &state, std::string const &option) // Using/Aliasing using namespace DataHeatBalance; using namespace DataSurfaces; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -512,7 +512,7 @@ void DXFOut(EnergyPlusData &state, using DataGlobals::NumOfZones; using DataStringGlobals::VerString; using namespace DXFEarClipping; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -845,7 +845,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), @@ -890,7 +890,7 @@ void DXFOutLines(EnergyPlusData &state, std::string const &ColorScheme) using DataDaylighting::ZoneDaylight; using DataGlobals::NumOfZones; using DataStringGlobals::VerString; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -954,7 +954,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); @@ -1002,7 +1002,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); @@ -1044,7 +1044,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); @@ -1103,7 +1103,7 @@ void DXFOutWireFrame(EnergyPlusData &state, std::string const &ColorScheme) using DataDaylighting::ZoneDaylight; using DataGlobals::NumOfZones; using DataStringGlobals::VerString; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1167,7 +1167,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); @@ -1272,8 +1272,8 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices using namespace DataHeatBalance; using namespace DataSurfaces; using DataGlobals::NumOfZones; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using ScheduleManager::GetScheduleMaxValue; using ScheduleManager::GetScheduleMinValue; using ScheduleManager::GetScheduleName; @@ -1388,44 +1388,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 @@ -1516,7 +1516,7 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices } } if (cNominalUwithConvCoeffs == "") { - cNominalUwithConvCoeffs = RoundSigDigits(NominalUwithConvCoeffs, 3); + cNominalUwithConvCoeffs = format("{:.3R}", NominalUwithConvCoeffs); } else { cNominalUwithConvCoeffs = "[invalid]"; } @@ -1529,7 +1529,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 = "**"; @@ -1538,10 +1538,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); @@ -1620,20 +1620,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'; @@ -1666,10 +1666,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) { @@ -1679,10 +1679,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 @@ -1717,14 +1717,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 51cf7e135f5..b0c6d1b7519 100644 --- a/src/EnergyPlus/OutsideEnergySources.cc +++ b/src/EnergyPlus/OutsideEnergySources.cc @@ -448,9 +448,8 @@ namespace OutsideEnergySources { if (DataGlobals::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 9cdadfd57f2..bc5ca54080e 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; @@ -466,7 +466,7 @@ 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; @@ -507,14 +507,12 @@ 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 6a5f022a8f3..278fac01ac3 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -263,7 +263,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; @@ -307,13 +307,11 @@ 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; } @@ -565,8 +563,8 @@ 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); @@ -792,28 +790,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; } @@ -828,7 +826,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; } @@ -843,7 +841,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; } @@ -886,8 +884,7 @@ 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; } @@ -1116,7 +1113,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; @@ -1401,7 +1398,7 @@ namespace PackagedTerminalHeatPump { // 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 @@ -1495,7 +1492,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); @@ -1685,28 +1682,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; } @@ -1721,7 +1718,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; } @@ -1736,7 +1733,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; } @@ -1786,8 +1783,7 @@ 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; @@ -2301,7 +2297,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); @@ -3146,13 +3142,12 @@ 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; } } @@ -3160,21 +3155,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; } @@ -3189,7 +3184,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; } @@ -3198,15 +3193,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; } @@ -3215,15 +3210,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 { @@ -3778,7 +3773,7 @@ namespace PackagedTerminalHeatPump { using Fans::GetFanVolFlow; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; - using General::TrimSigDigits; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; @@ -4181,9 +4176,7 @@ 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); @@ -4191,9 +4184,7 @@ 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); } @@ -4202,18 +4193,14 @@ 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); } @@ -4222,9 +4209,7 @@ 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); @@ -4813,7 +4798,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; @@ -5284,10 +5269,8 @@ 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."); } @@ -5335,10 +5318,8 @@ 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."); } @@ -5387,10 +5368,8 @@ 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."); } @@ -5435,10 +5414,8 @@ 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."); } @@ -5505,8 +5482,7 @@ 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)); } } @@ -5548,9 +5524,9 @@ namespace PackagedTerminalHeatPump { // Using/Aliasing using DataEnvironment::OutDryBulbTemp; using DataGlobals::WarmupFlag; - using General::RoundSigDigits; + using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyCpAirFnW; @@ -5854,7 +5830,7 @@ namespace PackagedTerminalHeatPump { using DataEnvironment::OutDryBulbTemp; using DataZoneEquipment::ZoneEquipConfig; using DXCoils::SimDXCoil; - using General::RoundSigDigits; + using General::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; @@ -6311,12 +6287,9 @@ 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("CalcPTUnit: Hot water coil control failed (iteration limit [" + - RoundSigDigits(SolveMaxIter) + "]) for " + PTUnit(PTUnitNum).UnitType + "=\"" + - PTUnit(PTUnitNum).Name, + ShowRecurringWarningErrorAtEnd(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) { @@ -6324,8 +6297,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("CalcPTUnit: Hot water coil control failed (flow limits) for " + PTUnit(PTUnitNum).UnitType + "=\"" + PTUnit(PTUnitNum).Name + "\"", @@ -7414,9 +7387,9 @@ namespace PackagedTerminalHeatPump { using DataEnvironment::OutDryBulbTemp; using DataGlobals::WarmupFlag; using DataZoneEnergyDemands::CurDeadBandOrSetback; - using General::RoundSigDigits; + using General::SolveRoot; - using General::TrimSigDigits; + using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyCpAirFnW; @@ -7623,7 +7596,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( @@ -7705,8 +7678,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(PTUnit(PTUnitNum).Name + @@ -8094,7 +8066,7 @@ namespace PackagedTerminalHeatPump { using DataEnvironment::OutDryBulbTemp; using DataZoneEquipment::ZoneEquipConfig; using DXCoils::SimDXCoil; - using General::RoundSigDigits; + using General::SolveRoot; using HeatingCoils::SimulateHeatingCoilComponents; using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; @@ -8456,12 +8428,10 @@ 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( - "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) { @@ -8470,8 +8440,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("RoutineName//Hot water coil control failed (flow limits) for " + PTUnit(PTUnitNum).UnitType + "=\"" + PTUnit(PTUnitNum).Name + "\"", @@ -8747,7 +8717,7 @@ 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 ec497c160c1..81ad80f046a 100644 --- a/src/EnergyPlus/PackagedThermalStorageCoil.cc +++ b/src/EnergyPlus/PackagedThermalStorageCoil.cc @@ -195,7 +195,7 @@ namespace PackagedThermalStorageCoil { // // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int TESCoilNum; @@ -214,13 +214,11 @@ 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; } @@ -1841,7 +1839,7 @@ namespace PackagedThermalStorageCoil { // Using/Aliasing using DataPlant::PlantLoop; using DataPlant::TypeOf_PackagedTESCoolingCoil; - using General::RoundSigDigits; + using PlantUtilities::ScanPlantLoopsForObject; using ScheduleManager::GetCurrentScheduleValue; @@ -1988,7 +1986,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("InitTESCoil: Invalid control schedule value for TES operating mode, set to Off", @@ -2051,7 +2049,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("InitTESCoil: Invalid control schedule value for TES operating mode, set to Off", @@ -4116,7 +4114,7 @@ namespace PackagedThermalStorageCoil { // na // Using/Aliasing - using General::RoundSigDigits; + using General::SolveRoot; using TempSolveRoot::SolveRoot; @@ -4197,8 +4195,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 +4216,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 +4262,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 +4288,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 dc6338f7b2c..cd2381835b4 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -271,8 +271,7 @@ 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 +714,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 +777,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 9090ae2d062..0828d673e92 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -157,7 +157,7 @@ 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 +177,11 @@ 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 +291,7 @@ namespace Photovoltaics { using namespace DataIPShortCuts; using DataSurfaces::Surface; using namespace DataHeatBalance; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using TranspiredCollector::GetTranspiredCollectorIndex; @@ -374,7 +372,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)); } } @@ -1720,7 +1718,7 @@ namespace Photovoltaics { // na // Using/Aliasing - using General::RoundSigDigits; + // Return value Real64 FUN(0.0); @@ -1746,8 +1744,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"); } @@ -1774,7 +1772,7 @@ namespace Photovoltaics { // na // Using/Aliasing - using General::RoundSigDigits; + // Return value Real64 FI(0.0); @@ -1799,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"); } @@ -1827,7 +1825,7 @@ namespace Photovoltaics { // na // Using/Aliasing - using General::RoundSigDigits; + // Return value Real64 FV(0.0); @@ -1853,8 +1851,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 f1b9b252777..2fd09678245 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -257,7 +257,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; @@ -396,7 +396,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)); @@ -405,7 +405,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; @@ -501,7 +501,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; @@ -509,7 +509,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; @@ -593,7 +593,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; @@ -601,7 +601,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; @@ -748,7 +748,7 @@ namespace PipeHeatTransfer { // na // Using/Aliasing - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -815,8 +815,7 @@ 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 70999eb1780..b8267dcc2b1 100644 --- a/src/EnergyPlus/Plant/Loop.cc +++ b/src/EnergyPlus/Plant/Loop.cc @@ -246,7 +246,7 @@ namespace DataPlant { using DataLoopNode::Node; using DataLoopNode::NodeID; using DataPlant::SupplySide; - using General::RoundSigDigits; + ; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int LoopInlet; // plant loop inlet node num. @@ -263,12 +263,8 @@ namespace 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("PlantSupplySide: PlantLoop=\"" + this->Name + diff --git a/src/EnergyPlus/Plant/LoopSide.cc b/src/EnergyPlus/Plant/LoopSide.cc index 023e3117c3d..0d4ad8aa8ee 100644 --- a/src/EnergyPlus/Plant/LoopSide.cc +++ b/src/EnergyPlus/Plant/LoopSide.cc @@ -758,12 +758,9 @@ namespace DataPlant { "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)); + 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."); } @@ -780,12 +777,9 @@ namespace DataPlant { "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)); + 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 { @@ -1319,7 +1313,7 @@ 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"}); @@ -1675,10 +1669,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 5ddd696c763..7350903f420 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: @@ -2099,7 +2098,7 @@ namespace EnergyPlus { using EMSManager::iTemperatureMaxSetPoint; using EMSManager::iTemperatureMinSetPoint; using EMSManager::iTemperatureSetPoint; - using General::RoundSigDigits; + ; using PlantUtilities::SetAllFlowLocks; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -3003,7 +3002,7 @@ namespace EnergyPlus { // Using/Aliasing using namespace DataSizing; using FluidProperties::GetDensityGlycol; - using General::RoundSigDigits; + ; // Locals bool localInitLoopEquip(true); @@ -3134,9 +3133,7 @@ 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); } } @@ -3242,7 +3239,7 @@ namespace EnergyPlus { using namespace DataSizing; using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; - using General::RoundSigDigits; + ; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("ResizePlantLoop"); @@ -3297,9 +3294,7 @@ 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 5eb7c1cad0d..7677f1c9c99 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -314,10 +314,8 @@ 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."); } @@ -407,9 +405,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."); } @@ -494,10 +491,8 @@ 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."); } @@ -904,161 +899,161 @@ 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", @@ -1203,15 +1198,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; } @@ -1223,16 +1216,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; } @@ -1268,7 +1259,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; @@ -1283,7 +1274,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)); } } @@ -1295,7 +1286,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)); } } @@ -1306,7 +1297,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)); } } @@ -1338,7 +1329,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)); } } @@ -1350,7 +1341,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)); } } @@ -1361,7 +1352,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)); } } @@ -1798,8 +1789,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."); } @@ -1889,8 +1879,7 @@ 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; } @@ -1912,11 +1901,8 @@ namespace PlantCentralGSHP { if (this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError < 1 && !DataGlobals::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 (!DataGlobals::WarmupFlag) { ++this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError; @@ -2273,9 +2259,8 @@ 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 "); } @@ -2388,8 +2373,7 @@ 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; } @@ -2409,11 +2393,8 @@ namespace PlantCentralGSHP { if (this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError < 1 && !DataGlobals::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 (!DataGlobals::WarmupFlag) { ++this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError; diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index 179616d32f9..b28170e9c46 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -229,15 +229,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; } @@ -470,8 +468,7 @@ 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; @@ -1082,9 +1079,8 @@ namespace PlantChillers { if (DataGlobals::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."); } @@ -1136,10 +1132,8 @@ 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."); } @@ -1204,10 +1198,8 @@ 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."); } @@ -1265,10 +1257,8 @@ 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."); } @@ -1844,9 +1834,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"); } @@ -1856,8 +1846,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"); } } @@ -2131,16 +2121,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; } @@ -2425,8 +2413,7 @@ 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; @@ -2981,9 +2968,8 @@ namespace PlantChillers { if (DataGlobals::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."); } @@ -3033,10 +3019,8 @@ 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."); } @@ -3101,10 +3085,8 @@ 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."); } @@ -3169,10 +3151,8 @@ 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."); } @@ -3816,9 +3796,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"); } @@ -3828,8 +3808,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"); } } @@ -4065,16 +4045,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; } @@ -4306,8 +4284,7 @@ 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; @@ -4847,9 +4824,8 @@ namespace PlantChillers { if (DataGlobals::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."); } @@ -4901,10 +4877,8 @@ 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."); } @@ -4970,10 +4944,8 @@ 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."); } @@ -5025,10 +4997,8 @@ 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."); } @@ -5076,10 +5046,8 @@ 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."); } @@ -5723,9 +5691,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"); } @@ -5735,8 +5703,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"); } } @@ -5922,15 +5890,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; } @@ -6501,9 +6467,8 @@ namespace PlantChillers { if (DataGlobals::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."); } @@ -6555,10 +6520,8 @@ 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."); } @@ -6618,10 +6581,8 @@ 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."); } @@ -7124,9 +7085,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 c054f10d125..7b474d1fc00 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -333,10 +333,8 @@ namespace PlantComponentTemperatureSources { if (DataGlobals::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 c1fb3f263a4..0709e6f9b3e 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -185,7 +185,7 @@ namespace PlantCondLoopOperation { using DataEnvironment::OutDryBulbTemp; using DataEnvironment::OutRelHum; using DataEnvironment::OutWetBulbTemp; // Current outdoor relative humidity [%] - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -795,7 +795,7 @@ 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 +924,7 @@ 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 +932,7 @@ 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..."); } } @@ -1446,7 +1440,7 @@ CurrentModuleObject, PlantOpSchemeName); } 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 21875c41a40..e8675691e7f 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -2156,8 +2156,7 @@ 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(ComponentClassName + " named " + this->Name + " - Iteration Limit exceeded calculating demand side loop flow rate continues.", @@ -2173,8 +2172,7 @@ 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(ComponentClassName + " named " + this->Name + " - Solver failed to calculate demand side loop flow rate continues.", @@ -2229,8 +2227,7 @@ 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(ComponentClassName + " named " + this->Name + " - Iteration Limit exceeded calculating demand side loop flow rate continues.", @@ -2246,8 +2243,7 @@ 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(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 1496c0f36d2..41c32a3367b 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -641,9 +641,8 @@ namespace EIRPlantLoopHeatPumps { if (DataGlobals::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,8 @@ 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 +816,8 @@ 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 +893,7 @@ 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 149b4accc1b..b2762a4b8a9 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -488,9 +488,7 @@ 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 @@ -1671,8 +1669,7 @@ 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; } @@ -1941,8 +1938,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); @@ -2279,8 +2275,7 @@ 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/PlantPressureSystem.cc b/src/EnergyPlus/PlantPressureSystem.cc index d3d0bd32e8d..ec2c8498dd5 100644 --- a/src/EnergyPlus/PlantPressureSystem.cc +++ b/src/EnergyPlus/PlantPressureSystem.cc @@ -868,7 +868,7 @@ namespace PlantPressureSystem { using DataPlant::SupplySide; using FluidProperties::GetDensityGlycol; using FluidProperties::GetViscosityGlycol; - using General::RoundSigDigits; + // Return value Real64 ResolvedLoopMassFlowRate; diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index 42c37f0a6f1..e49a10c9091 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include @@ -272,7 +271,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; } } @@ -478,13 +477,12 @@ 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); @@ -632,7 +630,7 @@ namespace PlantUtilities { using DataPlant::DemandSide; using DataPlant::PlantLoop; using DataPlant::SupplySide; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int MixerOutletNode; @@ -658,10 +656,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("Plant Flows (Loop=" + PlantLoop(LoopNum).Name + ") splitter inlet flow not match mixer outlet flow", @@ -676,10 +674,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"); } } @@ -704,10 +702,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("Plant Flows (Loop=" + PlantLoop(LoopNum).Name + ") splitter inlet flow does not match branch outlet flows", @@ -751,7 +749,7 @@ namespace PlantUtilities { using DataPlant::DemandSide; using DataPlant::PlantLoop; using DataPlant::SupplySide; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -820,8 +818,7 @@ 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 { @@ -842,25 +839,19 @@ 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; @@ -879,13 +870,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, "*************************"); @@ -1374,7 +1365,7 @@ namespace PlantUtilities { // Using/Aliasing using namespace DataPlant; - using General::RoundSigDigits; + // Object Data PlantCallingOrderInfoStruct RecordToMoveInPlantCallingOrderInfo; @@ -1760,7 +1751,7 @@ namespace PlantUtilities { // Using/Aliasing using namespace DataGlobals; using BranchInputManager::AuditBranches; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int LoopCtr; @@ -1850,8 +1841,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"); } } @@ -1888,7 +1879,7 @@ namespace PlantUtilities { // Using/Aliasing using namespace DataGlobals; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1957,7 +1948,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 6d7d71a5b87..4e713a1d228 100644 --- a/src/EnergyPlus/PlantValves.cc +++ b/src/EnergyPlus/PlantValves.cc @@ -85,7 +85,7 @@ 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 7c6a3fbcec0..b9590a50e91 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -52,7 +52,6 @@ #include #include #include -#include #include #include @@ -126,7 +125,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 @@ -639,7 +638,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; @@ -665,7 +664,7 @@ namespace PluginManagement { Py_DECREF(pModuleName); if (pyth_module == nullptr) { - EnergyPlus::ShowFatalError(state, "Cannot find 'traceback' module in reportPythonError(), this is weird"); + EnergyPlus::ShowFatalError(state, "Cannot find 'traceback' module in reportPythonError(state, ), this is weird"); return; } @@ -678,7 +677,7 @@ namespace PluginManagement { // traceback.format_exception returns a list, so iterate on that if (!pyth_val || !PyList_Check(pyth_val)) { // NOLINT(hicpp-signed-bitwise) - EnergyPlus::ShowFatalError(state, "In reportPythonError(), traceback.format_exception did not return a list."); + EnergyPlus::ShowFatalError(state, "In reportPythonError(state, ), traceback.format_exception did not return a list."); } unsigned long numVals = PyList_Size(pyth_val); @@ -712,7 +711,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 @@ -1081,7 +1080,7 @@ namespace PluginManagement { } } #else - void PluginManager::addToPythonPath(EnergyPlusData &state, const std::string &EP_UNUSED(path), bool EP_UNUSED(userDefinedPath)) + void PluginManager::addToPythonPath([[maybe_unused]] EnergyPlusData &state, const std::string &EP_UNUSED(path), bool EP_UNUSED(userDefinedPath)) { } #endif @@ -1122,7 +1121,7 @@ namespace PluginManagement { } } #else - int PluginManager::getGlobalVariableHandle(EnergyPlusData &state, const std::string &EP_UNUSED(name), bool const EP_UNUSED(suppress_warning)) + int PluginManager::getGlobalVariableHandle([[maybe_unused]] EnergyPlusData &state, const std::string &EP_UNUSED(name), bool const EP_UNUSED(suppress_warning)) { return -1; } @@ -1264,7 +1263,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) { @@ -1285,14 +1284,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, int EP_UNUSED(handle)) + Real64 PluginManager::getGlobalVariableValue([[maybe_unused]] EnergyPlusData &state, int EP_UNUSED(handle)) { return 0.0; } @@ -1308,13 +1307,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, int EP_UNUSED(handle), Real64 EP_UNUSED(value)) + void PluginManager::setGlobalVariableValue([[maybe_unused]] EnergyPlusData &state, int EP_UNUSED(handle), Real64 EP_UNUSED(value)) { } #endif @@ -1370,7 +1369,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 d201e1736b3..0e24a85fe5d 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -265,15 +265,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; @@ -284,24 +282,20 @@ 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; } @@ -310,15 +304,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; @@ -328,16 +320,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; @@ -352,8 +342,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)); } } @@ -828,8 +817,7 @@ 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("GroundHeatExchanger:Pond=\"" + this->Name + "\", is frozen", diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 9c14b1ed576..2b58ea25cd4 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -195,7 +195,7 @@ namespace PoweredInductionUnits { // Using/Aliasing using DataSizing::TermUnitPIU; - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int PIUNum; // index of powered induction unit being simulated @@ -218,13 +218,11 @@ 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; } @@ -1005,7 +1003,7 @@ namespace PoweredInductionUnits { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1101,9 +1099,8 @@ namespace PoweredInductionUnits { if (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."); } @@ -1146,9 +1143,8 @@ namespace PoweredInductionUnits { if (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."); } @@ -1193,10 +1189,8 @@ namespace PoweredInductionUnits { if (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."); } @@ -1239,9 +1233,8 @@ namespace PoweredInductionUnits { if (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."); } @@ -1291,8 +1284,8 @@ namespace PoweredInductionUnits { if (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."); } @@ -1379,10 +1372,8 @@ 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."); } @@ -1457,10 +1448,8 @@ 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 022aaa31ee6..87bb6ac77b5 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -47,7 +47,6 @@ // C++ Headers #include -#include // ObjexxFCL Headers #include @@ -106,7 +105,7 @@ namespace Psychrometrics { // Use Statements for other routines #ifdef EP_psych_errors - using General::TrimSigDigits; + #endif // Data @@ -334,7 +333,7 @@ namespace Psychrometrics { // na // Using/Aliasing - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -379,11 +378,11 @@ 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 { @@ -404,8 +403,7 @@ namespace Psychrometrics { if (RHValue > 1.01) { if (!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 + ','); @@ -426,8 +424,7 @@ namespace Psychrometrics { } else if (RHValue < -0.05) { if (!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 + ','); @@ -619,7 +616,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( @@ -634,8 +631,7 @@ namespace Psychrometrics { if (W <= -0.0001) { if (!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 + ','); @@ -643,7 +639,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( @@ -714,15 +710,15 @@ namespace Psychrometrics { if (iter > itmax) { if (!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("WetBulb not converged after max iterations(PsyTwbFnTdbWPb)", iPsyErrIndex(iPsyTwbFnTdbWPb3)); @@ -735,7 +731,7 @@ namespace Psychrometrics { #ifdef EP_psych_errors if (FlagError) { - ShowContinueError(state, " Resultant Temperature= " + TrimSigDigits(WBT, 2)); + ShowContinueError(state, format(" Resultant Temperature= {:.2T}", WBT)); } #endif @@ -762,7 +758,7 @@ namespace Psychrometrics { if (V <= -0.01) { if (!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 + ','); @@ -770,7 +766,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( @@ -790,7 +786,7 @@ namespace Psychrometrics { if (W < -0.0001) { if (!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 + ','); @@ -798,7 +794,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("Calculated Humidity Ratio invalid (PsyWFnTdbH)", iPsyErrIndex(iPsyWFnTdbH), W, W, _, "[]", "[]"); @@ -872,7 +868,7 @@ namespace Psychrometrics { } else { ShowContinueErrorTimeStamp(state, " Routine=Unknown,"); } - ShowContinueError(state, " Input Temperature=" + TrimSigDigits(T, 2)); + ShowContinueError(state, format(" Input Temperature={:.2T}", T)); } ShowRecurringWarningErrorAtEnd( "Temperature out of range [-100. to 200.] (PsyPsatFnTemp)", iPsyErrIndex(iPsyPsatFnTemp), T, T, _, "C", "C"); @@ -946,7 +942,7 @@ namespace Psychrometrics { if (TWB > (TDB + 0.01)) { if (ReportErrors && !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 + ','); @@ -954,7 +950,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( @@ -976,7 +972,7 @@ namespace Psychrometrics { if (W < 0.0) { if (ReportErrors && !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 + ','); @@ -984,7 +980,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( @@ -1012,10 +1008,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( @@ -1092,7 +1087,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; } @@ -1145,7 +1140,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) { @@ -1179,8 +1174,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 } @@ -1200,8 +1195,7 @@ namespace Psychrometrics { if (RHValue > 1.01) { if (!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 + ','); @@ -1222,8 +1216,7 @@ namespace Psychrometrics { } else if (RHValue < -0.05) { if (!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 + ','); @@ -1255,8 +1248,7 @@ namespace Psychrometrics { if (RHValue > 1.01) { if (!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 + ','); @@ -1277,8 +1269,7 @@ namespace Psychrometrics { } else if (RHValue < -0.05) { if (!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 + ','); @@ -1310,7 +1301,7 @@ namespace Psychrometrics { { if (!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 + ','); @@ -1318,8 +1309,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("Entered Humidity Ratio invalid (PsyWFnTdpPb)", iPsyErrIndex(iPsyWFnTdpPb), W, W, _, "[]", "[]"); @@ -1338,8 +1328,7 @@ namespace Psychrometrics { if (W <= -0.0001) { if (!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 + ','); @@ -1347,7 +1336,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( @@ -1428,7 +1417,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("Pressure out of range (PsyTsatFnPb)", iPsyErrIndex(iPsyTsatFnPb), Press, Press, _, "Pa", "Pa"); @@ -1500,13 +1489,13 @@ namespace Psychrometrics { if (iter > itmax) { if (!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( @@ -1520,7 +1509,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 329ea26c47e..5f80461276e 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -211,7 +211,7 @@ namespace Pumps { // Using/Aliasing using DataPlant::FlowPumpQuery; using DataPlant::PlantLoop; - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -240,12 +240,10 @@ 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; } @@ -441,8 +439,7 @@ 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; @@ -1295,7 +1292,7 @@ namespace Pumps { using DataPlant::PlantReSizingCompleted; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; - using General::RoundSigDigits; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; @@ -1383,29 +1380,17 @@ 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 { @@ -1744,7 +1729,7 @@ namespace Pumps { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using PlantUtilities::SetComponentFlowRate; using ScheduleManager::GetCurrentScheduleValue; @@ -1923,8 +1908,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."); } @@ -2018,7 +2002,7 @@ namespace Pumps { using DataSizing::PlantSizData; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2127,8 +2111,7 @@ 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); } } @@ -2389,7 +2372,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 3f12fbbd478..327e0c6a87d 100644 --- a/src/EnergyPlus/PurchasedAirManager.cc +++ b/src/EnergyPlus/PurchasedAirManager.cc @@ -226,7 +226,7 @@ namespace PurchasedAirManager { // at the system time step. // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -249,13 +249,11 @@ 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; } @@ -1119,7 +1117,7 @@ namespace PurchasedAirManager { using DataZoneEquipment::ZoneEquipConfig; using DataZoneEquipment::ZoneEquipInputsFilled; using General::FindNumberInList; - using General::RoundSigDigits; + using ZonePlenum::GetReturnPlenumIndex; using ZonePlenum::GetReturnPlenumName; @@ -1295,10 +1293,7 @@ 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."); @@ -1337,10 +1332,7 @@ 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."); @@ -1387,7 +1379,7 @@ namespace PurchasedAirManager { using DataHVACGlobals::CoolingCapacitySizing; using DataHVACGlobals::HeatingAirflowSizing; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; + using Psychrometrics::CPCW; using Psychrometrics::CPHW; using Psychrometrics::PsyCpAirFnW; @@ -1586,10 +1578,8 @@ 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."); } @@ -1747,10 +1737,8 @@ 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."); } @@ -1847,10 +1835,8 @@ 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."); } @@ -1945,10 +1931,8 @@ 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."); } @@ -2008,7 +1992,7 @@ namespace PurchasedAirManager { using DataZoneEnergyDemands::ZoneSysMoistureDemand; using DataZoneEquipment::PurchasedAir_Num; using DataZoneEquipment::ZoneEquipConfig; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2161,10 +2145,8 @@ 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( @@ -2435,10 +2417,8 @@ 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( @@ -2670,9 +2650,7 @@ 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 dae694ccfc9..3dc3f56d8a4 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,7 @@ 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 +4118,7 @@ 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 +4168,7 @@ 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 +4261,7 @@ 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 +4369,8 @@ 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 +4381,7 @@ 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 +4408,11 @@ 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 +5282,7 @@ 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 +5395,11 @@ 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 +5947,14 @@ 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 +5964,7 @@ 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 +6059,7 @@ 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 +6118,7 @@ namespace RefrigeratedCase { if ((NumUnusedRefrigCases > 0) && (!DataGlobals::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 +6150,7 @@ namespace RefrigeratedCase { if ((NumUnusedCompressors > 0) && (!DataGlobals::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 +6181,7 @@ namespace RefrigeratedCase { if ((NumUnusedWalkIns > 0) && (!DataGlobals::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 +6213,7 @@ namespace RefrigeratedCase { if ((NumUnusedCoils > 0) && (!DataGlobals::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 +6245,7 @@ namespace RefrigeratedCase { if ((NumUnusedSecondarys > 0) && (!DataGlobals::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 +6275,7 @@ namespace RefrigeratedCase { if ((NumUnusedCondensers > 0) && (!DataGlobals::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 +6303,7 @@ namespace RefrigeratedCase { if ((NumUnusedGasCoolers > 0) && (!DataGlobals::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. "); @@ -11257,7 +11204,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; @@ -14268,13 +14215,11 @@ 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 aebf6c72f92..a8af2bb2ca7 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,13 @@ 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(timeStepAtPeak)); +} + void ReportCoilSelection::setCoilCoolingCapacity( EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil @@ -1168,6 +1174,8 @@ 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(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(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(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(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(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(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(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(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(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 bfda7675020..59f29d83b61 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(int const timeStepAtPeak); + static std::string getTimeText(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 951db50ead9..0b072b49c87 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -276,7 +276,7 @@ namespace RoomAirModelAirflowNetwork { using DataLoopNode::NumOfNodes; using DataZoneEquipment::ZoneEquipConfig; using DataZoneEquipment::ZoneEquipList; - using General::RoundSigDigits; + using InternalHeatGains::SumInternalLatentGainsByTypes; using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -507,7 +507,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) { @@ -515,7 +515,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 12a5a26bb90..f182d770ddc 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -110,7 +110,7 @@ namespace RoomAirModelManager { // Using/Aliasing using namespace DataGlobals; using namespace DataRoomAirModel; - using General::RoundSigDigits; + // Data // MODULE PARAMETER DEFINITIONS @@ -325,7 +325,7 @@ namespace RoomAirModelManager { using DataSurfaces::SurfaceClass_IntMass; using DataZoneEquipment::EquipConfiguration; using DataZoneEquipment::ZoneEquipConfig; - using General::RoundSigDigits; + using RoomAirModelUserTempPattern::FigureNDheightInZone; using ScheduleManager::GetScheduleIndex; @@ -615,15 +615,13 @@ 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; } @@ -1063,7 +1061,7 @@ namespace RoomAirModelManager { using DataSurfaces::Surface; using DataHeatBalance::People; using DataHeatBalance::TotPeople; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int IOStat; @@ -1186,8 +1184,7 @@ 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)); } } } @@ -1402,7 +1399,7 @@ namespace RoomAirModelManager { using DataHVACGlobals::ZoneHVACTerminalTypes; using DataSurfaces::Surface; using DataSurfaces::SurfaceClass_IntMass; - using General::RoundSigDigits; + using InternalHeatGains::GetInternalGainDeviceIndex; using ScheduleManager::GetScheduleIndex; @@ -1635,7 +1632,7 @@ namespace RoomAirModelManager { 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)); + fmt::to_string(NumAlphas + NumNumbers - 1)); ErrorsFound = true; break; } @@ -1706,7 +1703,7 @@ namespace RoomAirModelManager { 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)); + fmt::to_string(NumAlphas + NumNumbers - 1)); ErrorsFound = true; break; } @@ -1796,7 +1793,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 @@ -1822,7 +1819,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; } } @@ -2089,9 +2086,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 945045dda61..6c677154d42 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -352,7 +352,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; } @@ -839,7 +839,7 @@ namespace RoomAirModelUserTempPattern { using DataSurfaces::SurfaceClass_Floor; using DataSurfaces::SurfaceClass_Wall; using DataVectorTypes::Vector; - using General::RoundSigDigits; + // Return value Real64 FigureNDheightInZone; @@ -920,8 +920,8 @@ namespace RoomAirModelUserTempPattern { if (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; } @@ -931,8 +931,8 @@ namespace RoomAirModelUserTempPattern { if (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 6557fe0d0b9..eb74d58da86 100644 --- a/src/EnergyPlus/RootFinder.cc +++ b/src/EnergyPlus/RootFinder.cc @@ -52,7 +52,6 @@ #include // EnergyPlus Headers -#include #include #include #include @@ -175,8 +174,7 @@ namespace RootFinder { // Use statements for data only modules // Using/Aliasing using namespace DataRootFinder; - using namespace DataGlobals; - using General::TrimSigDigits; + // Data // MODULE PARAMETER DEFINITIONS @@ -244,8 +242,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; @@ -254,10 +252,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; @@ -417,8 +415,7 @@ 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)); } } @@ -759,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."); } } @@ -794,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."); } } @@ -820,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."); } } @@ -1079,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."); } } @@ -1223,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."); } } @@ -1297,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."); } } @@ -1552,9 +1549,8 @@ 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."); } } @@ -1578,9 +1574,8 @@ 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."); } } @@ -1607,9 +1602,8 @@ 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."); } } @@ -1633,9 +1627,8 @@ 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."); } } @@ -1644,8 +1637,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."); } } @@ -1998,10 +1991,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."); } } @@ -2558,7 +2551,7 @@ 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 983095d5d90..18645430150 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -781,7 +781,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)) @@ -879,7 +879,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; } @@ -1828,8 +1828,8 @@ namespace RuntimeLanguageProcessor { // Using/Aliasing using namespace Psychrometrics; using CurveManager::CurveValue; - using General::RoundSigDigits; - using General::TrimSigDigits; + + // Return value ErlValueType ReturnValue; @@ -1998,8 +1998,7 @@ 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 (!DoingSizing && !KickOffSimulation && !EMSManager::FinishProcessingUserInput) { seriousErrorFound = true; } @@ -2046,8 +2045,7 @@ 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 (!DoingSizing && !KickOffSimulation && !EMSManager::FinishProcessingUserInput) { seriousErrorFound = true; @@ -2060,7 +2058,7 @@ namespace RuntimeLanguageProcessor { // throw error, ReturnValue.Type = ValueError; ReturnValue.Error = - "EvaluateExpression: Natural Log of zero or less! ln of value = " + TrimSigDigits(Operand(1).Number, 4); + format("EvaluateExpression: Natural Log of zero or less! ln of value = {:.4T}", Operand(1).Number); if (!DoingSizing && !KickOffSimulation && !EMSManager::FinishProcessingUserInput) { seriousErrorFound = true; } @@ -2244,16 +2242,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) { @@ -2557,9 +2555,7 @@ 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); } } @@ -2577,9 +2573,7 @@ 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); } } @@ -2628,7 +2622,7 @@ namespace RuntimeLanguageProcessor { // Using/Aliasing using CurveManager::GetCurveIndex; using DataGlobals::TimeStepZone; - using General::TrimSigDigits; + // Locals // SUBROUTINE PARAMETER DEFINITIONS: @@ -3122,7 +3116,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; } @@ -3784,7 +3778,7 @@ namespace RuntimeLanguageProcessor { // na // Using/Aliasing - using General::TrimSigDigits; + // Return value std::string String; @@ -3801,7 +3795,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 d1ecb17a4b3..663fc9c012c 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 f71e93c8f23..f3d9fc46f00 100644 --- a/src/EnergyPlus/SZVAVModel.cc +++ b/src/EnergyPlus/SZVAVModel.cc @@ -480,9 +480,7 @@ 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( SZVAVModel.UnitType + " \"" + SZVAVModel.Name + @@ -495,8 +493,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(SZVAVModel.UnitType + " \"" + SZVAVModel.Name + "\" - sensible part-load ratio out of range error continues. Sensible load statistics:", @@ -908,9 +905,7 @@ 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( SZVAVModel.UnitType + " \"" + SZVAVModel.Name + @@ -923,8 +918,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(SZVAVModel.UnitType + " \"" + SZVAVModel.Name + "\" - sensible part-load ratio out of range error continues. Sensible load statistics:", @@ -1328,9 +1322,7 @@ 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( SZVAVModel.UnitType + " \"" + SZVAVModel.Name + @@ -1343,8 +1335,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(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 de0e04ee07e..d5445d198d4 100644 --- a/src/EnergyPlus/ScheduleManager.cc +++ b/src/EnergyPlus/ScheduleManager.cc @@ -233,8 +233,8 @@ namespace ScheduleManager { // Using/Aliasing using General::ProcessDateString; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using DataGlobals::AnyEnergyManagementSystemInModel; using DataStringGlobals::CharComma; using DataStringGlobals::CharSemicolon; @@ -632,8 +632,7 @@ 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; @@ -645,13 +644,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."); } @@ -659,8 +659,7 @@ 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)); } } @@ -763,14 +762,24 @@ 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."); } } @@ -883,7 +892,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; } @@ -1006,31 +1015,28 @@ 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; } @@ -1390,7 +1396,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; @@ -1406,7 +1412,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; @@ -1669,7 +1675,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; } @@ -1711,8 +1717,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; } @@ -1857,19 +1862,16 @@ 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) @@ -1881,7 +1883,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; @@ -1971,7 +1973,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; @@ -2260,8 +2262,7 @@ 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; } @@ -2333,7 +2334,7 @@ namespace ScheduleManager { // na // Using/Aliasing - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2437,9 +2438,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"; @@ -2475,7 +2476,7 @@ namespace ScheduleManager { } for (Hr = 1; Hr <= 24; ++Hr) { for (TS = 1; TS <= 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,{},{},{},{}"); @@ -2821,7 +2822,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) { @@ -4860,7 +4861,7 @@ namespace ScheduleManager { // Using/Aliasing using DataGlobals::DisplayUnusedSchedules; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4900,7 +4901,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; } @@ -4923,7 +4924,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; } @@ -4946,7 +4947,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 5f12edfdd27..1a458000fef 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -586,7 +586,7 @@ namespace SetPointManager { using DataZoneControls::StageZoneLogic; using DataZoneEquipment::GetSystemNodeNumberForZone; using General::FindNumberInList; - using General::RoundSigDigits; + using NodeInputManager::GetNodeNums; using NodeInputManager::GetOnlySingleNode; using ScheduleManager::CheckScheduleValueMinMax; @@ -1079,8 +1079,7 @@ 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) { @@ -1093,9 +1092,7 @@ 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 = ""; @@ -1186,9 +1183,7 @@ 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); @@ -1284,9 +1279,7 @@ 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); @@ -1381,9 +1374,7 @@ 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); @@ -1812,17 +1803,13 @@ 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" @@ -1941,9 +1928,7 @@ 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) ); } { @@ -2040,9 +2025,7 @@ 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) ); } { @@ -2140,15 +2123,12 @@ 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."); } { @@ -2307,9 +2287,7 @@ 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; @@ -2387,9 +2365,7 @@ 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; @@ -2467,9 +2443,7 @@ 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; @@ -2548,9 +2522,7 @@ 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; @@ -2629,9 +2601,7 @@ 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; @@ -2710,9 +2680,7 @@ 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; @@ -2814,9 +2782,7 @@ 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; @@ -2921,9 +2887,7 @@ 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; @@ -3016,7 +2980,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; } @@ -3026,7 +2990,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; } @@ -3036,7 +3000,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; } @@ -3046,7 +3010,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; } @@ -3063,9 +3027,7 @@ 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; @@ -3172,9 +3134,7 @@ 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; @@ -3333,9 +3293,7 @@ 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); @@ -3428,9 +3386,7 @@ 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); @@ -8976,7 +8932,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 dc34dfd814e..48b32904b1c 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -333,7 +333,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,7 @@ 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 +4161,8 @@ namespace SimAirServingZones { } if (PrimaryAirSystem(AirLoopNum).DesignVolFlowRate < SmallAirVolFlow) { - ShowSevereError(state, "SizeAirLoopBranches: AirLoopHVAC " + PrimaryAirSystem(AirLoopNum).Name + " has air flow less than " + - General::RoundSigDigits(DataHVACGlobals::SmallAirVolFlow, 4) + " m3/s."); - ShowContinueError(state, "Primary air system volumetric flow rate = " + - General::RoundSigDigits(PrimaryAirSystem(AirLoopNum).DesignVolFlowRate, 4) + " m3/s."); + ShowSevereError(state, format("SizeAirLoopBranches: AirLoopHVAC {} has air flow less than {:.4R} m3/s.", PrimaryAirSystem(AirLoopNum).Name, DataHVACGlobals::SmallAirVolFlow)); + ShowContinueError(state, format("Primary air system volumetric flow rate = {:.4R} m3/s.", PrimaryAirSystem(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 e91181f320c..a7c4f121c6c 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -51,7 +51,6 @@ extern "C" { } // C++ Headers -#include #include #include @@ -246,7 +245,7 @@ namespace SimulationManager { using EMSManager::CheckIfAnyEMS; using EMSManager::ManageEMS; using ExteriorEnergyUse::ManageExteriorEnergyUse; - using General::TrimSigDigits; + using HVACControllers::DumpAirLoopStatistics; using MixedAir::CheckControllerLists; using NodeInputManager::CheckMarkedNodes; @@ -553,7 +552,7 @@ namespace SimulationManager { if (WarmupFlag) { ++NumOfWarmupDays; - cWarmupDay = TrimSigDigits(NumOfWarmupDays); + cWarmupDay = fmt::to_string(NumOfWarmupDays); DisplayString("Warming up {" + cWarmupDay + '}'); } else if (state.dataGlobal->DayOfSim == 1) { if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { @@ -737,7 +736,7 @@ namespace SimulationManager { using DataHVACGlobals::deviationFromSetPtThresholdClg; using DataHVACGlobals::deviationFromSetPtThresholdHtg; using DataHVACGlobals::LimitNumSysSteps; - using General::RoundSigDigits; + using namespace DataIPShortCuts; // SUBROUTINE PARAMETER DEFINITIONS: @@ -939,7 +938,7 @@ namespace SimulationManager { cNumericFieldNames); NumOfTimeStepInHour = Number(1); if (NumOfTimeStepInHour <= 0 || NumOfTimeStepInHour > 60) { - Alphas(1) = RoundSigDigits(NumOfTimeStepInHour); + Alphas(1) = fmt::to_string(NumOfTimeStepInHour); ShowWarningError(state, CurrentModuleObject + ": Requested number (" + Alphas(1) + ") invalid, Defaulted to 4"); NumOfTimeStepInHour = 4; } else if (mod(60, NumOfTimeStepInHour) != 0) { @@ -949,19 +948,16 @@ namespace SimulationManager { MinInt = NumOfTimeStepInHour - Div60(Num); Which = Num; } - ShowWarningError(state, CurrentModuleObject + ": Requested number (" + RoundSigDigits(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, NumOfTimeStepInHour, Div60(Which))); NumOfTimeStepInHour = Div60(Which); } if (CondFDAlgo && NumOfTimeStepInHour < 20) { - ShowWarningError(state, CurrentModuleObject + ": Requested number (" + RoundSigDigits(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, NumOfTimeStepInHour)); ShowContinueError(state, "..." + CurrentModuleObject + " is set to 20."); NumOfTimeStepInHour = 20; } if (NumOfTimeStepInHour < 4 && inputProcessor->getNumObjectsFound(state, "Zone") > 0) { - ShowWarningError(state, CurrentModuleObject + ": Requested number (" + RoundSigDigits(NumOfTimeStepInHour) + - ") is less than the suggested minimum of 4."); + ShowWarningError(state, format("{}: Requested number ({}) is less than the suggested minimum of 4.", CurrentModuleObject, 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) { @@ -1004,8 +1000,7 @@ namespace SimulationManager { MinInt = 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 = TimeStepZone; @@ -1290,14 +1285,12 @@ 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) { @@ -1377,10 +1370,10 @@ namespace SimulationManager { static constexpr auto Format_733(" System Convergence Limits, {}, {}, {}, {}\n"); print(state.files.eio, Format_733, - RoundSigDigits(MinInt), - RoundSigDigits(MaxIter), - RoundSigDigits(MinPlantSubIterations), - RoundSigDigits(MaxPlantSubIterations)); + MinInt, + MaxIter, + MinPlantSubIterations, + MaxPlantSubIterations); if (DoZoneSizing) { Alphas(1) = "Yes"; @@ -1440,21 +1433,21 @@ namespace SimulationManager { Alphas(2) = "ScriptF"; } Alphas(3) = overrideModeValue; - Alphas(4) = General::RoundSigDigits(DataGlobals::NumOfTimeStepInHour); + Alphas(4) = fmt::to_string(DataGlobals::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, " @@ -1508,12 +1501,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(DataGlobals::NumOfTimeStepInHour)); - UtilityRoutines::appendPerfLog(state, "Minimum Number of Warmup Days", General::RoundSigDigits(DataHeatBalance::MinNumberOfWarmupDays)); + UtilityRoutines::appendPerfLog(state, "Number of Timesteps per Hour", fmt::to_string(DataGlobals::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) @@ -1902,7 +1895,7 @@ namespace SimulationManager { using DataBranchNodeConnections::NumOfNodeConnections; using DataHeatBalance::CondFDRelaxFactor; using DataHeatBalance::CondFDRelaxFactorInput; - using General::RoundSigDigits; + using namespace DataSystemVariables; // , ONLY: MaxNumberOfThreads,NumberIntRadThreads,iEnvSetThreads using DataSurfaces::MaxVerticesPerSurface; @@ -2011,17 +2004,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, @@ -2094,7 +2087,7 @@ namespace SimulationManager { using DataEnvironment::EndMonthFlag; using DataEnvironment::EnvironmentName; using ExteriorEnergyUse::ManageExteriorEnergyUse; - using General::TrimSigDigits; + using PlantPipingSystemsManager::CheckIfAnyBasements; using PlantPipingSystemsManager::CheckIfAnySlabs; using PlantPipingSystemsManager::SimulateGroundDomains; @@ -2809,9 +2802,9 @@ namespace SimulationManager { ShowMessage(state, "No node connection errors were found."); } else { if (NumNodeConnectionErrors > 1) { - ShowMessage(state, "There were " + std::to_string(NumNodeConnectionErrors) + " node connection errors noted."); + ShowMessage(state, format("There were {} node connection errors noted.", NumNodeConnectionErrors)); } else { - ShowMessage(state, "There was " + std::to_string(NumNodeConnectionErrors) + " node connection error noted."); + ShowMessage(state, format("There was {} node connection error noted.", NumNodeConnectionErrors)); } } @@ -2839,7 +2832,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 47c3ea0e0fc..993fdd4ad38 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -241,7 +241,7 @@ 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 @@ -264,13 +264,11 @@ 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; } @@ -2460,9 +2458,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; @@ -2578,9 +2576,8 @@ 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."); } @@ -2627,10 +2624,8 @@ 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."); } @@ -2689,9 +2684,8 @@ 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."); } @@ -2749,9 +2743,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."); } @@ -2845,10 +2838,8 @@ 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."); } @@ -2878,10 +2869,8 @@ 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."); } @@ -2913,10 +2902,8 @@ 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."); } @@ -2926,10 +2913,8 @@ 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."); } @@ -3116,10 +3101,8 @@ 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."); } @@ -3199,10 +3182,8 @@ 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."); } @@ -3239,10 +3220,8 @@ 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); @@ -5902,9 +5881,7 @@ 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 6e52e5385f4..bda8cd543fd 100644 --- a/src/EnergyPlus/SizingAnalysisObjects.cc +++ b/src/EnergyPlus/SizingAnalysisObjects.cc @@ -451,8 +451,8 @@ 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; @@ -554,7 +554,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 2cc03051e60..af866332aa7 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -174,8 +174,8 @@ 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; @@ -354,11 +354,10 @@ namespace SizingManager { if (state.dataGlobal->DayOfSim == 1) { if (!isPulseZoneSizing) { DisplayString("Performing Zone Sizing Simulation"); - DisplayString("...for Sizing Period: #" + RoundSigDigits(NumSizingPeriodsPerformed) + ' ' + EnvironmentName); } else { DisplayString("Performing Zone Sizing Simulation for Load Component Report"); - DisplayString("...for Sizing Period: #" + RoundSigDigits(NumSizingPeriodsPerformed) + ' ' + EnvironmentName); } + DisplayString(fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, EnvironmentName)); } UpdateZoneSizing(state, DataGlobalConstants::CallIndicator::BeginDay); UpdateFacilitySizing(state, DataGlobalConstants::CallIndicator::BeginDay); @@ -399,7 +398,7 @@ namespace SizingManager { if (!WarmupFlag) { TimeStepInDay = (HourOfDay - 1) * NumOfTimeStepInHour + TimeStep; if (HourOfDay == 1 && 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; @@ -541,7 +540,7 @@ namespace SizingManager { } else { // (.NOT.WarmupFlag) if (state.dataGlobal->DayOfSim == 1) { DisplayString("Calculating System sizing"); - DisplayString("...for Sizing Period: #" + RoundSigDigits(NumSizingPeriodsPerformed) + ' ' + EnvironmentName); + DisplayString(fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, EnvironmentName)); } UpdateSysSizing(state, DataGlobalConstants::CallIndicator::BeginDay); } @@ -2068,7 +2067,7 @@ 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 @@ -2187,7 +2186,7 @@ namespace SizingManager { using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMaxValue; using namespace DataIPShortCuts; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2474,7 +2473,7 @@ namespace SizingManager { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; // Number of Alphas for each GetObjectItem call @@ -2523,8 +2522,7 @@ namespace SizingManager { } if (NumTimeStepsInAvg < NumOfTimeStepInHour) { - ShowWarningError(state, cCurrentModuleObject + ": note " + cNumericFieldNames(3) + " entered value=[" + RoundSigDigits(NumTimeStepsInAvg) + - "] is less than 1 hour (i.e., " + RoundSigDigits(NumOfTimeStepInHour) + " timesteps)."); + ShowWarningError(state, format("{}: note {} entered value=[{}] is less than 1 hour (i.e., {} timesteps).", cCurrentModuleObject, cNumericFieldNames(3), NumTimeStepsInAvg, NumOfTimeStepInHour)); } cCurrentModuleObject = "OutputControl:Sizing:Style"; @@ -2584,7 +2582,7 @@ namespace SizingManager { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ZoneSizIndex; // loop index @@ -2760,8 +2758,7 @@ 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); @@ -2810,8 +2807,7 @@ 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); @@ -2840,7 +2836,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 { @@ -2854,7 +2850,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 { @@ -2893,8 +2889,7 @@ 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); @@ -2906,8 +2901,7 @@ 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); @@ -2924,8 +2918,7 @@ 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); @@ -2945,8 +2938,7 @@ 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); @@ -2961,8 +2953,7 @@ 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); @@ -2970,8 +2961,7 @@ 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); @@ -2989,8 +2979,7 @@ 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); @@ -3011,8 +3000,7 @@ 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); @@ -3034,8 +3022,7 @@ 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); @@ -3056,8 +3043,7 @@ 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); @@ -3271,8 +3257,8 @@ namespace SizingManager { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + + // Sizing:System; int const iNameAlphaNum = 1; // A1, \field AirLoop Name @@ -3448,8 +3434,7 @@ 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); @@ -3468,8 +3453,7 @@ 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); @@ -3511,8 +3495,7 @@ 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); @@ -3536,8 +3519,7 @@ 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); @@ -3555,8 +3537,7 @@ 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); @@ -3652,8 +3633,7 @@ 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")) { @@ -3663,8 +3643,7 @@ 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); @@ -3684,8 +3663,7 @@ 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 { @@ -3711,8 +3689,7 @@ 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")) { @@ -3722,8 +3699,7 @@ 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); @@ -3743,8 +3719,7 @@ 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 { @@ -4024,7 +3999,7 @@ namespace SizingManager { // Using/Aliasing using DataStringGlobals::VerString; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4099,7 +4074,7 @@ namespace SizingManager { int const &TimeStepIndex // time step of the peak ) { - using General::RoundSigDigits; + if (ReportSysSizingMyOneTimeFlag) { print(state.files.eio, @@ -4156,8 +4131,8 @@ 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 @@ -4284,8 +4259,7 @@ 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 { @@ -4301,8 +4275,7 @@ 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) { @@ -4327,8 +4300,7 @@ 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) { @@ -4354,8 +4326,7 @@ 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) { @@ -4391,8 +4362,7 @@ 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 { @@ -4408,8 +4378,7 @@ 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) { @@ -4434,8 +4403,7 @@ 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) { @@ -4460,8 +4428,7 @@ 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) { @@ -4496,8 +4463,7 @@ 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 { @@ -4513,8 +4479,7 @@ 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) { @@ -4540,8 +4505,7 @@ 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) { @@ -4567,8 +4531,7 @@ 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) { @@ -4604,8 +4567,7 @@ 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 { @@ -4621,8 +4583,7 @@ 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) { @@ -4644,8 +4605,7 @@ 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 { @@ -4670,8 +4630,7 @@ 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 { @@ -4687,8 +4646,7 @@ 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) { @@ -4710,8 +4668,7 @@ 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 { @@ -4753,8 +4710,8 @@ 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 f71201135d6..f0e0cb9af60 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -321,8 +321,7 @@ 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 +417,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 +464,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 +548,7 @@ 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 a63f4afba04..b86a7605bb0 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -55,7 +55,6 @@ #include #include #include -#include // EnergyPlus Headers #include @@ -373,7 +372,7 @@ namespace SolarShading { // This subroutine gets the Shadowing Calculation object. // Using/Aliasing - using General::RoundSigDigits; + using namespace DataIPShortCuts; using DataSystemVariables::DetailedSkyDiffuseAlgorithm; using DataSystemVariables::DetailedSolarTimestepIntegration; @@ -427,7 +426,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) { @@ -762,7 +761,7 @@ namespace SolarShading { // METHODOLOGY EMPLOYED: // Allocation is dependent on the user input file. - using General::RoundSigDigits; + int SurfLoop; int I; @@ -1192,7 +1191,7 @@ 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", @@ -1200,7 +1199,7 @@ 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", @@ -1208,7 +1207,7 @@ 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 +2255,7 @@ 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,7 @@ 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 (!EnergyPlus::DataGlobals::DisplayExtraWarnings) break; @@ -2901,7 +2899,7 @@ namespace SolarShading { // REFERENCES: // BLAST/IBLAST code, original author George Walton - using General::RoundSigDigits; + using namespace DataWindowEquivalentLayer; Real64 AreaSum; // Intermediate calculation value @@ -2933,7 +2931,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 +3209,14 @@ 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 +3274,12 @@ 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 +3320,10 @@ 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 +4344,7 @@ 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,7 @@ namespace SolarShading { state.dataSolarShading->OverlapStatus = state.dataSolarShading->TooManyFigures; if (!state.dataSolarShading->TooManyFiguresMessage && !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 +4448,7 @@ namespace SolarShading { state.dataSolarShading->OverlapStatus = state.dataSolarShading->TooManyVertices; if (!state.dataSolarShading->TooManyVerticesMessage && !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 +4463,7 @@ namespace SolarShading { state.dataSolarShading->OverlapStatus = state.dataSolarShading->TooManyFigures; if (!state.dataSolarShading->TooManyFiguresMessage && !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; } @@ -4811,7 +4806,7 @@ 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 @@ -5198,16 +5193,14 @@ 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; @@ -10984,7 +10977,7 @@ 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"}); @@ -11023,7 +11016,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) { @@ -11036,7 +11029,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, ""); } @@ -11044,7 +11037,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;"); } @@ -11060,10 +11053,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; @@ -11076,14 +11069,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;"); } @@ -11099,10 +11092,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; @@ -11115,7 +11108,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 f6e49e7d085..534627bcc2f 100644 --- a/src/EnergyPlus/SplitterComponent.cc +++ b/src/EnergyPlus/SplitterComponent.cc @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -93,9 +92,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 @@ -114,13 +110,11 @@ 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; } @@ -160,7 +154,6 @@ namespace SplitterComponent { // Uses the status flags to trigger events. // Using/Aliasing - using General::TrimSigDigits; using NodeInputManager::GetOnlySingleNode; // SUBROUTINE PARAMETER DEFINITIONS: @@ -261,7 +254,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) { @@ -269,8 +262,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 8a7a2770a4d..63d9c672ca3 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,20 @@ 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; @@ -601,7 +600,7 @@ 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); @@ -882,7 +881,7 @@ namespace StandardRatings { using DataHVACGlobals::CoilDX_HeatingEmpirical; using DataHVACGlobals::CoilDX_MultiSpeedCooling; using DataHVACGlobals::CoilDX_MultiSpeedHeating; - using General::RoundSigDigits; + // Argument array dimensioning RatedTotalCapacity.dim(ns); @@ -1184,7 +1183,7 @@ namespace StandardRatings { using CurveManager::CurveValue; using CurveManager::GetCurveMinMaxValues; using CurveManager::GetCurveName; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1310,37 +1309,31 @@ 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."); @@ -2403,7 +2396,7 @@ namespace StandardRatings { // na // Using/Aliasing - using General::RoundSigDigits; + using namespace OutputReportPredefined; using DataHVACGlobals::CoilDX_CoolingSingleSpeed; using DataHVACGlobals::CoilDX_HeatingEmpirical; @@ -2527,7 +2520,7 @@ namespace StandardRatings { // Room Unitary Air Conditioners // Using/Aliasing - using General::RoundSigDigits; + using namespace OutputReportPredefined; using DataHVACGlobals::CoilDX_CoolingSingleSpeed; @@ -2568,8 +2561,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, @@ -2586,10 +2579,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 e060a0c4413..99d58d9fc35 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 @@ -121,10 +118,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, @@ -148,7 +141,7 @@ namespace SteamBaseboardRadiator { // Using/Aliasing using DataZoneEnergyDemands::CurDeadBandOrSetback; using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::TrimSigDigits; + using PlantUtilities::SetComponentFlowRate; using ScheduleManager::GetCurrentScheduleValue; @@ -174,13 +167,11 @@ 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; } @@ -231,7 +222,7 @@ 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."); } } @@ -281,8 +272,8 @@ 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; @@ -380,8 +371,7 @@ 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 { @@ -397,8 +387,7 @@ 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); @@ -418,8 +407,7 @@ 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 { @@ -441,13 +429,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; } @@ -464,12 +452,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; } @@ -488,13 +476,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; @@ -508,7 +496,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; } @@ -549,13 +537,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) { @@ -880,7 +868,7 @@ namespace SteamBaseboardRadiator { // USE BranchInputManager, ONLY: MyPlantSizingIndex using DataHeatBalance::Zone; using DataHVACGlobals::HeatingCapacitySizing; - using General::RoundSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1024,10 +1012,8 @@ 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."); } @@ -1280,7 +1266,7 @@ 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) @@ -1308,16 +1294,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"); @@ -1445,7 +1431,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: @@ -1462,19 +1448,14 @@ 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 (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 6afd9464b2f..52305268c6f 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -130,9 +129,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 @@ -156,13 +152,11 @@ 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; } @@ -1537,9 +1531,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; @@ -1560,12 +1551,10 @@ 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? } @@ -2169,17 +2158,13 @@ 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 8c059f20889..aee65171af0 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -275,7 +275,7 @@ namespace SurfaceGeometry { using namespace DataVectorTypes; using namespace OutputReportPredefined; - using General::RoundSigDigits; + using namespace DataReportingFlags; @@ -615,7 +615,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]"; } @@ -623,7 +623,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 = "**"; @@ -917,8 +917,8 @@ namespace SurfaceGeometry { // Surface%Vertex(1:) using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using namespace Vectors; using ScheduleManager::GetScheduleMaxValue; using ScheduleManager::GetScheduleMinValue; @@ -1584,9 +1584,7 @@ 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."); @@ -1621,10 +1619,8 @@ 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, @@ -1647,10 +1643,8 @@ 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. if ((Surface(SurfNum).Class == SurfaceClass_Wall && Surface(Found).Class != SurfaceClass_Wall) || @@ -1684,12 +1678,8 @@ namespace SurfaceGeometry { if (std::abs(Surface(SurfNum).SinTilt) > 0.5 || 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)); } @@ -1933,9 +1923,7 @@ 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)); } } } @@ -1950,13 +1938,11 @@ 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)); } } @@ -2143,8 +2129,7 @@ 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;"); } } @@ -2152,41 +2137,35 @@ 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; @@ -2255,27 +2234,20 @@ 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 && !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 (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) ); } } } @@ -2595,7 +2567,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; using namespace DataReportingFlags; - using General::TrimSigDigits; + using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMaxValue; @@ -2635,8 +2607,7 @@ 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; } @@ -2707,12 +2678,10 @@ 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; } @@ -2721,9 +2690,8 @@ namespace SurfaceGeometry { 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."); + 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); @@ -2757,7 +2725,7 @@ 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"}); @@ -2790,8 +2758,7 @@ 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; } @@ -2835,8 +2802,7 @@ 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; } @@ -2975,8 +2941,8 @@ 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"}); @@ -3020,14 +2986,12 @@ 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; } } @@ -3125,7 +3089,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; } @@ -3313,12 +3277,10 @@ 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; } @@ -3327,26 +3289,23 @@ namespace SurfaceGeometry { 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."); + 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; } @@ -3355,8 +3314,7 @@ namespace SurfaceGeometry { // Check wall height for the CFactor walls 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."); } } @@ -3364,13 +3322,11 @@ 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."); } } @@ -3388,11 +3344,10 @@ 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; } } @@ -3428,8 +3383,8 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + + // SUBROUTINE PARAMETER DEFINITIONS: static Array1D_string const cModuleObjects(10, @@ -3542,8 +3497,7 @@ 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; } @@ -3633,7 +3587,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; } @@ -3671,30 +3625,28 @@ 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."); } } @@ -3982,8 +3934,8 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4004,14 +3956,12 @@ 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; @@ -4035,8 +3985,7 @@ 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; } @@ -4184,12 +4133,10 @@ 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; } @@ -4198,9 +4145,8 @@ namespace SurfaceGeometry { 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."); + 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); @@ -4211,8 +4157,7 @@ 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; } @@ -4298,8 +4243,8 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -4390,8 +4335,7 @@ 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; } @@ -4535,8 +4479,7 @@ 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; } @@ -4545,8 +4488,7 @@ 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; } @@ -4604,8 +4546,8 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ConstrNumSh; // Construction number with Shade @@ -4752,12 +4694,9 @@ 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 @@ -4767,14 +4706,10 @@ 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; } } @@ -4826,8 +4761,7 @@ 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 @@ -4868,8 +4802,8 @@ 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: @@ -5193,7 +5127,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; + using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleMaxValue; @@ -5216,8 +5150,7 @@ 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; } @@ -5318,12 +5251,10 @@ 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; } @@ -5371,8 +5302,8 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using namespace DataReportingFlags; using namespace Vectors; @@ -5500,8 +5431,7 @@ 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; } @@ -5570,8 +5500,7 @@ 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; } @@ -5658,8 +5587,7 @@ 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; } @@ -5961,7 +5889,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -6112,7 +6040,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -6137,8 +6065,7 @@ 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; } @@ -6310,8 +6237,7 @@ 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); @@ -6326,8 +6252,7 @@ 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; @@ -6375,8 +6300,8 @@ namespace SurfaceGeometry { { using namespace DataIPShortCuts; using DataSurfaces::Surface; - using General::RoundSigDigits; - using General::TrimSigDigits; + + int IOStatus; // Used in GetObjectItem int NumAlphas; @@ -6432,8 +6357,7 @@ 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; } @@ -6478,8 +6402,7 @@ 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++) { @@ -6819,7 +6742,7 @@ namespace SurfaceGeometry { using DataHeatBalance::LowHConvLimit; using DataHeatBalSurface::MaxSurfaceTempLimit; using DataSurfaces::Surface; - using General::RoundSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CountHTAlgoObjectsSingleSurf; @@ -7252,25 +7175,20 @@ 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) { @@ -7413,7 +7331,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace Vectors; - using General::RoundSigDigits; + using namespace DataErrorTracking; // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7551,26 +7469,27 @@ namespace SurfaceGeometry { if (DistanceCheck < 0.01) { if (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) + + 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 (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 (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? @@ -7585,26 +7504,26 @@ namespace SurfaceGeometry { if (DistanceCheck < 0.01) { if (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) + ')'); + 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 (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 (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? @@ -7613,7 +7532,7 @@ namespace SurfaceGeometry { } else { if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides > 3) { if (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; @@ -7624,8 +7543,7 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.redimension(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); } else { if (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? @@ -7658,27 +7576,31 @@ 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); + 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 + "\"."); + 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); + 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 + + "], 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); + 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 + "\"."); + 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); + 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).Name + "\", in Zone=\"" + + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName + "\"."); } state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Azimuth = SurfWorldAz; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Tilt = SurfTilt; @@ -7752,7 +7674,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace Vectors; - using General::RoundSigDigits; + // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7804,7 +7726,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."); } @@ -8573,7 +8495,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -8621,8 +8543,7 @@ 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; } @@ -8632,25 +8553,21 @@ 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; } } @@ -8660,25 +8577,21 @@ 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; } } @@ -8732,11 +8645,8 @@ 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)); } } } @@ -9400,8 +9310,7 @@ 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; @@ -9542,7 +9451,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; // Locals @@ -9634,14 +9543,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"; } @@ -9659,7 +9568,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, @@ -9874,8 +9783,8 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace DataIPShortCuts; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using ScheduleManager::GetScheduleIndex; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -9959,9 +9868,7 @@ 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; @@ -9972,9 +9879,7 @@ 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; } } @@ -9994,9 +9899,7 @@ 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; @@ -10036,7 +9939,7 @@ namespace SurfaceGeometry { // Using/Aliasing using namespace Vectors; - using General::RoundSigDigits; + // SUBROUTINE PARAMETER DEFINITIONS: @@ -10189,10 +10092,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)); } } } @@ -10216,9 +10117,7 @@ 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)); } } } @@ -10234,7 +10133,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.; @@ -10290,8 +10189,7 @@ 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)); } } } @@ -10840,7 +10738,7 @@ 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: "); @@ -10917,11 +10815,9 @@ 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. } @@ -11077,9 +10973,7 @@ 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); @@ -11093,8 +10987,7 @@ 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 @@ -11610,7 +11503,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 @@ -11788,7 +11681,7 @@ namespace SurfaceGeometry { // the glazing systems. // Using/Aliasing - using General::RoundSigDigits; + using namespace Vectors; // Locals @@ -11858,10 +11751,8 @@ namespace SurfaceGeometry { if (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 { @@ -11946,7 +11837,7 @@ namespace SurfaceGeometry { // specific warnings or errors issued. // Using/Aliasing - using General::RoundSigDigits; + using namespace Vectors; // Locals @@ -12101,10 +11992,9 @@ namespace SurfaceGeometry { 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); + 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; } @@ -12486,7 +12376,7 @@ 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 @@ -12590,11 +12480,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; } @@ -12610,10 +12500,9 @@ 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."); } } @@ -12815,7 +12704,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; @@ -12938,8 +12827,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;"); } } @@ -13026,7 +12914,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 @@ -13183,16 +13071,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; @@ -13208,8 +13092,7 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides = NSides - M; } else { // too many if (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; @@ -13238,8 +13121,7 @@ namespace SurfaceGeometry { } OldVertex.deallocate(); if (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 b196ad216bf..80badb9ad80 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -186,7 +186,7 @@ namespace SurfaceGroundHeatExchanger { using DataEnvironment::GroundTemp_SurfaceObjInput; using FluidProperties::CheckFluidPropertyName; using FluidProperties::FindGlycol; - using General::RoundSigDigits; + using NodeInputManager::GetOnlySingleNode; using namespace DataLoopNode; @@ -264,13 +264,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; @@ -280,13 +280,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; @@ -390,7 +390,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; } @@ -589,7 +589,7 @@ 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 @@ -672,8 +672,7 @@ 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("CalcSurfaceGroundHeatExchanger=\"" + this->Name + "\", Did not converge (part 1)", @@ -733,7 +732,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, @@ -767,8 +766,7 @@ 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("CalcSurfaceGroundHeatExchanger=\"" + this->Name + "\", Did not converge (part 2)", @@ -786,8 +784,7 @@ 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("CalcSurfaceGroundHeatExchanger=\"" + this->Name + "\", Did not converge (part 3)", @@ -1054,7 +1051,7 @@ namespace SurfaceGroundHeatExchanger { // Using/Aliasing using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + // Return value Real64 CalcHXEffectTerm; @@ -1123,8 +1120,7 @@ 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("GroundHeatExchanger:Surface=\"" + this->Name + "\", water is frozen", diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index 87139f6b536..e9dfae25340 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -1715,7 +1715,7 @@ namespace SystemAvailabilityManager { // System Availability Manager algorithm. // Using/Aliasing - using General::TrimSigDigits; + { auto const SELECT_CASE_var(SysAvailType); @@ -1830,7 +1830,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."); } @@ -3753,7 +3753,7 @@ namespace SystemAvailabilityManager { using NodeInputManager::GetOnlySingleNode; using NodeInputManager::MarkNode; using namespace DataLoopNode; - using General::TrimSigDigits; + using namespace DataIPShortCuts; using CurveManager::CurveValue; using CurveManager::GetCurveIndex; @@ -3842,13 +3842,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) { @@ -3876,7 +3876,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; } } @@ -3887,8 +3887,7 @@ 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; } } @@ -3897,8 +3896,7 @@ 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; } } @@ -3906,8 +3904,7 @@ 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; } @@ -3917,8 +3914,7 @@ 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; } } @@ -3927,8 +3923,7 @@ 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; } } @@ -3936,8 +3931,7 @@ 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; } @@ -3947,8 +3941,7 @@ 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; } } @@ -3957,8 +3950,7 @@ 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; } } @@ -3966,8 +3958,7 @@ 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; } @@ -3982,7 +3973,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; } @@ -4007,7 +3998,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); @@ -4016,7 +4007,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 @@ -4041,14 +4032,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; } } @@ -4068,14 +4059,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; } } @@ -4929,7 +4920,7 @@ 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 f009c9db6f1..08c316d0a0b 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -5264,12 +5264,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 8767ce87923..2bd19586a14 100644 --- a/src/EnergyPlus/ThermalChimney.cc +++ b/src/EnergyPlus/ThermalChimney.cc @@ -152,7 +152,7 @@ namespace ThermalChimney { // stores it in the ThermalChimney data structure. // Using/Aliasing - using General::RoundSigDigits; + using ScheduleManager::GetScheduleIndex; using namespace DataIPShortCuts; @@ -227,22 +227,19 @@ 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; } @@ -276,21 +273,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; } @@ -300,9 +309,7 @@ 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 33c3a5de9e4..b52c1b4dc5b 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -1619,7 +1619,7 @@ 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 @@ -1710,8 +1710,7 @@ 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; } } @@ -1978,7 +1977,7 @@ namespace ThermalComfort { using DataEnvironment::EnvironmentName; using DataEnvironment::EnvironmentStartEnd; using DataEnvironment::RunPeriodEnvironment; - using General::RoundSigDigits; + using OutputReportTabular::isInQuadrilateral; using namespace OutputReportPredefined; @@ -2100,7 +2099,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); @@ -2110,8 +2109,7 @@ namespace ThermalComfort { for (iZone = 1; iZone <= 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 06f0cdec86f..11cd7ae61e1 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,11 @@ 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 +237,8 @@ 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 +284,7 @@ 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 +321,7 @@ 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 +527,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; @@ -852,7 +848,7 @@ namespace TranspiredCollector { using DataHVACGlobals::TimeStepSys; using DataSurfaces::Surface; using DataSurfaces::SurfaceData; - using General::RoundSigDigits; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -969,7 +965,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 a7c0d326072..70f389d4433 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -116,7 +116,7 @@ namespace UFADManager { using DataHVACGlobals::ShortenTimeStepSysRoomAir; using DataHVACGlobals::SysTimeElapsed; using namespace DataUCSDSharedData; - using General::RoundSigDigits; + // Data // MODULE VARIABLE DECLARATIONS: @@ -686,8 +686,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 59bc5f1bcf2..f02d26c3f81 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -156,7 +156,7 @@ 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 @@ -177,13 +177,11 @@ 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; } @@ -242,7 +240,7 @@ namespace UnitHeater { using Fans::GetFanOutletNode; using Fans::GetFanType; using Fans::GetFanVolFlow; - using General::TrimSigDigits; + using NodeInputManager::GetOnlySingleNode; using SteamCoils::GetCoilSteamInletNode; using SteamCoils::GetSteamCoilIndex; @@ -377,9 +375,7 @@ 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) { @@ -403,9 +399,7 @@ 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) { @@ -925,7 +919,7 @@ namespace UnitHeater { using DataHVACGlobals::HeatingAirflowSizing; using DataHVACGlobals::HeatingCapacitySizing; using DataPlant::PlantLoop; - using General::RoundSigDigits; + using PlantUtilities::MyPlantSizingIndex; using Psychrometrics::CPHW; using SteamCoils::GetCoilSteamInletNode; @@ -1198,10 +1192,8 @@ 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."); } @@ -1310,10 +1302,8 @@ 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 9522a97d719..5edefd05606 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -162,7 +162,7 @@ namespace UnitVentilator { // Using/Aliasing using DataSizing::ZoneEqUnitVent; - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int UnitVentNum; // index of unit ventilator being simulated @@ -183,13 +183,11 @@ 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; } @@ -258,7 +256,7 @@ namespace UnitVentilator { using DataSizing::AutoSize; using DataSizing::ZoneHVACSizing; using DataZoneEquipment::ZoneEquipConfig; - using General::TrimSigDigits; + using SingleDuct::GetATMixer; // SUBROUTINE PARAMETER DEFINITIONS: @@ -480,10 +478,7 @@ 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; @@ -520,9 +515,7 @@ 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) { @@ -1559,8 +1552,8 @@ 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; @@ -1992,10 +1985,8 @@ 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."); } @@ -2046,10 +2037,8 @@ 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."); } @@ -2178,10 +2167,8 @@ 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."); } @@ -2296,10 +2283,8 @@ 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."); } @@ -2417,8 +2402,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."); @@ -2447,10 +2432,8 @@ 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 e9cb22b5c8f..8b9270a1974 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,7 @@ 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 +535,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, format("...Fan volumetric flow rate = {:.5R} m3/s.", this->m_ActualFanVolFlowRate)); ShowContinueError(state, - "...Unitary system volumetric flow rate = " + General::RoundSigDigits(this->m_MaxHeatAirVolFlow, 5) + " m3/s."); + format("...Unitary system volumetric flow rate = {:.5R} m3/s.", this->m_MaxHeatAirVolFlow)); } } } @@ -2239,8 +2236,7 @@ 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 +2733,7 @@ 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 +5517,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 +5858,7 @@ 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 +5878,7 @@ 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 +5905,7 @@ 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 +5931,7 @@ 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 +5979,7 @@ 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 +5997,7 @@ 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 +6023,7 @@ 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 +6048,7 @@ 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 +6095,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 +6114,7 @@ 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 +6140,7 @@ 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 +6166,7 @@ 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 +6192,7 @@ 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 +6217,7 @@ 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 +6573,7 @@ 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 +6581,7 @@ 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 +6734,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 +8882,7 @@ 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(this->UnitType + " \"" + this->Name + "\" - Iteration limit exceeded in calculating sensible part-load ratio error " @@ -8926,8 +8895,7 @@ 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( this->UnitType + " \"" + this->Name + @@ -8940,8 +8908,7 @@ 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( this->UnitType + " \"" + this->Name + @@ -9312,9 +9279,7 @@ 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( this->UnitType + " \"" + this->Name + @@ -9327,8 +9292,7 @@ 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(this->UnitType + " \"" + this->Name + "\" - Latent part-load ratio out of range error continues. Latent load statistics:", @@ -9340,8 +9304,7 @@ 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(this->UnitType + " \"" + this->Name + "\" - Latent part-load ratio out of range error continues. Latent load statistics:", @@ -11737,9 +11700,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 +11722,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 +11744,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 +12116,8 @@ 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 +12140,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 +12162,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 +12378,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( @@ -12436,7 +12397,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( @@ -12454,8 +12415,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( @@ -12477,7 +12438,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(this->UnitType + " \"" + this->Name + @@ -13097,8 +13058,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(this->UnitType + " \"" + this->Name + @@ -13116,7 +13077,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( @@ -13472,8 +13433,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( @@ -13491,7 +13452,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( diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index c3b0974d0a4..729a7021710 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,7 @@ 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)); } } @@ -244,13 +241,11 @@ 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; } @@ -334,13 +329,11 @@ 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; } @@ -430,13 +423,11 @@ 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 9d9860ad478..38ac70a6b18 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 (DataGlobals::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,13 @@ namespace UtilityRoutines { // Calls AbortEnergyPlus using namespace DataErrorTracking; - using General::RoundSigDigits; + ShowErrorMessage(state, " ** Fatal ** " + ErrorMessage, OutUnit1, OutUnit2); DisplayString("**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); @@ -1691,7 +1691,7 @@ namespace UtilityRoutines { // Using/Aliasing using namespace DataErrorTracking; - using General::RoundSigDigits; + using General::strip_trailing_zeros; static std::string const StatMessageStart(" ** ~~~ ** "); @@ -1723,9 +1723,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); @@ -1744,19 +1744,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 df7ed366c7d..8613037bfd5 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -107,7 +107,7 @@ namespace VariableSpeedCoils { using DataPlant::TypeOf_CoilVSWAHPHeatingEquationFit; using DXCoils::AdjustCBF; using DXCoils::CalcCBF; - using General::RoundSigDigits; + static std::string const BlankString; @@ -139,7 +139,7 @@ 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 @@ -162,12 +162,10 @@ 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)); } } @@ -264,7 +262,7 @@ namespace VariableSpeedCoils { using CurveManager::CurveValue; using CurveManager::GetCurveIndex; using CurveManager::SetCurveOutputMinMaxValues; - using General::TrimSigDigits; + using OutAirNodeManager::CheckOutAirNodeNumber; using ScheduleManager::GetScheduleIndex; using WaterManager::SetupTankDemandComponent; @@ -399,8 +397,8 @@ 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; } @@ -409,8 +407,8 @@ 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; } @@ -430,7 +428,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)); } } @@ -467,7 +465,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)); } } } @@ -497,7 +495,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)); } } } @@ -527,7 +525,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)); } } } @@ -557,7 +555,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)); } } } @@ -587,7 +585,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)); } } } @@ -617,7 +615,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)); } } } @@ -648,7 +646,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)); } } } @@ -778,8 +776,8 @@ 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; } @@ -788,8 +786,8 @@ 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; } @@ -809,7 +807,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)); } } @@ -850,18 +848,18 @@ 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; } @@ -903,9 +901,9 @@ 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; } @@ -914,7 +912,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))); } } @@ -936,9 +934,9 @@ 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; } @@ -967,7 +965,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)); } } } @@ -997,7 +995,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)); } } } @@ -1027,7 +1025,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)); } } } @@ -1057,7 +1055,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)); } } } @@ -1178,8 +1176,8 @@ 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; } @@ -1188,8 +1186,8 @@ 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; } @@ -1209,7 +1207,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)); } } @@ -1245,7 +1243,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)); } } } @@ -1275,7 +1273,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)); } } } @@ -1305,7 +1303,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)); } } } @@ -1335,7 +1333,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)); } } } @@ -1365,7 +1363,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)); } } } @@ -1395,7 +1393,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)); } } } @@ -1426,7 +1424,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)); } } } @@ -1524,8 +1522,8 @@ 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; } @@ -1534,8 +1532,8 @@ 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; } @@ -1555,7 +1553,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)); } } @@ -1613,9 +1611,9 @@ 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; } @@ -1642,9 +1640,8 @@ 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; } @@ -1673,7 +1670,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)); } } } @@ -1703,7 +1700,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)); } } } @@ -1733,7 +1730,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)); } } } @@ -1763,7 +1760,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)); } } } @@ -1851,11 +1848,8 @@ 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; } @@ -1864,18 +1858,15 @@ 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; } @@ -1888,16 +1879,16 @@ 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; } } @@ -1943,8 +1934,8 @@ 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; } @@ -1975,15 +1966,15 @@ 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; } @@ -2026,7 +2017,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)); } } @@ -2065,7 +2056,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)); } } } @@ -2097,7 +2088,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)); } } } @@ -2129,7 +2120,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)); } } } @@ -2161,7 +2152,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)); } } } @@ -2193,7 +2184,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)); } } } @@ -2225,7 +2216,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)); } } } @@ -3037,7 +3028,7 @@ namespace VariableSpeedCoils { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; @@ -3148,13 +3139,11 @@ 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) { @@ -3644,8 +3633,8 @@ 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; @@ -4061,9 +4050,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 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."); } @@ -4162,8 +4150,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."); } @@ -4201,9 +4189,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."); } @@ -4229,9 +4216,8 @@ 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)); } } } @@ -4450,11 +4436,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."); } } @@ -4472,9 +4464,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."); } @@ -4534,24 +4525,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."); } } @@ -4749,10 +4753,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 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."); } @@ -4793,10 +4795,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 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."); } @@ -4813,21 +4813,21 @@ 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."); @@ -4838,17 +4838,17 @@ 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."); @@ -5548,7 +5548,7 @@ namespace VariableSpeedCoils { using DataHVACGlobals::DXCoilTotalCapacity; using DataHVACGlobals::HPWHInletDBTemp; using DataHVACGlobals::HPWHInletWBTemp; - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -7041,7 +7041,7 @@ 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 @@ -7051,8 +7051,7 @@ 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 704dffb3c8b..d2a5778c93d 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -164,7 +164,7 @@ namespace VentilatedSlab { // Using/Aliasing using DataSizing::ZoneEqVentedSlab; - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Item; // index of ventilated slab being simulated @@ -185,13 +185,11 @@ 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; } @@ -1654,7 +1652,7 @@ namespace VentilatedSlab { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; + using HVACHXAssistedCoolingCoil::GetHXCoilType; using HVACHXAssistedCoolingCoil::GetHXDXCoilName; using PlantUtilities::MyPlantSizingIndex; @@ -1907,10 +1905,8 @@ 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."); } @@ -1955,10 +1951,8 @@ 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."); } @@ -2083,10 +2077,8 @@ 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."); } @@ -2200,10 +2192,8 @@ 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."); } @@ -2328,10 +2318,8 @@ 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."); } @@ -2428,7 +2416,7 @@ namespace VentilatedSlab { using DataHVACGlobals::ZoneCompTurnFansOff; using DataHVACGlobals::ZoneCompTurnFansOn; using DataLoopNode::Node; - using General::TrimSigDigits; + using HeatingCoils::CheckHeatingCoilSchedule; using HVACHXAssistedCoolingCoil::CheckHXAssistedCoolingCoilSchedule; using NodeInputManager::GetOnlySingleNode; @@ -3410,7 +3398,7 @@ namespace VentilatedSlab { // Using/Aliasing using DataEnvironment::OutBaroPress; - using General::RoundSigDigits; + using DataHeatBalance::Zone; using DataHeatBalFanSys::CTFTsrcConstPart; @@ -3706,15 +3694,12 @@ 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.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + @@ -3759,12 +3744,9 @@ 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.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + @@ -3792,12 +3774,9 @@ 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.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + @@ -3955,15 +3934,12 @@ 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.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + @@ -4038,11 +4014,9 @@ 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.dataVentilatedSlab->cMO_VentilatedSlab + " [" + state.dataVentilatedSlab->VentSlab(Item).Name + diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index 0221057cdae..15c613c04dd 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 @@ -186,7 +184,7 @@ 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 @@ -211,13 +209,11 @@ 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; } @@ -899,7 +895,7 @@ namespace WaterCoils { // Using/Aliasing using General::Iterate; - using General::RoundSigDigits; + using General::SafeDivide; using General::SolveRoot; using namespace OutputReportPredefined; @@ -1175,8 +1171,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; @@ -1185,8 +1180,8 @@ 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); @@ -1245,16 +1240,11 @@ 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; } @@ -1286,19 +1276,14 @@ 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 @@ -1406,11 +1391,10 @@ 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); @@ -1450,12 +1434,11 @@ 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); @@ -1518,7 +1501,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"); @@ -1530,7 +1513,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 @@ -2046,8 +2029,8 @@ namespace WaterCoils { // Using/Aliasing using namespace DataSizing; using DataEnvironment::StdBaroPress; - using General::RoundSigDigits; - using General::TrimSigDigits; + + using PlantUtilities::RegisterPlantCompDesignFlow; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2353,8 +2336,7 @@ 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; } @@ -2401,8 +2383,7 @@ 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; } @@ -2688,10 +2669,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"); + 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 @@ -2950,7 +2931,7 @@ namespace WaterCoils { // Re-engineered for EnergyPlus by Richard Liesen PhD in 1998 // Using/Aliasing - using General::TrimSigDigits; + // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -3092,21 +3073,19 @@ 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"); } @@ -5613,7 +5592,7 @@ namespace WaterCoils { // // Using/Aliasing - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CoilNum; @@ -5635,12 +5614,10 @@ 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? } @@ -6190,7 +6167,7 @@ namespace WaterCoils { // none // Using/Aliasing - using General::RoundSigDigits; + using General::SolveRoot; // Return value @@ -6228,11 +6205,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; @@ -6487,7 +6464,7 @@ namespace WaterCoils { using DataLoopNode::Node; using DataPlant::ccSimPlantEquipTypes; using DataPlant::PlantLoop; - using General::TrimSigDigits; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -6506,17 +6483,14 @@ 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 (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))); } } } @@ -6622,7 +6596,7 @@ 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); @@ -6630,8 +6604,7 @@ 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 a5f7fd31e0a..0e34fefbd39 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,10 @@ 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 +420,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 5f63b7f1999..c335928fa2d 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -214,13 +214,11 @@ 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; } @@ -247,13 +245,11 @@ 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; } @@ -532,8 +528,7 @@ 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)); } } @@ -701,9 +696,7 @@ 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; } @@ -738,8 +731,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."); } } @@ -797,9 +789,7 @@ 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) @@ -810,10 +800,7 @@ 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) @@ -983,28 +970,20 @@ 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."); @@ -1013,25 +992,19 @@ 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; } } @@ -1162,7 +1135,7 @@ namespace WaterThermalTanks { 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)); + format(" difference must be > 0 and <= 20. Dead band = {:.1T}", hpwhNumeric[1 + nNumericOffset])); ErrorsFound = true; } @@ -1192,8 +1165,7 @@ 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; } @@ -1205,16 +1177,13 @@ 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; } @@ -1230,8 +1199,7 @@ 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; } @@ -1458,7 +1426,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 @@ -1467,8 +1435,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 @@ -1567,8 +1535,7 @@ 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; @@ -1597,10 +1564,8 @@ namespace WaterThermalTanks { if (DXCoils::DXCoil(HPWH.DXCoilNum).HPWHCondPumpElecNomPower / DXCoils::DXCoil(HPWH.DXCoilNum).RatedTotCap2 > 0.1422) { 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)) { @@ -1631,8 +1596,7 @@ 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; } @@ -1640,8 +1604,7 @@ 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; } @@ -2730,8 +2693,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; } @@ -2760,8 +2723,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; } @@ -2937,8 +2900,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; } @@ -2954,8 +2917,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; } @@ -2982,8 +2945,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; } @@ -2996,8 +2959,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; } @@ -3630,8 +3593,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; } @@ -3639,8 +3602,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; } @@ -3655,8 +3618,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; } @@ -3667,8 +3630,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; } @@ -4027,9 +3990,7 @@ 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; } @@ -4643,7 +4604,7 @@ 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", @@ -4652,7 +4613,7 @@ 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", @@ -5034,7 +4995,7 @@ 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", @@ -5043,7 +5004,7 @@ 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", @@ -5478,12 +5439,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"); @@ -5684,8 +5643,7 @@ 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; } } @@ -5697,8 +5655,7 @@ 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; } } @@ -5755,8 +5712,7 @@ 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; } } @@ -6045,11 +6001,7 @@ 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); @@ -6057,9 +6009,7 @@ 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); } @@ -6669,9 +6619,7 @@ 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(this->Type + " = '" + this->Name + "': Temperature of tank < 2C indicates of possibility of freeze", @@ -7536,9 +7484,7 @@ 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(this->Type + " = '" + this->Name + "': Temperature of tank < 2C indicates of possibility of freeze", @@ -7866,7 +7812,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(DesupHtr.Type + " \"" + DesupHtr.Name + "\": Water heater tank set point temperature is greater than or equal to the cut-in " @@ -8028,8 +7974,7 @@ 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(DesupHtr.Type + " \"" + DesupHtr.Name + @@ -8050,9 +7995,7 @@ 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 { @@ -8145,8 +8088,7 @@ 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(DesupHtr.Type + " \"" + DesupHtr.Name + @@ -8166,9 +8108,7 @@ 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 { @@ -8857,8 +8797,7 @@ 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( @@ -8875,9 +8814,7 @@ 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 { @@ -9047,9 +8984,7 @@ 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( @@ -9066,9 +9001,7 @@ 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 aa8644a4c28..5cfeac8a424 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -135,7 +135,7 @@ namespace WaterToAirHeatPump { // Using/Aliasing using FluidProperties::FindGlycol; - using General::TrimSigDigits; + // shut off after compressor cycle off [s] // cycling fan/cycling compressor @@ -161,13 +161,11 @@ 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 +1049,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 +1412,7 @@ namespace WaterToAirHeatPump { if (LoadSidePressure < LowPressCutoff && !FirstHVACIteration) { if (!WarmupFlag) { - ShowRecurringWarningErrorAtEnd("WaterToAir Heat pump:cooling [" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + - "] shut off on low pressure < " + RoundSigDigits(LowPressCutoff, 0), + ShowRecurringWarningErrorAtEnd(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 +1426,7 @@ namespace WaterToAirHeatPump { if (SourceSidePressure > HighPressCutoff && !FirstHVACIteration) { if (!WarmupFlag) { - ShowRecurringWarningErrorAtEnd("WaterToAir Heat pump:cooling [" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + - "] shut off on high pressure > " + RoundSigDigits(HighPressCutoff, 0), + ShowRecurringWarningErrorAtEnd(format("WaterToAir Heat pump:cooling [{}] shut off on high pressure > {:.0R}", state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name, HighPressCutoff), state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).HighPressClgError, SourceSideInletTemp, SourceSideInletTemp, @@ -1721,7 +1717,7 @@ namespace WaterToAirHeatPump { using Psychrometrics::PsyWFnTdbH; // USE DataZoneEnergyDemands using DataPlant::PlantLoop; - using General::RoundSigDigits; + using General::SolveRoot; // Locals @@ -1943,8 +1939,7 @@ namespace WaterToAirHeatPump { LoadSidePressure = GetSatPressureRefrig(state, Refrigerant, LoadSideTemp, state.dataWaterToAirHeatPump->RefrigIndex, RoutineNameLoadSideTemp); if (SourceSidePressure < LowPressCutoff && !FirstHVACIteration) { if (!WarmupFlag) { - ShowRecurringWarningErrorAtEnd("WaterToAir Heat pump:heating [" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + "] shut off on low pressure < " + - RoundSigDigits(LowPressCutoff, 0), + ShowRecurringWarningErrorAtEnd(format("WaterToAir Heat pump:heating [{}] shut off on low pressure < {:.0R}", state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name, LowPressCutoff), state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LowPressHtgError, SourceSidePressure, SourceSidePressure, @@ -1958,8 +1953,7 @@ namespace WaterToAirHeatPump { if (LoadSidePressure > HighPressCutoff && !FirstHVACIteration) { if (!WarmupFlag) { - ShowRecurringWarningErrorAtEnd("WaterToAir Heat pump:heating [" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + - "] shut off on high pressure > " + RoundSigDigits(HighPressCutoff, 0), + ShowRecurringWarningErrorAtEnd(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 ac42cee2f78..7b78c7aa8ff 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -170,7 +170,7 @@ namespace WaterToAirHeatPumpSimple { // Using/Aliasing using FluidProperties::FindGlycol; - using General::TrimSigDigits; + // percent on-time (on-time/cycle time) // shut off after compressor cycle off [s] @@ -197,12 +197,10 @@ 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)); } } @@ -1099,8 +1097,8 @@ 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; @@ -1264,10 +1262,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 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."); } @@ -1705,10 +1701,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 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."); } @@ -1760,10 +1754,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 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."); } @@ -1782,22 +1774,22 @@ 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."); @@ -1808,18 +1800,18 @@ 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."); @@ -1877,8 +1869,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."); } @@ -1910,10 +1902,8 @@ 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)); } } } @@ -2019,9 +2009,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."); } @@ -3170,7 +3159,7 @@ 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 @@ -3180,8 +3169,7 @@ 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 e21af8fdce5..4795a5d68b3 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; DataGlobals::NumOfDayInEnvrn = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).TotalDays; // Set day loop maximum from DataGlobals if (!DataGlobals::DoingSizing && !DataGlobals::KickOffSimulation) { @@ -684,8 +683,7 @@ 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 +744,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 +770,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 +792,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 +1004,14 @@ 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 +2179,9 @@ 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 +2262,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 +2274,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 +2286,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 +2298,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 +2334,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 +2346,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 +3137,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 +3422,7 @@ 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 +3494,21 @@ 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); @@ -4357,16 +4353,9 @@ 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))); } } @@ -4426,17 +4415,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; } @@ -4454,12 +4443,10 @@ 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. } @@ -4551,37 +4538,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"); @@ -4869,15 +4856,12 @@ 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; } @@ -4913,17 +4897,18 @@ 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 @@ -4934,9 +4919,7 @@ 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 @@ -4953,10 +4936,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 @@ -4988,16 +4974,13 @@ 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; } } @@ -5005,9 +4988,7 @@ 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 @@ -5023,9 +5004,7 @@ 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,8 +5192,7 @@ namespace WeatherManager { 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) + ']'); + format("{} invalid (Day of Month) [{}]", DataIPShortCuts::cNumericFieldNames(2), state.dataWeatherManager->RunPeriodDesignInput(Count).startDay)); ErrorsFound = true; } break; @@ -5224,23 +5202,20 @@ namespace WeatherManager { 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) + ']'); + 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) + ']'); + 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) + ']'); + format("{} invalid (Month) [{}]", DataIPShortCuts::cNumericFieldNames(1), state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth)); ErrorsFound = true; break; } @@ -5518,8 +5493,7 @@ 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; } @@ -5968,10 +5942,9 @@ 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; } @@ -6268,8 +6241,7 @@ 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) { @@ -6401,9 +6373,7 @@ 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; @@ -6413,25 +6383,20 @@ 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; } @@ -7438,7 +7403,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; } @@ -7515,7 +7480,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; } @@ -7532,7 +7497,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); @@ -7547,7 +7512,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); @@ -8632,8 +8597,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: @@ -8641,8 +8606,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: @@ -8651,8 +8616,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,"; @@ -8663,7 +8628,7 @@ namespace WeatherManager { << "NA" << "," << "NA" - << "," << General::RoundSigDigits(10.0, 1) << '\n'; + << "," << format("{:.1R}", 10.0) << '\n'; } break; default: @@ -8675,7 +8640,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 fecdba9bb58..a56557053e4 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -114,7 +114,7 @@ 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 +134,10 @@ 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 +188,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 +292,7 @@ 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 +303,7 @@ 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 +314,14 @@ 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 +331,7 @@ 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 +342,7 @@ 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 +353,7 @@ 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; } @@ -371,14 +362,13 @@ namespace WindTurbine { 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."); + " 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 +376,8 @@ 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 +386,14 @@ 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 +402,14 @@ 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 +418,7 @@ 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 +432,9 @@ 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 +446,7 @@ 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 +457,7 @@ 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 +468,7 @@ 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 6060570a70b..88a6242a734 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -154,7 +154,7 @@ 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) @@ -176,13 +176,11 @@ 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; } @@ -234,7 +232,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); @@ -381,10 +379,7 @@ 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); @@ -417,11 +412,7 @@ 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); @@ -927,7 +918,7 @@ 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 @@ -1416,7 +1407,7 @@ 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 @@ -1509,7 +1500,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("ZoneHVAC:WindowAirConditioner=\"" + state.dataWindowAC->WindAC(WindACNum).Name + "\" -- Exceeded max iterations error (sensible runtime) continues...", @@ -1556,7 +1547,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("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 ada8529c1af..fec210208d0 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -129,7 +129,7 @@ namespace WindowEquivalentLayer { using DataGlobals::HourOfDay; using DataGlobals::TimeStep; using DataGlobals::WarmupFlag; - using General::TrimSigDigits; + void InitEquivalentLayerWindowCalculations(EnergyPlusData &state) { @@ -449,7 +449,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; @@ -561,8 +561,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; } @@ -978,7 +978,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) { @@ -1103,9 +1103,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; } @@ -1239,9 +1239,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; } @@ -1424,9 +1424,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; } @@ -4792,8 +4792,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("CONSTRUCTION:WINDOWEQUIVALENTLAYER = \"" + FS.Name + "\"; " + RoutineName + @@ -5268,8 +5268,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("CONSTRUCTION:WINDOWEQUIVALENTLAYER = \"" + FS.Name + "\"; " + RoutineName + diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 163a21ecbb9..1af31ae6247 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -172,7 +172,7 @@ namespace WindowManager { // Using/Aliasing using namespace Vectors; - using General::TrimSigDigits; + using WindowEquivalentLayer::InitEquivalentLayerWindowCalculations; int CoefNum; // Polynomial coefficient number @@ -602,10 +602,8 @@ 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."); } @@ -1519,7 +1517,7 @@ namespace WindowManager { { // Initializes variables used in the window optical and thermal calculation. - using General::RoundSigDigits; + int ConstrNum; // Construction number int SurfNum; // Surface number @@ -1657,11 +1655,9 @@ namespace WindowManager { if (DifOverrideCount > 0) { if (!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)); } } @@ -2854,8 +2850,8 @@ 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; @@ -3415,7 +3411,7 @@ 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)); } } @@ -3575,9 +3571,7 @@ namespace WindowManager { if (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())); } } @@ -6791,7 +6785,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; @@ -7463,7 +7457,7 @@ 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: diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index 634e80b248b..e70092eff77 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -56,12 +56,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include @@ -86,7 +84,6 @@ namespace ZoneAirLoopEquipmentManager { // DATE WRITTEN May 1997 using DataGlobals::NumOfZones; - using DataHVACGlobals::FirstTimeStepSysFlag; using namespace DataDefineEquip; void ManageZoneAirLoopEquipment(EnergyPlusData &state, std::string const &ZoneAirLoopEquipName, @@ -108,7 +105,6 @@ namespace ZoneAirLoopEquipmentManager { // (water-air, refrigerant-air, steam-air, electric-electric, // water-water, etc) - using General::TrimSigDigits; int AirDistUnitNum; @@ -126,12 +122,10 @@ 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 55270865137..4c072005deb 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -182,8 +182,8 @@ 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 +292,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 +323,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 +424,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 +440,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 +448,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 +541,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 +559,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 +647,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 +665,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 +759,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 +776,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 +872,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 +888,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 +970,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 +987,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 +1049,7 @@ namespace ZoneContaminantPredictorCorrector { // Using/Aliasing using namespace DataIPShortCuts; - using General::TrimSigDigits; + using ScheduleManager::CheckScheduleValue; using ScheduleManager::CheckScheduleValueMinMax; using ScheduleManager::GetScheduleIndex; @@ -1662,7 +1646,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 d787591ec53..410f89a5c1c 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,11 @@ 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 +280,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 +289,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 +298,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 +328,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 +358,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 +391,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 +402,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 +772,8 @@ 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.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + @@ -809,9 +805,8 @@ 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.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + @@ -837,8 +832,7 @@ 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.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + @@ -854,8 +848,7 @@ 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.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).UnitType + " \"" + state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).Name + @@ -873,8 +866,7 @@ 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 +881,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 2a5d74dd82b..27efad38d23 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -446,7 +446,7 @@ namespace ZoneEquipmentManager { using DataLoopNode::Node; using DataZoneEnergyDemands::DeadBandOrSetback; using DataZoneEnergyDemands::ZoneSysEnergyDemand; - using General::RoundSigDigits; + // Parameters static std::string const RoutineName("SizeZoneEquipment"); @@ -1432,7 +1432,7 @@ namespace ZoneEquipmentManager { using DataHVACGlobals::SmallTempDiff; using EMSManager::ManageEMS; using General::MovingAvg; - using General::RoundSigDigits; + // SUBROUTINE PARAMETER DEFINITIONS: @@ -1870,33 +1870,25 @@ 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"); @@ -1921,32 +1913,24 @@ 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"); @@ -4169,18 +4153,10 @@ 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; } @@ -5781,7 +5757,7 @@ 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 1697b91b719..48bb27decc5 100644 --- a/src/EnergyPlus/ZonePlenum.cc +++ b/src/EnergyPlus/ZonePlenum.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -120,7 +119,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 @@ -142,15 +140,11 @@ 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; } @@ -173,15 +167,11 @@ 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; } @@ -195,7 +185,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."); } } @@ -671,6 +661,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 73b02e11866..a18f409ec92 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -256,8 +256,8 @@ 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; @@ -518,8 +518,7 @@ 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; } @@ -825,9 +824,7 @@ 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; } @@ -1149,8 +1146,7 @@ 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; } @@ -1158,8 +1154,7 @@ 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; } @@ -1169,7 +1164,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 @@ -1577,9 +1572,7 @@ 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; } @@ -1806,14 +1799,12 @@ 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; } @@ -1893,16 +1884,14 @@ 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; } } @@ -2021,14 +2010,12 @@ 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; } @@ -2046,8 +2033,7 @@ 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; } } @@ -2090,16 +2076,14 @@ 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; } } @@ -2120,8 +2104,7 @@ 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; } } @@ -2245,8 +2228,7 @@ 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; } @@ -2263,8 +2245,7 @@ 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; } @@ -2274,8 +2255,7 @@ 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; } @@ -2286,9 +2266,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; } } @@ -2297,8 +2281,7 @@ 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; } @@ -2315,8 +2298,7 @@ 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; } @@ -2326,8 +2308,9 @@ 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; } @@ -2338,9 +2321,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; } } @@ -3194,8 +3181,8 @@ 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; @@ -3411,8 +3398,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."); } } @@ -3707,7 +3694,7 @@ namespace ZoneTempPredictorCorrector { // Using/Aliasing using DataZoneControls::OccRoomTSetPointCool; using DataZoneControls::OccRoomTSetPointHeat; - using General::TrimSigDigits; + using ScheduleManager::GetCurrentScheduleValue; using ScheduleManager::GetScheduleValuesForDay; @@ -3877,9 +3864,7 @@ 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)); } } @@ -3933,7 +3918,7 @@ namespace ZoneTempPredictorCorrector { // Using/Aliasing using DataLoopNode::Node; - using General::RoundSigDigits; + using ScheduleManager::GetCurrentScheduleValue; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -4063,11 +4048,10 @@ 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."); } @@ -4087,11 +4071,10 @@ 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."); } @@ -4138,12 +4121,11 @@ 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."); } @@ -4166,13 +4148,12 @@ 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."); } @@ -4320,7 +4301,7 @@ namespace ZoneTempPredictorCorrector { using DataSurfaces::HeatTransferModel_EMPD; using DataSurfaces::HeatTransferModel_HAMT; using DataSurfaces::Surface; - using General::RoundSigDigits; + using ScheduleManager::GetCurrentScheduleValue; // SUBROUTINE PARAMETER DEFINITIONS: @@ -4617,10 +4598,9 @@ 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."); } } @@ -4713,7 +4693,7 @@ namespace ZoneTempPredictorCorrector { using DataRoomAirModel::ZTM1OC; using DataRoomAirModel::ZTMX; using DataRoomAirModel::ZTOC; - using General::TrimSigDigits; + using RoomAirModelManager::ManageAirModel; // HybridModel @@ -6410,7 +6390,7 @@ namespace ZoneTempPredictorCorrector { using DataDefineEquip::AirDistUnit; using DataLoopNode::Node; using DataZoneEquipment::ZoneEquipConfig; - using General::RoundSigDigits; + using InternalHeatGains::SumAllInternalConvectionGains; using InternalHeatGains::SumAllReturnAirConvectionGains; //using ZonePlenum::ZoneRetPlenCond; @@ -6689,7 +6669,7 @@ namespace ZoneTempPredictorCorrector { if ((std::abs(imBalance) > Threshold) && (!WarmupFlag) && (!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"); } @@ -7022,7 +7002,7 @@ namespace ZoneTempPredictorCorrector { // obtained from thermal comfort models. // Using/Aliasing - using General::TrimSigDigits; + using ScheduleManager::GetCurrentScheduleValue; using ThermalComfort::ManageThermalComfort; @@ -7122,9 +7102,7 @@ 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)); } } @@ -7351,9 +7329,7 @@ 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 6b9b43dd2b1..7a0b949c1a1 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -213,7 +213,7 @@ Real64 getVariableValue(EnergyPlusState state, const int handle) { // 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 auto thisState = reinterpret_cast(state); - 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; @@ -243,7 +243,7 @@ Real64 getMeterValue(EnergyPlusState state, int handle) { // 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 auto thisState = reinterpret_cast(state); - 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; @@ -277,8 +277,7 @@ 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; } @@ -287,8 +286,7 @@ 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)); } } @@ -312,7 +310,7 @@ void resetActuator(EnergyPlusState state, int handle) { // 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 auto thisState = reinterpret_cast(state); - 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; @@ -338,7 +336,7 @@ void setActuatorValue(EnergyPlusState state, const int handle, const Real64 valu // 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 auto thisState = reinterpret_cast(state); - 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; @@ -367,7 +365,7 @@ Real64 getActuatorValue(EnergyPlusState state, const int handle) { // 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 auto thisState = reinterpret_cast(state); - 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; @@ -411,7 +409,7 @@ Real64 getInternalVariableValue(EnergyPlusState state, int handle) { // 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 auto thisState = reinterpret_cast(state); - 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; @@ -430,7 +428,7 @@ 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; @@ -443,7 +441,7 @@ 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; } @@ -459,7 +457,7 @@ 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; @@ -467,7 +465,7 @@ 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; @@ -480,7 +478,7 @@ 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; @@ -488,7 +486,7 @@ 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; @@ -501,7 +499,7 @@ 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; @@ -509,7 +507,7 @@ 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; @@ -522,7 +520,7 @@ 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; @@ -530,7 +528,7 @@ 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; @@ -543,7 +541,7 @@ 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; @@ -551,7 +549,7 @@ 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; @@ -564,7 +562,7 @@ 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; @@ -572,7 +570,7 @@ 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 2f9842b963a..5a04dda6c61 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc @@ -9590,14 +9590,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 ce6e48c1c24..ea608f7970a 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -1582,7 +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), + 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)); diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index dc96dbc9cea..ae0522d9f37 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -106,7 +106,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 aafbbdc5db0..c5344178973 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -1333,8 +1333,7 @@ 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); @@ -1371,8 +1370,7 @@ 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); @@ -1409,8 +1407,7 @@ TEST_F(LowTempRadiantSystemTest, InitLowTempRadiantSystemCFloPump) 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}); + 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 4d33786a672..632c7a1a05c 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -109,7 +109,6 @@ using namespace EnergyPlus::OutputReportPredefined; using namespace EnergyPlus::OutputReportTabular; using namespace EnergyPlus::OutputProcessor; using namespace SimulationManager; -using namespace ObjexxFCL; TEST_F(EnergyPlusFixture, OutputReportTabularTest_ConfirmSetUnitsStyleFromString) { @@ -7420,11 +7419,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; } @@ -7458,8 +7457,8 @@ 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) * @@ -7471,7 +7470,7 @@ TEST_F(EnergyPlusFixture, AzimuthToCardinal) // 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; + 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), @@ -7488,7 +7487,7 @@ TEST_F(EnergyPlusFixture, AzimuthToCardinal) // 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; + 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), @@ -7526,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 a780745a042..2d532cd1dfe 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 db0976f717d..75834ba2918 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..d21d6693596 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc @@ -71,7 +71,7 @@ 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..1ba17acc74a 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,7 @@ 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)); } }