diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index 41d41df5280..1fa3f930f05 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -318,8 +318,8 @@ namespace AirLoopHVACDOAS { int index = -1; std::size_t loop = 0; - for (const auto &thisAirLoopMixerObject : state.dataAirLoopHVACDOAS->airloopMixer) { - if (Util::SameString(objectName, thisAirLoopMixerObject.name)) { + for (auto &thisAirLoopMixerObject : state.dataAirLoopHVACDOAS->airloopMixer) { + if (Util::SameString(thisAirLoopMixerObject.name, objectName)) { index = static_cast(loop); return index; } @@ -367,8 +367,8 @@ namespace AirLoopHVACDOAS { int index = -1; std::size_t loop = 0; - for (const auto &thisAirLoopSplitterObj : state.dataAirLoopHVACDOAS->airloopSplitter) { - if (Util::SameString(objectName, thisAirLoopSplitterObj.name)) { + for (auto &thisAirLoopSplitterObj : state.dataAirLoopHVACDOAS->airloopSplitter) { + if (Util::SameString(thisAirLoopSplitterObj.name, objectName)) { index = static_cast(loop); return index; } @@ -505,14 +505,17 @@ namespace AirLoopHVACDOAS { CurrentModuleObject = "AirLoopHVAC:OutdoorAirSystem:EquipmentList"; int CoolingCoilOrder = 0; int FanOrder = 0; + std::string coilCoolingWater = "COIL:COOLING:WATER"; + std::string coilHeatingWater = "Coil:Heating:Water"; + std::string coilCoolingWaterDetailedGeometry = "Coil : Cooling : Water : DetailedGeometry"; for (int CompNum = 1; CompNum <= thisOutsideAirSys.NumComponents; ++CompNum) { - std::string const &CompType = thisOutsideAirSys.ComponentType(CompNum); - std::string const &CompName = thisOutsideAirSys.ComponentName(CompNum); + std::string &CompType = thisOutsideAirSys.ComponentType(CompNum); + std::string &CompName = thisOutsideAirSys.ComponentName(CompNum); bool InletNodeErrFlag = false; bool OutletNodeErrFlag = false; - const std::string typeNameUC = Util::makeUPPER(thisOutsideAirSys.ComponentType(CompNum)); + std::string typeNameUC = Util::makeUPPER(thisOutsideAirSys.ComponentType(CompNum)); switch (static_cast(getEnumValue(validEquipNamesUC, typeNameUC))) { case ValidEquipListType::OutdoorAirMixer: case ValidEquipListType::FanConstantVolume: @@ -560,7 +563,7 @@ namespace AirLoopHVACDOAS { case ValidEquipListType::CoilCoolingWater: thisOutsideAirSys.InletNodeNum(CompNum) = WaterCoils::GetCoilInletNode(state, typeNameUC, CompName, InletNodeErrFlag); thisOutsideAirSys.OutletNodeNum(CompNum) = WaterCoils::GetCoilOutletNode(state, typeNameUC, CompName, OutletNodeErrFlag); - thisDOAS.CWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode(state, "COIL:COOLING:WATER", CompName, errorsFound); + thisDOAS.CWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode(state, coilCoolingWater, CompName, errorsFound); if (errorsFound) { ShowContinueError(state, format("The control node number is not found in {} = {}", CurrentModuleObject, CompName)); } @@ -576,7 +579,7 @@ namespace AirLoopHVACDOAS { case ValidEquipListType::CoilHeatingWater: thisOutsideAirSys.InletNodeNum(CompNum) = WaterCoils::GetCoilInletNode(state, typeNameUC, CompName, InletNodeErrFlag); thisOutsideAirSys.OutletNodeNum(CompNum) = WaterCoils::GetCoilOutletNode(state, typeNameUC, CompName, OutletNodeErrFlag); - thisDOAS.HWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", CompName, errorsFound); + thisDOAS.HWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode(state, coilHeatingWater, CompName, errorsFound); if (errorsFound) { ShowContinueError(state, format("The control node number is not found in {} = {}", CurrentModuleObject, CompName)); } @@ -596,8 +599,7 @@ namespace AirLoopHVACDOAS { case ValidEquipListType::CoilCoolingWaterDetailedGeometry: thisOutsideAirSys.InletNodeNum(CompNum) = WaterCoils::GetCoilInletNode(state, typeNameUC, CompName, InletNodeErrFlag); thisOutsideAirSys.OutletNodeNum(CompNum) = WaterCoils::GetCoilOutletNode(state, typeNameUC, CompName, OutletNodeErrFlag); - thisDOAS.CWCtrlNodeNum = - WaterCoils::GetCoilWaterInletNode(state, "Coil:Cooling:Water:DetailedGeometry", CompName, errorsFound); + thisDOAS.CWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode(state, coilCoolingWaterDetailedGeometry, CompName, errorsFound); if (errorsFound) { ShowContinueError(state, format("The control node number is not found in {} = {}", CurrentModuleObject, CompName)); } @@ -844,7 +846,7 @@ namespace AirLoopHVACDOAS { // Check valid OA controller for (int OASysNum = 1; OASysNum <= state.dataAirLoop->NumOASystems; OASysNum++) { - if (Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerListName, "")) { + if (state.dataAirLoop->OutsideAirSys(OASysNum).ControllerListName == "") { if (state.dataAirLoop->OutsideAirSys(OASysNum).AirLoopDOASNum == -1) { ShowSevereError(state, format(R"(AirLoopHVAC:OutdoorAirSystem = "{}" invalid Controller List Name = " not found.)", @@ -867,8 +869,8 @@ namespace AirLoopHVACDOAS { bool ErrorsFound = false; Real64 rho; for (int CompNum = 1; CompNum <= state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).NumComponents; ++CompNum) { - std::string const &CompType = state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).ComponentType(CompNum); - std::string const &CompName = state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).ComponentName(CompNum); + std::string &CompType = state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).ComponentType(CompNum); + std::string &CompName = state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).ComponentName(CompNum); if (Util::SameString(CompType, "FAN:SYSTEMMODEL")) { state.dataFans->fans(this->m_FanIndex)->simulate(state, FirstHVACIteration); } @@ -878,7 +880,7 @@ namespace AirLoopHVACDOAS { if (Util::SameString(CompType, "COIL:HEATING:WATER")) { WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_HeatCoilNum); - Real64 const CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", CompName, ErrorsFound); + Real64 const CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, CompType, CompName, ErrorsFound); rho = state.dataPlnt->PlantLoop(this->HWPlantLoc.loopNum).glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); PlantUtilities::InitComponentNodes(state, 0.0, @@ -888,7 +890,7 @@ namespace AirLoopHVACDOAS { } if (Util::SameString(CompType, "COIL:COOLING:WATER")) { WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum); - Real64 const CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water", CompName, ErrorsFound); + Real64 const CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, CompType, CompName, ErrorsFound); rho = state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).glycol->getDensity(state, Constant::CWInitConvTemp, RoutineName); PlantUtilities::InitComponentNodes(state, 0.0, @@ -898,8 +900,7 @@ namespace AirLoopHVACDOAS { } if (Util::SameString(CompType, "COIL:COOLING:WATER:DETAILEDGEOMETRY")) { WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum); - Real64 const CoilMaxVolFlowRate = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", CompName, ErrorsFound); + Real64 const CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, CompType, CompName, ErrorsFound); rho = state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).glycol->getDensity(state, Constant::CWInitConvTemp, RoutineName); PlantUtilities::InitComponentNodes(state, 0.0, diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 6800ed24c2b..ca6714ccb69 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -2284,11 +2284,11 @@ namespace AirflowNetwork { cNumericFields); simulation_control.ductSizing.name = Alphas(1); - if (Util::SameString(Alphas(2), Util::makeUPPER("MaximumVelocity"))) { + if (Util::SameString(Alphas(2), "MaximumVelocity")) { simulation_control.ductSizing.method = DuctSizingMethod::MaxVelocity; - } else if (Util::SameString(Alphas(2), Util::makeUPPER("PressureLoss"))) { + } else if (Util::SameString(Alphas(2), "PressureLoss")) { simulation_control.ductSizing.method = DuctSizingMethod::PressureLoss; - } else if (Util::SameString(Alphas(2), Util::makeUPPER("PressureLossWithMaximumVelocity"))) { + } else if (Util::SameString(Alphas(2), "PressureLossWithMaximumVelocity")) { simulation_control.ductSizing.method = DuctSizingMethod::VelocityAndLoss; } else { ShowSevereError(m_state, format("{} {} object, {} = {} is invalid.", RoutineName, CurrentModuleObject, cAlphaFields(2), Alphas(2))); @@ -3961,7 +3961,7 @@ namespace AirflowNetwork { // Avoid duplication of EPlusName if (!simulation_control.DuctLoss) { for (int j = 1; j < i; ++j) { - if (!Util::SameString(Alphas(2), "")) { + if (Alphas(2) != "") { if (Util::SameString(DisSysNodeData(j).EPlusName, Alphas(2))) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + "=\"" + Alphas(1) + "\" Duplicated " + cAlphaFields(2) + @@ -10374,12 +10374,12 @@ namespace AirflowNetwork { } // Validate EPlus Node names and types for (int i = 1; i <= DisSysNumOfNodes; ++i) { - if (Util::SameString(DisSysNodeData(i).EPlusName, "") || Util::SameString(DisSysNodeData(i).EPlusName, "Other")) { + if (DisSysNodeData(i).EPlusName.empty() || Util::SameString(DisSysNodeData(i).EPlusName, "Other")) { continue; } LocalError = false; for (int j = 1; j <= m_state.dataLoopNodes->NumOfNodes; ++j) { // NodeID - if (DisSysNodeData(i).EPlusName == m_state.dataLoopNodes->NodeID(j)) { + if (equali(DisSysNodeData(i).EPlusName, m_state.dataLoopNodes->NodeID(j))) { DisSysNodeData(i).AirLoopNum = get_airloop_number(j); if (DisSysNodeData(i).AirLoopNum == 0) { ShowSevereError(m_state, @@ -12123,7 +12123,7 @@ namespace AirflowNetwork { if (m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).NumSubComps == 0) { DataLoopNode::ConnectionObjectType TypeOfComp = static_cast(EnergyPlus::getEnumValue( BranchNodeConnections::ConnectionObjectTypeNamesUC, - m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).TypeOf)); + Util::makeUPPER(m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).TypeOf))); std::string const &NameOfComp = m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).Name; if (IsParentObject(m_state, TypeOfComp, NameOfComp)) { diff --git a/src/EnergyPlus/Autosizing/Base.cc b/src/EnergyPlus/Autosizing/Base.cc index 714d3009d17..655a99a4ebe 100644 --- a/src/EnergyPlus/Autosizing/Base.cc +++ b/src/EnergyPlus/Autosizing/Base.cc @@ -605,7 +605,7 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro } } -bool BaseSizer::isValidCoilType(std::string const &_compType) +bool BaseSizer::isValidCoilType(std::string &_compType) { int coilNum = 0; for (auto const &coilType : HVAC::cAllCoilTypes) { @@ -619,7 +619,7 @@ bool BaseSizer::isValidCoilType(std::string const &_compType) return false; } -bool BaseSizer::isValidFanType(std::string const &_compType) +bool BaseSizer::isValidFanType(std::string &_compType) { // if compType name is one of the fan objects, then return true if (Util::SameString(_compType, "Fan:SystemModel")) { diff --git a/src/EnergyPlus/Autosizing/Base.hh b/src/EnergyPlus/Autosizing/Base.hh index 11975b6a2d7..3d3d90a49a6 100644 --- a/src/EnergyPlus/Autosizing/Base.hh +++ b/src/EnergyPlus/Autosizing/Base.hh @@ -290,9 +290,9 @@ protected: void select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &errorsFound); - bool isValidCoilType(std::string const &compType); + bool isValidCoilType(std::string &compType); - bool isValidFanType(std::string const &compType); + bool isValidFanType(std::string &compType); bool checkInitialized(EnergyPlusData &state, bool &errorsFound); diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc index 31815c634c3..138501613cc 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -197,7 +197,8 @@ namespace BoilerSteam { thisBoiler.Name = state.dataIPShortCut->cAlphaArgs(1); // Validate fuel type input - thisBoiler.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(2))); + thisBoiler.FuelType = + static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); // INPUTS from the IDF file thisBoiler.BoilerMaxOperPress = state.dataIPShortCut->rNumericArgs(1); diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index 561923fc093..0e22176f3a8 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -212,7 +212,7 @@ void GetBoilerInput(EnergyPlusData &state) thisBoiler.Type = DataPlant::PlantEquipmentType::Boiler_Simple; // Validate fuel type input - thisBoiler.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, s_ipsc->cAlphaArgs(2))); + thisBoiler.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(2)))); thisBoiler.NomCap = s_ipsc->rNumericArgs(1); if (s_ipsc->rNumericArgs(1) == 0.0) { diff --git a/src/EnergyPlus/BranchInputManager.cc b/src/EnergyPlus/BranchInputManager.cc index 1ac63b2df75..5071f5e299d 100644 --- a/src/EnergyPlus/BranchInputManager.cc +++ b/src/EnergyPlus/BranchInputManager.cc @@ -367,8 +367,8 @@ namespace BranchInputManager { } else { for (BranchNum = 1; BranchNum <= NumBranches; ++BranchNum) { for (CompNum = 1; CompNum <= state.dataBranchInputManager->Branch(BranchNum).NumOfComponents; ++CompNum) { - if (Util::SameString(CompType, state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType) && - Util::SameString(CompName, state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).Name)) { + if (Util::SameString(state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType, CompType) && + Util::SameString(state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).Name, CompName)) { GetAirBranchIndex = BranchNum; goto BranchLoop_exit; } @@ -421,10 +421,10 @@ namespace BranchInputManager { } else { if (BranchNum > 0 && BranchNum <= NumBranches) { for (CompNum = 1; CompNum <= state.dataBranchInputManager->Branch(BranchNum).NumOfComponents; ++CompNum) { - if (Util::SameString("Fan:OnOff", state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType) || - Util::SameString("Fan:ConstantVolume", state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType) || - Util::SameString("Fan:VariableVolume", state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType) || - Util::SameString("Fan:SystemModel", state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType)) { + if (Util::SameString(state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType, "Fan:OnOff") || + Util::SameString(state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType, "Fan:ConstantVolume") || + Util::SameString(state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType, "Fan:VariableVolume") || + Util::SameString(state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType, "Fan:SystemModel")) { FanType = state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType; FanName = state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).Name; break; @@ -1093,7 +1093,7 @@ namespace BranchInputManager { void GetSingleBranchInput(EnergyPlusData &state, std::string_view const RoutineName, int const BCount, - Array1D_string const &Alphas, + Array1D_string &Alphas, Array1D_string const &cAlphaFields, int const NumAlphas, Array1D_int &NodeNums, @@ -2460,8 +2460,8 @@ namespace BranchInputManager { std::string FoundBranchName; if (present(CompType) && present(CompName)) { for (CpN = 1; CpN <= state.dataBranchInputManager->Branch(BrN).NumOfComponents; ++CpN) { - if (!Util::SameString(CompType(), state.dataBranchInputManager->Branch(BrN).Component(CpN).CType) || - !Util::SameString(CompName(), state.dataBranchInputManager->Branch(BrN).Component(CpN).Name)) { + if (!Util::SameString(state.dataBranchInputManager->Branch(BrN).Component(CpN).CType, CompType()) || + !Util::SameString(state.dataBranchInputManager->Branch(BrN).Component(CpN).Name, CompName())) { continue; } FoundBranchName = state.dataBranchInputManager->Branch(BrN).Name; diff --git a/src/EnergyPlus/BranchInputManager.hh b/src/EnergyPlus/BranchInputManager.hh index c89d6275bf3..d5049768273 100644 --- a/src/EnergyPlus/BranchInputManager.hh +++ b/src/EnergyPlus/BranchInputManager.hh @@ -242,7 +242,7 @@ namespace BranchInputManager { void GetSingleBranchInput(EnergyPlusData &state, std::string_view RoutineName, int BCount, - Array1D_string const &Alphas, + Array1D_string &Alphas, Array1D_string const &cAlphaFields, int NumAlphas, Array1D_int &NodeNums, diff --git a/src/EnergyPlus/CTElectricGenerator.cc b/src/EnergyPlus/CTElectricGenerator.cc index aadcd96f7f7..17ea4b5379c 100644 --- a/src/EnergyPlus/CTElectricGenerator.cc +++ b/src/EnergyPlus/CTElectricGenerator.cc @@ -309,7 +309,7 @@ namespace CTElectricGenerator { // Validate fuel type input state.dataCTElectricGenerator->CTGenerator(genNum).FuelType = - static_cast(getEnumValue(Constant::eFuelNamesUC, AlphArray(11))); + static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(AlphArray(11)))); if (state.dataCTElectricGenerator->CTGenerator(genNum).FuelType == Constant::eFuel::Invalid) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(11), AlphArray(11))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index 46bd35192a6..668a61c68ea 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -448,7 +448,8 @@ void GetBLASTAbsorberInput(EnergyPlusData &state) thisChiller.PumpPowerCoef[2] = state.dataIPShortCut->rNumericArgs(14); thisChiller.TempLowLimitEvapOut = state.dataIPShortCut->rNumericArgs(15); - thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(8))); + thisChiller.FlowMode = + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 543208a81fa..bac8e1a7df4 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -434,7 +434,7 @@ void GetElectricEIRChillerInput(EnergyPlusData &state) "Condenser (unknown?) Nodes"); } - thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, s_ipsc->cAlphaArgs(10))); + thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(10)))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, s_ipsc->cCurrentModuleObject, s_ipsc->cAlphaArgs(1))); ShowContinueError(state, format("Invalid {}={}", s_ipsc->cAlphaFieldNames(10), s_ipsc->cAlphaArgs(10))); @@ -614,8 +614,8 @@ void GetElectricEIRChillerInput(EnergyPlusData &state) } if (NumAlphas > 16) { - thisChiller.CondenserFlowControl = - static_cast(getEnumValue(DataPlant::CondenserFlowControlNamesUC, s_ipsc->cAlphaArgs(17))); + thisChiller.CondenserFlowControl = static_cast( + getEnumValue(DataPlant::CondenserFlowControlNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(17)))); } else { thisChiller.CondenserFlowControl = DataPlant::CondenserFlowControl::ConstantFlow; } diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index 0c9ed92289f..550132f2bf5 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -547,7 +547,7 @@ void GetGasAbsorberInput(EnergyPlusData &state) thisChiller.SizFac = s_ipsc->rNumericArgs(17); // Validate fuel type input - thisChiller.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, s_ipsc->cAlphaArgs(17))); + thisChiller.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(17)))); if (thisChiller.FuelType == Constant::eFuel::Invalid) { ShowSevereError(state, format("{}=\"{}\", invalid value", s_ipsc->cCurrentModuleObject, s_ipsc->cAlphaArgs(1))); ShowContinueError(state, format("Invalid {}={}", s_ipsc->cAlphaFieldNames(17), s_ipsc->cAlphaArgs(17))); diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index f0f27036085..4fb96e636b5 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -447,7 +447,8 @@ void GetIndirectAbsorberInput(EnergyPlusData &state) } { - thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(6))); + thisChiller.FlowMode = + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 0d0f215d07b..a3ae2569cb3 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -386,7 +386,8 @@ void GetElecReformEIRChillerInput(EnergyPlusData &state) state, s_ipsc->cCurrentModuleObject, s_ipsc->cAlphaArgs(1), s_ipsc->cAlphaArgs(8), s_ipsc->cAlphaArgs(9), "Condenser Water Nodes"); { - thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, s_ipsc->cAlphaArgs(10))); + thisChiller.FlowMode = + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(10)))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, s_ipsc->cCurrentModuleObject, s_ipsc->cAlphaArgs(1))); ShowContinueError(state, format("Invalid {}={}", s_ipsc->cAlphaFieldNames(10), s_ipsc->cAlphaArgs(10))); @@ -585,8 +586,8 @@ void GetElecReformEIRChillerInput(EnergyPlusData &state) } if (NumAlphas > 15) { - thisChiller.CondenserFlowControl = - static_cast(getEnumValue(DataPlant::CondenserFlowControlNamesUC, s_ipsc->cAlphaArgs(16))); + thisChiller.CondenserFlowControl = static_cast( + getEnumValue(DataPlant::CondenserFlowControlNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(16)))); } else { thisChiller.CondenserFlowControl = DataPlant::CondenserFlowControl::ConstantFlow; } diff --git a/src/EnergyPlus/Coils/CoilCoolingDXAshrae205Performance.cc b/src/EnergyPlus/Coils/CoilCoolingDXAshrae205Performance.cc index 6bde580d10b..819151e4fbb 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXAshrae205Performance.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXAshrae205Performance.cc @@ -90,7 +90,7 @@ CoilCoolingDX205Performance::CoilCoolingDX205Performance(EnergyPlus::EnergyPlusD auto const &fields = instance.value(); name = instance.key(); - if (!Util::SameString(name_to_find, name)) { + if (!Util::SameString(name, name_to_find)) { ShowFatalError(state, format("Could not find Coil:Cooling:DX:Performance object with name: {}", name_to_find)); } diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc index 04e9b3bd922..5c18449efd8 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc @@ -142,7 +142,7 @@ CoilCoolingDXCurveFitOperatingMode::CoilCoolingDXCurveFitOperatingMode(EnergyPlu state.dataIPShortCut->rNumericArgs, NumNumbers, IOStatus); - if (!Util::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { + if (!Util::SameString(state.dataIPShortCut->cAlphaArgs(1), name_to_find)) { continue; } found_it = true; diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc index 57287f92404..c788d071f9d 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc @@ -64,7 +64,7 @@ using namespace EnergyPlus; void CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec(EnergyPlus::EnergyPlusData &state, - const CoilCoolingDXCurveFitPerformanceInputSpecification &input_data) + CoilCoolingDXCurveFitPerformanceInputSpecification &input_data) { static constexpr std::string_view routineName("CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec: "); @@ -105,7 +105,7 @@ void CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec(EnergyPlus::Ener this->alternateMode.oneTimeInit(state); // oneTimeInit does not need to be delayed in this use case } // Validate fuel type input - this->compressorFuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(input_data.compressor_fuel_type))); + this->compressorFuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, input_data.compressor_fuel_type)); if (this->compressorFuelType == Constant::eFuel::Invalid) { ShowSevereError(state, format("{} {} =\"{}\" invalid", std::string{routineName}, this->object_name, this->name)); ShowContinueError(state, format("...Compressor Fuel Type=\"{}\".", input_data.compressor_fuel_type)); @@ -173,7 +173,7 @@ CoilCoolingDXCurveFitPerformance::CoilCoolingDXCurveFitPerformance(EnergyPlus::E IOStatus, _, state.dataIPShortCut->lAlphaFieldBlanks); - if (!Util::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { + if (!Util::SameString(state.dataIPShortCut->cAlphaArgs(1), name_to_find)) { continue; } found_it = true; diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh index 908dbfbe078..6f454c8d42d 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh @@ -86,7 +86,7 @@ struct CoilCoolingDXCurveFitPerformance : public CoilCoolingDXPerformanceBase static constexpr std::string_view object_name = "Coil:Cooling:DX:CurveFit:Performance"; std::string parentName; - void instantiateFromInputSpec(EnergyPlusData &state, const CoilCoolingDXCurveFitPerformanceInputSpecification &input_data); + void instantiateFromInputSpec(EnergyPlusData &state, CoilCoolingDXCurveFitPerformanceInputSpecification &input_data); void simulate(EnergyPlusData &state, const DataLoopNode::NodeData &inletNode, diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc index b77964a4da9..80656dcbdff 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc @@ -296,7 +296,7 @@ CoilCoolingDXCurveFitSpeed::CoilCoolingDXCurveFitSpeed(EnergyPlus::EnergyPlusDat state.dataIPShortCut->rNumericArgs, NumNumbers, IOStatus); - if (!Util::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { + if (!Util::SameString(state.dataIPShortCut->cAlphaArgs(1), name_to_find)) { continue; } found_it = true; diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index ccf1231d575..64ae46bc3a2 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -341,7 +341,7 @@ namespace CondenserLoopTowers { } tower.TowerFreeConvNomCapSizingFactor = NumArray(12); if (NumAlphas >= 4) { - tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, Util::makeUPPER(AlphArray(4)))); + tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, AlphArray(4))); if (tower.PerformanceInputMethod_Num == PIM::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(4), AlphArray(4)); ErrorsFound = true; @@ -403,7 +403,7 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, Util::makeUPPER(AlphArray(6)))); + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, AlphArray(6))); tower.UserEvapLossFactor = NumArray(19); // N11 , \field Evaporation Loss Factor tower.DriftLossFraction = NumArray(20) / 100.0; // N12, \field Drift Loss Percent @@ -413,7 +413,7 @@ namespace CondenserLoopTowers { tower.SizFac = 1.0; } - tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, Util::makeUPPER(AlphArray(7)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, AlphArray(7))); if (tower.BlowdownMode == Blowdown::Schedule) { if ((tower.blowdownSched = Sched::GetSchedule(state, AlphArray(8))) == nullptr) { ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(8), AlphArray(8)); @@ -456,7 +456,7 @@ namespace CondenserLoopTowers { // fluid bypass for single speed tower if (s_ipsc->lAlphaFieldBlanks(11) || AlphArray(11).empty()) { tower.CapacityControl = CapacityCtrl::FanCycling; // FanCycling - } else if ((tower.CapacityControl = static_cast(getEnumValue(CapacityCtrlNamesUC, AlphArray(11)))) == + } else if ((tower.CapacityControl = static_cast(getEnumValue(CapacityCtrlNamesUC, Util::makeUPPER(AlphArray(11))))) == CapacityCtrl::Invalid) { tower.CapacityControl = CapacityCtrl::FanCycling; ShowWarningInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(11), AlphArray(11), "The default Fan Cycling is used."); @@ -481,7 +481,7 @@ namespace CondenserLoopTowers { // cell control for single speed tower if (!s_ipsc->lAlphaFieldBlanks(12)) { - tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, Util::makeUPPER(AlphArray(12)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, AlphArray(12))); } // High speed air flow rate must be greater than free convection air flow rate. @@ -603,7 +603,7 @@ namespace CondenserLoopTowers { BranchNodeConnections::TestCompSet(state, s_ipsc->cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); if (NumAlphas >= 4) { - tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, Util::makeUPPER(AlphArray(4)))); + tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, AlphArray(4))); } else { // Since Performance Input Method has been omitted then assume it to be UA and DESIGN WATER FLOW RATE tower.PerformanceInputMethod_Num = PIM::UFactor; @@ -715,7 +715,7 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, Util::makeUPPER(AlphArray(6)))); + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, AlphArray(6))); tower.UserEvapLossFactor = NumArray(27); // N23 , \field Evaporation Loss Factor tower.DriftLossFraction = NumArray(28) / 100.0; // N24, \field Drift Loss Percent tower.ConcentrationRatio = NumArray(29); // N17, \field Blowdown Concentration Ratio @@ -724,7 +724,7 @@ namespace CondenserLoopTowers { tower.SizFac = 1.0; } - tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, Util::makeUPPER(AlphArray(7)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, AlphArray(7))); if (tower.BlowdownMode == Blowdown::Schedule) { if ((tower.blowdownSched = Sched::GetSchedule(state, AlphArray(8))) == nullptr) { ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(8), AlphArray(8)); @@ -751,7 +751,7 @@ namespace CondenserLoopTowers { // cell control for two speed tower if (!s_ipsc->lAlphaFieldBlanks(11)) { - tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, Util::makeUPPER(AlphArray(11)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, AlphArray(11))); } if (s_ipsc->lAlphaFieldBlanks(9)) { @@ -1345,7 +1345,7 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, Util::makeUPPER(AlphArray(8)))); + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, AlphArray(8))); tower.UserEvapLossFactor = NumArray(11); // N11 , \field Evaporation Loss Factor tower.DriftLossFraction = NumArray(12) / 100.0; // N12, \field Drift Loss Percent tower.ConcentrationRatio = NumArray(13); // N13, \field Blowdown Concentration Ratio @@ -1354,7 +1354,7 @@ namespace CondenserLoopTowers { tower.SizFac = 1.0; } - tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, Util::makeUPPER(AlphArray(9)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, AlphArray(9))); if (tower.BlowdownMode == Blowdown::Schedule) { if ((tower.blowdownSched = Sched::GetSchedule(state, AlphArray(10))) == nullptr) { ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(10), AlphArray(10)); @@ -1381,7 +1381,7 @@ namespace CondenserLoopTowers { // cell control for variable speed tower if (!s_ipsc->lAlphaFieldBlanks(13)) { - tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, Util::makeUPPER(AlphArray(13)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, AlphArray(13))); } if (s_ipsc->lAlphaFieldBlanks(11)) { @@ -1586,7 +1586,7 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, Util::makeUPPER(AlphArray(10)))); + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, AlphArray(10))); tower.UserEvapLossFactor = NumArray(23); // N23 , \field Evaporation Loss Factor tower.DriftLossFraction = NumArray(24) / 100.0; // N24, \field Drift Loss Percent tower.ConcentrationRatio = NumArray(25); // N25, \field Blowdown Concentration Ratio @@ -1595,7 +1595,7 @@ namespace CondenserLoopTowers { tower.SizFac = 1.0; } - tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, Util::makeUPPER(AlphArray(11)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, AlphArray(11))); if (tower.BlowdownMode == Blowdown::Schedule) { if ((tower.blowdownSched = Sched::GetSchedule(state, AlphArray(12))) == nullptr) { ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(12), AlphArray(12)); @@ -1622,7 +1622,7 @@ namespace CondenserLoopTowers { tower.TowerMassFlowRateMultiplier = tower.MaxFracFlowRate; // cell control for variable speed Merkel tower if (!s_ipsc->lAlphaFieldBlanks(15)) { - tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, Util::makeUPPER(AlphArray(15)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, AlphArray(15))); } if (s_ipsc->lAlphaFieldBlanks(13)) { @@ -2426,7 +2426,7 @@ namespace CondenserLoopTowers { // Design water flow rate is assumed to be 3 gpm per ton (SI equivalent 5.382E-8 m3/s per watt) this->DesignWaterFlowRate = 5.382e-8 * this->TowerNominalCapacity; tmpDesignWaterFlowRate = this->DesignWaterFlowRate; - if (Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:SingleSpeed")) { + if (DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)] == "CoolingTower:SingleSpeed") { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], @@ -2441,7 +2441,7 @@ namespace CondenserLoopTowers { "Initial Design Water Flow Rate based on tower nominal capacity [m3/s]", this->DesignWaterFlowRate); } - } else if (Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:TwoSpeed")) { + } else if (DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)] == "CoolingTower:TwoSpeed") { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], @@ -2938,7 +2938,7 @@ namespace CondenserLoopTowers { } if (this->PerformanceInputMethod_Num == PIM::NominalCapacity && - Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:TwoSpeed")) { + (DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)] == "CoolingTower:TwoSpeed")) { if (this->DesignWaterFlowRate >= HVAC::SmallWaterVolFlow && this->TowerLowSpeedNomCap > 0.0) { // nominal capacity doesn't include compressor heat; predefined factor was 1.25 W heat rejection per W of evap cooling but now is a @@ -3103,7 +3103,7 @@ namespace CondenserLoopTowers { // calibrate variable speed tower model based on user input by finding calibration water flow rate ratio that // yields an approach temperature that matches user input - if (Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:VariableSpeed")) { + if (DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)] == "CoolingTower:VariableSpeed") { // check range for water flow rate ratio (make sure RegulaFalsi converges) Real64 MaxWaterFlowRateRatio = 0.5; // maximum water flow rate ratio which yields desired approach temp diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 30926c99f09..a8cc3168181 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -780,7 +780,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) intConvUserCurve.Name = ipsc->cAlphaArgs(1); ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, intConvUserCurve.Name}; - intConvUserCurve.refTempType = static_cast(getEnumValue(RefTempNamesUC, ipsc->cAlphaArgs(2))); + intConvUserCurve.refTempType = static_cast(getEnumValue(RefTempNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); if (intConvUserCurve.refTempType == RefTemp::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -874,7 +874,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) extConvUserCurve.Name = ipsc->cAlphaArgs(1); ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, extConvUserCurve.Name}; - extConvUserCurve.windSpeedType = static_cast(getEnumValue(RefWindNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); + extConvUserCurve.windSpeedType = static_cast(getEnumValue(RefWindNamesUC, ipsc->cAlphaArgs(2))); if (extConvUserCurve.windSpeedType == RefWind::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1060,7 +1060,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) ErrorsFound = true; } - HcExt hcExt = static_cast(getEnumValue(HcExtNamesUC, Alphas(Ptr + 1))); + HcExt hcExt = static_cast(getEnumValue(HcExtNamesUC, Util::makeUPPER(Alphas(Ptr + 1)))); switch (hcExt) { @@ -1176,7 +1176,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) continue; } - HcInt hcInt = static_cast(getEnumValue(HcIntNamesUC, Alphas(Ptr + 1))); + HcInt hcInt = static_cast(getEnumValue(HcIntNamesUC, Util::makeUPPER(Alphas(Ptr + 1)))); switch (hcInt) { // Are these not used anymore? They can be deleted then @@ -1308,7 +1308,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) ipsc->cNumericFieldNames); // Check Field 1 for validity ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, ""}; - SurfaceFilter surfaceFilter = static_cast(getEnumValue(SurfaceFilterNamesUC, Alphas(1))); + SurfaceFilter surfaceFilter = static_cast(getEnumValue(SurfaceFilterNamesUC, Util::makeUPPER(Alphas(1)))); for (int Pass = 1, Ptr = 2, FieldNo = 2, NumField = 1; Pass <= 2; ++Pass, Ptr += 4, FieldNo += 4, ++NumField) { @@ -1318,7 +1318,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) if (Alphas(Ptr) == "OUTSIDE") { - HcExt hcExt = static_cast(getEnumValue(HcExtNamesUC, Alphas(Ptr + 1))); + HcExt hcExt = static_cast(getEnumValue(HcExtNamesUC, Util::makeUPPER(Alphas(Ptr + 1)))); switch (hcExt) { @@ -1423,7 +1423,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) } // switch (hcExt) } else if (Alphas(Ptr) == "INSIDE") { - HcInt hcInt = static_cast(getEnumValue(HcIntNamesUC, Alphas(Ptr + 1))); + HcInt hcInt = static_cast(getEnumValue(HcIntNamesUC, Util::makeUPPER(Alphas(Ptr + 1)))); switch (hcInt) { @@ -1606,7 +1606,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) auto &intAlgo = state.dataConvect->intAdaptiveConvAlgo; for (int iInConvClass = 0, i = 2; iInConvClass < (int)IntConvClass::Num && i <= NumAlphas; ++iInConvClass, i += 2) { - intAlgo.intConvClassEqNums[iInConvClass] = static_cast(getEnumValue(HcIntNamesUC, ipsc->cAlphaArgs(i))); + intAlgo.intConvClassEqNums[iInConvClass] = static_cast(getEnumValue(HcIntNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(i)))); if (intAlgo.intConvClassEqNums[iInConvClass] == HcInt::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(i), ipsc->cAlphaArgs(i)); @@ -1643,7 +1643,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) for (int iOutConvClass = 0, i = 2; i < (int)ExtConvClass::Num && i <= NumAlphas; ++iOutConvClass, i += 2) { - extAlgo.extConvClass2EqNums[iOutConvClass] = static_cast(getEnumValue(HcExtNamesUC, ipsc->cAlphaArgs(i))); + extAlgo.extConvClass2EqNums[iOutConvClass] = static_cast(getEnumValue(HcExtNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(i)))); if (extAlgo.extConvClass2EqNums[iOutConvClass] == HcExt::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(i), ipsc->cAlphaArgs(i)); diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc index 1c68caa93b0..06ffe8e9a52 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -237,7 +237,7 @@ namespace CoolTower { { state.dataCoolTower->CoolTowerSys(CoolTowerNum).FlowCtrlType = - static_cast(getEnumValue(FlowCtrlNamesUC, s_ipsc->cAlphaArgs(5))); // Type of flow control + static_cast(getEnumValue(FlowCtrlNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(5)))); // Type of flow control if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).FlowCtrlType == FlowCtrl::Invalid) { ShowSevereError( state, diff --git a/src/EnergyPlus/CostEstimateManager.cc b/src/EnergyPlus/CostEstimateManager.cc index 72a30586bc2..0dd16723560 100644 --- a/src/EnergyPlus/CostEstimateManager.cc +++ b/src/EnergyPlus/CostEstimateManager.cc @@ -184,7 +184,7 @@ namespace CostEstimateManager { IOStatus); state.dataCostEstimateManager->CostLineItem(Item).LineName = state.dataIPShortCut->cAlphaArgs(1); state.dataCostEstimateManager->CostLineItem(Item).ParentObjType = - static_cast(getEnumValue(ParentObjectNamesUC, state.dataIPShortCut->cAlphaArgs(3))); + static_cast(getEnumValue(ParentObjectNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); state.dataCostEstimateManager->CostLineItem(Item).ParentObjName = state.dataIPShortCut->cAlphaArgs(4); state.dataCostEstimateManager->CostLineItem(Item).PerEach = state.dataIPShortCut->rNumericArgs(1); state.dataCostEstimateManager->CostLineItem(Item).PerSquareMeter = state.dataIPShortCut->rNumericArgs(2); diff --git a/src/EnergyPlus/CurveManager.cc b/src/EnergyPlus/CurveManager.cc index 332d8c004d1..bf716a26ef0 100644 --- a/src/EnergyPlus/CurveManager.cc +++ b/src/EnergyPlus/CurveManager.cc @@ -2576,9 +2576,9 @@ namespace Curve { }; NormalizationMethod normalizeMethod = NM_NONE; if (fields.count("normalization_method") != 0u) { - if (Util::SameString(fields.at("normalization_method").get(), "DIVISORONLY")) { + if (equali(fields.at("normalization_method").get(), "DIVISORONLY")) { normalizeMethod = NM_DIVISOR_ONLY; - } else if (Util::SameString(fields.at("normalization_method").get(), "AUTOMATICWITHDIVISOR")) { + } else if (equali(fields.at("normalization_method").get(), "AUTOMATICWITHDIVISOR")) { normalizeMethod = NM_AUTO_WITH_DIVISOR; } } @@ -3010,7 +3010,7 @@ namespace Curve { if (InInputType.empty()) { return true; // if not used it is valid } - CurveInputType found = static_cast(getEnumValue(inputTypes, Util::makeUPPER(InInputType))); + CurveInputType found = static_cast(getEnumValue(inputTypes, InInputType)); return found != CurveInputType::Invalid; } @@ -3038,7 +3038,7 @@ namespace Curve { }; constexpr std::array(CurveOutputType::Num)> outputTypes = { "DIMENSIONLESS", "PRESSURE", "TEMPERATURE", "CAPACITY", "POWER"}; - CurveOutputType found = static_cast(getEnumValue(outputTypes, Util::makeUPPER(InOutputType))); + CurveOutputType found = static_cast(getEnumValue(outputTypes, InOutputType)); return found != CurveOutputType::Invalid; } diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 08a6065c4d2..720226b636c 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -3251,7 +3251,7 @@ void GetDXCoils(EnergyPlusData &state) cFieldName = "Evaporator Air Temperature Type for Curve Objects"; // Alphas(10) fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "evaporator_air_temperature_type_for_curve_objects"); - thisDXCoil.InletAirTemperatureType = static_cast(getEnumValue(HVAC::oatTypeNamesUC, Util::makeUPPER(fieldValue))); + thisDXCoil.InletAirTemperatureType = static_cast(getEnumValue(HVAC::oatTypeNamesUC, fieldValue)); if (thisDXCoil.InletAirTemperatureType == HVAC::OATType::Invalid) { // wrong temperature type selection ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); @@ -3718,7 +3718,7 @@ void GetDXCoils(EnergyPlusData &state) cFieldName = "Evaporator Air Temperature Type for Curve Objects"; // Alphas(6) fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "evaporator_air_temperature_type_for_curve_objects"); - thisDXCoil.InletAirTemperatureType = static_cast(getEnumValue(HVAC::oatTypeNamesUC, Util::makeUPPER(fieldValue))); + thisDXCoil.InletAirTemperatureType = static_cast(getEnumValue(HVAC::oatTypeNamesUC, fieldValue)); if (thisDXCoil.InletAirTemperatureType == HVAC::OATType::Invalid) { // wrong temperature type selection ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); @@ -4142,7 +4142,7 @@ void GetDXCoils(EnergyPlusData &state) } // A13; \field Fuel type, Validate fuel type input - thisDXCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(13))); + thisDXCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(Alphas(13)))); thisDXCoil.NumOfSpeeds = Numbers(6); // Number of speeds if (thisDXCoil.NumOfSpeeds < 2) { @@ -4668,7 +4668,7 @@ void GetDXCoils(EnergyPlusData &state) } // A10; \field Fuel type, Validate fuel type input - thisDXCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(10))); + thisDXCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(Alphas(10)))); thisDXCoil.RegionNum = Numbers(8); // Region Number for HSPF Calc thisDXCoil.NumOfSpeeds = Numbers(9); // Number of speeds @@ -15347,7 +15347,7 @@ GetDXCoilName(EnergyPlusData &state, int &DXCoilIndex, bool &ErrorsFound, std::s } Real64 GetCoilCapacity(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -15767,15 +15767,15 @@ int GetHPCoolingCoilIndex(EnergyPlusData &state, DXCoolingCoilIndex = 0; - DataLoopNode::ConnectionObjectType HeatingCoilTypeNum = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(HeatingCoilType))); + DataLoopNode::ConnectionObjectType HeatingCoilTypeNum = + static_cast(getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, HeatingCoilType)); DataLoopNode::ConnectionObjectType CompSetsParentType; // Parent object type which uses DX heating coil pass into this function std::string CompSetsParentName; for (WhichComp = 1; WhichComp <= state.dataBranchNodeConnections->NumCompSets; ++WhichComp) { if (HeatingCoilTypeNum != state.dataBranchNodeConnections->CompSets(WhichComp).ComponentObjectType || - !Util::SameString(HeatingCoilName, state.dataBranchNodeConnections->CompSets(WhichComp).CName)) { + !Util::SameString(state.dataBranchNodeConnections->CompSets(WhichComp).CName, HeatingCoilName)) { continue; } CompSetsParentType = state.dataBranchNodeConnections->CompSets(WhichComp).ParentObjectType; diff --git a/src/EnergyPlus/DXCoils.hh b/src/EnergyPlus/DXCoils.hh index 3ce9b7f34a2..3d118033965 100644 --- a/src/EnergyPlus/DXCoils.hh +++ b/src/EnergyPlus/DXCoils.hh @@ -719,7 +719,7 @@ namespace DXCoils { EnergyPlusData &state, int &DXCoilIndex, bool &ErrorsFound, std::string_view const ThisObjectType = {}, bool const SuppressWarning = false); Real64 GetCoilCapacity(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); diff --git a/src/EnergyPlus/DataSurfaceColors.cc b/src/EnergyPlus/DataSurfaceColors.cc index 922fb8e81c7..c4e47771ebd 100644 --- a/src/EnergyPlus/DataSurfaceColors.cc +++ b/src/EnergyPlus/DataSurfaceColors.cc @@ -103,7 +103,7 @@ bool MatchAndSetColorTextString(EnergyPlusData &state, } // try to find enum value - int foundIdx = getEnumValue(colorkeys, Util::makeUPPER(String)); + int foundIdx = getEnumValue(colorkeys, String); if (foundIdx == -1) { return false; } diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index b14bc7f3d17..98a9cb54fd6 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -685,7 +685,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) for (int CompNum = 1; CompNum <= state.dataZoneEquip->SupplyAirPath(PathNum).NumOfComponents; ++CompNum) { - if ((AlphArray(Counter) == "AIRLOOPHVAC:ZONESPLITTER") || (AlphArray(Counter) == "AIRLOOPHVAC:SUPPLYPLENUM")) { + if ((equali(AlphArray(Counter), "AIRLOOPHVAC:ZONESPLITTER")) || (equali(AlphArray(Counter), "AIRLOOPHVAC:SUPPLYPLENUM"))) { state.dataZoneEquip->SupplyAirPath(PathNum).ComponentType(CompNum) = AlphArray(Counter); state.dataZoneEquip->SupplyAirPath(PathNum).ComponentName(CompNum) = AlphArray(Counter + 1); @@ -698,7 +698,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) state.dataZoneEquip->SupplyAirPath(PathNum).SplitterIndex(CompNum) = 0; state.dataZoneEquip->SupplyAirPath(PathNum).PlenumIndex(CompNum) = 0; state.dataZoneEquip->SupplyAirPath(PathNum).ComponentTypeEnum(CompNum) = - (AirLoopHVACZone)getEnumValue(AirLoopHVACTypeNamesUC, AlphArray(Counter)); + (AirLoopHVACZone)getEnumValue(AirLoopHVACTypeNamesUC, Util::makeUPPER(AlphArray(Counter))); } else { ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, cAlphaFields(1), state.dataZoneEquip->SupplyAirPath(PathNum).Name)); ShowContinueError(state, format("Unhandled component type =\"{}\".", AlphArray(Counter))); @@ -767,7 +767,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; } state.dataZoneEquip->ReturnAirPath(PathNum).ComponentTypeEnum(CompNum) = - static_cast(getEnumValue(AirLoopHVACTypeNamesUC, AlphArray(Counter))); + static_cast(getEnumValue(AirLoopHVACTypeNamesUC, Util::makeUPPER(AlphArray(Counter)))); } else { ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, cAlphaFields(1), state.dataZoneEquip->ReturnAirPath(PathNum).Name)); ShowContinueError(state, format("Unhandled component type =\"{}\".", AlphArray(Counter))); @@ -883,7 +883,7 @@ void processZoneEquipmentInput(EnergyPlusData &state, std::string loadDistName = ip->getAlphaFieldValue(epListFields, objectSchemaProps, "load_distribution_scheme"); thisZoneEquipList.LoadDistScheme = - static_cast(getEnumValue(DataZoneEquipment::LoadDistNamesUC, Util::makeUPPER(loadDistName))); + static_cast(getEnumValue(DataZoneEquipment::LoadDistNamesUC, loadDistName)); if (thisZoneEquipList.LoadDistScheme == DataZoneEquipment::LoadDist::Invalid) { ShowSevereError(state, format("{}{} = \"{}, Invalid choice\".", RoutineName, CurrentModuleObject, thisZoneEquipList.Name)); ShowContinueError(state, format("...load_distribution_scheme=\"{}\".", loadDistName)); @@ -1250,7 +1250,7 @@ void processZoneEquipSplitterInput(EnergyPlusData &state, static constexpr std::string_view RoutineName("processZoneEquipSplitterInput: "); // include trailing blank space auto &ip = state.dataInputProcessing->inputProcessor; std::string const zeqTypeName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_equipment_object_type"); - thisZeqSplitter.zoneEquipType = DataZoneEquipment::ZoneEquipType(getEnumValue(zoneEquipTypeNamesUC, zeqTypeName)); + thisZeqSplitter.zoneEquipType = DataZoneEquipment::ZoneEquipType(getEnumValue(zoneEquipTypeNamesUC, Util::makeUPPER(zeqTypeName))); if (thisZeqSplitter.zoneEquipType == ZoneEquipType::Invalid) { ShowSevereError(state, format("{}{} = {}", RoutineName, zeqSplitterModuleObject, thisZeqSplitter.Name)); ShowContinueError(state, format("..Invalid Equipment Type = {}", zeqTypeName)); @@ -1295,8 +1295,8 @@ void processZoneEquipSplitterInput(EnergyPlusData &state, NodeInputManager::CompFluidStream::Primary, objectIsParent); - thisZeqSplitter.tstatControl = DataZoneEquipment::ZoneEquipTstatControl( - getEnumValue(zoneEquipTstatControlNamesUC, ip->getAlphaFieldValue(objectFields, objectSchemaProps, "thermostat_control_method"))); + thisZeqSplitter.tstatControl = DataZoneEquipment::ZoneEquipTstatControl(getEnumValue( + zoneEquipTstatControlNamesUC, Util::makeUPPER(ip->getAlphaFieldValue(objectFields, objectSchemaProps, "thermostat_control_method")))); if (thisZeqSplitter.tstatControl == DataZoneEquipment::ZoneEquipTstatControl::SingleSpace) { std::string spaceName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "control_space_name"); thisZeqSplitter.controlSpaceIndex = Util::FindItemInList(spaceName, state.dataHeatBal->space); @@ -1306,8 +1306,8 @@ void processZoneEquipSplitterInput(EnergyPlusData &state, state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; } } - thisZeqSplitter.spaceSizingBasis = DataZoneEquipment::SpaceEquipSizingBasis( - getEnumValue(spaceEquipSizingBasisNamesUC, ip->getAlphaFieldValue(objectFields, objectSchemaProps, "space_fraction_method"))); + thisZeqSplitter.spaceSizingBasis = DataZoneEquipment::SpaceEquipSizingBasis(getEnumValue( + spaceEquipSizingBasisNamesUC, Util::makeUPPER(ip->getAlphaFieldValue(objectFields, objectSchemaProps, "space_fraction_method")))); auto extensibles = objectFields.find("spaces"); auto const &extensionSchemaProps = objectSchemaProps["spaces"]["items"]["properties"]; @@ -1383,8 +1383,8 @@ void processZoneEquipMixerInput(EnergyPlusData &state, state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; } - thisZeqMixer.spaceSizingBasis = DataZoneEquipment::SpaceEquipSizingBasis( - getEnumValue(spaceEquipSizingBasisNamesUC, ip->getAlphaFieldValue(objectFields, objectSchemaProps, "space_fraction_method"))); + thisZeqMixer.spaceSizingBasis = DataZoneEquipment::SpaceEquipSizingBasis(getEnumValue( + spaceEquipSizingBasisNamesUC, Util::makeUPPER(ip->getAlphaFieldValue(objectFields, objectSchemaProps, "space_fraction_method")))); auto extensibles = objectFields.find("spaces"); auto const &extensionSchemaProps = objectSchemaProps["spaces"]["items"]["properties"]; @@ -1801,7 +1801,7 @@ int GetZoneEquipControlledZoneNum(EnergyPlusData &state, DataZoneEquipment::Zone } for (int Num = 1; Num <= state.dataZoneEquip->ZoneEquipList(CtrlZone).NumOfEquipTypes; ++Num) { if (zoneEquipType == state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipType(Num) && - Util::SameString(EquipmentName, state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipName(Num))) { + Util::SameString(state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipName(Num), EquipmentName)) { return ControlZoneNum = CtrlZone; } } diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 82ed0a15ae0..96d58821fcc 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -1149,7 +1149,7 @@ void CalcDayltgCoeffsMapPoints(EnergyPlusData &state, int const mapNum) int WinEl; // window elements counter Vector3 W2; - Vector3 W3; + Vector3 W3 = {0.0, 0.0, 0.0}; Vector3 W21; Vector3 W23; Vector3 RREF2; @@ -4586,8 +4586,7 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) if (s_ipsc->lAlphaFieldBlanks(3)) { daylightControl.DaylightMethod = DaylightingMethod::SplitFlux; } else { - daylightControl.DaylightMethod = - static_cast(getEnumValue(DaylightingMethodNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); + daylightControl.DaylightMethod = static_cast(getEnumValue(DaylightingMethodNamesUC, s_ipsc->cAlphaArgs(3))); if (daylightControl.DaylightMethod == DaylightingMethod::Invalid) { daylightControl.DaylightMethod = DaylightingMethod::SplitFlux; @@ -4614,7 +4613,7 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) daylightControl.availSched = Sched::GetScheduleAlwaysOn(state); } - daylightControl.LightControlType = static_cast(getEnumValue(LtgCtrlTypeNamesUC, s_ipsc->cAlphaArgs(5))); + daylightControl.LightControlType = static_cast(getEnumValue(LtgCtrlTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(5)))); if (daylightControl.LightControlType == LtgCtrlType::Invalid) { ShowWarningInvalidKey( state, eoh, s_ipsc->cAlphaFieldNames(5), s_ipsc->cAlphaArgs(5), "Continuous assumed, and the simulation continues."); diff --git a/src/EnergyPlus/DemandManager.cc b/src/EnergyPlus/DemandManager.cc index efac0797c07..5815e1ad405 100644 --- a/src/EnergyPlus/DemandManager.cc +++ b/src/EnergyPlus/DemandManager.cc @@ -401,8 +401,7 @@ void GetDemandManagerListInput(EnergyPlusData &state) thisDemandMgrList.History = 0.0; // Validate Demand Manager Priority - thisDemandMgrList.ManagerPriority = - static_cast(getEnumValue(ManagePriorityNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(6)))); + thisDemandMgrList.ManagerPriority = static_cast(getEnumValue(ManagePriorityNamesUC, s_ipsc->cAlphaArgs(6))); ErrorsFound = ErrorsFound || (thisDemandMgrList.ManagerPriority == ManagePriorityType::Invalid); // Get DEMAND MANAGER Type and Name pairs @@ -414,7 +413,7 @@ void GetDemandManagerListInput(EnergyPlusData &state) auto &thisManager = thisDemandMgrList.Manager(MgrNum); // Validate DEMAND MANAGER Type - ManagerType MgrType = static_cast(getEnumValue(ManagerNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(MgrNum * 2 + 5)))); + ManagerType MgrType = static_cast(getEnumValue(ManagerNamesUC, s_ipsc->cAlphaArgs(MgrNum * 2 + 5))); if (MgrType != ManagerType::Invalid) { thisManager = Util::FindItemInList(s_ipsc->cAlphaArgs(MgrNum * 2 + 6), state.dataDemandManager->DemandMgr); if (thisManager == 0) { @@ -644,7 +643,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, Util::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, AlphArray(3))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) { @@ -656,7 +655,7 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.LowerLimit = NumArray(2); // Validate Selection Control - demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, AlphArray(4))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(4) == 0.0) { @@ -731,7 +730,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, Util::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, AlphArray(3))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) { @@ -743,7 +742,7 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.LowerLimit = NumArray(2); // Validate Selection Control - demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, AlphArray(4))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(4) == 0.0) { @@ -840,7 +839,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, Util::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, AlphArray(3))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) { @@ -852,7 +851,7 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.LowerLimit = NumArray(2); // Validate Selection Control - demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, AlphArray(4))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(4) == 0.0) { @@ -949,7 +948,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, Util::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, AlphArray(3))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) { @@ -971,7 +970,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Selection Control - demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, AlphArray(4))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(5) == 0.0) { @@ -1064,7 +1063,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitVentNamesUC, Util::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitVentNamesUC, AlphArray(3))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); demandMgr.LimitDuration = (NumArray(1) == 0.0) ? state.dataGlobal->MinutesInTimeStep : NumArray(1); @@ -1079,7 +1078,7 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.LowerLimit = NumArray(4); // Validate Selection Control - demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, AlphArray(4))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); demandMgr.RotationDuration = (NumArray(5) == 0.0) ? state.dataGlobal->MinutesInTimeStep : NumArray(5); diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index a6bd9fc70c5..0fb09896e3e 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -122,6 +122,7 @@ namespace DesiccantDehumidifiers { // (Please see copyright and disclaimer information at end of module) Real64 constexpr TempSteamIn = 100.0; + std::string coilHeatingWater = "Coil:Heating:Water"; void SimDesiccantDehumidifier(EnergyPlusData &state, std::string const &CompName, // name of the dehumidifier unit @@ -375,7 +376,7 @@ namespace DesiccantDehumidifiers { desicDehum.RegenCoilType = Alphas(8); desicDehum.RegenCoilName = Alphas(9); - desicDehum.regenFanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(10))); + desicDehum.regenFanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(Alphas(10)))); assert(desicDehum.regenFanType != HVAC::FanType::Invalid); RegenCoilType = Alphas(8); @@ -415,7 +416,7 @@ namespace DesiccantDehumidifiers { // Get the Heating Coil Hot water Inlet or control Node number errFlag = false; - desicDehum.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", RegenCoilName, errFlag); + desicDehum.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, coilHeatingWater, RegenCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); ErrorsFound = true; @@ -423,7 +424,7 @@ namespace DesiccantDehumidifiers { // Get the Regeneration Heating Coil hot water max volume flow rate errFlag = false; - desicDehum.MaxCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", RegenCoilName, errFlag); + desicDehum.MaxCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, RegenCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); ErrorsFound = true; @@ -431,7 +432,7 @@ namespace DesiccantDehumidifiers { // Get the Regeneration Heating Coil Inlet Node errFlag = false; - int RegenCoilAirInletNode = WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", RegenCoilName, errFlag); + int RegenCoilAirInletNode = WaterCoils::GetCoilInletNodeConstCoil(state, "Coil:Heating:Water", RegenCoilName, errFlag); desicDehum.RegenCoilInletNode = RegenCoilAirInletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); @@ -440,7 +441,7 @@ namespace DesiccantDehumidifiers { // Get the Regeneration Heating Coil Outlet Node errFlag = false; - int RegenCoilAirOutletNode = WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", RegenCoilName, errFlag); + int RegenCoilAirOutletNode = WaterCoils::GetCoilOutletNode(state, coilHeatingWater, RegenCoilName, errFlag); desicDehum.RegenCoilOutletNode = RegenCoilAirOutletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); @@ -465,7 +466,7 @@ namespace DesiccantDehumidifiers { // Get the regeneration Heating Coil steam inlet node number errFlag = false; - desicDehum.CoilControlNode = SteamCoils::GetCoilSteamInletNode(state, "Coil:Heating:Steam", RegenCoilName, errFlag); + desicDehum.CoilControlNode = SteamCoils::GetCoilSteamInletNode(state, desicDehum.RegenCoilType, RegenCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); ErrorsFound = true; @@ -764,7 +765,7 @@ namespace DesiccantDehumidifiers { ErrorsFoundGeneric = true; } - desicDehum.regenFanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(6))); + desicDehum.regenFanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(Alphas(6)))); assert(desicDehum.regenFanType != HVAC::FanType::Invalid); desicDehum.RegenFanName = Alphas(7); @@ -786,7 +787,7 @@ namespace DesiccantDehumidifiers { ErrorsFoundGeneric = true; } - desicDehum.regenFanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Alphas(8))); + desicDehum.regenFanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Util::makeUPPER(Alphas(8)))); if (desicDehum.regenFanPlace == HVAC::FanPlace::Invalid) { ShowWarningInvalidKey(state, eoh, cAlphaFields(8), Alphas(8), "DrawThrough"); desicDehum.regenFanPlace = HVAC::FanPlace::DrawThru; @@ -902,7 +903,7 @@ namespace DesiccantDehumidifiers { // Get the Heating Coil Hot water Inlet or control Node number errFlag = false; - desicDehum.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", RegenCoilName, errFlag); + desicDehum.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, coilHeatingWater, RegenCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); ErrorsFound = true; @@ -910,7 +911,7 @@ namespace DesiccantDehumidifiers { // Get the Regeneration Heating Coil hot water max volume flow rate errFlag = false; - desicDehum.MaxCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", RegenCoilName, errFlag); + desicDehum.MaxCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, RegenCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); ErrorsFound = true; @@ -918,7 +919,7 @@ namespace DesiccantDehumidifiers { // Get the Regeneration Heating Coil Inlet Node errFlag = false; - int RegenCoilAirInletNode = WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", RegenCoilName, errFlag); + int RegenCoilAirInletNode = WaterCoils::GetCoilInletNodeConstCoil(state, "Coil:Heating:Water", RegenCoilName, errFlag); desicDehum.RegenCoilInletNode = RegenCoilAirInletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); @@ -927,7 +928,7 @@ namespace DesiccantDehumidifiers { // Get the Regeneration Heating Coil Outlet Node errFlag = false; - int RegenCoilAirOutletNode = WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", RegenCoilName, errFlag); + int RegenCoilAirOutletNode = WaterCoils::GetCoilOutletNode(state, coilHeatingWater, RegenCoilName, errFlag); desicDehum.RegenCoilOutletNode = RegenCoilAirOutletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); @@ -964,7 +965,7 @@ namespace DesiccantDehumidifiers { // Get the regeneration Heating Coil steam inlet node number errFlag = false; - desicDehum.CoilControlNode = SteamCoils::GetCoilSteamInletNode(state, "Coil:Heating:Steam", RegenCoilName, errFlag); + desicDehum.CoilControlNode = SteamCoils::GetCoilSteamInletNode(state, desicDehum.RegenCoilType, RegenCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, desicDehum.Name)); ErrorsFound = true; @@ -1650,8 +1651,7 @@ namespace DesiccantDehumidifiers { } ErrorFlag = false; - desicDehum.MaxCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", desicDehum.RegenCoilName, ErrorFlag); + desicDehum.MaxCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, desicDehum.RegenCoilName, ErrorFlag); if (desicDehum.MaxCoilFluidFlow > 0.0) { Real64 FluidDensity = state.dataPlnt->PlantLoop(desicDehum.plantLoc.loopNum).glycol->getDensity(state, Constant::HWInitConvTemp, initCBVAV); @@ -1759,7 +1759,7 @@ namespace DesiccantDehumidifiers { WaterCoils::SimulateWaterCoilComponents(state, desicDehum.RegenCoilName, FirstHVACIteration, desicDehum.RegenCoilIndex); ErrorFlag = false; Real64 CoilMaxVolFlowRate = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", desicDehum.RegenCoilName, ErrorFlag); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, desicDehum.RegenCoilName, ErrorFlag); // if (ErrorFlag) { // ErrorsFound = true; //} diff --git a/src/EnergyPlus/DuctLoss.cc b/src/EnergyPlus/DuctLoss.cc index 63e294b1c94..703b31a1fb2 100644 --- a/src/EnergyPlus/DuctLoss.cc +++ b/src/EnergyPlus/DuctLoss.cc @@ -820,7 +820,8 @@ namespace DuctLoss { if (thisDuctLoss.LossType == DuctLossType::Leakage) { AFNNodeNum1 = state.afn->AirflowNetworkLinkageData(thisDuctLoss.LinkageNum).NodeNums[0]; AFNNodeNum2 = state.afn->AirflowNetworkLinkageData(thisDuctLoss.LinkageNum).NodeNums[1]; - if (!state.afn->DisSysNodeData(AFNNodeNum1).EPlusName.empty() && state.afn->DisSysNodeData(AFNNodeNum1).EPlusType != "ZONE") { + if (!state.afn->DisSysNodeData(AFNNodeNum1).EPlusName.empty() && + !equali(state.afn->DisSysNodeData(AFNNodeNum1).EPlusType, "ZONE")) { NodeNum1 = Util::FindItemInList(state.afn->DisSysNodeData(AFNNodeNum1).EPlusName, state.dataLoopNodes->NodeID); // Zone inlet state.afn->DisSysNodeData(AFNNodeNum1).EPlusNodeNum = NodeNum1; diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index 75e6f84e158..459cb9abf8f 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -754,8 +754,9 @@ namespace EMSManager { thisEMSactuator.UniqueIDName = cAlphaArgs(2); thisEMSactuator.ControlTypeName = cAlphaArgs(4); - auto found = state.dataRuntimeLang->EMSActuatorAvailableMap.find( - std::make_tuple(thisEMSactuator.ComponentTypeName, thisEMSactuator.UniqueIDName, thisEMSactuator.ControlTypeName)); + auto found = state.dataRuntimeLang->EMSActuatorAvailableMap.find(std::make_tuple(Util::makeUPPER(thisEMSactuator.ComponentTypeName), + Util::makeUPPER(thisEMSactuator.UniqueIDName), + Util::makeUPPER(thisEMSactuator.ControlTypeName))); if (found != state.dataRuntimeLang->EMSActuatorAvailableMap.end()) { // SetupNodeSetPointAsActuators has NOT been called yet at this point @@ -858,7 +859,7 @@ namespace EMSManager { state.dataRuntimeLang->EMSProgramCallManager(CallManagerNum).Name = cAlphaArgs(1); state.dataRuntimeLang->EMSProgramCallManager(CallManagerNum).CallingPoint = - static_cast(getEnumValue(EMSCallFromNamesUC, Util::makeUPPER(cAlphaArgs(2)))); + static_cast(getEnumValue(EMSCallFromNamesUC, cAlphaArgs(2))); ErrorsFound = ErrorsFound || (state.dataRuntimeLang->EMSProgramCallManager(CallManagerNum).CallingPoint == EMSCallFrom::Invalid); @@ -1041,8 +1042,9 @@ namespace EMSManager { continue; } - auto found = s_lang->EMSActuatorAvailableMap.find( - std::make_tuple(actuatorUsed.ComponentTypeName, actuatorUsed.UniqueIDName, actuatorUsed.ControlTypeName)); + auto found = s_lang->EMSActuatorAvailableMap.find(std::make_tuple(Util::makeUPPER(actuatorUsed.ComponentTypeName), + Util::makeUPPER(actuatorUsed.UniqueIDName), + Util::makeUPPER(actuatorUsed.ControlTypeName))); if (found == s_lang->EMSActuatorAvailableMap.end()) { if (reportErrors) { ShowSevereError(state, format("Actuator {} = {} not found.", cCurrentModuleObject, actuatorUsed.Name)); @@ -2169,8 +2171,8 @@ void SetupEMSInternalVariable( bool FoundDuplicate = false; for (int InternalVarAvailNum = 1; InternalVarAvailNum <= state.dataRuntimeLang->numEMSInternalVarsAvailable; ++InternalVarAvailNum) { - if ((Util::SameString(cDataTypeName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName)) && - (Util::SameString(cUniqueIDName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName))) { + if ((Util::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName, cDataTypeName)) && + (Util::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName, cUniqueIDName))) { FoundDuplicate = true; break; } @@ -2218,8 +2220,8 @@ void SetupEMSInternalVariable( bool FoundDuplicate = false; for (int InternalVarAvailNum = 1; InternalVarAvailNum <= state.dataRuntimeLang->numEMSInternalVarsAvailable; ++InternalVarAvailNum) { - if ((Util::SameString(cDataTypeName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName)) && - (Util::SameString(cUniqueIDName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName))) { + if ((Util::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName, cDataTypeName)) && + (Util::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName, cUniqueIDName))) { FoundDuplicate = true; break; } diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index 7411057d1bc..cac79d704f0 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -276,7 +276,7 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i if (s_ipsc->cAlphaArgs(3).empty()) { thisEarthTube.FanType = Ventilation::Natural; } else { - thisEarthTube.FanType = static_cast(getEnumValue(ventilationNamesUC, s_ipsc->cAlphaArgs(3))); + thisEarthTube.FanType = static_cast(getEnumValue(ventilationNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); if (thisEarthTube.FanType == Ventilation::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3)); ErrorsFound = true; @@ -384,7 +384,7 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i ErrorsFound = true; } - SoilType soilType = static_cast(getEnumValue(soilTypeNamesUC, s_ipsc->cAlphaArgs(4))); + SoilType soilType = static_cast(getEnumValue(soilTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(4)))); constexpr std::array(SoilType::Num)> thermalDiffusivity = {0.0781056, 0.055728, 0.0445824, 0.024192}; constexpr std::array(SoilType::Num)> thermalConductivity = {2.42, 1.3, 0.865, 0.346}; if (soilType == SoilType::Invalid) { @@ -415,7 +415,7 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i if (s_ipsc->cAlphaArgs(5).empty()) { thisEarthTube.ModelType = EarthTubeModelType::Basic; } else { - thisEarthTube.ModelType = static_cast(getEnumValue(solutionTypeNamesUC, s_ipsc->cAlphaArgs(5))); + thisEarthTube.ModelType = static_cast(getEnumValue(solutionTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(5)))); if (thisEarthTube.ModelType == EarthTubeModelType::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(5), s_ipsc->cAlphaArgs(5)); ErrorsFound = true; diff --git a/src/EnergyPlus/EconomicLifeCycleCost.cc b/src/EnergyPlus/EconomicLifeCycleCost.cc index 703f2d73435..e27fa5c3c4f 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.cc +++ b/src/EnergyPlus/EconomicLifeCycleCost.cc @@ -210,7 +210,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key MidYear // \key BeginningOfYear // \default EndOfYear - elcc->discountConvention = static_cast(getEnumValue(DiscConvNamesUC, Util::makeUPPER(AlphaArray(2)))); + elcc->discountConvention = static_cast(getEnumValue(DiscConvNamesUC, AlphaArray(2))); if (elcc->discountConvention == DiscConv::Invalid) { elcc->discountConvention = DiscConv::EndOfYear; ShowWarningError( @@ -223,7 +223,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key ConstantDollar // \key CurrentDollar // \default ConstantDollar - elcc->inflationApproach = static_cast(getEnumValue(InflApprNamesUC, Util::makeUPPER(AlphaArray(3)))); + elcc->inflationApproach = static_cast(getEnumValue(InflApprNamesUC, AlphaArray(3))); if (elcc->inflationApproach == InflAppr::Invalid) { elcc->inflationApproach = InflAppr::ConstantDollar; ShowWarningError(state, @@ -295,7 +295,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key November // \key December // \default January - elcc->baseDateMonth = getEnumValue(Util::MonthNamesUC, Util::makeUPPER(AlphaArray(4))); + elcc->baseDateMonth = getEnumValue(Util::MonthNamesUC, AlphaArray(4)); if (elcc->baseDateMonth == -1) { elcc->baseDateMonth = 0; ShowWarningError(state, @@ -336,7 +336,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key November // \key December // \default January - elcc->serviceDateMonth = getEnumValue(Util::MonthNamesUC, Util::makeUPPER(AlphaArray(5))); + elcc->serviceDateMonth = getEnumValue(Util::MonthNamesUC, AlphaArray(5)); if (elcc->serviceDateMonth == -1) { elcc->serviceDateMonth = 0; ShowWarningError(state, @@ -404,7 +404,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key StraightLine-40year // \key None // \default None - elcc->depreciationMethod = static_cast(getEnumValue(DeprMethodNamesUC, Util::makeUPPER(AlphaArray(6)))); + elcc->depreciationMethod = static_cast(getEnumValue(DeprMethodNamesUC, AlphaArray(6))); if (elcc->depreciationMethod == DeprMethod::Invalid) { elcc->depreciationMethod = DeprMethod::None; if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { @@ -498,7 +498,7 @@ void GetInputLifeCycleCostRecurringCosts(EnergyPlusData &state) // \key MajorOverhaul // \key OtherOperational // \default Maintenance - elcc->RecurringCosts[iInObj].category = static_cast(getEnumValue(CostCategoryNamesUCNoSpace, Util::makeUPPER(AlphaArray(2)))); + elcc->RecurringCosts[iInObj].category = static_cast(getEnumValue(CostCategoryNamesUCNoSpace, AlphaArray(2))); bool isNotRecurringCost = (elcc->RecurringCosts[iInObj].category != CostCategory::Maintenance && elcc->RecurringCosts[iInObj].category != CostCategory::Repair && elcc->RecurringCosts[iInObj].category != CostCategory::Operation && elcc->RecurringCosts[iInObj].category != CostCategory::Replacement && @@ -521,7 +521,7 @@ void GetInputLifeCycleCostRecurringCosts(EnergyPlusData &state) // \key ServicePeriod // \key BasePeriod // \default ServicePeriod - elcc->RecurringCosts[iInObj].startOfCosts = static_cast(getEnumValue(StartCostNamesUC, Util::makeUPPER(AlphaArray(3)))); + elcc->RecurringCosts[iInObj].startOfCosts = static_cast(getEnumValue(StartCostNamesUC, AlphaArray(3))); if (elcc->RecurringCosts[iInObj].startOfCosts == StartCosts::Invalid) { elcc->RecurringCosts[iInObj].startOfCosts = StartCosts::ServicePeriod; ShowWarningError(state, @@ -709,7 +709,7 @@ void GetInputLifeCycleCostNonrecurringCost(EnergyPlusData &state) // \key Salvage // \key OtherCapital // \default Construction - elcc->NonrecurringCost[iInObj].category = static_cast(getEnumValue(CostCategoryNamesUCNoSpace, Util::makeUPPER(AlphaArray(2)))); + elcc->NonrecurringCost[iInObj].category = static_cast(getEnumValue(CostCategoryNamesUCNoSpace, AlphaArray(2))); bool isNotNonRecurringCost = (elcc->NonrecurringCost[iInObj].category != CostCategory::Construction && elcc->NonrecurringCost[iInObj].category != CostCategory::Salvage && elcc->NonrecurringCost[iInObj].category != CostCategory::OtherCapital); @@ -729,7 +729,7 @@ void GetInputLifeCycleCostNonrecurringCost(EnergyPlusData &state) // \key ServicePeriod // \key BasePeriod // \default ServicePeriod - elcc->NonrecurringCost[iInObj].startOfCosts = static_cast(getEnumValue(StartCostNamesUC, Util::makeUPPER(AlphaArray(3)))); + elcc->NonrecurringCost[iInObj].startOfCosts = static_cast(getEnumValue(StartCostNamesUC, AlphaArray(3))); if (elcc->NonrecurringCost[iInObj].startOfCosts == StartCosts::Invalid) { elcc->NonrecurringCost[iInObj].startOfCosts = StartCosts::ServicePeriod; ShowWarningError(state, @@ -859,7 +859,8 @@ void GetInputLifeCycleCostUsePriceEscalation(EnergyPlusData &state) // \key Water // \key OtherFuel1 // \key OtherFuel2 - elcc->UsePriceEscalation(iInObj).resource = static_cast(getEnumValue(Constant::eResourceNamesUC, AlphaArray(2))); + elcc->UsePriceEscalation(iInObj).resource = + static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER(AlphaArray(2)))); if (NumAlphas > 3) { ShowWarningError(state, format("In {} contains more alpha fields than expected.", CurrentModuleObject)); } @@ -895,7 +896,7 @@ void GetInputLifeCycleCostUsePriceEscalation(EnergyPlusData &state) // \key November // \key December // \default January - elcc->UsePriceEscalation(iInObj).escalationStartMonth = getEnumValue(Util::MonthNamesUC, Util::makeUPPER(AlphaArray(3))); + elcc->UsePriceEscalation(iInObj).escalationStartMonth = getEnumValue(Util::MonthNamesUC, AlphaArray(3)); if (elcc->UsePriceEscalation(iInObj).escalationStartMonth == -1) { elcc->UsePriceEscalation(iInObj).escalationStartMonth = 0; ShowWarningError(state, @@ -1010,7 +1011,8 @@ void GetInputLifeCycleCostUseAdjustment(EnergyPlusData &state) // \key Water // \key OtherFuel1 // \key OtherFuel2 - elcc->UseAdjustment(iInObj).resource = static_cast(getEnumValue(Constant::eResourceNamesUC, AlphaArray(2))); + elcc->UseAdjustment(iInObj).resource = + static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER(AlphaArray(2)))); if (NumAlphas > 2) { ShowWarningError(state, format("In {} contains more alpha fields than expected.", CurrentModuleObject)); } diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index a409476ec7d..c24557a4265 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -412,7 +412,7 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i switch (tariff.kindMtr) { case MeterType::Water: { // conversion factor - tariff.convChoice = static_cast(getEnumValue(econConvNamesUC, s_ipsc->cAlphaArgs(3))); + tariff.convChoice = static_cast(getEnumValue(econConvNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); switch (tariff.convChoice) { case EconConv::USERDEF: { tariff.energyConv = s_ipsc->rNumericArgs(1); // energy conversion factor @@ -457,7 +457,7 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i case MeterType::ElecPurchased: case MeterType::ElecSurplusSold: case MeterType::ElecNet: { - tariff.convChoice = static_cast(getEnumValue(econConvNamesUC, s_ipsc->cAlphaArgs(3))); + tariff.convChoice = static_cast(getEnumValue(econConvNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); switch (tariff.convChoice) { case EconConv::USERDEF: { @@ -507,7 +507,7 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i // If it's a gas meter case MeterType::Gas: { - tariff.convChoice = static_cast(getEnumValue(econConvNamesUC, s_ipsc->cAlphaArgs(3))); + tariff.convChoice = static_cast(getEnumValue(econConvNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); switch (tariff.convChoice) { case EconConv::USERDEF: { tariff.energyConv = s_ipsc->rNumericArgs(1); // energy conversion factor @@ -569,7 +569,7 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i // It it's neither an electric, water or gas meter, we cannot accept volumetric units // because we cannot infer the heat content case MeterType::Other: { - tariff.convChoice = static_cast(getEnumValue(econConvNamesUC, s_ipsc->cAlphaArgs(3))); + tariff.convChoice = static_cast(getEnumValue(econConvNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); switch (tariff.convChoice) { case EconConv::USERDEF: { tariff.energyConv = s_ipsc->rNumericArgs(1); // energy conversion factor @@ -772,7 +772,8 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i if (s_ipsc->lAlphaFieldBlanks(13)) { tariff.buyOrSell = BuySell::BuyFromUtility; - } else if ((tariff.buyOrSell = static_cast(getEnumValue(buySellNamesUC, s_ipsc->cAlphaArgs(13)))) == BuySell::Invalid) { + } else if ((tariff.buyOrSell = static_cast(getEnumValue(buySellNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(13))))) == + BuySell::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(13), s_ipsc->cAlphaArgs(13)); ErrorsFound = true; } @@ -901,7 +902,7 @@ void GetInputEconomicsQualify(EnergyPlusData &state, bool &ErrorsFound) // true qualify.thresholdPt = AssignVariablePt(state, s_ipsc->cAlphaArgs(5), isNotNumeric, varIsArgument, varNotYetDefined, ObjType::Invalid, 0, qualify.tariffIndx); // enumerated list of the kind of season - if ((qualify.season = static_cast(getEnumValue(seasonNamesUC, s_ipsc->cAlphaArgs(6)))) == Season::Invalid) { + if ((qualify.season = static_cast(getEnumValue(seasonNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(6))))) == Season::Invalid) { ShowWarningInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(6), s_ipsc->cAlphaArgs(6), "Annual"); qualify.season = Season::Annual; } @@ -973,7 +974,7 @@ void GetInputEconomicsChargeSimple(EnergyPlusData &state, bool &ErrorsFound) // chargeSimple.sourcePt = AssignVariablePt(state, s_ipsc->cAlphaArgs(3), true, varIsArgument, varNotYetDefined, ObjType::Invalid, 0, chargeSimple.tariffIndx); // enumerated list of the kind of season - chargeSimple.season = static_cast(getEnumValue(seasonNamesUC, s_ipsc->cAlphaArgs(4))); + chargeSimple.season = static_cast(getEnumValue(seasonNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(4)))); if (chargeSimple.season == Season::Invalid) { ShowWarningInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(4), s_ipsc->cAlphaArgs(4), "Annual"); chargeSimple.season = Season::Annual; @@ -1057,7 +1058,7 @@ void GetInputEconomicsChargeBlock(EnergyPlusData &state, bool &ErrorsFound) // t chargeBlock.sourcePt = AssignVariablePt(state, s_ipsc->cAlphaArgs(3), true, varIsArgument, varNotYetDefined, ObjType::Invalid, 0, chargeBlock.tariffIndx); // enumerated list of the kind of season - chargeBlock.season = static_cast(getEnumValue(seasonNamesUC, s_ipsc->cAlphaArgs(4))); + chargeBlock.season = static_cast(getEnumValue(seasonNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(4)))); if (chargeBlock.season == Season::Invalid) { ShowWarningInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(4), s_ipsc->cAlphaArgs(4), "Annual"); chargeBlock.season = Season::Annual; @@ -1182,12 +1183,12 @@ void GetInputEconomicsRatchet(EnergyPlusData &state, bool &ErrorsFound) // true ratchet.adjustmentPt = AssignVariablePt(state, s_ipsc->cAlphaArgs(4), true, varIsArgument, varNotYetDefined, ObjType::Ratchet, iInObj, ratchet.tariffIndx); // seasons to and from - ratchet.seasonFrom = static_cast(getEnumValue(seasonNamesUC, s_ipsc->cAlphaArgs(5))); + ratchet.seasonFrom = static_cast(getEnumValue(seasonNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(5)))); if (ratchet.seasonFrom == Season::Invalid) { ShowWarningInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(5), s_ipsc->cAlphaArgs(5), "Annual"); ratchet.seasonFrom = Season::Annual; } - ratchet.seasonTo = static_cast(getEnumValue(seasonNamesUC, s_ipsc->cAlphaArgs(6))); + ratchet.seasonTo = static_cast(getEnumValue(seasonNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(6)))); if (ratchet.seasonTo == Season::Invalid) { ShowWarningInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(6), s_ipsc->cAlphaArgs(56), "Annual"); ratchet.seasonTo = Season::Annual; @@ -1252,7 +1253,7 @@ void GetInputEconomicsVariable(EnergyPlusData &state, bool &ErrorsFound) // true auto &econVar = s_econ->econVar(variablePt); // validate the kind of variable - not used internally except for validation - econVar.varUnitType = static_cast(getEnumValue(varUnitTypeNamesUC, s_ipsc->cAlphaArgs(3))); + econVar.varUnitType = static_cast(getEnumValue(varUnitTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); if (econVar.varUnitType == VarUnitType::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3)); ErrorsFound = true; @@ -1896,7 +1897,7 @@ int FindTariffIndex( int found = 0; for (int iTariff = 1; iTariff <= s_econ->numTariff; ++iTariff) { - if (Util::SameString(nameOfTariff, s_econ->tariff(iTariff).tariffName)) { + if (Util::SameString(s_econ->tariff(iTariff).tariffName, nameOfTariff)) { found = iTariff; break; } @@ -4719,7 +4720,7 @@ void selectTariff(EnergyPlusData &state) groupIndex(iTariff) = groupCount; // set all remaining matching items to the same index for (int kTariff = iTariff + 1; kTariff <= s_econ->numTariff; ++kTariff) { - if (Util::SameString(s_econ->tariff(kTariff).groupName, tariff.groupName)) { + if (equali(s_econ->tariff(kTariff).groupName, tariff.groupName)) { groupIndex(kTariff) = groupCount; } } diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index f6348c34a17..10adfd65ba3 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -746,7 +746,7 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje if (!s_ipsc->lAlphaFieldBlanks(3)) { // Load the Generator Control Operation Scheme - genOperationScheme_ = static_cast(getEnumValue(generatorOpSchemeNamesUC, s_ipsc->cAlphaArgs(3))); + genOperationScheme_ = static_cast(getEnumValue(generatorOpSchemeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); if (genOperationScheme_ == GeneratorOpScheme::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3)); errorsFound = true; @@ -770,7 +770,7 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje if (s_ipsc->cAlphaArgs(6).empty()) { bussType = ElectricBussType::ACBuss; - } else if ((bussType = static_cast(getEnumValue(electricBussTypeNamesUC, s_ipsc->cAlphaArgs(6)))) == + } else if ((bussType = static_cast(getEnumValue(electricBussTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(6))))) == ElectricBussType::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(6), s_ipsc->cAlphaArgs(6)); errorsFound = true; @@ -813,7 +813,7 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje // user selected storage operation scheme if (s_ipsc->lAlphaFieldBlanks(10)) { storageScheme_ = StorageOpScheme::FacilityDemandStoreExcessOnSite; - } else if ((storageScheme_ = static_cast(getEnumValue(storageOpSchemeNamesUC, s_ipsc->cAlphaArgs(10)))) == + } else if ((storageScheme_ = static_cast(getEnumValue(storageOpSchemeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(10))))) == StorageOpScheme::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(10), s_ipsc->cAlphaArgs(10)); errorsFound = true; @@ -2078,7 +2078,7 @@ GeneratorController::GeneratorController(EnergyPlusData &state, name = objectName; - generatorType = static_cast(getEnumValue(generatorTypeNamesUC, Util::makeUPPER(objectType))); + generatorType = static_cast(getEnumValue(generatorTypeNamesUC, objectType)); switch (generatorType) { case GeneratorType::ICEngine: { compPlantType = DataPlant::PlantEquipmentType::Generator_ICEngine; @@ -2868,7 +2868,7 @@ ACtoDCConverter::ACtoDCConverter(EnergyPlusData &state, std::string const &objec errorsFound = true; } - modelType_ = static_cast(getEnumValue(converterModelTypeNamesUC, s_ipsc->cAlphaArgs(3))); + modelType_ = static_cast(getEnumValue(converterModelTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); if (modelType_ == ConverterModelType::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3)); errorsFound = true; @@ -4503,7 +4503,7 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons if (s_ipsc->lAlphaFieldBlanks(3)) { usageMode_ = TransformerUse::PowerInFromGrid; // default - } else if ((usageMode_ = static_cast(getEnumValue(transformerUseNamesUC, s_ipsc->cAlphaArgs(3)))) == + } else if ((usageMode_ = static_cast(getEnumValue(transformerUseNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3))))) == TransformerUse::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3)); errorsFound = true; @@ -4535,7 +4535,8 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons tempRise_ = s_ipsc->rNumericArgs(4); eddyFrac_ = s_ipsc->rNumericArgs(5); - performanceInputMode_ = static_cast(getEnumValue(transformerPerformanceInputNamesUC, s_ipsc->cAlphaArgs(6))); + performanceInputMode_ = + static_cast(getEnumValue(transformerPerformanceInputNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(6)))); if (performanceInputMode_ == TransformerPerformanceInput::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(6), s_ipsc->cAlphaArgs(6)); errorsFound = true; diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index d276c92dad0..4e81e6f2a86 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -3489,7 +3489,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) thisZoneEvapUnit.FanName = Alphas(8); - thisZoneEvapUnit.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(7))); + thisZoneEvapUnit.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(Alphas(7)))); assert(thisZoneEvapUnit.fanType != HVAC::FanType::Invalid); thisZoneEvapUnit.FanIndex = Fans::GetFanIndex(state, thisZoneEvapUnit.FanName); @@ -3511,7 +3511,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) thisZoneEvapUnit.DesignAirVolumeFlowRate = Numbers(1); - thisZoneEvapUnit.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Alphas(9))); + thisZoneEvapUnit.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Util::makeUPPER(Alphas(9)))); assert(thisZoneEvapUnit.fanPlace != HVAC::FanPlace::Invalid); // get the zone number served by the zoneHVAC evaporative cooler @@ -3529,7 +3529,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) constexpr std::array(ControlType::Num)> controlTypeNamesUC = { "ZONETEMPERATUREDEADBANDONOFFCYCLING", "ZONECOOLINGLOADONOFFCYCLING", "ZONECOOLINGLOADVARIABLESPEEDFAN"}; - thisZoneEvapUnit.ControlSchemeType = static_cast(getEnumValue(controlTypeNamesUC, Alphas(10))); + thisZoneEvapUnit.ControlSchemeType = static_cast(getEnumValue(controlTypeNamesUC, Util::makeUPPER(Alphas(10)))); if (thisZoneEvapUnit.ControlSchemeType == ControlType::Invalid) { ShowSevereError(state, format("{}=\"{}\" invalid data.", CurrentModuleObject, thisZoneEvapUnit.Name)); ShowContinueError(state, format("invalid choice found {}=\"{}\".", cAlphaFields(10), Alphas(10))); @@ -3539,7 +3539,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) thisZoneEvapUnit.ThrottlingRange = Numbers(2); thisZoneEvapUnit.ThresholdCoolingLoad = Numbers(3); - thisZoneEvapUnit.EvapCooler_1_Type_Num = static_cast(getEnumValue(evapCoolerTypeNamesUC, Alphas(11))); + thisZoneEvapUnit.EvapCooler_1_Type_Num = static_cast(getEnumValue(evapCoolerTypeNamesUC, Util::makeUPPER(Alphas(11)))); if (thisZoneEvapUnit.EvapCooler_1_Type_Num != EvapCoolerType::Invalid) { thisZoneEvapUnit.EvapCooler_1_ObjectClassName = evapCoolerTypeNames[static_cast(thisZoneEvapUnit.EvapCooler_1_Type_Num)]; } else { @@ -3557,7 +3557,8 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) } if (!lAlphaBlanks(13)) { - thisZoneEvapUnit.EvapCooler_2_Type_Num = static_cast(getEnumValue(evapCoolerTypeNamesUC, Alphas(13))); + thisZoneEvapUnit.EvapCooler_2_Type_Num = + static_cast(getEnumValue(evapCoolerTypeNamesUC, Util::makeUPPER(Alphas(13)))); if (thisZoneEvapUnit.EvapCooler_2_Type_Num != EvapCoolerType::Invalid) { thisZoneEvapUnit.EvapCooler_2_ObjectClassName = evapCoolerTypeNames[static_cast(thisZoneEvapUnit.EvapCooler_2_Type_Num)]; } else { diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index c253783fb19..5e9ace1e04c 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -287,7 +287,7 @@ namespace EvaporativeFluidCoolers { if (state.dataIPShortCut->lAlphaFieldBlanks(6) || AlphArray(6).empty()) { thisEFC.capacityControl = CapacityControl::FanCycling; // FanCycling } else { - thisEFC.capacityControl = static_cast(getEnumValue(controlNamesUC, Util::makeUPPER(AlphArray(6)))); + thisEFC.capacityControl = static_cast(getEnumValue(controlNamesUC, AlphArray(6))); if (thisEFC.capacityControl == CapacityControl::Invalid) { thisEFC.capacityControl = CapacityControl::FanCycling; ShowWarningError(state, @@ -305,7 +305,7 @@ namespace EvaporativeFluidCoolers { if (AlphArray(7).empty()) { thisEFC.EvapLossMode = EvapLoss::ByMoistTheory; } else { - thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, Util::makeUPPER(AlphArray(7)))); + thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, AlphArray(7))); if (thisEFC.EvapLossMode == EvapLoss::Invalid) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(7), AlphArray(7))); ShowContinueError(state, format("Entered in {} = {}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); @@ -340,7 +340,7 @@ namespace EvaporativeFluidCoolers { thisEFC.ConcentrationRatio = 3.0; } } else { - thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, Util::makeUPPER(AlphArray(8)))); + thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, AlphArray(8))); if (thisEFC.BlowdownMode == Blowdown::Invalid) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8))); ShowContinueError(state, format("Entered in {} ={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); @@ -648,7 +648,7 @@ namespace EvaporativeFluidCoolers { if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { thisEFC.EvapLossMode = EvapLoss::ByMoistTheory; } else { - thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, Util::makeUPPER(AlphArray(6)))); + thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, AlphArray(6))); if (thisEFC.EvapLossMode == EvapLoss::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(6), AlphArray(6))); ShowContinueError(state, format("Entered in {} = {}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); @@ -682,7 +682,7 @@ namespace EvaporativeFluidCoolers { thisEFC.ConcentrationRatio = 3.0; } } else { - thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, Util::makeUPPER(AlphArray(7)))); + thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, AlphArray(7))); if (thisEFC.BlowdownMode == Blowdown::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(7), AlphArray(7))); ShowContinueError(state, format("Entered in {} = {}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); diff --git a/src/EnergyPlus/ExhaustAirSystemManager.cc b/src/EnergyPlus/ExhaustAirSystemManager.cc index 03e1b5008b9..cd3d370a2aa 100644 --- a/src/EnergyPlus/ExhaustAirSystemManager.cc +++ b/src/EnergyPlus/ExhaustAirSystemManager.cc @@ -158,7 +158,7 @@ namespace ExhaustAirSystemManager { thisExhSys.ZoneMixerIndex = zoneMixerIndex; thisExhSys.centralFanType = static_cast( - getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(ip->getAlphaFieldValue(objectFields, objectSchemaProps, "fan_object_type")))); + getEnumValue(HVAC::fanTypeNamesUC, ip->getAlphaFieldValue(objectFields, objectSchemaProps, "fan_object_type"))); if (thisExhSys.centralFanType != HVAC::FanType::SystemModel && thisExhSys.centralFanType != HVAC::FanType::ComponentModel) { ShowSevereError(state, format("{}{}={}", RoutineName, cCurrentModuleObject, thisExhSys.Name)); ShowContinueError(state, format("Fan Type ={} is not supported.", HVAC::fanTypeNames[(int)thisExhSys.centralFanType])); diff --git a/src/EnergyPlus/ExteriorEnergyUse.cc b/src/EnergyPlus/ExteriorEnergyUse.cc index c3fc54ad880..f00b7c0a624 100644 --- a/src/EnergyPlus/ExteriorEnergyUse.cc +++ b/src/EnergyPlus/ExteriorEnergyUse.cc @@ -274,8 +274,8 @@ namespace ExteriorEnergyUse { ShowSevereEmptyField(state, eoh, s_ipsc->cAlphaFieldNames(2)); ErrorsFound = true; - } else if ((exteriorEquip.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, s_ipsc->cAlphaArgs(2)))) == - Constant::eFuel::Invalid) { + } else if ((exteriorEquip.FuelType = static_cast( + getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(2))))) == Constant::eFuel::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(2), s_ipsc->cAlphaArgs(2)); ErrorsFound = true; diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 4ed960dba54..b881879417e 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -285,7 +285,7 @@ namespace FanCoilUnits { "VARIABLEFANCONSTANTFLOW", "MULTISPEEDFAN", "ASHRAE90VARIABLEFAN"}; - std::string capCtrlMeth = Alphas(3); + std::string capCtrlMeth = Util::makeUPPER(Alphas(3)); fanCoil.CapCtrlMeth_Num = static_cast(getEnumValue(CapCtrlMethUC, capCtrlMeth)); if (fanCoil.CapCtrlMeth_Num == CCM::ASHRAE) { fanCoil.DesZoneCoolingLoad = DataSizing::AutoSize; @@ -497,7 +497,7 @@ namespace FanCoilUnits { } } - fanCoil.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(9))); + fanCoil.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(Alphas(9)))); if (fanCoil.fanType != HVAC::FanType::Constant && fanCoil.fanType != HVAC::FanType::VAV && fanCoil.fanType != HVAC::FanType::OnOff && fanCoil.fanType != HVAC::FanType::SystemModel) { ShowSevereInvalidKey(state, @@ -1506,10 +1506,9 @@ namespace FanCoilUnits { state, fanCoil.UnitType, fanCoil.Name, "User-Specified Maximum Hot Water Flow [m3/s]", fanCoil.MaxHotWaterVolFlow); } } else { - state.dataFanCoilUnits->CoilWaterInletNode = - WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", fanCoil.HCoilName, ErrorsFound); - state.dataFanCoilUnits->CoilWaterOutletNode = - WaterCoils::GetCoilWaterOutletNode(state, "Coil:Heating:Water", fanCoil.HCoilName, ErrorsFound); + std::string coilType = "Coil:Heating:Water"; + state.dataFanCoilUnits->CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, coilType, fanCoil.HCoilName, ErrorsFound); + state.dataFanCoilUnits->CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, coilType, fanCoil.HCoilName, ErrorsFound); if (IsAutoSize) { int PltSizHeatNum = PlantUtilities::MyPlantSizingIndex(state, "Coil:Heating:Water", diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 5d0ade185cb..09d67e28761 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -400,7 +400,7 @@ void GetFanInput(EnergyPlusData &state) format("{}=\"{}\" has specified 0.0 max air flow rate. It will not be used in the simulation.", cCurrentModuleObject, fan->Name)); } fan->maxAirFlowRateIsAutosized = true; - fan->minAirFracMethod = static_cast(getEnumValue(minFlowFracMethodNamesUC, cAlphaArgs(3))); + fan->minAirFracMethod = static_cast(getEnumValue(minFlowFracMethodNamesUC, Util::makeUPPER(cAlphaArgs(3)))); fan->minFrac = rNumericArgs(4); fan->fixedMin = rNumericArgs(5); @@ -535,7 +535,7 @@ void GetFanInput(EnergyPlusData &state) if (NumAlphas <= 6 || lAlphaFieldBlanks(7)) { fan->availManagerMode = AvailManagerMode::Coupled; - } else if ((fan->availManagerMode = static_cast(getEnumValue(availManagerModeNamesUC, cAlphaArgs(7)))) == + } else if ((fan->availManagerMode = static_cast(getEnumValue(availManagerModeNamesUC, Util::makeUPPER(cAlphaArgs(7))))) == AvailManagerMode::Invalid) { ShowSevereInvalidKey(state, eoh, cAlphaFieldNames(7), cAlphaArgs(7)); ErrorsFound = true; @@ -801,7 +801,8 @@ void GetFanInput(EnergyPlusData &state) fan->motorSizingFactor = rNumericArgs(15); // Motor sizing factor [-] fan->motorInAirFrac = rNumericArgs(16); // Fraction of fan and motor losses to airstream [-] - fan->vfdEffType = static_cast(getEnumValue(vfdEffTypeNamesUC, cAlphaArgs(5))); // VFD efficiency type [Speed or Power + fan->vfdEffType = + static_cast(getEnumValue(vfdEffTypeNamesUC, Util::makeUPPER(cAlphaArgs(5)))); // VFD efficiency type [Speed or Power fan->vfdMaxOutPower = rNumericArgs(17); // VFD maximum output power [W, autosizable] fan->vfdSizingFactor = rNumericArgs(18); // VFD sizing factor [-] @@ -901,7 +902,7 @@ void GetFanInput(EnergyPlusData &state) if (lAlphaFieldBlanks(5)) { fan->speedControl = SpeedControl::Discrete; } else { - fan->speedControl = static_cast(getEnumValue(speedControlNamesUC, cAlphaArgs(5))); + fan->speedControl = static_cast(getEnumValue(speedControlNamesUC, Util::makeUPPER(cAlphaArgs(5)))); } fan->minPowerFlowFrac = rNumericArgs(2); @@ -920,7 +921,7 @@ void GetFanInput(EnergyPlusData &state) if (lAlphaFieldBlanks(6)) { fan->powerSizingMethod = PowerSizing::PerFlowPerPressure; } else { - fan->powerSizingMethod = static_cast(getEnumValue(powerSizingNamesUC, cAlphaArgs(6))); + fan->powerSizingMethod = static_cast(getEnumValue(powerSizingNamesUC, Util::makeUPPER(cAlphaArgs(6)))); } fan->elecPowerPerFlowRate = rNumericArgs(7); fan->elecPowerPerFlowRatePerPressure = rNumericArgs(8); diff --git a/src/EnergyPlus/FaultsManager.cc b/src/EnergyPlus/FaultsManager.cc index 841b2d0284b..a8417a556c5 100644 --- a/src/EnergyPlus/FaultsManager.cc +++ b/src/EnergyPlus/FaultsManager.cc @@ -475,8 +475,7 @@ namespace FaultsManager { // Chiller check int ChillerNum; - ChillerType ChillerTypeCheck = - static_cast(getEnumValue(ChillerTypeNamesUC, Util::makeUPPER(faultsChillerFouling.ChillerType))); + ChillerType ChillerTypeCheck = static_cast(getEnumValue(ChillerTypeNamesUC, faultsChillerFouling.ChillerType)); switch (ChillerTypeCheck) { case ChillerType::ChillerElectric: { // Check whether the chiller name and chiller type match each other @@ -822,7 +821,7 @@ namespace FaultsManager { } // Coil check and link - CoilType CoilTypeCheck = static_cast(getEnumValue(CoilTypeNamesUC, Util::makeUPPER(faultsCoilSATFouling.CoilType))); + CoilType CoilTypeCheck = static_cast(getEnumValue(CoilTypeNamesUC, faultsCoilSATFouling.CoilType)); switch (CoilTypeCheck) { case CoilType::CoilHeatingElectric: case CoilType::CoilHeatingFuel: @@ -1061,8 +1060,9 @@ namespace FaultsManager { state.dataCondenserLoopTowers->towers(TowerNum).FaultyTowerFoulingIndex = jFault_TowerFouling; // Check the faulty tower type - if (!Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], - faultsTowerFouling.TowerType)) { + if (!Util::SameString( + faultsTowerFouling.TowerType, + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)])) { ShowWarningError( state, format("{} = \"{}\" invalid {} = \"{}\" not match the type of {}. Tower type in the fault model is updated. ", @@ -1169,8 +1169,9 @@ namespace FaultsManager { state.dataCondenserLoopTowers->towers(TowerNum).FaultyCondenserSWTIndex = jFault_CondenserSWT; // Check the faulty tower type - if (!Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], - faultsCondSWTFouling.TowerType)) { + if (!Util::SameString( + faultsCondSWTFouling.TowerType, + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)])) { ShowWarningError(state, format("{} = \"{}\" invalid {} = \"{}\" not match the type of {}. Tower type is updated. ", cFaultCurrentObject, @@ -1244,7 +1245,7 @@ namespace FaultsManager { // Chiller check int ChillerNum; - ChillerType ChillerTypeCheck = static_cast(getEnumValue(ChillerTypeNamesUC, Util::makeUPPER(faultsChillerSWT.ChillerType))); + ChillerType ChillerTypeCheck = static_cast(getEnumValue(ChillerTypeNamesUC, faultsChillerSWT.ChillerType)); switch (ChillerTypeCheck) { case ChillerType::ChillerElectric: { // Check whether the chiller name and chiller type match each other @@ -1436,7 +1437,7 @@ namespace FaultsManager { faultsAirFilter.Name = cAlphaArgs(1); // Information of the fan associated with the fouling air filter - faultsAirFilter.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, cAlphaArgs(2))); + faultsAirFilter.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(cAlphaArgs(2)))); if (faultsAirFilter.fanType == HVAC::FanType::SystemModel) { ShowSevereError(state, "Fault:AirFilter cannot be applied to a Fan:SystemModel object"); state.dataFaultsMgr->ErrorsFound = true; @@ -1644,7 +1645,7 @@ namespace FaultsManager { state.dataFaultsMgr->ErrorsFound = true; } - faultsFoulCoil.FoulingInputMethod = static_cast(getEnumValue(FouledCoilNamesUC, Util::makeUPPER(cAlphaArgs(5)))); + faultsFoulCoil.FoulingInputMethod = static_cast(getEnumValue(FouledCoilNamesUC, cAlphaArgs(5))); if (faultsFoulCoil.FoulingInputMethod == FouledCoil::Invalid) { faultsFoulCoil.FoulingInputMethod = FouledCoil::UARated; } diff --git a/src/EnergyPlus/FileSystem.cc b/src/EnergyPlus/FileSystem.cc index 1692ea2228b..63033e09600 100644 --- a/src/EnergyPlus/FileSystem.cc +++ b/src/EnergyPlus/FileSystem.cc @@ -243,7 +243,7 @@ namespace FileSystem { { std::string stringExtension = toString(filePath.extension()); stringExtension = stringExtension.substr(stringExtension.rfind('.') + 1); - return static_cast(getEnumValue(FileTypesExtUC, Util::makeUPPER(stringExtension))); + return static_cast(getEnumValue(FileTypesExtUC, stringExtension)); } // TODO: remove for fs::path::replace_extension directly? Note that replace_extension mutates the object diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index 7e005e3959e..13a8fe26545 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -477,7 +477,7 @@ void FluidCoolerspecs::setupOutputVars(EnergyPlusData &state) bool FluidCoolerspecs::validateSingleSpeedInputs(EnergyPlusData &state, std::string const &cCurrentModuleObject, - Array1D const &AlphArray, + Array1D &AlphArray, Array1D const &cNumericFieldNames, Array1D const &cAlphaFieldNames) { @@ -617,7 +617,7 @@ bool FluidCoolerspecs::validateSingleSpeedInputs(EnergyPlusData &state, bool FluidCoolerspecs::validateTwoSpeedInputs(EnergyPlusData &state, std::string const &cCurrentModuleObject, - Array1D const &AlphArray, + Array1D &AlphArray, Array1D const &cNumericFieldNames, Array1D const &cAlphaFieldNames) { diff --git a/src/EnergyPlus/FluidCoolers.hh b/src/EnergyPlus/FluidCoolers.hh index ea1f003991c..0801a51eb3a 100644 --- a/src/EnergyPlus/FluidCoolers.hh +++ b/src/EnergyPlus/FluidCoolers.hh @@ -178,13 +178,13 @@ namespace FluidCoolers { bool validateSingleSpeedInputs(EnergyPlusData &state, std::string const &cCurrentModuleObject, - Array1D const &AlphArray, + Array1D &AlphArray, Array1D const &cNumericFieldNames, Array1D const &cAlphaFieldNames); bool validateTwoSpeedInputs(EnergyPlusData &state, std::string const &cCurrentModuleObject, - Array1D const &AlphArray, + Array1D &AlphArray, Array1D const &cNumericFieldNames, Array1D const &cAlphaFieldNames); diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index 4f4baa460f6..ca2ac8e6256 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -297,7 +297,7 @@ namespace FuelCellElectricGenerator { auto &fuelCell = state.dataFuelCellElectGen->FuelCell(fuelCellNum); fuelCell.FCPM.Name = AlphArray(1); - fuelCell.FCPM.EffMode = static_cast(getEnumValue(curveModeNamesUC, AlphArray(2))); + fuelCell.FCPM.EffMode = static_cast(getEnumValue(curveModeNamesUC, Util::makeUPPER(AlphArray(2)))); if (fuelCell.FCPM.EffMode == DataGenerators::CurveMode::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(2), AlphArray(2)); ErrorsFound = true; @@ -330,7 +330,7 @@ namespace FuelCellElectricGenerator { fuelCell.FCPM.ShutDownElectConsum = NumArray(16); fuelCell.FCPM.ANC0 = NumArray(17); fuelCell.FCPM.ANC1 = NumArray(18); - fuelCell.FCPM.SkinLossMode = static_cast(getEnumValue(skinLossNamesUC, AlphArray(4))); + fuelCell.FCPM.SkinLossMode = static_cast(getEnumValue(skinLossNamesUC, Util::makeUPPER(AlphArray(4)))); if (fuelCell.FCPM.SkinLossMode == DataGenerators::SkinLoss::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(4), AlphArray(4)); ErrorsFound = true; @@ -473,7 +473,8 @@ namespace FuelCellElectricGenerator { } fuelCell.AirSup.BlowerHeatLossFactor = NumArray(1); - fuelCell.AirSup.AirSupRateMode = static_cast(getEnumValue(airSupRateModeNamesUC, AlphArray(4))); + fuelCell.AirSup.AirSupRateMode = + static_cast(getEnumValue(airSupRateModeNamesUC, Util::makeUPPER(AlphArray(4)))); if (fuelCell.AirSup.AirSupRateMode == DataGenerators::AirSupRateMode::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(4), AlphArray(4)); ErrorsFound = true; @@ -507,13 +508,15 @@ namespace FuelCellElectricGenerator { } } - fuelCell.AirSup.IntakeRecoveryMode = static_cast(getEnumValue(recoverModeNamesUC, AlphArray(7))); + fuelCell.AirSup.IntakeRecoveryMode = + static_cast(getEnumValue(recoverModeNamesUC, Util::makeUPPER(AlphArray(7)))); if (fuelCell.AirSup.IntakeRecoveryMode == DataGenerators::RecoverMode::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(7), AlphArray(7)); ErrorsFound = true; } - fuelCell.AirSup.ConstituentMode = static_cast(getEnumValue(constituentModeNamesUC, AlphArray(8))); + fuelCell.AirSup.ConstituentMode = + static_cast(getEnumValue(constituentModeNamesUC, Util::makeUPPER(AlphArray(8)))); if (fuelCell.AirSup.ConstituentMode == DataGenerators::ConstituentMode::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(8), AlphArray(8)); ErrorsFound = true; @@ -659,7 +662,8 @@ namespace FuelCellElectricGenerator { fuelCell.WaterSup.PmpPowerLossFactor = NumArray(1); - fuelCell.WaterSup.waterTempMode = static_cast(getEnumValue(waterTempModeNamesUC, AlphArray(4))); + fuelCell.WaterSup.waterTempMode = + static_cast(getEnumValue(waterTempModeNamesUC, Util::makeUPPER(AlphArray(4)))); if (fuelCell.WaterSup.waterTempMode == DataGenerators::WaterTempMode::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(4), AlphArray(4)); @@ -745,7 +749,7 @@ namespace FuelCellElectricGenerator { fuelCell.AuxilHeat.UASkin = NumArray(4); fuelCell.AuxilHeat.SkinLossDestination = - static_cast(getEnumValue(lossDestinationNamesUC, AlphArray(2))); + static_cast(getEnumValue(lossDestinationNamesUC, Util::makeUPPER(AlphArray(2)))); if (fuelCell.AuxilHeat.SkinLossDestination == DataGenerators::LossDestination::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(2), AlphArray(2)); ErrorsFound = true; @@ -848,7 +852,8 @@ namespace FuelCellElectricGenerator { NodeInputManager::CompFluidStream::Secondary, DataLoopNode::ObjectIsNotParent); - fuelCell.ExhaustHX.HXmodelMode = static_cast(getEnumValue(exhaustGasHXNamesUC, AlphArray(5))); + fuelCell.ExhaustHX.HXmodelMode = + static_cast(getEnumValue(exhaustGasHXNamesUC, Util::makeUPPER(AlphArray(5)))); if (fuelCell.ExhaustHX.HXmodelMode == DataGenerators::ExhaustGasHX::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(5), AlphArray(5)); ErrorsFound = true; @@ -972,7 +977,7 @@ namespace FuelCellElectricGenerator { fuelCell.Inverter.Name = AlphArray(1); fuelCell.Inverter.EffMode = - static_cast(getEnumValue(inverterEfficiencyModeNamesUC, AlphArray(2))); + static_cast(getEnumValue(inverterEfficiencyModeNamesUC, Util::makeUPPER(AlphArray(2)))); if (fuelCell.Inverter.EffMode == DataGenerators::InverterEfficiencyMode::Invalid) { ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(2), AlphArray(2)); ErrorsFound = true; diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index cb5b5416485..c85d9b344cb 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -167,6 +167,9 @@ namespace Furnaces { // MODULE PARAMETER DEFINITIONS static constexpr std::string_view BlankString; + std::string coilHeatingDxVariableSpeed = "COIL:HEATING:DX:VARIABLESPEED"; + std::string coilCoolingDxVariableSpeed = "Coil:Cooling:DX:VariableSpeed"; + std::string coilHeatingWater = "Coil:Heating:Water"; // Functions @@ -960,7 +963,7 @@ namespace Furnaces { FanName = Alphas(8); errFlag = false; - thisFurnace.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(7))); + thisFurnace.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(Alphas(7)))); if (thisFurnace.fanType != HVAC::FanType::OnOff && thisFurnace.fanType != HVAC::FanType::Constant) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(7), Alphas(7))); @@ -1000,7 +1003,7 @@ namespace Furnaces { } } - thisFurnace.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Alphas(9))); + thisFurnace.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Util::makeUPPER(Alphas(9)))); assert(thisFurnace.fanPlace != HVAC::FanPlace::Invalid); // Get coil data @@ -1065,10 +1068,9 @@ namespace Furnaces { ShowContinueError(state, format("...occurs in {} = {}", CurrentModuleObject, Alphas(1))); ErrorsFound = true; } else { // mine data from heating coil object - // Get the Heating Coil water Inlet or control Node number errFlag = false; - thisFurnace.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", HeatingCoilName, errFlag); + thisFurnace.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, HeatingCoilType, HeatingCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -1076,7 +1078,7 @@ namespace Furnaces { // Get the Heating Coil hot water max volume flow rate errFlag = false; - thisFurnace.MaxHeatCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", HeatingCoilName, errFlag); + thisFurnace.MaxHeatCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, HeatingCoilType, HeatingCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -1084,7 +1086,7 @@ namespace Furnaces { // Get the Heating Coil Inlet Node errFlag = false; - HeatingCoilInletNode = WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", HeatingCoilName, errFlag); + HeatingCoilInletNode = WaterCoils::GetCoilInletNodeConstCoil(state, "Coil:Heating:Water", HeatingCoilName, errFlag); thisFurnace.HWCoilAirInletNode = HeatingCoilInletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -1093,7 +1095,7 @@ namespace Furnaces { // Get the Heating Coil Outlet Node errFlag = false; - HeatingCoilOutletNode = WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", HeatingCoilName, errFlag); + HeatingCoilOutletNode = WaterCoils::GetCoilOutletNode(state, HeatingCoilType, HeatingCoilName, errFlag); thisFurnace.HWCoilAirOutletNode = HeatingCoilOutletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -1130,7 +1132,7 @@ namespace Furnaces { // Get the Heating Coil steam inlet node number errFlag = false; - thisFurnace.CoilControlNode = SteamCoils::GetCoilSteamInletNode(state, "COIL:HEATING:STEAM", HeatingCoilName, errFlag); + thisFurnace.CoilControlNode = SteamCoils::GetCoilSteamInletNode(state, HeatingCoilType, HeatingCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -1497,7 +1499,7 @@ namespace Furnaces { // Get fan data FanName = Alphas(8); - thisFurnace.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(7))); + thisFurnace.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(Alphas(7)))); if (thisFurnace.fanType != HVAC::FanType::OnOff && thisFurnace.fanType != HVAC::FanType::Constant) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); @@ -1538,7 +1540,7 @@ namespace Furnaces { } } - thisFurnace.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Alphas(9))); + thisFurnace.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Util::makeUPPER(Alphas(9)))); assert(thisFurnace.fanPlace != HVAC::FanPlace::Invalid); // Get coil data @@ -1615,7 +1617,7 @@ namespace Furnaces { // Get the Heating Coil water Inlet or control Node number errFlag = false; - thisFurnace.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", HeatingCoilName, errFlag); + thisFurnace.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, HeatingCoilType, HeatingCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -1623,7 +1625,7 @@ namespace Furnaces { // Get the Heating Coil hot water max volume flow rate errFlag = false; - thisFurnace.MaxHeatCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", HeatingCoilName, errFlag); + thisFurnace.MaxHeatCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, HeatingCoilType, HeatingCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -1631,7 +1633,7 @@ namespace Furnaces { // Get the Heating Coil Inlet Node errFlag = false; - HeatingCoilInletNode = WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", HeatingCoilName, errFlag); + HeatingCoilInletNode = WaterCoils::GetCoilInletNodeConstCoil(state, "Coil:Heating:Water", HeatingCoilName, errFlag); thisFurnace.HWCoilAirInletNode = HeatingCoilInletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -1640,7 +1642,7 @@ namespace Furnaces { // Get the Heating Coil Outlet Node errFlag = false; - HeatingCoilOutletNode = WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", HeatingCoilName, errFlag); + HeatingCoilOutletNode = WaterCoils::GetCoilOutletNode(state, HeatingCoilType, HeatingCoilName, errFlag); thisFurnace.HWCoilAirOutletNode = HeatingCoilOutletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -1677,7 +1679,7 @@ namespace Furnaces { // Get the Heating Coil steam inlet node number errFlag = false; - thisFurnace.CoilControlNode = SteamCoils::GetCoilSteamInletNode(state, "Coil:Heating:Steam", HeatingCoilName, errFlag); + thisFurnace.CoilControlNode = SteamCoils::GetCoilSteamInletNode(state, HeatingCoilType, HeatingCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -2076,7 +2078,7 @@ namespace Furnaces { // Get the Heating Coil water Inlet or control Node number errFlag = false; - thisFurnace.SuppCoilControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", ReheatingCoilName, errFlag); + thisFurnace.SuppCoilControlNode = WaterCoils::GetCoilWaterInletNode(state, ReheatingCoilType, ReheatingCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -2084,8 +2086,7 @@ namespace Furnaces { // Get the ReHeat Coil hot water max volume flow rate errFlag = false; - thisFurnace.MaxSuppCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", ReheatingCoilName, errFlag); + thisFurnace.MaxSuppCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, ReheatingCoilType, ReheatingCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -2093,7 +2094,7 @@ namespace Furnaces { // Get the ReHeat Coil Inlet Node errFlag = false; - ReheatCoilInletNode = WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", ReheatingCoilName, errFlag); + ReheatCoilInletNode = WaterCoils::GetCoilInletNodeConstCoil(state, "Coil:Heating:Water", ReheatingCoilName, errFlag); thisFurnace.SuppCoilAirInletNode = ReheatCoilInletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -2102,7 +2103,7 @@ namespace Furnaces { // Get the ReHeat Coil Outlet Node errFlag = false; - ReheatCoilOutletNode = WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", ReheatingCoilName, errFlag); + ReheatCoilOutletNode = WaterCoils::GetCoilOutletNode(state, ReheatingCoilType, ReheatingCoilName, errFlag); thisFurnace.SuppCoilAirOutletNode = ReheatCoilOutletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -2139,7 +2140,7 @@ namespace Furnaces { // Get the Heating Coil steam inlet node number errFlag = false; - thisFurnace.SuppCoilControlNode = SteamCoils::GetCoilSteamInletNode(state, "Coil:Heating:Steam", ReheatingCoilName, errFlag); + thisFurnace.SuppCoilControlNode = SteamCoils::GetCoilSteamInletNode(state, ReheatingCoilType, ReheatingCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -2557,7 +2558,7 @@ namespace Furnaces { thisFurnace.CoolingCoilIndex = IntegratedHeatPump::GetCoilIndexIHP(state, CoolingCoilType, CoolingCoilName, errFlag); IHPCoilName = state.dataIntegratedHP->IntegratedHeatPumps(thisFurnace.CoolingCoilIndex).SCCoilName; thisFurnace.MaxCoolAirVolFlow = - VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed(state, "COIL:COOLING:DX:VARIABLESPEED", IHPCoilName, errFlag); + VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed(state, coilCoolingDxVariableSpeed, IHPCoilName, errFlag); } else { thisFurnace.MaxCoolAirVolFlow = VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed(state, CoolingCoilType, CoolingCoilName, errFlag); @@ -2622,7 +2623,7 @@ namespace Furnaces { thisFurnace.CoolingCoilIndex = IntegratedHeatPump::GetCoilIndexIHP(state, CoolingCoilType, CoolingCoilName, errFlag); IHPCoilName = state.dataIntegratedHP->IntegratedHeatPumps(thisFurnace.CoolingCoilIndex).SCCoilName; thisFurnace.DesignCoolingCapacity = - VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, "COIL:COOLING:DX:VARIABLESPEED", IHPCoilName, errFlag); + VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, coilCoolingDxVariableSpeed, IHPCoilName, errFlag); } else { thisFurnace.DesignCoolingCapacity = VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, CoolingCoilType, CoolingCoilName, errFlag); @@ -2792,7 +2793,7 @@ namespace Furnaces { // Get fan data FanName = Alphas(7); - thisFurnace.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(6))); + thisFurnace.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(Alphas(6)))); if (thisFurnace.fanType == HVAC::FanType::OnOff || thisFurnace.fanType == HVAC::FanType::Constant) { @@ -3095,7 +3096,7 @@ namespace Furnaces { // Get the Heating Coil water Inlet or control Node number errFlag = false; - thisFurnace.SuppCoilControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); + thisFurnace.SuppCoilControlNode = WaterCoils::GetCoilWaterInletNode(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -3103,7 +3104,7 @@ namespace Furnaces { // Get the ReHeat Coil hot water max volume flow rate errFlag = false; - thisFurnace.MaxSuppCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); + thisFurnace.MaxSuppCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -3111,7 +3112,7 @@ namespace Furnaces { // Get the ReHeat Coil Inlet Node errFlag = false; - SupHeatCoilInletNode = WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); + SupHeatCoilInletNode = WaterCoils::GetCoilInletNodeConstCoil(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); thisFurnace.SuppCoilAirInletNode = SupHeatCoilInletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -3120,7 +3121,7 @@ namespace Furnaces { // Get the ReHeat Coil Outlet Node errFlag = false; - SupHeatCoilOutletNode = WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); + SupHeatCoilOutletNode = WaterCoils::GetCoilOutletNode(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); thisFurnace.SuppCoilAirOutletNode = SupHeatCoilOutletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -3155,7 +3156,7 @@ namespace Furnaces { // Get the Heating Coil steam inlet node number errFlag = false; - thisFurnace.SuppCoilControlNode = SteamCoils::GetCoilSteamInletNode(state, "Coil:Heating:Steam", SuppHeatCoilName, errFlag); + thisFurnace.SuppCoilControlNode = SteamCoils::GetCoilSteamInletNode(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -3195,7 +3196,7 @@ namespace Furnaces { ErrorsFound = true; } // IF (Furnace(FurnaceNum)%HeatingCoilType_Num == Coil_HeatingGasOrOtherFuel .OR. &, etc. - thisFurnace.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Alphas(14))); + thisFurnace.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Util::makeUPPER(Alphas(14)))); assert(thisFurnace.fanPlace != HVAC::FanPlace::Invalid); if (lAlphaBlanks(15)) { @@ -3447,11 +3448,12 @@ namespace Furnaces { if (thisFurnace.bIsIHP) { IHPCoilName = state.dataIntegratedHP->IntegratedHeatPumps(thisFurnace.CoolingCoilIndex).SHCoilName; + thisFurnace.MaxHeatAirVolFlow = - VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed(state, "COIL:HEATING:DX:VARIABLESPEED", IHPCoilName, errFlag); + VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed(state, coilHeatingDxVariableSpeed, IHPCoilName, errFlag); IHPCoilName = state.dataIntegratedHP->IntegratedHeatPumps(thisFurnace.CoolingCoilIndex).SCCoilName; thisFurnace.MaxCoolAirVolFlow = - VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed(state, "COIL:COOLING:DX:VARIABLESPEED", IHPCoilName, errFlag); + VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed(state, coilCoolingDxVariableSpeed, IHPCoilName, errFlag); } else { thisFurnace.MaxHeatAirVolFlow = VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed(state, HeatingCoilType, HeatingCoilName, errFlag); @@ -3528,7 +3530,7 @@ namespace Furnaces { if (thisFurnace.bIsIHP) { IHPCoilName = state.dataIntegratedHP->IntegratedHeatPumps(thisFurnace.CoolingCoilIndex).SHCoilName; thisFurnace.DesignHeatingCapacity = - VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, "Coil:Heating:DX:VariableSpeed", IHPCoilName, errFlag); + VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, coilHeatingDxVariableSpeed, IHPCoilName, errFlag); } else { thisFurnace.DesignHeatingCapacity = VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, HeatingCoilType, HeatingCoilName, errFlag); @@ -3545,7 +3547,7 @@ namespace Furnaces { if (thisFurnace.bIsIHP) { IHPCoilName = state.dataIntegratedHP->IntegratedHeatPumps(thisFurnace.CoolingCoilIndex).SCCoilName; thisFurnace.DesignCoolingCapacity = - VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, "COIL:COOLING:DX:VARIABLESPEED", IHPCoilName, errFlag); + VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, coilCoolingDxVariableSpeed, IHPCoilName, errFlag); } else { thisFurnace.DesignCoolingCapacity = VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, CoolingCoilType, CoolingCoilName, errFlag); @@ -3723,7 +3725,7 @@ namespace Furnaces { // Get fan data FanName = Alphas(7); errFlag = false; - thisFurnace.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(6))); + thisFurnace.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(Alphas(6)))); if (thisFurnace.fanType != HVAC::FanType::OnOff) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); @@ -3919,7 +3921,7 @@ namespace Furnaces { // Get the Heating Coil water Inlet or control Node number errFlag = false; - thisFurnace.SuppCoilControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); + thisFurnace.SuppCoilControlNode = WaterCoils::GetCoilWaterInletNode(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -3927,7 +3929,7 @@ namespace Furnaces { // Get the ReHeat Coil hot water max volume flow rate errFlag = false; - thisFurnace.MaxSuppCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); + thisFurnace.MaxSuppCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -3935,7 +3937,7 @@ namespace Furnaces { // Get the ReHeat Coil Inlet Node errFlag = false; - SupHeatCoilInletNode = WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); + SupHeatCoilInletNode = WaterCoils::GetCoilInletNodeConstCoil(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); thisFurnace.SuppCoilAirInletNode = SupHeatCoilInletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -3944,7 +3946,7 @@ namespace Furnaces { // Get the ReHeat Coil Outlet Node errFlag = false; - SupHeatCoilOutletNode = WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", SuppHeatCoilName, errFlag); + SupHeatCoilOutletNode = WaterCoils::GetCoilOutletNode(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); thisFurnace.SuppCoilAirOutletNode = SupHeatCoilOutletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); @@ -3980,7 +3982,7 @@ namespace Furnaces { // Get the Heating Coil steam inlet node number errFlag = false; - thisFurnace.SuppCoilControlNode = SteamCoils::GetCoilSteamInletNode(state, "Coil:Heating:Steam", SuppHeatCoilName, errFlag); + thisFurnace.SuppCoilControlNode = SteamCoils::GetCoilSteamInletNode(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisFurnace.Name)); ErrorsFound = true; @@ -4042,7 +4044,7 @@ namespace Furnaces { } } - thisFurnace.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Alphas(15))); + thisFurnace.fanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Util::makeUPPER(Alphas(15)))); assert(thisFurnace.fanPlace != HVAC::FanPlace::Invalid); if (lAlphaBlanks(16)) { @@ -4823,7 +4825,7 @@ namespace Furnaces { ShowFatalError(state, "InitFurnace: Program terminated for previous conditions."); } thisFurnace.MaxHeatCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", thisFurnace.HeatingCoilName, ErrorsFound); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, thisFurnace.HeatingCoilName, ErrorsFound); if (thisFurnace.MaxHeatCoilFluidFlow > 0.0) { rho = state.dataPlnt->PlantLoop(thisFurnace.plantLoc.loopNum).glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); @@ -4881,7 +4883,7 @@ namespace Furnaces { ShowFatalError(state, "InitFurnace: Program terminated for previous conditions."); } thisFurnace.MaxSuppCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", thisFurnace.SuppHeatCoilName, ErrorsFound); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, thisFurnace.SuppHeatCoilName, ErrorsFound); if (thisFurnace.MaxSuppCoilFluidFlow > 0.0) { rho = state.dataPlnt->PlantLoop(thisFurnace.SuppPlantLoc.loopNum) .glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); @@ -4943,8 +4945,7 @@ namespace Furnaces { // If water coil max water flow rate is autosized, simulate once in order to mine max flow rate if (thisFurnace.HeatingCoilType_Num == HVAC::Coil_HeatingWater) { WaterCoils::SimulateWaterCoilComponents(state, thisFurnace.HeatingCoilName, FirstHVACIteration, thisFurnace.HeatingCoilIndex); - CoilMaxVolFlowRate = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", thisFurnace.HeatingCoilName, ErrorsFound); + CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, thisFurnace.HeatingCoilName, ErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { rho = state.dataPlnt->PlantLoop(thisFurnace.plantLoc.loopNum) .glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); @@ -4976,8 +4977,7 @@ namespace Furnaces { // If water coil max water flow rate is autosized, simulate once in order to mine max flow rate WaterCoils::SimulateWaterCoilComponents( state, thisFurnace.SuppHeatCoilName, FirstHVACIteration, thisFurnace.SuppHeatCoilIndex); - CoilMaxVolFlowRate = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", thisFurnace.SuppHeatCoilName, ErrorsFound); + CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, thisFurnace.SuppHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { rho = state.dataPlnt->PlantLoop(thisFurnace.SuppPlantLoc.loopNum) .glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); diff --git a/src/EnergyPlus/General.cc b/src/EnergyPlus/General.cc index 30ce4172262..026a7728f7b 100644 --- a/src/EnergyPlus/General.cc +++ b/src/EnergyPlus/General.cc @@ -1187,8 +1187,7 @@ void ScanForReports(EnergyPlusData &state, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - ReportType checkReportType = - static_cast(getEnumValue(ReportTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); + ReportType checkReportType = static_cast(getEnumValue(ReportTypeNamesUC, state.dataIPShortCut->cAlphaArgs(1))); switch (checkReportType) { case ReportType::DXF: { @@ -1286,16 +1285,16 @@ void ScanForReports(EnergyPlusData &state, state.dataGeneral->EMSoutput = true; - AvailRpt CheckAvailRpt = static_cast(getEnumValue(AvailRptNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); + AvailRpt CheckAvailRpt = static_cast(getEnumValue(AvailRptNamesUC, state.dataIPShortCut->cAlphaArgs(1))); state.dataRuntimeLang->OutputEMSActuatorAvailSmall = (CheckAvailRpt == AvailRpt::NotByUniqueKeyNames); state.dataRuntimeLang->OutputEMSActuatorAvailFull = (CheckAvailRpt == AvailRpt::Verbose); - CheckAvailRpt = static_cast(getEnumValue(AvailRptNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + CheckAvailRpt = static_cast(getEnumValue(AvailRptNamesUC, state.dataIPShortCut->cAlphaArgs(2))); state.dataRuntimeLang->OutputEMSInternalVarsSmall = (CheckAvailRpt == AvailRpt::NotByUniqueKeyNames); state.dataRuntimeLang->OutputEMSInternalVarsFull = (CheckAvailRpt == AvailRpt::Verbose); ERLdebugOutputLevel CheckERLlevel = - static_cast(getEnumValue(ERLdebugOutputLevelNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + static_cast(getEnumValue(ERLdebugOutputLevelNamesUC, state.dataIPShortCut->cAlphaArgs(3))); state.dataRuntimeLang->OutputEMSErrors = (CheckERLlevel == ERLdebugOutputLevel::ErrorsOnly || CheckERLlevel == ERLdebugOutputLevel::Verbose); state.dataRuntimeLang->OutputFullEMSTrace = (CheckERLlevel == ERLdebugOutputLevel::Verbose); @@ -1307,14 +1306,14 @@ void ScanForReports(EnergyPlusData &state, // Process the Scan Request DoReport = false; - ReportName rptName = static_cast(getEnumValue(ReportNamesUC, Util::makeUPPER(Util::makeUPPER(reportName)))); + ReportName rptName = static_cast(getEnumValue(ReportNamesUC, reportName)); switch (rptName) { case ReportName::Constructions: { if (present(ReportKey)) { - if (Util::SameString(ReportKey(), "Constructions")) { + if (equali(ReportKey(), "Constructions")) { DoReport = state.dataGeneral->Constructions; } - if (Util::SameString(ReportKey(), "Materials")) { + if (equali(ReportKey(), "Materials")) { DoReport = state.dataGeneral->Materials; } } @@ -1338,7 +1337,7 @@ void ScanForReports(EnergyPlusData &state, // IF (PRESENT(Option1)) Option1=SchRptOption } break; case ReportName::Surfaces: { - RptKey rptKey = static_cast(getEnumValue(RptKeyNamesUC, Util::makeUPPER(ReportKey()))); + RptKey rptKey = static_cast(getEnumValue(RptKeyNamesUC, ReportKey())); switch (rptKey) { // Autodesk:OPTIONAL ReportKey used without PRESENT check case RptKey::Costinfo: { DoReport = state.dataGeneral->CostInfo; diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 8895f467704..0c1f2b9eca6 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -991,7 +991,7 @@ void TestSupplyAirPathIntegrity(EnergyPlusData &state, bool &ErrFound) PrimaryAirLoopName); AirLoopHVACCompType CompType = static_cast( - getEnumValue(AirLoopHVACCompTypeNamesUC, Util::makeUPPER(state.dataZoneEquip->SupplyAirPath(BCount).ComponentType(Count)))); + getEnumValue(AirLoopHVACCompTypeNamesUC, state.dataZoneEquip->SupplyAirPath(BCount).ComponentType(Count))); switch (CompType) { case AirLoopHVACCompType::SupplyPlenum: { @@ -1313,7 +1313,7 @@ void TestReturnAirPathIntegrity(EnergyPlusData &state, bool &ErrFound, Array2S_i if (NumComp > 0) { AirLoopHVACCompType CompType = static_cast( - getEnumValue(AirLoopHVACCompTypeNamesUC, Util::makeUPPER(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(NumComp)))); + getEnumValue(AirLoopHVACCompTypeNamesUC, state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(NumComp))); switch (CompType) { case AirLoopHVACCompType::ZoneMixer: { @@ -1408,7 +1408,7 @@ void TestReturnAirPathIntegrity(EnergyPlusData &state, bool &ErrFound, Array2S_i for (int Count3 = 1; Count3 <= NumComp - 1; ++Count3) { AirLoopHVACCompType CompType = static_cast( - getEnumValue(AirLoopHVACCompTypeNamesUC, Util::makeUPPER(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(Count3)))); + getEnumValue(AirLoopHVACCompTypeNamesUC, state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(Count3))); switch (CompType) { case AirLoopHVACCompType::ZoneMixer: { diff --git a/src/EnergyPlus/GeneratorFuelSupply.cc b/src/EnergyPlus/GeneratorFuelSupply.cc index eaf19815363..24a15538a88 100644 --- a/src/EnergyPlus/GeneratorFuelSupply.cc +++ b/src/EnergyPlus/GeneratorFuelSupply.cc @@ -137,9 +137,9 @@ namespace GeneratorFuelSupply { ErrorObjectHeader eoh{routineName, cCurrentModuleObject, AlphArray(1)}; state.dataGenerator->FuelSupply(FuelSupNum).Name = AlphArray(1); - if (Util::SameString("TemperatureFromAirNode", AlphArray(2))) { + if (Util::SameString(AlphArray(2), "TemperatureFromAirNode")) { state.dataGenerator->FuelSupply(FuelSupNum).FuelTempMode = DataGenerators::FuelTemperatureMode::FuelInTempFromNode; - } else if (Util::SameString("Scheduled", AlphArray(2))) { + } else if (Util::SameString(AlphArray(2), "Scheduled")) { state.dataGenerator->FuelSupply(FuelSupNum).FuelTempMode = DataGenerators::FuelTemperatureMode::FuelInTempSchedule; } else { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), AlphArray(2))); diff --git a/src/EnergyPlus/GroundHeatExchangers/Slinky.cc b/src/EnergyPlus/GroundHeatExchangers/Slinky.cc index 44bcf516797..e2b7d82fc9c 100644 --- a/src/EnergyPlus/GroundHeatExchangers/Slinky.cc +++ b/src/EnergyPlus/GroundHeatExchangers/Slinky.cc @@ -113,10 +113,10 @@ GLHESlinky::GLHESlinky(EnergyPlusData &state, std::string const &objName, nlohma this->pipe.outRadius = this->pipe.outDia / 2.0; this->pipe.thickness = j["pipe_thickness"].get(); - std::string const hxConfig = Util::makeUPPER(j["heat_exchanger_configuration"].get()); - if (Util::SameString(hxConfig, "VERTICAL")) { + std::string hxConfig = Util::makeUPPER(j["heat_exchanger_configuration"].get()); + if (hxConfig == "VERTICAL") { this->verticalConfig = true; - } else if (Util::SameString(hxConfig, "HORIZONTAL")) { + } else if (hxConfig == "HORIZONTAL") { this->verticalConfig = false; } @@ -181,7 +181,7 @@ GLHESlinky::GLHESlinky(EnergyPlusData &state, std::string const &objName, nlohma // Initialize ground temperature model and get pointer reference GroundTemp::ModelType gtmType = static_cast( - getEnumValue(GroundTemp::modelTypeNamesUC, Util::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()))); + getEnumValue(GroundTemp::modelTypeNamesUC, j["undisturbed_ground_temperature_model_type"].get())); assert(gtmType != GroundTemp::ModelType::Invalid); std::string const gtmName = Util::makeUPPER(j["undisturbed_ground_temperature_model_name"].get()); diff --git a/src/EnergyPlus/GroundHeatExchangers/Vertical.cc b/src/EnergyPlus/GroundHeatExchangers/Vertical.cc index 2e005cea40b..3b4413b2a1c 100644 --- a/src/EnergyPlus/GroundHeatExchangers/Vertical.cc +++ b/src/EnergyPlus/GroundHeatExchangers/Vertical.cc @@ -377,7 +377,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: this->prevTimeSteps = 0.0; GroundTemp::ModelType modelType = static_cast( - getEnumValue(GroundTemp::modelTypeNamesUC, Util::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()))); + getEnumValue(GroundTemp::modelTypeNamesUC, j["undisturbed_ground_temperature_model_type"].get())); assert(modelType != GroundTemp::ModelType::Invalid); // Initialize ground temperature model and get pointer reference diff --git a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc index 572441cfd32..72ea224cf7c 100644 --- a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc +++ b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc @@ -1133,7 +1133,7 @@ namespace HVACHXAssistedCoolingCoil { } Real64 GetCoilCapacity(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1342,7 +1342,7 @@ namespace HVACHXAssistedCoolingCoil { } int GetCoilWaterInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1628,7 +1628,7 @@ namespace HVACHXAssistedCoolingCoil { } Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1691,7 +1691,7 @@ namespace HVACHXAssistedCoolingCoil { } Real64 GetHXCoilAirFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1746,8 +1746,8 @@ namespace HVACHXAssistedCoolingCoil { } bool VerifyHeatExchangerParent(EnergyPlusData &state, - std::string const &HXType, // must match coil types in this module - std::string const &HXName // must match coil names for the coil type + std::string &HXType, // must match coil types in this module + std::string const &HXName // must match coil names for the coil type ) { @@ -1772,7 +1772,7 @@ namespace HVACHXAssistedCoolingCoil { } if (WhichCoil != 0) { - if (Util::SameString(HVAC::hxTypeNames[(int)state.dataHVACAssistedCC->HXAssistedCoil(WhichCoil).hxType], HXType)) { + if (Util::SameString(HXType, HVAC::hxTypeNames[(int)state.dataHVACAssistedCC->HXAssistedCoil(WhichCoil).hxType])) { return true; } } diff --git a/src/EnergyPlus/HVACHXAssistedCoolingCoil.hh b/src/EnergyPlus/HVACHXAssistedCoolingCoil.hh index a427fbfaf94..9f1a28396c4 100644 --- a/src/EnergyPlus/HVACHXAssistedCoolingCoil.hh +++ b/src/EnergyPlus/HVACHXAssistedCoolingCoil.hh @@ -147,7 +147,7 @@ namespace HVACHXAssistedCoolingCoil { int &CompIndex); Real64 GetCoilCapacity(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -173,7 +173,7 @@ namespace HVACHXAssistedCoolingCoil { ); int GetCoilWaterInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -217,20 +217,20 @@ namespace HVACHXAssistedCoolingCoil { ); Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); Real64 GetHXCoilAirFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); bool VerifyHeatExchangerParent(EnergyPlusData &state, - std::string const &HXType, // must match coil types in this module - std::string const &HXName // must match coil names for the coil type + std::string &HXType, // must match coil types in this module + std::string const &HXName // must match coil names for the coil type ); } // namespace HVACHXAssistedCoolingCoil diff --git a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc index aefcdbccc73..5d5ff696eaa 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -123,6 +123,9 @@ namespace HVACMultiSpeedHeatPump { Num }; + std::string coilHeatingWater = "Coil:Heating:Water"; + std::string coilHeatingSteam = "Coil:Heating:Steam"; + void SimMSHeatPump(EnergyPlusData &state, std::string_view CompName, // Name of the unitary engine driven heat pump system bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system time step @@ -842,7 +845,7 @@ namespace HVACMultiSpeedHeatPump { thisMSHP.HeatCoilName = Alphas(11); // Get the Heating Coil water Inlet or control Node number errFlag = false; - thisMSHP.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", thisMSHP.HeatCoilName, errFlag); + thisMSHP.CoilControlNode = WaterCoils::GetCoilWaterInletNode(state, Alphas(10), thisMSHP.HeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); ErrorsFound = true; @@ -850,7 +853,7 @@ namespace HVACMultiSpeedHeatPump { // Get the ReHeat Coil hot water max volume flow rate errFlag = false; - thisMSHP.MaxCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", thisMSHP.HeatCoilName, errFlag); + thisMSHP.MaxCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, Alphas(10), thisMSHP.HeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); ErrorsFound = true; @@ -858,7 +861,7 @@ namespace HVACMultiSpeedHeatPump { // Get the supplemental Heating Coil Inlet Node errFlag = false; - HeatingCoilInletNode = WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", thisMSHP.HeatCoilName, errFlag); + HeatingCoilInletNode = WaterCoils::GetCoilInletNodeConstCoil(state, "Coil:Heating:Water", thisMSHP.HeatCoilName, errFlag); thisMSHP.CoilAirInletNode = HeatingCoilInletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); @@ -867,7 +870,7 @@ namespace HVACMultiSpeedHeatPump { // Get the supplemental Heating Coil Outlet Node errFlag = false; - HeatingCoilOutletNode = WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", thisMSHP.HeatCoilName, errFlag); + HeatingCoilOutletNode = WaterCoils::GetCoilOutletNode(state, Alphas(10), thisMSHP.HeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); ErrorsFound = true; @@ -901,7 +904,7 @@ namespace HVACMultiSpeedHeatPump { // Get the supplemental Heating Coil steam inlet node number errFlag = false; - thisMSHP.CoilControlNode = SteamCoils::GetCoilAirOutletNode(state, "Coil:Heating:Steam", thisMSHP.HeatCoilName, errFlag); + thisMSHP.CoilControlNode = SteamCoils::GetCoilAirOutletNode(state, Alphas(10), thisMSHP.HeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); ErrorsFound = true; @@ -1108,7 +1111,7 @@ namespace HVACMultiSpeedHeatPump { // Get the Heating Coil water Inlet or control Node number errFlag = false; - thisMSHP.SuppCoilControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", thisMSHP.SuppHeatCoilName, errFlag); + thisMSHP.SuppCoilControlNode = WaterCoils::GetCoilWaterInletNode(state, Alphas(14), thisMSHP.SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); ErrorsFound = true; @@ -1116,8 +1119,7 @@ namespace HVACMultiSpeedHeatPump { // Get the ReHeat Coil hot water max volume flow rate errFlag = false; - thisMSHP.MaxSuppCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", thisMSHP.SuppHeatCoilName, errFlag); + thisMSHP.MaxSuppCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, Alphas(14), thisMSHP.SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); ErrorsFound = true; @@ -1125,7 +1127,7 @@ namespace HVACMultiSpeedHeatPump { // Get the Supplemental Heating Coil Inlet Node errFlag = false; - SuppHeatCoilInletNode = WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", thisMSHP.SuppHeatCoilName, errFlag); + SuppHeatCoilInletNode = WaterCoils::GetCoilInletNodeConstCoil(state, "Coil:Heating:Water", thisMSHP.SuppHeatCoilName, errFlag); thisMSHP.SuppCoilAirInletNode = SuppHeatCoilInletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); @@ -1134,7 +1136,7 @@ namespace HVACMultiSpeedHeatPump { // Get the Supplemental Heating Coil Outlet Node errFlag = false; - SuppHeatCoilOutletNode = WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", thisMSHP.SuppHeatCoilName, errFlag); + SuppHeatCoilOutletNode = WaterCoils::GetCoilOutletNode(state, Alphas(14), thisMSHP.SuppHeatCoilName, errFlag); thisMSHP.SuppCoilAirOutletNode = SuppHeatCoilOutletNode; if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); @@ -1169,7 +1171,7 @@ namespace HVACMultiSpeedHeatPump { // Get the Supplemental Heating Coil steam inlet node number errFlag = false; - thisMSHP.SuppCoilControlNode = SteamCoils::GetCoilAirOutletNode(state, "Coil:Heating:Steam", thisMSHP.SuppHeatCoilName, errFlag); + thisMSHP.SuppCoilControlNode = SteamCoils::GetCoilAirOutletNode(state, Alphas(14), thisMSHP.SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name)); ErrorsFound = true; @@ -1852,13 +1854,13 @@ namespace HVACMultiSpeedHeatPump { ShowFatalError(state, "InitMSHeatPump: Program terminated for previous conditions."); } MSHeatPump(MSHeatPumpNum).MaxCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).HeatCoilName, ErrorsFound); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, MSHeatPump(MSHeatPumpNum).HeatCoilName, ErrorsFound); if (MSHeatPump(MSHeatPumpNum).MaxCoilFluidFlow > 0.0) { rho = state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).plantLoc.loopNum) .glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); MSHeatPump(MSHeatPumpNum).MaxCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).HeatCoilName, ErrorsFound) * rho; + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, MSHeatPump(MSHeatPumpNum).HeatCoilName, ErrorsFound) * rho; } // fill outlet node for coil MSHeatPump(MSHeatPumpNum).CoilOutletNode = @@ -1908,14 +1910,13 @@ namespace HVACMultiSpeedHeatPump { ShowFatalError(state, "InitMSHeatPump: Program terminated for previous conditions."); } MSHeatPump(MSHeatPumpNum).MaxSuppCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound); if (MSHeatPump(MSHeatPumpNum).MaxSuppCoilFluidFlow > 0.0) { rho = state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).SuppPlantLoc.loopNum) .glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); MSHeatPump(MSHeatPumpNum).MaxSuppCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound) * - rho; + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound) * rho; } // fill outlet node for coil MSHeatPump(MSHeatPumpNum).SuppCoilOutletNode = @@ -2163,7 +2164,7 @@ namespace HVACMultiSpeedHeatPump { state, MSHeatPump(MSHeatPumpNum).HeatCoilName, FirstHVACIteration, MSHeatPump(MSHeatPumpNum).HeatCoilNum); CoilMaxVolFlowRate = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).HeatCoilName, ErrorsFound); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, MSHeatPump(MSHeatPumpNum).HeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { rho = state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).plantLoc.loopNum) .glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); @@ -2204,7 +2205,7 @@ namespace HVACMultiSpeedHeatPump { state, MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, FirstHVACIteration, MSHeatPump(MSHeatPumpNum).SuppHeatCoilNum); CoilMaxVolFlowRate = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { rho = state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).SuppPlantLoc.loopNum) .glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); @@ -2698,7 +2699,7 @@ namespace HVACMultiSpeedHeatPump { 1.0, QActual); // QCoilReq, simulate any load > 0 to get max capacity of steam coil MSHeatPump(MSHeatPumpNum).DesignSuppHeatingCapacity = - SteamCoils::GetCoilCapacity(state, "Coil:Heating:Steam", MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound); + SteamCoils::GetCoilCapacity(state, coilHeatingSteam, MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound); } // from IF(MSHeatPump(MSHeatPumpNum)%SuppHeatCoilType == Coil_HeatingSteam) THEN } // from IF( FirstHVACIteration ) THEN diff --git a/src/EnergyPlus/HVACSingleDuctInduc.cc b/src/EnergyPlus/HVACSingleDuctInduc.cc index cce1579cd92..7dddde28399 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.cc +++ b/src/EnergyPlus/HVACSingleDuctInduc.cc @@ -809,10 +809,14 @@ namespace HVACSingleDuctInduc { if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, "Coil:Heating:Water")) { - int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode( - state, "Coil:Heating:Water", state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil, ErrorsFound); - int CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode( - state, "Coil:Heating:Water", state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil, ErrorsFound); + int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, + state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, + state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil, + ErrorsFound); + int CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, + state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, + state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil, + ErrorsFound); if (IsAutoSize) { int PltSizHeatNum = PlantUtilities::MyPlantSizingIndex(state, "Coil:Heating:Water", diff --git a/src/EnergyPlus/HVACStandAloneERV.cc b/src/EnergyPlus/HVACStandAloneERV.cc index a23f0e298be..14f40cec879 100644 --- a/src/EnergyPlus/HVACStandAloneERV.cc +++ b/src/EnergyPlus/HVACStandAloneERV.cc @@ -1543,7 +1543,7 @@ void ReportStandAloneERV(EnergyPlusData &state, int const StandAloneERVNum) // n // Utility subroutines/functions for the HeatingCoil Module Real64 GetSupplyAirFlowRate(EnergyPlusData &state, - std::string const &ERVType, // must be "ZoneHVAC:EnergyRecoveryVentilator" + std::string &ERVType, // must be "ZoneHVAC:EnergyRecoveryVentilator" std::string const &ERVCtrlName, // must match a controller name in the ERV data structure bool &ErrorsFound // set to true if problem ) @@ -1699,7 +1699,7 @@ int getEqIndex(EnergyPlusData &state, std::string_view CompName) } for (int StandAloneERVNum = 1; StandAloneERVNum <= state.dataHVACStandAloneERV->NumStandAloneERVs; StandAloneERVNum++) { - if (Util::SameString(CompName, state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).Name)) { + if (Util::SameString(state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).Name, CompName)) { return StandAloneERVNum; } } diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index 1451b0e0f62..06ea513b7c4 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -191,6 +191,8 @@ namespace HVACUnitaryBypassVAV { ReportCBVAV(state, CBVAVNum); } + std::string coilHeatingWater = "Coil:Heating:Water"; + void SimCBVAV(EnergyPlusData &state, int const CBVAVNum, // Index of the current CBVAV system being simulated bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep @@ -977,7 +979,7 @@ namespace HVACUnitaryBypassVAV { // Dehumidification control mode if (Util::SameString(Alphas(19), "None")) { thisCBVAV.DehumidControlType = DehumidControl::None; - } else if (Util::SameString(Alphas(19), "")) { + } else if (Alphas(19) == "") { thisCBVAV.DehumidControlType = DehumidControl::None; } else if (Util::SameString(Alphas(19), "Multimode")) { if (thisCBVAV.CoolCoilType == HVAC::CoilType::DXCoolingTwoStageWHumControl) { @@ -1366,13 +1368,13 @@ namespace HVACUnitaryBypassVAV { ShowFatalError(state, "InitCBVAV: Program terminated for previous conditions."); } - cBVAV.MaxHeatCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", cBVAV.HeatCoilName, ErrorsFound); + cBVAV.MaxHeatCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, cBVAV.HeatCoilName, ErrorsFound); if (cBVAV.MaxHeatCoilFluidFlow > 0.0) { Real64 FluidDensity = state.dataPlnt->PlantLoop(cBVAV.plantLoc.loopNum).glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); cBVAV.MaxHeatCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", cBVAV.HeatCoilName, ErrorsFound) * FluidDensity; + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, cBVAV.HeatCoilName, ErrorsFound) * FluidDensity; } } else if (cBVAV.HeatCoilType == HVAC::CoilType::HeatingSteam) { @@ -1460,7 +1462,7 @@ namespace HVACUnitaryBypassVAV { if (cBVAV.HeatCoilType == HVAC::CoilType::HeatingWater) { WaterCoils::SimulateWaterCoilComponents(state, cBVAV.HeatCoilName, FirstHVACIteration, cBVAV.HeatCoilIndex); ErrorFlag = false; - Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", cBVAV.HeatCoilName, ErrorFlag); + Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, cBVAV.HeatCoilName, ErrorFlag); if (ErrorFlag) { ShowContinueError(state, format("Occurs in {} = {}", "AirLoopHVAC:UnitaryHeatCool:VAVChangeoverBypass", cBVAV.Name)); } diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index e5d1ab6f855..ca7f536f7f8 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -124,6 +124,9 @@ using namespace DataPlant; constexpr std::array tuTypeNames = {"ZoneHVAC:TerminalUnit:VariableRefrigerantFlow"}; +std::string coilHeatingWater = "Coil:Heating:Water"; +std::string coilHeatingSteam = "Coil:Heating:Steam"; + void SimulateVRF(EnergyPlusData &state, std::string_view CompName, bool const FirstHVACIteration, @@ -3515,7 +3518,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) if (state.dataHVACVarRefFlow->VRF(thisVrfTU.VRFSysNum).VRFAlgorithmType == AlgorithmType::FluidTCtrl) { // Algorithm Type: VRF model based on physics, applicable for Fluid Temperature Control - if (Util::SameString(HVAC::cAllCoilTypes(thisVrfTU.DXCoolCoilType_Num), HVAC::cAllCoilTypes(HVAC::CoilVRF_FluidTCtrl_Cooling))) { + if (HVAC::cAllCoilTypes(thisVrfTU.DXCoolCoilType_Num) == HVAC::cAllCoilTypes(HVAC::CoilVRF_FluidTCtrl_Cooling)) { errFlag = false; if (thisVrfTU.TUListIndex > 0 && thisVrfTU.IndexToTUInTUList > 0) { state.dataHVACVarRefFlow->TerminalUnitList(thisVrfTU.TUListIndex).coolingCoilAvailScheds(thisVrfTU.IndexToTUInTUList) = @@ -3599,7 +3602,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } else { // Algorithm Type: VRF model based on system curve - if (Util::SameString(HVAC::cAllCoilTypes(thisVrfTU.DXCoolCoilType_Num), HVAC::cAllCoilTypes(HVAC::CoilVRF_Cooling))) { + if (HVAC::cAllCoilTypes(thisVrfTU.DXCoolCoilType_Num) == HVAC::cAllCoilTypes(HVAC::CoilVRF_Cooling)) { if (thisVrfTU.TUListIndex > 0 && thisVrfTU.IndexToTUInTUList > 0) { state.dataHVACVarRefFlow->TerminalUnitList(thisVrfTU.TUListIndex).coolingCoilAvailScheds(thisVrfTU.IndexToTUInTUList) = DXCoils::GetDXCoilAvailSched(state, DXCoolingCoilType, cAlphaArgs(12), errFlag); @@ -3678,7 +3681,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) if (state.dataHVACVarRefFlow->VRF(thisVrfTU.VRFSysNum).VRFAlgorithmType == AlgorithmType::FluidTCtrl) { // Algorithm Type: VRF model based on physics, applicable for Fluid Temperature Control - if (Util::SameString(HVAC::cAllCoilTypes(thisVrfTU.DXHeatCoilType_Num), HVAC::cAllCoilTypes(HVAC::CoilVRF_FluidTCtrl_Heating))) { + if (HVAC::cAllCoilTypes(thisVrfTU.DXHeatCoilType_Num) == HVAC::cAllCoilTypes(HVAC::CoilVRF_FluidTCtrl_Heating)) { errFlag = false; if (thisVrfTU.TUListIndex > 0 && thisVrfTU.IndexToTUInTUList > 0) { state.dataHVACVarRefFlow->TerminalUnitList(thisVrfTU.TUListIndex).heatingCoilAvailScheds(thisVrfTU.IndexToTUInTUList) = @@ -3921,7 +3924,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } else { // Algorithm Type: VRF model based on system curve - if (Util::SameString(HVAC::cAllCoilTypes(thisVrfTU.DXHeatCoilType_Num), HVAC::cAllCoilTypes(HVAC::CoilVRF_Heating))) { + if (HVAC::cAllCoilTypes(thisVrfTU.DXHeatCoilType_Num) == HVAC::cAllCoilTypes(HVAC::CoilVRF_Heating)) { if (thisVrfTU.TUListIndex > 0 && thisVrfTU.IndexToTUInTUList > 0) { state.dataHVACVarRefFlow->TerminalUnitList(thisVrfTU.TUListIndex).heatingCoilAvailScheds(thisVrfTU.IndexToTUInTUList) = DXCoils::GetDXCoilAvailSched(state, DXHeatingCoilType, cAlphaArgs(14), errFlag); @@ -4257,7 +4260,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) // Get the supplemental heating coil water Inlet or control node number errFlag = false; thisVrfTU.SuppHeatCoilFluidInletNode = - WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", thisVrfTU.SuppHeatCoilName, errFlag); + WaterCoils::GetCoilWaterInletNode(state, coilHeatingWater, thisVrfTU.SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + thisVrfTU.Name); ErrorsFound = true; @@ -4265,23 +4268,21 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) // Get the supplemental heating coil hot water max volume flow rate errFlag = false; thisVrfTU.SuppHeatCoilFluidMaxFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", thisVrfTU.SuppHeatCoilName, errFlag); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, thisVrfTU.SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + thisVrfTU.Name); ErrorsFound = true; } // Get the supplemental heating Coil air inlet node errFlag = false; - thisVrfTU.SuppHeatCoilAirInletNode = - WaterCoils::GetCoilInletNode(state, "Coil:Heating:Water", thisVrfTU.SuppHeatCoilName, errFlag); + thisVrfTU.SuppHeatCoilAirInletNode = WaterCoils::GetCoilInletNode(state, coilHeatingWater, thisVrfTU.SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + thisVrfTU.Name); ErrorsFound = true; } // Get the supplemental heating coil air outlet node errFlag = false; - thisVrfTU.SuppHeatCoilAirOutletNode = - WaterCoils::GetCoilOutletNode(state, "Coil:Heating:Water", thisVrfTU.SuppHeatCoilName, errFlag); + thisVrfTU.SuppHeatCoilAirOutletNode = WaterCoils::GetCoilOutletNode(state, coilHeatingWater, thisVrfTU.SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + thisVrfTU.Name); ErrorsFound = true; @@ -4304,7 +4305,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) // Get the supplemental heating Coil steam inlet node number errFlag = false; thisVrfTU.SuppHeatCoilFluidInletNode = - SteamCoils::GetCoilSteamInletNode(state, "Coil:Heating:Steam", thisVrfTU.SuppHeatCoilName, errFlag); + SteamCoils::GetCoilSteamInletNode(state, coilHeatingSteam, thisVrfTU.SuppHeatCoilName, errFlag); if (errFlag) { ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + thisVrfTU.Name); ErrorsFound = true; @@ -5664,8 +5665,8 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool if (errFlag) { ShowFatalError(state, format("{}: Program terminated for previous conditions.", RoutineName)); } - state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = WaterCoils::GetCoilMaxWaterFlowRate( - state, "Coil:Heating:Water", state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilName, ErrorsFound); + state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilName, ErrorsFound); if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow > 0.0) { rho = state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilPlantLoc.loopNum) @@ -6342,7 +6343,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilIndex); // design hot water volume flow rate Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate( - state, "Coil:Heating:Water", state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilName, ErrorsFound); + state, coilHeatingWater, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { rho = state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilPlantLoc.loopNum) .glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); @@ -6454,7 +6455,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool 1.0, ErrorsFound); // QCoilReq, simulate any load > 0 to get max capacity of steam coil SuppHeatCoilCapacity = - SteamCoils::GetCoilCapacity(state, "Coil:Heating:Steam", state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilName, ErrorsFound); + SteamCoils::GetCoilCapacity(state, coilHeatingSteam, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilName, ErrorsFound); state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSuppHeatingCapacity = SuppHeatCoilCapacity; } // from if VRFTU( VRFTUNum ).SuppHeatCoilType_Num == HVAC::Coil_HeatingSteam @@ -10846,7 +10847,7 @@ int getEqIndex(EnergyPlusData &state, std::string_view VRFTUName) } for (int VRFTUNum = 1; VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU; VRFTUNum++) { - if (Util::SameString(VRFTUName, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).Name)) { + if (Util::SameString(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).Name, VRFTUName)) { return VRFTUNum; } } diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index a19f029fc87..fb0d1a08810 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -176,8 +176,7 @@ namespace HeatBalFiniteDiffManager { if (!s_ipsc->lAlphaFieldBlanks(1)) { { - s_hbfd->CondFDSchemeType = - static_cast(getEnumValue(CondFDSchemeTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(1)))); + s_hbfd->CondFDSchemeType = static_cast(getEnumValue(CondFDSchemeTypeNamesUC, s_ipsc->cAlphaArgs(1))); if (s_hbfd->CondFDSchemeType == CondFDScheme::Invalid) { ShowSevereError(state, format("{}: invalid {} entered={}, must match CrankNicholsonSecondOrder or FullyImplicitFirstOrder.", diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index 2938393d08f..cc473907ee8 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -719,7 +719,8 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err // Set space flow fractions // Infiltration equipment design level calculation method. - AirflowSpec flow = static_cast(getEnumValue(airflowSpecNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) + AirflowSpec flow = + static_cast(getEnumValue(airflowSpecNamesUC, Util::makeUPPER(cAlphaArgs(4)))); // NOLINT(modernize-use-auto) switch (flow) { case AirflowSpec::FlowPerZone: if (lNumericFieldBlanks(1)) { @@ -912,7 +913,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } } thisInfiltration.densityBasis = static_cast( - getEnumValue(infVentDensityBasisNamesUC, cAlphaArgs(5))); // NOLINT(modernize-use-auto) + getEnumValue(infVentDensityBasisNamesUC, Util::makeUPPER(cAlphaArgs(5)))); // NOLINT(modernize-use-auto) } } } @@ -1394,7 +1395,8 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } // Ventilation equipment design level calculation method - AirflowSpec flow = static_cast(getEnumValue(airflowSpecNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) + AirflowSpec flow = + static_cast(getEnumValue(airflowSpecNamesUC, Util::makeUPPER(cAlphaArgs(4)))); // NOLINT(modernize-use-auto) switch (flow) { case AirflowSpec::FlowPerZone: thisVentilation.DesignLevel = rNumericArgs(1); @@ -1523,7 +1525,8 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err if (cAlphaArgs(5).empty()) { thisVentilation.FanType = DataHeatBalance::VentilationType::Natural; } else { - thisVentilation.FanType = static_cast(getEnumValue(ventilationTypeNamesUC, cAlphaArgs(5))); + thisVentilation.FanType = + static_cast(getEnumValue(ventilationTypeNamesUC, Util::makeUPPER(cAlphaArgs(5)))); if (thisVentilation.FanType == DataHeatBalance::VentilationType::Invalid) { ShowSevereError(state, format(R"({}{}="{}". invalid {}="{}".)", @@ -1798,7 +1801,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } thisVentilation.densityBasis = static_cast( - getEnumValue(infVentDensityBasisNamesUC, cAlphaArgs(11))); // NOLINT(modernize-use-auto) + getEnumValue(infVentDensityBasisNamesUC, Util::makeUPPER(cAlphaArgs(11)))); // NOLINT(modernize-use-auto) // Report variables should be added for individual VENTILATION objects, in addition to zone totals below @@ -2436,7 +2439,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } // Mixing equipment design level calculation method - AirflowSpec flow = static_cast(getEnumValue(airflowSpecNamesUC, cAlphaArgs(4))); + AirflowSpec flow = static_cast(getEnumValue(airflowSpecNamesUC, Util::makeUPPER(cAlphaArgs(4)))); switch (flow) { case AirflowSpec::FlowPerZone: thisMixing.DesignLevel = rNumericArgs(1); @@ -2935,7 +2938,8 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } // Mixing equipment design level calculation method. - AirflowSpec flow = static_cast(getEnumValue(airflowSpecNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) + AirflowSpec flow = + static_cast(getEnumValue(airflowSpecNamesUC, Util::makeUPPER(cAlphaArgs(4)))); // NOLINT(modernize-use-auto) switch (flow) { case AirflowSpec::FlowPerZone: thisMixing.DesignLevel = rNumericArgs(1); @@ -4262,8 +4266,8 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if state.dataRoomAir->AirModel(ZoneNum).ZoneName = state.dataIPShortCut->cAlphaArgs(2); // state.dataRoomAir->AirModel(ZoneNum).AirModelName = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAir->AirModel(ZoneNum).AirModel = - static_cast(getEnumValue(roomAirModelNamesUC, state.dataIPShortCut->cAlphaArgs(3))); // is this arg1 or arg3? + state.dataRoomAir->AirModel(ZoneNum).AirModel = static_cast( + getEnumValue(roomAirModelNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); // is this arg1 or arg3? switch (state.dataRoomAir->AirModel(ZoneNum).AirModel) { case RoomAir::RoomAirModel::Mixing: // nothing to do here actually @@ -4376,7 +4380,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } state.dataRoomAir->AirModel(ZoneNum).TempCoupleScheme = - static_cast(getEnumValue(couplingSchemeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); + static_cast(getEnumValue(couplingSchemeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (state.dataRoomAir->AirModel(ZoneNum).TempCoupleScheme == RoomAir::CouplingScheme::Invalid) { ShowWarningError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(4), state.dataIPShortCut->cAlphaArgs(4))); ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 79e56d8b704..3a8614eff4d 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -1160,7 +1160,7 @@ namespace HeatBalanceIntRadExchange { bool enclMatchFound = false; for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++enclosureNum) { auto &thisEnclosure = state.dataViewFactor->EnclRadInfo(enclosureNum); - if (Util::SameString(thisSpaceOrSpaceListName, thisEnclosure.Name)) { + if (Util::SameString(thisEnclosure.Name, thisSpaceOrSpaceListName)) { // View factor space name matches enclosure name enclMatchFound = true; break; diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 4b783a87103..cffb029909f 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -740,7 +740,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - Convect::HcInt hcIn = static_cast(getEnumValue(Convect::HcIntNamesUC, AlphaName(1))); + Convect::HcInt hcIn = static_cast(getEnumValue(Convect::HcIntNamesUC, Util::makeUPPER(AlphaName(1)))); if (hcIn == Convect::HcInt::TrombeWall) { ShowSevereError(state, @@ -780,7 +780,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - Convect::HcExt hcOut = static_cast(getEnumValue(Convect::HcExtNamesUC, AlphaName(1))); + Convect::HcExt hcOut = static_cast(getEnumValue(Convect::HcExtNamesUC, Util::makeUPPER(AlphaName(1)))); if (hcOut != Convect::HcExt::ASHRAESimple && hcOut != Convect::HcExt::ASHRAETARP && hcOut != Convect::HcExt::MoWiTTHcOutside && hcOut != Convect::HcExt::DOE2HcOutside && hcOut != Convect::HcExt::AdaptiveConvectionAlgorithm) { @@ -1118,7 +1118,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cNumericFieldNames); if (NumAlpha > 0) { { - int FlowTypeNum = getEnumValue(DataHeatBalance::AdjustmentTypeNamesUC, Util::makeUPPER(AlphaName(1))); + int FlowTypeNum = getEnumValue(DataHeatBalance::AdjustmentTypeNamesUC, AlphaName(1)); state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = static_cast(FlowTypeNum); AlphaName(1) = DataHeatBalance::AdjustmentTypeNamesCC[FlowTypeNum]; DataHeatBalance::AdjustmentType ZoneFlowAdjustment = state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment; @@ -1143,7 +1143,7 @@ namespace HeatBalanceManager { } if (NumAlpha > 1) { { - int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationFlowTypeNamesUC, Util::makeUPPER(AlphaName(2))); + int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationFlowTypeNamesUC, AlphaName(2)); state.dataHeatBal->ZoneAirMassFlow.InfiltrationTreatment = static_cast(FlowTypeNum); AlphaName(2) = DataHeatBalance::InfiltrationFlowTypeNamesCC[FlowTypeNum]; if (state.dataHeatBal->ZoneAirMassFlow.InfiltrationTreatment == DataHeatBalance::InfiltrationFlow::Add || @@ -1169,7 +1169,7 @@ namespace HeatBalanceManager { } else { if (NumAlpha > 2) { { - int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationZoneTypeNamesUC, Util::makeUPPER(AlphaName(3))); + int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationZoneTypeNamesUC, AlphaName(3)); state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones = static_cast(FlowTypeNum); AlphaName(3) = DataHeatBalance::InfiltrationZoneTypeNamesCC[FlowTypeNum]; if (state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones == DataHeatBalance::InfiltrationZoneType::Invalid) { @@ -1226,7 +1226,7 @@ namespace HeatBalanceManager { if (NumAlpha > 0) { HVACSystemRootFinding.Algorithm = AlphaName(1); HVACSystemRootFinding.HVACSystemRootSolverMethod = - static_cast(getEnumValue(HVACSystemRootSolverAlgorithmUC, Util::makeUPPER(AlphaName(1)))); + static_cast(getEnumValue(HVACSystemRootSolverAlgorithmUC, AlphaName(1))); if (HVACSystemRootFinding.HVACSystemRootSolverMethod == HVACSystemRootSolverAlgorithm::Invalid) { HVACSystemRootFinding.HVACSystemRootSolverMethod = HVACSystemRootSolverAlgorithm::RegulaFalsi; ShowWarningInvalidKey( @@ -2284,7 +2284,7 @@ namespace HeatBalanceManager { void ProcessZoneData(EnergyPlusData &state, std::string const &cCurrentModuleObject, int const ZoneLoop, - Array1D_string const &cAlphaArgs, + Array1D_string &cAlphaArgs, int const NumAlphas, Array1D const &rNumericArgs, int const NumNumbers, @@ -2340,7 +2340,7 @@ namespace HeatBalanceManager { } if (NumAlphas > 1 && !state.dataIPShortCut->lAlphaFieldBlanks(2)) { - Convect::HcInt hcIn = static_cast(getEnumValue(Convect::HcIntNamesUC, cAlphaArgs(2))); + Convect::HcInt hcIn = static_cast(getEnumValue(Convect::HcIntNamesUC, Util::makeUPPER(cAlphaArgs(2)))); if (hcIn != Convect::HcInt::ASHRAESimple && hcIn != Convect::HcInt::ASHRAETARP && hcIn != Convect::HcInt::CeilingDiffuser && hcIn != Convect::HcInt::TrombeWall && hcIn != Convect::HcInt::AdaptiveConvectionAlgorithm && hcIn != Convect::HcInt::ASTMC1340) { @@ -2357,7 +2357,7 @@ namespace HeatBalanceManager { if (NumAlphas > 2 && !state.dataIPShortCut->lAlphaFieldBlanks(3)) { - Convect::HcExt hcOut = static_cast(getEnumValue(Convect::HcExtNamesUC, cAlphaArgs(3))); + Convect::HcExt hcOut = static_cast(getEnumValue(Convect::HcExtNamesUC, Util::makeUPPER(cAlphaArgs(3)))); if (hcOut != Convect::HcExt::ASHRAESimple && hcOut != Convect::HcExt::ASHRAETARP && hcOut != Convect::HcExt::MoWiTTHcOutside && hcOut != Convect::HcExt::DOE2HcOutside && hcOut != Convect::HcExt::AdaptiveConvectionAlgorithm) { @@ -2376,9 +2376,9 @@ namespace HeatBalanceManager { // Process the input field: Part of Total Floor Area // The default value is YES and so only NO needs to be handled if (NumAlphas > 3) { - if (Util::SameString("No", cAlphaArgs(4))) { + if (Util::SameString(cAlphaArgs(4), "No")) { state.dataHeatBal->Zone(ZoneLoop).isPartOfTotalArea = false; - } else if (Util::SameString("Yes", cAlphaArgs(4)) || lAlphaFieldBlanks(4)) { + } else if (Util::SameString(cAlphaArgs(4), "Yes") || lAlphaFieldBlanks(4)) { state.dataHeatBal->Zone(ZoneLoop).isPartOfTotalArea = true; } else { ShowSevereError(state, format("{}{}=\"{}\".", RoutineName, cCurrentModuleObject, state.dataHeatBal->Zone(ZoneLoop).Name)); @@ -5369,11 +5369,11 @@ namespace HeatBalanceManager { } windowThermalModel.CalculationStandard = - static_cast(getEnumValue(TARCOGGassesParams::stdrdNamesUC, s_ipsc->cAlphaArgs(2))); - windowThermalModel.ThermalModel = - static_cast(getEnumValue(TARCOGParams::thermalModelNamesUC, s_ipsc->cAlphaArgs(3))); - windowThermalModel.DeflectionModel = - static_cast(getEnumValue(TARCOGParams::deflectionCalculationNamesUC, s_ipsc->cAlphaArgs(4))); + static_cast(getEnumValue(TARCOGGassesParams::stdrdNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(2)))); + windowThermalModel.ThermalModel = static_cast( + getEnumValue(TARCOGParams::thermalModelNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); + windowThermalModel.DeflectionModel = static_cast( + getEnumValue(TARCOGParams::deflectionCalculationNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(4)))); if (windowThermalModel.DeflectionModel == TARCOGParams::DeflectionCalculation::TEMPERATURE) { windowThermalModel.VacuumPressureLimit = s_ipsc->rNumericArgs(2); diff --git a/src/EnergyPlus/HeatBalanceManager.hh b/src/EnergyPlus/HeatBalanceManager.hh index 9d22345168e..cb45ee14bb7 100644 --- a/src/EnergyPlus/HeatBalanceManager.hh +++ b/src/EnergyPlus/HeatBalanceManager.hh @@ -114,7 +114,7 @@ namespace HeatBalanceManager { void ProcessZoneData(EnergyPlusData &state, std::string const &cCurrentModuleObject, int const ZoneLoop, - Array1D_string const &cAlphaArgs, + Array1D_string &cAlphaArgs, int const NumAlphas, Array1D const &rNumericArgs, int const NumNumbers, diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index 2b3742e0161..3496643977f 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -605,7 +605,7 @@ namespace HeatingCoils { heatingCoil.HeatingCoilModel = "Fuel"; heatingCoil.HCoilType_Num = HVAC::Coil_HeatingGasOrOtherFuel; - heatingCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(3))); + heatingCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(Alphas(3)))); if (!(heatingCoil.FuelType == Constant::eFuel::NaturalGas || heatingCoil.FuelType == Constant::eFuel::Propane || heatingCoil.FuelType == Constant::eFuel::Diesel || heatingCoil.FuelType == Constant::eFuel::Gasoline || heatingCoil.FuelType == Constant::eFuel::FuelOilNo1 || heatingCoil.FuelType == Constant::eFuel::FuelOilNo2 || @@ -2898,7 +2898,7 @@ namespace HeatingCoils { } void CheckHeatingCoilSchedule(EnergyPlusData &state, - std::string const &CompType, // unused1208 + std::string &CompType, // unused1208 std::string_view CompName, Real64 &Value, int &CompIndex) @@ -3157,7 +3157,7 @@ namespace HeatingCoils { } int GetHeatReclaimSourceIndex(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) diff --git a/src/EnergyPlus/HeatingCoils.hh b/src/EnergyPlus/HeatingCoils.hh index 2b68e775d8d..ee0b91edd9a 100644 --- a/src/EnergyPlus/HeatingCoils.hh +++ b/src/EnergyPlus/HeatingCoils.hh @@ -209,7 +209,7 @@ namespace HeatingCoils { void GetCoilIndex(EnergyPlusData &state, std::string const &HeatingCoilName, int &HeatingCoilIndex, bool &ErrorsFound); void CheckHeatingCoilSchedule(EnergyPlusData &state, - std::string const &CompType, // unused1208 + std::string &CompType, // unused1208 std::string_view CompName, Real64 &Value, int &CompIndex); @@ -239,7 +239,7 @@ namespace HeatingCoils { ); int GetHeatReclaimSourceIndex(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); diff --git a/src/EnergyPlus/HybridUnitaryAirConditioners.cc b/src/EnergyPlus/HybridUnitaryAirConditioners.cc index 678e6f3bbea..52265f1484c 100644 --- a/src/EnergyPlus/HybridUnitaryAirConditioners.cc +++ b/src/EnergyPlus/HybridUnitaryAirConditioners.cc @@ -637,15 +637,15 @@ void GetInputZoneHybridUnitaryAirConditioners(EnergyPlusData &state, bool &Error // The original code never checks if this field is empty, but adding this check leads to a unit test failure. // ShowSevereEmptyField(state, eoh, cAlphaFields(15)); // ErrorsFound = true; - } else if ((hybridUnitaryAC.firstFuel = static_cast( - getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(Alphas(15))))) == Constant::eFuel::Invalid) { + } else if ((hybridUnitaryAC.firstFuel = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(15)))) == + Constant::eFuel::Invalid) { ShowSevereInvalidKey(state, eoh, cAlphaFields(15), Alphas(15)); ErrorsFound = true; } // A16, \field Second fuel type if (!lAlphaBlanks(16) && Alphas(16) != "NONE" && - (hybridUnitaryAC.secondFuel = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(Alphas(16))))) == + (hybridUnitaryAC.secondFuel = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(16)))) == Constant::eFuel::Invalid) { ShowSevereInvalidKey(state, eoh, cAlphaFields(16), Alphas(16)); ErrorsFound = true; @@ -653,7 +653,7 @@ void GetInputZoneHybridUnitaryAirConditioners(EnergyPlusData &state, bool &Error // A17, \field Third fuel type if (!lAlphaBlanks(17) && Alphas(17) != "NONE" && - (hybridUnitaryAC.thirdFuel = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(Alphas(17))))) == + (hybridUnitaryAC.thirdFuel = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(17)))) == Constant::eFuel::Invalid) { ShowSevereInvalidKey(state, eoh, cAlphaFields(17), Alphas(17)); ErrorsFound = true; diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index b487573a180..dcaabb8d9e9 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -2222,12 +2222,11 @@ namespace InternalHeatGains { } // Environmental class - thisZoneITEq.Class = static_cast(getEnumValue(ITEClassNamesUC, Util::makeUPPER(IHGAlphas(10)))); + thisZoneITEq.Class = static_cast(getEnumValue(ITEClassNamesUC, IHGAlphas(10))); ErrorsFound = ErrorsFound || (thisZoneITEq.Class == ITEClass::Invalid); // Air and supply inlet connections - thisZoneITEq.AirConnectionType = - static_cast(getEnumValue(ITEInletConnectionNamesUC, Util::makeUPPER(IHGAlphas(11)))); + thisZoneITEq.AirConnectionType = static_cast(getEnumValue(ITEInletConnectionNamesUC, IHGAlphas(11))); if (thisZoneITEq.AirConnectionType == ITEInletConnection::RoomAirModel) { // ZoneITEq(Loop).AirConnectionType = ITEInletConnection::RoomAirModel; ShowWarningError(state, diff --git a/src/EnergyPlus/Material.cc b/src/EnergyPlus/Material.cc index 0cdf8c9e805..c4134759f31 100644 --- a/src/EnergyPlus/Material.cc +++ b/src/EnergyPlus/Material.cc @@ -204,7 +204,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if s_mat->materialMap.insert_or_assign(matNameUC, mat->Num); std::string roughness = s_ip->getAlphaFieldValue(objectFields, objectSchemaProps, "roughness"); - mat->Roughness = static_cast(getEnumValue(surfaceRoughnessNamesUC, Util::makeUPPER(roughness))); + mat->Roughness = static_cast(getEnumValue(surfaceRoughnessNamesUC, roughness)); mat->Thickness = s_ip->getRealFieldValue(objectFields, objectSchemaProps, "thickness"); mat->Conductivity = s_ip->getRealFieldValue(objectFields, objectSchemaProps, "conductivity"); mat->Density = s_ip->getRealFieldValue(objectFields, objectSchemaProps, "density"); @@ -279,7 +279,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if mat->Num = s_mat->materials.isize(); s_mat->materialMap.insert_or_assign(mat->Name, mat->Num); - mat->Roughness = static_cast(getEnumValue(surfaceRoughnessNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(2)))); + mat->Roughness = static_cast(getEnumValue(surfaceRoughnessNamesUC, s_ipsc->cAlphaArgs(2))); mat->Resistance = s_ipsc->rNumericArgs(1); mat->ROnly = true; @@ -985,7 +985,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // Load the material derived type from the input data. - matGas->gases[0].type = static_cast(getEnumValue(gasTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(2)))); + matGas->gases[0].type = static_cast(getEnumValue(gasTypeNamesUC, s_ipsc->cAlphaArgs(2))); matGas->Roughness = SurfaceRoughness::MediumRough; matGas->Thickness = s_ipsc->rNumericArgs(1); @@ -1088,7 +1088,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // Load the material derived type from the input data. - matGas->gases[0].type = static_cast(getEnumValue(gasTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(2)))); // Error check? + matGas->gases[0].type = static_cast(getEnumValue(gasTypeNamesUC, s_ipsc->cAlphaArgs(2))); // Error check? matGas->Roughness = SurfaceRoughness::MediumRough; @@ -1102,7 +1102,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if if (!s_ipsc->lAlphaFieldBlanks(2)) { // Get gap vent type - matGas->gapVentType = static_cast(getEnumValue(gapVentTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); + matGas->gapVentType = static_cast(getEnumValue(gapVentTypeNamesUC, s_ipsc->cAlphaArgs(3))); } if (gasType == GasType::Custom) { @@ -1194,7 +1194,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if matGas->numGases = NumGases; for (NumGas = 0; NumGas < NumGases; ++NumGas) { auto &gas = matGas->gases[NumGas]; - gas.type = static_cast(getEnumValue(gasTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(2 + NumGas)))); + gas.type = static_cast(getEnumValue(gasTypeNamesUC, s_ipsc->cAlphaArgs(2 + NumGas))); if (gas.type == GasType::Invalid) { ShowSevereError(state, format("{}=\"{}\", Illegal value.", s_ipsc->cCurrentModuleObject, s_ipsc->cAlphaArgs(1 + NumGas))); // Error check? @@ -1520,8 +1520,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // Load the material derived type from the input data. - matScreen->bmRefModel = - static_cast(getEnumValue(screenBeamReflectanceModelNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(2)))); + matScreen->bmRefModel = static_cast(getEnumValue(screenBeamReflectanceModelNamesUC, s_ipsc->cAlphaArgs(2))); if (matScreen->bmRefModel == ScreenBeamReflectanceModel::Invalid) { ShowSevereError(state, format("{}=\"{}\", Illegal value.", s_ipsc->cCurrentModuleObject, s_ipsc->cAlphaArgs(1))); ShowContinueError(state, @@ -2150,7 +2149,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // MaximizeSolar or BlockBeamSolar mat->slatAngleType = SlatAngleType::FixedSlatAngle; if (!s_ipsc->lAlphaFieldBlanks(3)) { - mat->slatAngleType = static_cast(getEnumValue(slatAngleTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); + mat->slatAngleType = static_cast(getEnumValue(slatAngleTypeNamesUC, s_ipsc->cAlphaArgs(3))); } if (mat->SlatWidth < mat->SlatSeparation) { ShowWarningError(state, format("{}=\"{}\", Slat Separation/Width", s_ipsc->cCurrentModuleObject, s_ipsc->cAlphaArgs(1))); @@ -2260,7 +2259,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // need to treat the A2 with is just the name of the soil(it is // not important) - mat->Roughness = static_cast(getEnumValue(surfaceRoughnessNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(3)))); + mat->Roughness = static_cast(getEnumValue(surfaceRoughnessNamesUC, s_ipsc->cAlphaArgs(3))); if (s_ipsc->lAlphaFieldBlanks(4)) { mat->calcMethod = EcoRoofCalcMethod::SchaapGenuchten; diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index eba05927711..31b9bff7711 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -937,8 +937,7 @@ void GetOutsideAirSysInputs(EnergyPlusData &state) int AlphaNum = 2; for (int CompNum = 1; CompNum <= thisControllerList.NumControllers; ++CompNum) { // Json will catch any object types that are not the correct key choice of Controller:OutdoorAir or Controller:WaterCoil - thisControllerList.ControllerType(CompNum) = - static_cast(getEnumValue(ControllerKindNamesUC, Util::makeUPPER(AlphArray(AlphaNum)))); + thisControllerList.ControllerType(CompNum) = static_cast(getEnumValue(ControllerKindNamesUC, AlphArray(AlphaNum))); thisControllerList.ControllerName(CompNum) = AlphArray(AlphaNum + 1); // loop over all previous controller lists to check if this controllers is also present on previous controllers for (int previousListNum = 1; previousListNum < Item; ++previousListNum) { @@ -1328,7 +1327,7 @@ void GetOAControllerInputs(EnergyPlusData &state) } // System outdoor air method - thisVentilationMechanical.SystemOAMethod = static_cast(getEnumValue(SOAMNamesUC, Util::makeUPPER(AlphArray(4)))); + thisVentilationMechanical.SystemOAMethod = static_cast(getEnumValue(SOAMNamesUC, AlphArray(4))); if (thisVentilationMechanical.SystemOAMethod == DataSizing::SysOAMethod::IAQP || thisVentilationMechanical.SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlSchOcc || @@ -2004,7 +2003,7 @@ void GetOAMixerInputs(EnergyPlusData &state) void ProcessOAControllerInputs(EnergyPlusData &state, std::string_view const CurrentModuleObject, int const OutAirNum, - Array1D_string const &AlphArray, + Array1D_string &AlphArray, int const NumAlphas, Array1D const &NumArray, int const NumNums, @@ -2414,7 +2413,7 @@ void ProcessOAControllerInputs(EnergyPlusData &state, // Beginning Initialization Section of the Module //****************************************************************************** -void InitOutsideAirSys(EnergyPlusData &state, int const(OASysNum), int const AirLoopNum) +void InitOutsideAirSys(EnergyPlusData &state, int OASysNum, int AirLoopNum) { // SUBROUTINE INFORMATION: @@ -4727,7 +4726,7 @@ void OAControllerProps::SizeOAController(EnergyPlusData &state) // to the coil components that don't have design air flow as an input. if (state.dataSize->CurOASysNum > 0) { for (int CompNum = 1; CompNum <= state.dataAirLoop->OutsideAirSys(state.dataSize->CurOASysNum).NumComponents; ++CompNum) { - std::string const &CompType = state.dataAirLoop->OutsideAirSys(state.dataSize->CurOASysNum).ComponentType(CompNum); + std::string &CompType = state.dataAirLoop->OutsideAirSys(state.dataSize->CurOASysNum).ComponentType(CompNum); std::string const &CompName = state.dataAirLoop->OutsideAirSys(state.dataSize->CurOASysNum).ComponentName(CompNum); if (Util::SameString(CompType, "COIL:COOLING:WATER:DETAILEDGEOMETRY") || Util::SameString(CompType, "COIL:HEATING:WATER") || Util::SameString(CompType, "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED")) { diff --git a/src/EnergyPlus/MixedAir.hh b/src/EnergyPlus/MixedAir.hh index ef18877d879..edf1a449826 100644 --- a/src/EnergyPlus/MixedAir.hh +++ b/src/EnergyPlus/MixedAir.hh @@ -389,7 +389,7 @@ namespace MixedAir { void ProcessOAControllerInputs(EnergyPlusData &state, std::string_view CurrentModuleObject, int OutAirNum, - Array1D_string const &AlphArray, + Array1D_string &AlphArray, int const NumAlphas, Array1D const &NumArray, int const NumNums, diff --git a/src/EnergyPlus/NodeInputManager.cc b/src/EnergyPlus/NodeInputManager.cc index ff0914c9e99..c67d258e9b4 100644 --- a/src/EnergyPlus/NodeInputManager.cc +++ b/src/EnergyPlus/NodeInputManager.cc @@ -1028,7 +1028,7 @@ void CalcMoreNodeInfo(EnergyPlusData &state) nodeFluids.push_back( (state.dataLoopNodes->Node(iNode).FluidIndex == 0) ? nullptr : state.dataFluid->glycols(state.dataLoopNodes->Node(iNode).FluidIndex)); - for (auto const *reqVar : state.dataOutputProcessor->reqVars) { + for (auto *reqVar : state.dataOutputProcessor->reqVars) { if (Util::SameString(reqVar->key, state.dataLoopNodes->NodeID(iNode)) || reqVar->key.empty()) { if (Util::SameString(reqVar->name, "System Node Wetbulb Temperature")) { state.dataNodeInputMgr->NodeWetBulbRepReq(iNode) = true; diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 6dc80d81ad8..be823c77f42 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -120,6 +120,7 @@ namespace OutdoorAirUnit { // component types addressed by this module constexpr static std::string_view ZoneHVACOAUnit = {"ZoneHVAC:OutdoorAirUnit"}; constexpr static std::string_view ZoneHVACEqList = {"ZoneHVAC:OutdoorAirUnit:EquipmentList"}; + std::string coilHeatingWater = "Coil:Heating:Water"; void SimOutdoorAirUnit(EnergyPlusData &state, std::string_view CompName, // name of the outdoor air unit @@ -581,8 +582,7 @@ namespace OutdoorAirUnit { for (int InListNum = 1; InListNum <= NumInList; ++InListNum) { thisOutAirUnit.OAEquip(InListNum).ComponentName = AlphArray(InListNum * 2 + 1); - thisOutAirUnit.OAEquip(InListNum).Type = - static_cast(getEnumValue(CompTypeNamesUC, Util::makeUPPER(AlphArray(InListNum * 2)))); + thisOutAirUnit.OAEquip(InListNum).Type = static_cast(getEnumValue(CompTypeNamesUC, AlphArray(InListNum * 2))); int const CompNum = InListNum; @@ -595,31 +595,17 @@ namespace OutdoorAirUnit { CompTypeNamesUC[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); - thisOutAirUnit.OAEquip(CompNum).CoilAirInletNode = - WaterCoils::GetCoilInletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + std::string tempCompName(CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)]); + thisOutAirUnit.OAEquip(CompNum).CoilAirInletNode = WaterCoils::GetCoilInletNodeConstCoil( + state, tempCompName, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilAirOutletNode = - WaterCoils::GetCoilOutletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + WaterCoils::GetCoilOutletNode(state, tempCompName, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilWaterInletNode = - GetCoilWaterInletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + GetCoilWaterInletNode(state, tempCompName, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilWaterOutletNode = - GetCoilWaterOutletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + GetCoilWaterOutletNode(state, tempCompName, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).MaxVolWaterFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + WaterCoils::GetCoilMaxWaterFlowRate(state, tempCompName, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).MinVolWaterFlow = 0.0; break; } @@ -630,25 +616,18 @@ namespace OutdoorAirUnit { CompTypeNamesUC[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); + std::string tempCompName(CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)]); thisOutAirUnit.OAEquip(CompNum).CoilAirInletNode = - WaterCoils::GetCoilInletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); - thisOutAirUnit.OAEquip(CompNum).CoilAirOutletNode = WaterCoils::GetCoilOutletNode( - state, "Coil:Heating:Water", thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); + WaterCoils::GetCoilInletNode(state, tempCompName, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); + thisOutAirUnit.OAEquip(CompNum).CoilAirOutletNode = + WaterCoils::GetCoilOutletNode(state, coilHeatingWater, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); + std::string tempContantCompType(CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)]); thisOutAirUnit.OAEquip(CompNum).CoilWaterInletNode = - GetCoilWaterInletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + GetCoilWaterInletNode(state, tempContantCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilWaterOutletNode = - GetCoilWaterOutletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + GetCoilWaterOutletNode(state, tempContantCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate( - state, "Coil:Heating:Water", thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); + state, coilHeatingWater, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).MinVolWaterFlow = 0.0; break; } @@ -665,11 +644,9 @@ namespace OutdoorAirUnit { state, thisOutAirUnit.OAEquip(CompNum).ComponentIndex, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilWaterInletNode = GetCoilSteamInletNode( state, thisOutAirUnit.OAEquip(CompNum).ComponentIndex, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); + std::string tempConstCompType(CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)]); thisOutAirUnit.OAEquip(CompNum).CoilWaterOutletNode = - GetCoilSteamOutletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + GetCoilSteamOutletNode(state, tempConstCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).MaxVolWaterFlow = GetCoilMaxSteamFlowRate(state, thisOutAirUnit.OAEquip(CompNum).ComponentIndex, ErrorsFound); @@ -686,35 +663,26 @@ namespace OutdoorAirUnit { thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; + std::string tempConstCompType(CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)]); thisOutAirUnit.OAEquip(CompNum).CoilAirInletNode = - WaterCoils::GetCoilInletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + WaterCoils::GetCoilInletNode(state, tempConstCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilAirOutletNode = - WaterCoils::GetCoilOutletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + WaterCoils::GetCoilOutletNode(state, tempConstCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilWaterInletNode = - GetCoilWaterInletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + GetCoilWaterInletNode(state, tempConstCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilWaterOutletNode = - GetCoilWaterOutletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + GetCoilWaterOutletNode(state, tempConstCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], + tempConstCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, + ErrorsFound); thisOutAirUnit.OAEquip(CompNum).MinVolWaterFlow = 0.0; break; } case CompType::WaterCoil_CoolingHXAsst: { + std::string tempConstCompType(CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)]); thisOutAirUnit.OAEquip(CompNum).CoilAirInletNode = HVACHXAssistedCoolingCoil::GetCoilInletNode(state, CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], @@ -726,20 +694,11 @@ namespace OutdoorAirUnit { thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilWaterInletNode = - GetCoilWaterInletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + GetCoilWaterInletNode(state, tempConstCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).CoilWaterOutletNode = - GetCoilWaterOutletNode(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + GetCoilWaterOutletNode(state, tempConstCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).MaxVolWaterFlow = HVACHXAssistedCoolingCoil::GetCoilMaxWaterFlowRate( - state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(CompNum).Type)], - thisOutAirUnit.OAEquip(CompNum).ComponentName, - ErrorsFound); + state, tempConstCompType, thisOutAirUnit.OAEquip(CompNum).ComponentName, ErrorsFound); thisOutAirUnit.OAEquip(CompNum).MinVolWaterFlow = 0.0; break; } @@ -1204,11 +1163,9 @@ namespace OutdoorAirUnit { for (int compLoop = 1; compLoop <= thisOutAirUnit.NumComponents; ++compLoop) { if ((thisOutAirUnit.OAEquip(compLoop).Type == CompType::WaterCoil_Cooling) || (thisOutAirUnit.OAEquip(compLoop).Type == CompType::WaterCoil_DetailedCool)) { + std::string tempConstCompType(CompTypeNames[static_cast(thisOutAirUnit.OAEquip(compLoop).Type)]); thisOutAirUnit.OAEquip(compLoop).MaxVolWaterFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(compLoop).Type)], - thisOutAirUnit.OAEquip(compLoop).ComponentName, - errFlag); + WaterCoils::GetCoilMaxWaterFlowRate(state, tempConstCompType, thisOutAirUnit.OAEquip(compLoop).ComponentName, errFlag); Real64 const rho = state.dataPlnt->PlantLoop(thisOutAirUnit.OAEquip(compLoop).plantLoc.loopNum) .glycol->getDensity(state, Constant::CWInitConvTemp, RoutineName); thisOutAirUnit.OAEquip(compLoop).MaxWaterMassFlow = rho * thisOutAirUnit.OAEquip(compLoop).MaxVolWaterFlow; @@ -1221,11 +1178,9 @@ namespace OutdoorAirUnit { } if (thisOutAirUnit.OAEquip(compLoop).Type == CompType::WaterCoil_SimpleHeat) { + std::string tempConstCompType(CompTypeNames[static_cast(thisOutAirUnit.OAEquip(compLoop).Type)]); thisOutAirUnit.OAEquip(compLoop).MaxVolWaterFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(compLoop).Type)], - thisOutAirUnit.OAEquip(compLoop).ComponentName, - errFlag); + WaterCoils::GetCoilMaxWaterFlowRate(state, tempConstCompType, thisOutAirUnit.OAEquip(compLoop).ComponentName, errFlag); Real64 const rho = state.dataPlnt->PlantLoop(thisOutAirUnit.OAEquip(compLoop).plantLoc.loopNum) .glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName); thisOutAirUnit.OAEquip(compLoop).MaxWaterMassFlow = rho * thisOutAirUnit.OAEquip(compLoop).MaxVolWaterFlow; @@ -1250,11 +1205,9 @@ namespace OutdoorAirUnit { thisOutAirUnit.OAEquip(compLoop).CoilWaterOutletNode); } if (thisOutAirUnit.OAEquip(compLoop).Type == CompType::WaterCoil_CoolingHXAsst) { + std::string tempConstCompType(CompTypeNames[static_cast(thisOutAirUnit.OAEquip(compLoop).Type)]); thisOutAirUnit.OAEquip(compLoop).MaxVolWaterFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, - CompTypeNames[static_cast(thisOutAirUnit.OAEquip(compLoop).Type)], - thisOutAirUnit.OAEquip(compLoop).ComponentName, - errFlag); + WaterCoils::GetCoilMaxWaterFlowRate(state, tempConstCompType, thisOutAirUnit.OAEquip(compLoop).ComponentName, errFlag); Real64 const rho = state.dataPlnt->PlantLoop(thisOutAirUnit.OAEquip(compLoop).plantLoc.loopNum) .glycol->getDensity(state, Constant::CWInitConvTemp, RoutineName); thisOutAirUnit.OAEquip(compLoop).MaxWaterMassFlow = rho * thisOutAirUnit.OAEquip(compLoop).MaxVolWaterFlow; diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index b5713193943..eca09bbc65b 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -721,8 +721,7 @@ namespace OutputProcessor { } // Check for invalid resource - Constant::eResource resource = - static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); + Constant::eResource resource = static_cast(getEnumValue(Constant::eResourceNamesUC, ipsc->cAlphaArgs(2))); if (resource == Constant::eResource::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1030,8 +1029,7 @@ namespace OutputProcessor { } // Can't use resource type in AddMeter cause it will confuse it with other meters. So, now: - Constant::eResource resource = - static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); + Constant::eResource resource = static_cast(getEnumValue(Constant::eResourceNamesUC, ipsc->cAlphaArgs(2))); if (resource == Constant::eResource::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -3886,7 +3884,7 @@ void UpdateMeterReporting(EnergyPlusData &state) } else { // Wildcard input std::string nameSubstr = name.substr(0, wildCardPosition); for (int iMeter = 0; iMeter < (int)op->meters.size(); ++iMeter) { - if (Util::SameString(op->meters[iMeter]->Name.substr(0, wildCardPosition), nameSubstr)) { + if (equali(op->meters[iMeter]->Name.substr(0, wildCardPosition), nameSubstr)) { SetInitialMeterReportingAndOutputNames(state, iMeter, MeterFileOnlyIndicator, freq, CumulativeIndicator); result = true; } diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 2698e6b2397..4fe2122ed20 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -396,7 +396,7 @@ void GetInputTabularMonthly(EnergyPlusData &state) } std::string const curAggString = AlphArray(jField + 1); // kind of aggregation identified (see AggType parameters) - AggType curAggType = static_cast(getEnumValue(AggTypeNamesUC, Util::makeUPPER(curAggString))); + AggType curAggType = static_cast(getEnumValue(AggTypeNamesUC, curAggString)); // set accumulator values to default as appropriate for aggregation type if (curAggType == AggType::Invalid) { ShowWarningError(state, format("{}={}, Variable name={}", CurrentModuleObject, ort->MonthlyInput(TabNum).name, AlphArray(jField))); @@ -1381,7 +1381,7 @@ void GetInputTabularStyle(EnergyPlusData &state) UnitsStyle SetUnitsStyleFromString(std::string const &unitStringIn) { - UnitsStyle unitsStyleReturn = static_cast(getEnumValue(UnitsStyleNamesUC, Util::makeUPPER(unitStringIn))); + UnitsStyle unitsStyleReturn = static_cast(getEnumValue(UnitsStyleNamesUC, unitStringIn)); if (unitsStyleReturn == UnitsStyle::Invalid) { unitsStyleReturn = UnitsStyle::NotFound; } @@ -2067,7 +2067,7 @@ void InitializePredefinedMonthlyTitles(EnergyPlusData &state) NumMonthlyReports)); } else { for (int xcount = 1; xcount <= numNamedMonthly; ++xcount) { - if (!Util::SameString(MonthlyNamedReports(xcount), ort->namedMonthly(xcount).title)) { + if (!Util::SameString(ort->namedMonthly(xcount).title, MonthlyNamedReports(xcount))) { ShowSevereError(state, "InitializePredefinedMonthlyTitles: Monthly Report Titles in OutputReportTabular do not match titles in DataOutput."); ShowContinueError(state, format("first mismatch at ORT [{}] =\"{}\".", numNamedMonthly, ort->namedMonthly(xcount).title)); @@ -7201,7 +7201,7 @@ void WriteMonthlyTables(EnergyPlusData &state) format("{} [{}]", ort->MonthlyColumns(curCol).varName, Constant::unitNames[(int)ort->MonthlyColumns(curCol).units]); LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); GetUnitConversion(state, indexUnitConv, curConversionFactor, state.dataOutRptTab->curConversionOffset, curUnits); - } else if (Util::SameString(Constant::unitNames[(int)ort->MonthlyColumns(curCol).units], "J")) { + } else if (Constant::unitNames[(int)ort->MonthlyColumns(curCol).units] == "J") { curUnits = energyUnitsString; curConversionFactor = energyUnitsConversionFactor; state.dataOutRptTab->curConversionOffset = 0.0; diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 42fbf903451..d2cae0f1f95 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -223,7 +223,7 @@ namespace PhotovoltaicThermalCollectors { auto &thisTmpSimplePVTperf = tmpSimplePVTperf(Item); thisTmpSimplePVTperf.Name = state.dataIPShortCut->cAlphaArgs(1); thisTmpSimplePVTperf.ThermEfficMode = - static_cast(getEnumValue(ThermEfficTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + static_cast(getEnumValue(ThermEfficTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2))); thisTmpSimplePVTperf.ThermalActiveFract = state.dataIPShortCut->rNumericArgs(1); thisTmpSimplePVTperf.ThermEffic = state.dataIPShortCut->rNumericArgs(2); diff --git a/src/EnergyPlus/Plant/EquipAndOperations.cc b/src/EnergyPlus/Plant/EquipAndOperations.cc index 88a01ab0fc8..ecffd7236b6 100644 --- a/src/EnergyPlus/Plant/EquipAndOperations.cc +++ b/src/EnergyPlus/Plant/EquipAndOperations.cc @@ -297,7 +297,7 @@ namespace DataPlant { auto &this_equip(this->CoolingOnlyEquipList(equipListNum).Comp(compNum)); PlantLocation compLoc; DataPlant::PlantEquipmentType Type = - static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); + static_cast(getEnumValue(PlantEquipTypeNamesUC, this_equip.TypeOf)); bool errFlag1(false); int NumSearchResults(0); PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, compLoc, errFlag1, _, _, NumSearchResults); @@ -383,7 +383,7 @@ namespace DataPlant { auto &this_equip(this->HeatingOnlyEquipList(equipListNum).Comp(compNum)); PlantLocation compLoc; DataPlant::PlantEquipmentType Type; - Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); + Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, this_equip.TypeOf)); bool errFlag1(false); int NumSearchResults(0); PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, compLoc, errFlag1, _, _, NumSearchResults); @@ -472,7 +472,7 @@ namespace DataPlant { auto &this_equip(this->SimultHeatCoolCoolingEquipList(equipListNum).Comp(compNum)); PlantLocation compLoc; DataPlant::PlantEquipmentType Type; - Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); + Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, this_equip.TypeOf)); bool errFlag1(false); int NumSearchResults(0); PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, compLoc, errFlag1, _, _, NumSearchResults); @@ -560,7 +560,7 @@ namespace DataPlant { auto &this_equip(this->SimultHeatCoolHeatingEquipList(equipListNum).Comp(compNum)); PlantLocation compLoc; DataPlant::PlantEquipmentType Type; - Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); + Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, this_equip.TypeOf)); bool errFlag1(false); int NumSearchResults(0); PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, compLoc, errFlag1, _, _, NumSearchResults); diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index f306e4c3e6d..bbaf8ae047a 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -559,7 +559,7 @@ void GetPlantLoopData(EnergyPlusData &state) } else { this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand; } - } else if (Util::SameString(Alpha(16), "")) { + } else if (Alpha(16) == "") { this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; } else { ShowWarningError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); @@ -615,13 +615,12 @@ void GetPlantLoopData(EnergyPlusData &state) } else { PressSimAlphaIndex = 15; } - this_loop.TypeOfWaterLoop = static_cast(getEnumValue(DataPlant::waterLoopTypeNamesUC, Util::makeUPPER(Alpha(19)))); + this_loop.TypeOfWaterLoop = static_cast(getEnumValue(DataPlant::waterLoopTypeNamesUC, Alpha(19))); if (NumAlphas >= PressSimAlphaIndex) { MatchedPressureString = false; - this_loop.PressureSimType = - static_cast(getEnumValue(PressureSimTypeNamesUC, Util::makeUPPER(Alpha(PressSimAlphaIndex)))); + this_loop.PressureSimType = static_cast(getEnumValue(PressureSimTypeNamesUC, Alpha(PressSimAlphaIndex))); switch (this_loop.PressureSimType) { // Check all types @@ -893,7 +892,7 @@ void GetPlantInput(EnergyPlusData &state) this_comp.location = EnergyPlus::PlantLocation(LoopNum, LoopSideNum, BranchNum, CompNum); PlantUtilities::SetPlantLocationLinks(state, this_comp.location); - this_comp.Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_comp_type))); + this_comp.Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, this_comp_type)); switch (this_comp.Type) { case PlantEquipmentType::Pipe: { diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index f7093de0fea..596a238d2c2 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -223,8 +223,8 @@ namespace PlantChillers { thisChiller.Name = state.dataIPShortCut->cAlphaArgs(1); thisChiller.ChillerType = DataPlant::PlantEquipmentType::Chiller_Electric; - thisChiller.CondenserType = static_cast( - getEnumValue(DataPlant::CondenserTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + thisChiller.CondenserType = + static_cast(getEnumValue(DataPlant::CondenserTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2))); switch (thisChiller.CondenserType) { case DataPlant::CondenserType::AirCooled: case DataPlant::CondenserType::WaterCooled: diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index c69fb6eda17..696991615e5 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -1400,8 +1400,8 @@ void FindCompSPInput(EnergyPlusData &state, SchemeNameFound = true; - DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(CurrentModuleObject))); + DataLoopNode::ConnectionObjectType objType = + static_cast(getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, CurrentModuleObject)); if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { LoopOpSchemeObj = "PlantEquipmentOperationSchemes"; @@ -2603,7 +2603,7 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration) auto &this_equip_list = this_op_scheme.EquipList(ListNum); for (int EquipNum = 1, EquipNum_end = this_equip_list.NumComps; EquipNum <= EquipNum_end; ++EquipNum) { auto &this_equip = this_equip_list.Comp(EquipNum); - Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); + Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, this_equip.TypeOf)); bool errFlag1 = false; PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, plantLoc, errFlag1, _, _, NumSearchResults, _, LoopNum); diff --git a/src/EnergyPlus/PlantLoadProfile.cc b/src/EnergyPlus/PlantLoadProfile.cc index 3227c3ed14a..c2e32bd994f 100644 --- a/src/EnergyPlus/PlantLoadProfile.cc +++ b/src/EnergyPlus/PlantLoadProfile.cc @@ -436,7 +436,7 @@ void GetPlantProfileInput(EnergyPlusData &state) DataPlant::PlantEquipmentType::PlantLoadProfile; // parameter assigned in DataPlant state.dataPlantLoadProfile->PlantProfile(ProfileNum).FluidType = - static_cast(getEnumValue(PlantLoopFluidTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); + static_cast(getEnumValue(PlantLoopFluidTypeNamesUC, state.dataIPShortCut->cAlphaArgs(6))); if (state.dataPlantLoadProfile->PlantProfile(ProfileNum).FluidType == PlantLoopFluidType::Invalid) { state.dataPlantLoadProfile->PlantProfile(ProfileNum).FluidType = PlantLoopFluidType::Water; } diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index db2f9fcc134..0473dd2d7ac 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -1905,8 +1905,8 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) std::string &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; for (auto const &classToInput : classesToInput) { cCurrentModuleObject = DataPlant::PlantEquipTypeNames[static_cast(classToInput.thisType)]; - DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(cCurrentModuleObject))); + DataLoopNode::ConnectionObjectType objType = + static_cast(getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, cCurrentModuleObject)); int numPLHP = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); if (numPLHP > 0) { auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject); @@ -2030,7 +2030,7 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) auto const heatSizingType = fields.find("heat_pump_sizing_method"); if (heatSizingType != fields.end()) { thisPLHP.heatSizingMethod = - static_cast(getEnumValue(PLHPHeatSizTypeNamesUC, Util::makeUPPER(heatSizingType.value().get()))); + static_cast(getEnumValue(PLHPHeatSizTypeNamesUC, heatSizingType.value().get())); } else { // revert to legacy sizing method, if no companion coil and this coil type is heating, set to heating if (thisPLHP.companionCoilName.empty() && thisPLHP.EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRHeating) { @@ -2043,8 +2043,7 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) constexpr std::array(ControlType::Num)> PLHPCtrlTypeNamesUC = {"SETPOINT", "LOAD"}; auto const controlType = fields.find("control_type"); if (controlType != fields.end()) { - thisPLHP.sysControlType = - static_cast(getEnumValue(PLHPCtrlTypeNamesUC, Util::makeUPPER(controlType.value().get()))); + thisPLHP.sysControlType = static_cast(getEnumValue(PLHPCtrlTypeNamesUC, controlType.value().get())); } else { thisPLHP.sysControlType = ControlType::Load; } @@ -2058,8 +2057,8 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) "NONE", "TIMED", "ONDEMAND", "TIMEDEMPIRICAL"}; auto const defrostControlStrategy = fields.find("heat_pump_defrost_control"); if (defrostControlStrategy != fields.end()) { - thisPLHP.defrostStrategy = static_cast( - getEnumValue(PLHPDefrostTypeNamesUC, Util::makeUPPER(defrostControlStrategy.value().get()))); + thisPLHP.defrostStrategy = + static_cast(getEnumValue(PLHPDefrostTypeNamesUC, defrostControlStrategy.value().get())); } else { thisPLHP.defrostStrategy = DefrostControl::None; } @@ -3394,8 +3393,8 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) for (auto &classToInput : classesToInput) { cCurrentModuleObject = DataPlant::PlantEquipTypeNames[static_cast(classToInput.thisType)]; - DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(cCurrentModuleObject))); + DataLoopNode::ConnectionObjectType objType = + static_cast(getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, cCurrentModuleObject)); auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject); if (instances == state.dataInputProcessing->inputProcessor->epJSON.end()) { @@ -3510,8 +3509,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } // A8 flow mode - thisPLHP.flowMode = static_cast( - getEnumValue(DataPlant::FlowModeNamesUC, Util::makeUPPER(fields.at("flow_mode").get()))); + thisPLHP.flowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, fields.at("flow_mode").get())); // A9 outdoor_air_temperature_curve_input_variable std::string oaTempCurveInputVar = Util::makeUPPER(fields.at("outdoor_air_temperature_curve_input_variable").get()); @@ -3585,7 +3583,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) thisPLHP.defrostType = DefrostType::Invalid; } else { thisPLHP.defrostType = - static_cast(getEnumValue(DefrostTypeNamesUC, Util::makeUPPER(fields.at("defrost_control_type").get()))); + static_cast(getEnumValue(DefrostTypeNamesUC, fields.at("defrost_control_type").get())); if (thisPLHP.defrostType == DefrostType::Invalid) { thisPLHP.defrostType = DefrostType::OnDemand; // set to default thisPLHP.defrostOpTimeFrac = 0.0; @@ -3821,7 +3819,7 @@ void HeatPumpAirToWater::processInputForEIRPLHP(EnergyPlusData &state) for (auto &classToInput : classesToInput) { cCurrentModuleObjectSingleMode = DataPlant::PlantEquipTypeNames[static_cast(classToInput.thisType)]; DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(cCurrentModuleObjectSingleMode))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, cCurrentModuleObjectSingleMode)); // read shared fields HeatPumpAirToWater thisAWHP; @@ -3862,8 +3860,8 @@ void HeatPumpAirToWater::processInputForEIRPLHP(EnergyPlusData &state) } auto controlType = fields.find("control_type"); if (controlType != fields.end()) { - thisAWHP.controlType = static_cast( - getEnumValue(AWHPControlTypeUC, Util::makeUPPER(fields.at("control_type").get()))); + thisAWHP.controlType = + static_cast(getEnumValue(AWHPControlTypeUC, fields.at("control_type").get())); } else { thisAWHP.controlType = CompressorControlType::VariableSpeed; } @@ -3999,8 +3997,8 @@ void HeatPumpAirToWater::processInputForEIRPLHP(EnergyPlusData &state) "NONE", "TIMED", "ONDEMAND", "TIMEDEMPIRICAL"}; auto const defrostControlStrategy = fields.find("heat_pump_defrost_control"); if (defrostControlStrategy != fields.end()) { - thisAWHP.defrostStrategy = static_cast( - getEnumValue(PLHPDefrostTypeNamesUC, Util::makeUPPER(defrostControlStrategy.value().get()))); + thisAWHP.defrostStrategy = + static_cast(getEnumValue(PLHPDefrostTypeNamesUC, defrostControlStrategy.value().get())); } else { thisAWHP.defrostStrategy = DefrostControl::None; } diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index b96085f3d77..598c3a37eef 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -1650,7 +1650,7 @@ void ScanPlantLoopsForObject(EnergyPlusData &state, for (CompCtr = 1; CompCtr <= this_branch.TotalComponents; ++CompCtr) { auto &this_component = this_branch.Comp(CompCtr); if (this_component.Type == CompType) { - if (Util::SameString(CompName, this_component.Name)) { + if (Util::SameString(this_component.Name, CompName)) { FoundCompName = true; if (present(InletNodeNumber)) { if (InletNodeNumber > 0) { diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 45f83657fe9..d19d59dbe12 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -234,7 +234,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) } Constant::Units thisUnit = Constant::Units::None; if (!units.empty()) { - thisUnit = static_cast(getEnumValue(Constant::unitNamesUC, Util::makeUPPER(units))); + thisUnit = static_cast(getEnumValue(Constant::unitNamesUC, units)); if (thisUnit == Constant::Units::Invalid) { thisUnit = Constant::Units::customEMS; } diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index 012efd3aaab..f20fe4bed13 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -175,8 +175,7 @@ void SetupPollutionCalculations(EnergyPlusData &state) if (!state.dataIPShortCut->lAlphaFieldBlanks(1) && (freq = static_cast( - getEnumValue(OutputProcessor::reportFreqNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1))))) == - OutputProcessor::ReportFreq::Invalid) { + getEnumValue(OutputProcessor::reportFreqNamesUC, state.dataIPShortCut->cAlphaArgs(1)))) == OutputProcessor::ReportFreq::Invalid) { ShowSevereError(state, format("Invalid reporting frequency {}", state.dataIPShortCut->cAlphaArgs(1))); continue; } @@ -284,7 +283,7 @@ void GetPollutionFactorInput(EnergyPlusData &state) ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - PollFuel pollFuel = static_cast(getEnumValue(pollFuelNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(1)))); + PollFuel pollFuel = static_cast(getEnumValue(pollFuelNamesUC, ipsc->cAlphaArgs(1))); if (pollFuel == PollFuel::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 432bb6da86f..acb5155f945 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -314,7 +314,7 @@ void GetPIUs(EnergyPlusData &state) thisPIU.FanOnFlowFrac = ip->getRealFieldValue(fields, objectSchemaProps, "fan_on_flow_fraction"); } thisPIU.HCoilType = static_cast( - getEnumValue(HCoilNamesUC, Util::makeUPPER(ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_object_type")))); + getEnumValue(HCoilNamesUC, ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_object_type"))); switch (thisPIU.HCoilType) { case HtgCoilType::SimpleHeating: { thisPIU.HCoil_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; @@ -384,30 +384,23 @@ void GetPIUs(EnergyPlusData &state) // The reheat coil control node is necessary for hot water reheat, but not necessary for electric or gas reheat. switch (thisPIU.HCoilType) { case HtgCoilType::SimpleHeating: { - thisPIU.HCoilInAirNode = - WaterCoils::GetCoilInletNode(state, - ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_object_type"), - ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_name"), - ErrorsFound); - - thisPIU.HotControlNode = GetCoilWaterInletNode(state, - ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_object_type"), - ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_name"), - ErrorsFound); + std::string ctype = ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_object_type"); + thisPIU.HCoilInAirNode = WaterCoils::GetCoilInletNode( + state, ctype, ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_name"), ErrorsFound); + + thisPIU.HotControlNode = + GetCoilWaterInletNode(state, ctype, ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_name"), ErrorsFound); break; } case HtgCoilType::SteamAirHeating: { - int SteamCoilIndex = SteamCoils::GetSteamCoilIndex(state, - ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_object_type"), - ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_name"), - ErrorsFound); + std::string ctype = ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_object_type"); + int SteamCoilIndex = SteamCoils::GetSteamCoilIndex( + state, ctype, ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_name"), ErrorsFound); thisPIU.HCoilInAirNode = SteamCoils::GetCoilAirInletNode( state, SteamCoilIndex, ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_name"), ErrorsFound); - thisPIU.HotControlNode = GetCoilSteamInletNode(state, - ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_object_type"), - ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_name"), - ErrorsFound); + thisPIU.HotControlNode = + GetCoilSteamInletNode(state, ctype, ip->getAlphaFieldValue(fields, objectSchemaProps, "reheat_coil_name"), ErrorsFound); break; } case HtgCoilType::Electric: @@ -456,7 +449,7 @@ void GetPIUs(EnergyPlusData &state) // Variable speed fan inputs std::string const fan_control_type = ip->getAlphaFieldValue(fields, objectSchemaProps, "fan_control_type"); - thisPIU.fanControlType = static_cast(getEnumValue(fanCntrlTypeNamesUC, Util::makeUPPER(fan_control_type))); + thisPIU.fanControlType = static_cast(getEnumValue(fanCntrlTypeNamesUC, fan_control_type)); if (thisPIU.fanControlType == FanCntrlType::Invalid) { ShowSevereError(state, format("Illegal Fan Control Type = {}", fan_control_type)); @@ -1197,10 +1190,10 @@ void SizePIU(EnergyPlusData &state, int const PIUNum) } } else { CheckZoneSizing(state, thisPIU.UnitType, thisPIU.Name); - if (Util::SameString(HCoilNamesUC[static_cast(thisPIU.HCoilType)], "Coil:Heating:Water")) { - - int const CoilWaterInletNode = GetCoilWaterInletNode(state, "Coil:Heating:Water", thisPIU.HCoil, ErrorsFound); - int const CoilWaterOutletNode = GetCoilWaterOutletNode(state, "Coil:Heating:Water", thisPIU.HCoil, ErrorsFound); + if (HCoilNamesUC[static_cast(thisPIU.HCoilType)] == "COIL:HEATING:WATER") { + std::string hCoilType = "Coil:Heating:Water"; + int const CoilWaterInletNode = GetCoilWaterInletNode(state, hCoilType, thisPIU.HCoil, ErrorsFound); + int const CoilWaterOutletNode = GetCoilWaterOutletNode(state, hCoilType, thisPIU.HCoil, ErrorsFound); // Autosized maximum hot water flow for reporting Real64 MaxVolHotWaterFlowDes = 0.0; @@ -1289,10 +1282,10 @@ void SizePIU(EnergyPlusData &state, int const PIUNum) state, thisPIU.UnitType, thisPIU.Name, "User-Specified Maximum Reheat Steam Flow Rate [m3/s]", thisPIU.MaxVolHotWaterFlow); } } else { - if (Util::SameString(HCoilNames[static_cast(thisPIU.HCoilType)], "Coil:Heating:Steam")) { - - int const CoilSteamInletNode = GetCoilSteamInletNode(state, "Coil:Heating:Steam", thisPIU.HCoil, ErrorsFound); - int const CoilSteamOutletNode = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", thisPIU.HCoil, ErrorsFound); + if (HCoilNames[static_cast(thisPIU.HCoilType)] == "Coil:Heating:Steam") { + std::string hCoilType = "Coil:Heating:Steam"; + int const CoilSteamInletNode = GetCoilSteamInletNode(state, hCoilType, thisPIU.HCoil, ErrorsFound); + int const CoilSteamOutletNode = GetCoilSteamOutletNode(state, hCoilType, thisPIU.HCoil, ErrorsFound); Real64 MaxVolHotSteamFlowDes = 0.0; // Autosized maximum hot steam flow for reporting if (IsAutoSize) { diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index ca2d0dca25b..ef93b055e14 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -311,7 +311,7 @@ void GetPumpInput(EnergyPlusData &state) ObjectIsNotParent); TestCompSet(state, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaArgs(2), thisInput->cAlphaArgs(3), "Water Nodes"); - thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(4))); @@ -395,8 +395,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.HasVFD = false; } else { thisPump.HasVFD = true; - thisPump.VFD.VFDControlType = - static_cast(getEnumValue(controlTypeVFDNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(7)))); + thisPump.VFD.VFDControlType = static_cast(getEnumValue(controlTypeVFDNamesUC, state.dataIPShortCut->cAlphaArgs(7))); switch (thisPump.VFD.VFDControlType) { @@ -480,8 +479,7 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(14)) { - thisPump.powerSizingMethod = - static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(14)))); + thisPump.powerSizingMethod = static_cast(getEnumValue(powerSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(14))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", @@ -583,7 +581,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.Energy = 0.0; thisPump.Power = 0.0; - thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, @@ -648,8 +646,7 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(8)) { - thisPump.powerSizingMethod = - static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + thisPump.powerSizingMethod = static_cast(getEnumValue(powerSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(8))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", @@ -780,8 +777,7 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(6)) { - thisPump.powerSizingMethod = - static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); + thisPump.powerSizingMethod = static_cast(getEnumValue(powerSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(6))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", @@ -869,7 +865,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.SequencingScheme = PumpBankControlSeq::SequentialScheme; } - thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(5))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(5))); @@ -924,8 +920,7 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(8)) { - thisPump.powerSizingMethod = - static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + thisPump.powerSizingMethod = static_cast(getEnumValue(powerSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(8))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", @@ -1013,7 +1008,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.SequencingScheme = PumpBankControlSeq::SequentialScheme; } - thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(5))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, @@ -1066,8 +1061,7 @@ void GetPumpInput(EnergyPlusData &state) } } if (!thisInput->lAlphaFieldBlanks(8)) { - thisPump.powerSizingMethod = - static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + thisPump.powerSizingMethod = static_cast(getEnumValue(powerSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(8))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", diff --git a/src/EnergyPlus/PurchasedAirManager.cc b/src/EnergyPlus/PurchasedAirManager.cc index a2d8862c4d6..01f6a3c21a1 100644 --- a/src/EnergyPlus/PurchasedAirManager.cc +++ b/src/EnergyPlus/PurchasedAirManager.cc @@ -365,12 +365,12 @@ void GetPurchasedAir(EnergyPlusData &state) PurchAir.MinCoolSuppAirHumRat = s_ip->getRealFieldValue(fields, schemaProps, "minimum_cooling_supply_air_humidity_ratio"); cAlphaFieldName = "Heating Limit"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "heating_limit"); - PurchAir.HeatingLimit = static_cast(getEnumValue(limitTypeNamesUC, Util::makeUPPER(fieldValue))); + PurchAir.HeatingLimit = static_cast(getEnumValue(limitTypeNamesUC, fieldValue)); PurchAir.MaxHeatVolFlowRate = s_ip->getRealFieldValue(fields, schemaProps, "maximum_heating_air_flow_rate"); PurchAir.MaxHeatSensCap = s_ip->getRealFieldValue(fields, schemaProps, "maximum_sensible_heating_capacity"); cAlphaFieldName = "Cooling Limit"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "cooling_limit"); - PurchAir.CoolingLimit = static_cast(getEnumValue(limitTypeNamesUC, Util::makeUPPER(fieldValue))); + PurchAir.CoolingLimit = static_cast(getEnumValue(limitTypeNamesUC, fieldValue)); PurchAir.MaxCoolVolFlowRate = s_ip->getRealFieldValue(fields, schemaProps, "maximum_cooling_air_flow_rate"); PurchAir.MaxCoolTotCap = s_ip->getRealFieldValue(fields, schemaProps, "maximum_total_cooling_capacity"); // get optional heating availability schedule @@ -394,12 +394,12 @@ void GetPurchasedAir(EnergyPlusData &state) // get Dehumidification control type cAlphaFieldName = "Dehumidification Control Type"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "dehumidification_control_type"); - PurchAir.DehumidCtrlType = static_cast(getEnumValue(humControlNamesUC, Util::makeUPPER(fieldValue))); + PurchAir.DehumidCtrlType = static_cast(getEnumValue(humControlNamesUC, fieldValue)); PurchAir.CoolSHR = s_ip->getRealFieldValue(fields, schemaProps, "cooling_sensible_heat_ratio"); // get Humidification control type cAlphaFieldName = "Humidification Control Type"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "humidification_control_type"); - PurchAir.HumidCtrlType = static_cast(getEnumValue(humControlNamesUC, Util::makeUPPER(fieldValue))); + PurchAir.HumidCtrlType = static_cast(getEnumValue(humControlNamesUC, fieldValue)); // get Design specification outdoor air object cAlphaFieldName = "Design Specification Outdoor Air Object Name"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "design_specification_outdoor_air_object_name"); @@ -455,7 +455,7 @@ void GetPurchasedAir(EnergyPlusData &state) // get Demand controlled ventilation type cAlphaFieldName = "Demand Controlled Ventilation Type"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "demand_controlled_ventilation_type"); - PurchAir.DCVType = static_cast(getEnumValue(dcvNamesUC, Util::makeUPPER(fieldValue))); + PurchAir.DCVType = static_cast(getEnumValue(dcvNamesUC, fieldValue)); if (PurchAir.DCVType == DCV::CO2SetPoint) { if (!state.dataContaminantBalance->Contaminant.CO2Simulation) { PurchAir.DCVType = DCV::None; @@ -470,11 +470,11 @@ void GetPurchasedAir(EnergyPlusData &state) // get Outdoor air economizer type cAlphaFieldName = "Outdoor Air Economizer Type"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "outdoor_air_economizer_type"); - PurchAir.EconomizerType = static_cast(getEnumValue(econNamesUC, Util::makeUPPER(fieldValue))); + PurchAir.EconomizerType = static_cast(getEnumValue(econNamesUC, fieldValue)); // get Outdoor air heat recovery type and effectiveness cAlphaFieldName = "Heat Recovery Type"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "heat_recovery_type"); - PurchAir.HtRecType = static_cast(getEnumValue(heatRecoveryNamesUC, Util::makeUPPER(fieldValue))); + PurchAir.HtRecType = static_cast(getEnumValue(heatRecoveryNamesUC, fieldValue)); } else { // No outdoorair PurchAir.DCVType = DCV::None; PurchAir.EconomizerType = Econ::NoEconomizer; @@ -515,7 +515,7 @@ void GetPurchasedAir(EnergyPlusData &state) // get heating fuel type cAlphaFieldName = "Heating Fuel Type"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "heating_fuel_type"); - PurchAir.heatingFuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(fieldValue))); + PurchAir.heatingFuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, fieldValue)); // get optional cooling fuel efficiency schedule name cAlphaFieldName = "Cooling Fuel Efficiency Schedule Name"; std::string const coolFuelEfficiencySchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "cooling_fuel_efficiency_schedule_name"); @@ -528,7 +528,7 @@ void GetPurchasedAir(EnergyPlusData &state) // get cooling fuel type cAlphaFieldName = "Cooling Fuel Type"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "cooling_fuel_type"); - PurchAir.coolingFuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(fieldValue))); + PurchAir.coolingFuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, fieldValue)); } EndUniqueNodeCheck(state, s_ipsc->cCurrentModuleObject); } diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index 8335533db0d..577c3cb5139 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -4965,8 +4965,7 @@ void GetRefrigerationInput(EnergyPlusData &state) if (lAlphaBlanks(5)) { Compressor(CompNum).TransFlag = false; // For some reason, Alkphas(5) is not uppercased? - } else if (CriticalType crit = static_cast(getEnumValue(criticalTypeNamesUC, Util::makeUPPER(Alphas(5)))); - crit != CriticalType::Invalid) { + } else if (CriticalType crit = static_cast(getEnumValue(criticalTypeNamesUC, Alphas(5))); crit != CriticalType::Invalid) { Compressor(CompNum).TransFlag = static_cast(crit); } else { ShowSevereInvalidKey(state, eoh, cAlphaFieldNames(5), Alphas(5)); diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 0cbb7dd450f..f848105773f 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -856,10 +856,10 @@ int ReportCoilSelection::getIndexForOrCreateDataObjFromCoilName(EnergyPlusData & bool locIsCooling(false); bool locIsHeating(false); for (int loop = 1; loop <= HVAC::NumAllCoilTypes; ++loop) { - if (Util::SameString(coilType, HVAC::cAllCoilTypes(loop))) { + if (equali(coilType, HVAC::cAllCoilTypes(loop))) { found = true; - locIsCooling = Util::SameString(coilType, HVAC::cCoolingCoilTypes(loop)); - locIsHeating = Util::SameString(coilType, HVAC::cHeatingCoilTypes(loop)); + locIsCooling = equali(coilType, HVAC::cCoolingCoilTypes(loop)); + locIsHeating = equali(coilType, HVAC::cHeatingCoilTypes(loop)); break; } } @@ -2028,7 +2028,7 @@ std::string ReportCoilSelection::getTimeText(EnergyPlusData &state, int const ti return returnString; } -bool ReportCoilSelection::isCompTypeFan(std::string const &compType // string component type, input object class name +bool ReportCoilSelection::isCompTypeFan(std::string &compType // string component type, input object class name ) { // if compType name is one of the fan objects, then return true @@ -2050,7 +2050,7 @@ bool ReportCoilSelection::isCompTypeFan(std::string const &compType // string co return false; } -bool ReportCoilSelection::isCompTypeCoil(std::string const &compType // string component type, input object class name +bool ReportCoilSelection::isCompTypeCoil(std::string &compType // string component type, input object class name ) { // if compType name is one of the coil objects, then return true diff --git a/src/EnergyPlus/ReportCoilSelection.hh b/src/EnergyPlus/ReportCoilSelection.hh index 4c0ec590f24..45800e75825 100644 --- a/src/EnergyPlus/ReportCoilSelection.hh +++ b/src/EnergyPlus/ReportCoilSelection.hh @@ -415,10 +415,10 @@ public: // methods static std::string getTimeText(EnergyPlusData &state, int const timeStepAtPeak); - bool isCompTypeFan(std::string const &compType // string component type, input object class name + bool isCompTypeFan(std::string &compType // string component type, input object class name ); - bool isCompTypeCoil(std::string const &compType // string component type, input object class name + bool isCompTypeCoil(std::string &compType // string component type, input object class name ); void setZoneLatentLoadCoolingIdealPeak(int const zoneIndex, Real64 const zoneCoolingLatentLoad); diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 41158f4406a..01a82695ba3 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -299,7 +299,7 @@ namespace RoomAir { } } } - } else if (Util::SameString(zoneEquipList.EquipName(I), afnHVAC.Name)) { + } else if (Util::SameString(afnHVAC.Name, zoneEquipList.EquipName(I))) { if (afnHVAC.EquipConfigIndex == 0) { afnHVAC.EquipConfigIndex = I; } @@ -309,7 +309,7 @@ namespace RoomAir { } } for (int iNode = 1; iNode <= state.dataLoopNodes->NumOfNodes; ++iNode) { // loop over all nodes to find supply node ID - if (Util::SameString(state.dataLoopNodes->NodeID(iNode), afnHVAC.SupplyNodeName)) { + if (equali(state.dataLoopNodes->NodeID(iNode), afnHVAC.SupplyNodeName)) { afnHVAC.SupNodeNum = iNode; break; } @@ -339,7 +339,7 @@ namespace RoomAir { if (afnHVAC.RetNodeNum == 0) { for (int iNode = 1; iNode <= state.dataLoopNodes->NumOfNodes; ++iNode) { // loop over all nodes to find return node ID - if (Util::SameString(state.dataLoopNodes->NodeID(iNode), afnHVAC.ReturnNodeName)) { + if (equali(state.dataLoopNodes->NodeID(iNode), afnHVAC.ReturnNodeName)) { afnHVAC.RetNodeNum = iNode; break; } diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index d64b36e1610..6f171d69329 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -441,7 +441,7 @@ namespace RoomAir { roomAirPattern.TwoGradPatrn.HiGradient = ipsc->rNumericArgs(6); roomAirPattern.TwoGradPatrn.InterpolationMode = - static_cast(getEnumValue(userDefinedPatternModeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); + static_cast(getEnumValue(userDefinedPatternModeNamesUC, ipsc->cAlphaArgs(2))); if (roomAirPattern.TwoGradPatrn.InterpolationMode == UserDefinedPatternMode::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -701,7 +701,7 @@ namespace RoomAir { airNode.SurfMask.allocate(NumOfSurfs); } - airNode.ClassType = static_cast(getEnumValue(airNodeTypeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); + airNode.ClassType = static_cast(getEnumValue(airNodeTypeNamesUC, ipsc->cAlphaArgs(2))); if (airNode.ClassType == AirNodeType::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1038,8 +1038,7 @@ namespace RoomAir { ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(3)); ErrorsFound = true; } - } else if ((zoneCV.VforComfort = static_cast(getEnumValue(comfortNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(3))))) == - Comfort::Invalid) { + } else if ((zoneCV.VforComfort = static_cast(getEnumValue(comfortNamesUC, ipsc->cAlphaArgs(3)))) == Comfort::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } @@ -1155,7 +1154,7 @@ namespace RoomAir { } // 2nd alpha is diffuser type - zoneUI.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); + zoneUI.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, ipsc->cAlphaArgs(2))); if (zoneUI.DiffuserType == Diffuser::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1214,7 +1213,7 @@ namespace RoomAir { state.dataRoomAir->IsZoneUFAD(zoneUE.ZonePtr) = true; state.dataRoomAir->ZoneUFADPtr(zoneUE.ZonePtr) = Loop + state.dataRoomAir->TotUFADInt; } - zoneUE.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); + zoneUE.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, ipsc->cAlphaArgs(2))); if (zoneUE.DiffuserType == Diffuser::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1554,8 +1553,8 @@ namespace RoomAir { int numGainsFound = 0; for (int gainsLoop = 1; gainsLoop <= numInputGains; ++gainsLoop) { auto &intGain = roomAFNZoneNode.IntGain(gainsLoop); - intGain.type = static_cast( - getEnumValue(DataHeatBalance::IntGainTypeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(gainsLoop * 2)))); + intGain.type = + static_cast(getEnumValue(DataHeatBalance::IntGainTypeNamesUC, ipsc->cAlphaArgs(gainsLoop * 2))); if (intGain.type == DataHeatBalance::IntGainType::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(gainsLoop * 2), ipsc->cAlphaArgs(gainsLoop * 2)); diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index 5707b7cd9fa..23a809c551b 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -1310,7 +1310,7 @@ void ParseExpression(EnergyPlusData &state, const size_t len = strlen(string); const std::string potential_match = String.substr(Pos, len); - if ((case_insensitive && Util::SameString(potential_match, string)) || (!case_insensitive && potential_match == string)) { + if ((case_insensitive && equali(potential_match, string)) || (!case_insensitive && potential_match == string)) { if (state.dataSysVars->DeveloperFlag) { print(state.files.debug, "OPERATOR \"{}\"\n", potential_match); } @@ -3386,7 +3386,7 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state) ShowContinueError(state, format("...Units entered in {} (deprecated use)=\"{}\"", cAlphaFieldNames(1), UnitsA)); } } - curUnit = static_cast(getEnumValue(Constant::unitNamesUC, Util::makeUPPER(UnitsB))); + curUnit = static_cast(getEnumValue(Constant::unitNamesUC, UnitsB)); state.dataRuntimeLangProcessor->RuntimeReportVar(RuntimeReportVarNum).Name = cAlphaArgs(1); @@ -3559,7 +3559,7 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state) ShowContinueError(state, format("...Units entered in {} (deprecated use)=\"{}\"", cAlphaFieldNames(1), UnitsA)); } } - curUnit = static_cast(getEnumValue(Constant::unitNamesUC, Util::makeUPPER(UnitsB))); + curUnit = static_cast(getEnumValue(Constant::unitNamesUC, UnitsB)); state.dataRuntimeLangProcessor->RuntimeReportVar(RuntimeReportVarNum).Name = cAlphaArgs(1); @@ -3618,8 +3618,7 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state) } // Resource Type - Constant::eResource resource = - static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER(cAlphaArgs(5)))); + Constant::eResource resource = static_cast(getEnumValue(Constant::eResourceNamesUC, cAlphaArgs(5))); if (resource == Constant::eResource::Invalid) { ShowSevereError(state, format("{}{}=\"{} invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index fe139ad1fcb..50a442bce12 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -1840,15 +1840,15 @@ void InitSetPointManagers(EnergyPlusData &state) } } - auto const &primaryAirSystem = state.dataAirSystemsData->PrimaryAirSystems(spmSZR->airLoopNum); + auto &primaryAirSystem = state.dataAirSystemsData->PrimaryAirSystems(spmSZR->airLoopNum); MixedAirNode = primaryAirSystem.OASysOutletNodeNum; InletBranchNum = primaryAirSystem.InletBranchNum[0]; LoopInNode = primaryAirSystem.Branch(InletBranchNum).NodeNumIn; // get the supply fan inlet and outlet nodes if (MixedAirNode > 0) { bool LookForFan = false; - for (auto const &branch : primaryAirSystem.Branch) { - for (auto const &comp : branch.Comp) { + for (auto &branch : primaryAirSystem.Branch) { + for (auto &comp : branch.Comp) { if (MixedAirNode == comp.NodeNumIn) { LookForFan = true; } diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index cab17f051b8..f0493837294 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -1361,8 +1361,8 @@ void GetAirPathData(EnergyPlusData &state) CompType_Num = GetOACompTypeNum(state, OASysNum, OACompNum); if (CompType_Num == CompType::WaterCoil_DetailedCool || CompType_Num == CompType::WaterCoil_SimpleHeat || CompType_Num == CompType::WaterCoil_Cooling) { - WaterCoilNodeNum = - GetCoilWaterInletNode(state, GetOACompType(state, OASysNum, OACompNum), GetOACompName(state, OASysNum, OACompNum), ErrorsFound); + std::string ctype = GetOACompType(state, OASysNum, OACompNum); + WaterCoilNodeNum = GetCoilWaterInletNode(state, ctype, GetOACompName(state, OASysNum, OACompNum), ErrorsFound); CheckCoilWaterInletNode(state, WaterCoilNodeNum, NodeNotFound); UnitarySystems::isWaterCoilHeatRecoveryType(state, WaterCoilNodeNum, NodeNotFound); if (NodeNotFound) { @@ -7621,11 +7621,11 @@ bool CheckWaterCoilOnPrimaryAirLoopBranch(EnergyPlusData &state, SimAirServingZo if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { for (int AirSysNum = 1; AirSysNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirSysNum) { - auto const &primaryAirSystems = state.dataAirSystemsData->PrimaryAirSystems(AirSysNum); + auto &primaryAirSystems = state.dataAirSystemsData->PrimaryAirSystems(AirSysNum); for (int BranchNum = 1; BranchNum <= primaryAirSystems.NumBranches; ++BranchNum) { for (int CompNum = 1; CompNum <= primaryAirSystems.Branch(BranchNum).TotalComponents; ++CompNum) { if ((CompTypeNum == primaryAirSystems.Branch(BranchNum).Comp(CompNum).CompType_Num) && - Util::SameString(CompName, primaryAirSystems.Branch(BranchNum).Comp(CompNum).Name)) { + Util::SameString(primaryAirSystems.Branch(BranchNum).Comp(CompNum).Name, CompName)) { return true; } } @@ -7656,7 +7656,7 @@ bool CheckWaterCoilOnOASystem(EnergyPlusData &state, SimAirServingZones::CompTyp auto &outsideAirSys = state.dataAirLoop->OutsideAirSys(OASysNum); for (int OACompNum = 1; OACompNum <= outsideAirSys.NumComponents; ++OACompNum) { if ((CompTypeNum == outsideAirSys.ComponentTypeEnum(OACompNum)) && - (Util::SameString(CompName, outsideAirSys.ComponentName(OACompNum)))) { + (Util::SameString(outsideAirSys.ComponentName(OACompNum), CompName))) { return true; } } @@ -7693,7 +7693,7 @@ bool CheckWaterCoilSystemOnAirLoopOrOASystem(EnergyPlusData &state, SimAirServin for (int HXASSCoilNum = 1; HXASSCoilNum <= state.dataHVACAssistedCC->TotalNumHXAssistedCoils; ++HXASSCoilNum) { std::string CompType = state.dataHVACAssistedCC->HXAssistedCoil(HXASSCoilNum).CoolingCoilType; if ((Util::SameString(CompType, "Coil:Cooling:Water") || Util::SameString(CompType, "Coil:Cooling:Water:DetailedGeometry")) && - Util::SameString(CompName, state.dataHVACAssistedCC->HXAssistedCoil(HXASSCoilNum).CoolingCoilName)) { + Util::SameString(state.dataHVACAssistedCC->HXAssistedCoil(HXASSCoilNum).CoolingCoilName, CompName)) { CoilSystemName = state.dataHVACAssistedCC->HXAssistedCoil(HXASSCoilNum).Name; CoilSystemTypeNum = SimAirServingZones::CompType::WaterCoil_CoolingHXAsst; WaterCoilIsOnWaterCoilSystem = true; diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index e7e41dc13a5..3e70b91d196 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -1090,7 +1090,7 @@ namespace SimulationManager { state.dataIPShortCut->cNumericFieldNames); if (NumAlpha > 0) { state.dataHeatBal->heatIndexMethod = - static_cast(getEnumValue(DataHeatBalance::HeatIndexMethodUC, Util::makeUPPER(Alphas(1)))); + static_cast(getEnumValue(DataHeatBalance::HeatIndexMethodUC, Alphas(1))); } } diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 29ca2e3937d..a32e99c69eb 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -3056,8 +3056,8 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state) } else { CheckZoneSizing(state, this->sysType, this->SysName); if (Util::SameString(this->ReheatComp, "Coil:Heating:Water")) { - state.dataSingleDuct->CoilWaterInletNodeSS = GetCoilWaterInletNode(state, "Coil:Heating:Water", this->ReheatName, ErrorsFound); - state.dataSingleDuct->CoilWaterOutletNodeSS = GetCoilWaterOutletNode(state, "Coil:Heating:Water", this->ReheatName, ErrorsFound); + state.dataSingleDuct->CoilWaterInletNodeSS = GetCoilWaterInletNode(state, this->ReheatComp, this->ReheatName, ErrorsFound); + state.dataSingleDuct->CoilWaterOutletNodeSS = GetCoilWaterOutletNode(state, this->ReheatComp, this->ReheatName, ErrorsFound); if (IsAutoSize) { PlantSizingErrorsFound = false; PltSizHeatNum = MyPlantSizingIndex(state, @@ -3167,8 +3167,8 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state) } else { CheckZoneSizing(state, this->sysType, this->SysName); if (Util::SameString(this->ReheatComp, "Coil:Heating:Steam")) { - state.dataSingleDuct->CoilSteamInletNodeSS = GetCoilSteamInletNode(state, "Coil:Heating:Steam", this->ReheatName, ErrorsFound); - state.dataSingleDuct->CoilSteamOutletNodeSS = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", this->ReheatName, ErrorsFound); + state.dataSingleDuct->CoilSteamInletNodeSS = GetCoilSteamInletNode(state, this->ReheatComp, this->ReheatName, ErrorsFound); + state.dataSingleDuct->CoilSteamOutletNodeSS = GetCoilSteamOutletNode(state, this->ReheatComp, this->ReheatName, ErrorsFound); if (IsAutoSize) { PlantSizingErrorsFound = false; PltSizHeatNum = MyPlantSizingIndex(state, diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 81bf550a123..0a357806be8 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -2345,7 +2345,7 @@ void ProcessInputOARequirements(EnergyPlusData &state, auto &thisOARequirements(state.dataSize->OARequirements(OAIndex)); if (NumAlphas > 1) { - thisOARequirements.OAFlowMethod = static_cast(getEnumValue(OAFlowCalcMethodNamesUC, Util::makeUPPER(Alphas(2)))); + thisOARequirements.OAFlowMethod = static_cast(getEnumValue(OAFlowCalcMethodNamesUC, Alphas(2))); if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->OARequirements(OAIndex).Name)); ShowContinueError(state, format("...Invalid {}=\"{}\",", cAlphaFields(2), Alphas(2))); @@ -3216,10 +3216,10 @@ void GetZoneSizingInput(EnergyPlusData &state) constexpr static std::array(DataSizing::AirflowSizingMethod::Num)> AirflowSizingMethodNamesUC = { "DESIGNDAY", "FLOW/ZONE", "DESIGNDAYWITHLIMIT"}; state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod = - static_cast(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + static_cast(getEnumValue(AirflowSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(5))); assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod != AirflowSizingMethod::Invalid); state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod = - static_cast(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); + static_cast(getEnumValue(AirflowSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(6))); assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod != AirflowSizingMethod::Invalid); BooleanSwitch accountForDOAS = getYesNoValue(state.dataIPShortCut->cAlphaArgs(8)); @@ -3229,7 +3229,7 @@ void GetZoneSizingInput(EnergyPlusData &state) constexpr static std::array(DataSizing::DOASControl::Num)> DOASControlNamesUC = { "NEUTRALSUPPLYAIR", "NEUTRALDEHUMIDIFIEDSUPPLYAIR", "COLDSUPPLYAIR"}; state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASControlStrategy = - static_cast(getEnumValue(DOASControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); + static_cast(getEnumValue(DOASControlNamesUC, state.dataIPShortCut->cAlphaArgs(9))); state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASLowSetpoint = state.dataIPShortCut->rNumericArgs(17); state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASHighSetpoint = state.dataIPShortCut->rNumericArgs(18); @@ -3511,8 +3511,8 @@ void GetSystemSizingInput(EnergyPlusData &state) constexpr std::array(DataSizing::LoadSizing::Num)> LoadSizingNamesUC{ "SENSIBLE", "LATENT", "TOTAL", "VENTILATIONREQUIREMENT"}; - SysSizInput(SysSizIndex).loadSizingType = static_cast( - getEnumValue(LoadSizingNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum)))); + SysSizInput(SysSizIndex).loadSizingType = + static_cast(getEnumValue(LoadSizingNamesUC, state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum))); // assign PeakLoad based on LoadSizing for now if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Sensible) { @@ -3525,11 +3525,11 @@ void GetSystemSizingInput(EnergyPlusData &state) } // set the CoolCapControl input constexpr std::array(CapacityControl::Num)> CapacityControlNamesUC{"VAV", "BYPASS", "VT", "ONOFF"}; - SysSizInput(SysSizIndex).CoolCapControl = static_cast( - getEnumValue(CapacityControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iCoolCapControlAlphaNum)))); + SysSizInput(SysSizIndex).CoolCapControl = + static_cast(getEnumValue(CapacityControlNamesUC, state.dataIPShortCut->cAlphaArgs(iCoolCapControlAlphaNum))); - SysSizInput(SysSizIndex).SizingOption = static_cast( - getEnumValue(SizingConcurrenceNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum)))); + SysSizInput(SysSizIndex).SizingOption = + static_cast(getEnumValue(SizingConcurrenceNamesUC, state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum))); BooleanSwitch is100PctOACooling = getYesNoValue(state.dataIPShortCut->cAlphaArgs(i100PercentOACoolingAlphaNum)); SysSizInput(SysSizIndex).CoolOAOption = (is100PctOACooling == BooleanSwitch::Yes) ? OAControl::AllOA : OAControl::MinOA; @@ -4052,12 +4052,12 @@ void GetPlantSizingInput(EnergyPlusData &state) constexpr static std::array(DataSizing::TypeOfPlantLoop::Num)> TypeOfPlantLoopNamesUC = { "HEATING", "COOLING", "CONDENSER", "STEAM"}; state.dataSize->PlantSizData(PltSizIndex).LoopType = - static_cast(getEnumValue(TypeOfPlantLoopNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + static_cast(getEnumValue(TypeOfPlantLoopNamesUC, state.dataIPShortCut->cAlphaArgs(2))); assert(state.dataSize->PlantSizData(PltSizIndex).LoopType != TypeOfPlantLoop::Invalid); if (NumAlphas > 2) { state.dataSize->PlantSizData(PltSizIndex).ConcurrenceOption = - static_cast(getEnumValue(SizingConcurrenceNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + static_cast(getEnumValue(SizingConcurrenceNamesUC, state.dataIPShortCut->cAlphaArgs(3))); } if (NumAlphas > 3) { { diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index 48868193daa..893b4dc769c 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -1508,7 +1508,7 @@ namespace SteamCoils { state.dataSteamCoils->GetSteamCoilsInputFlag = false; } - if (CoilType == "COIL:HEATING:STEAM") { + if (Util::makeUPPER(CoilType) == "COIL:HEATING:STEAM") { IndexNum = Util::FindItemInList(CoilName, state.dataSteamCoils->SteamCoil); } else { IndexNum = 0; @@ -1589,7 +1589,7 @@ namespace SteamCoils { } Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1761,7 +1761,7 @@ namespace SteamCoils { } int GetCoilAirOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type [[maybe_unused]] bool &ErrorsFound // set to true if problem ) @@ -1844,7 +1844,7 @@ namespace SteamCoils { } int GetCoilSteamInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1929,7 +1929,7 @@ namespace SteamCoils { } int GetCoilSteamOutletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1976,7 +1976,7 @@ namespace SteamCoils { } Real64 GetCoilCapacity(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -2057,7 +2057,7 @@ namespace SteamCoils { } int GetSteamCoilControlNodeNum(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorFlag // set to true if problem ) @@ -2107,7 +2107,7 @@ namespace SteamCoils { } int GetSteamCoilAvailScheduleIndex(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) diff --git a/src/EnergyPlus/SteamCoils.hh b/src/EnergyPlus/SteamCoils.hh index 0133739d11a..297d07ce25e 100644 --- a/src/EnergyPlus/SteamCoils.hh +++ b/src/EnergyPlus/SteamCoils.hh @@ -187,7 +187,7 @@ namespace SteamCoils { void CheckSteamCoilSchedule(EnergyPlusData &state, std::string const &CompType, std::string_view CompName, Real64 &Value, int &CompIndex); Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -210,7 +210,7 @@ namespace SteamCoils { ); int GetCoilAirOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -222,7 +222,7 @@ namespace SteamCoils { ); int GetCoilSteamInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -234,13 +234,13 @@ namespace SteamCoils { ); int GetCoilSteamOutletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); Real64 GetCoilCapacity([[maybe_unused]] EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -252,7 +252,7 @@ namespace SteamCoils { ); int GetSteamCoilControlNodeNum(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorFlag // set to true if problem ); diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index c254d24f790..1407693923f 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -9738,8 +9738,8 @@ namespace SurfaceGeometry { s_ipsc->cAlphaArgs(1))); } - windowShadingControl.shadingControlType = static_cast( - getEnumValue(WindowShadingControlTypeNamesUC, Util::makeUPPER(s_ipsc->cAlphaArgs(5)))); + windowShadingControl.shadingControlType = + static_cast(getEnumValue(WindowShadingControlTypeNamesUC, s_ipsc->cAlphaArgs(5))); if (windowShadingControl.ShadingDevice > 0) { if (s_mat->materials(windowShadingControl.ShadingDevice)->group == Material::Group::Screen && diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index 53b15f13f48..47fe5b2b190 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -1296,8 +1296,7 @@ namespace Avail { ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "availability_manager_name"); std::string availManagerObjType = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "availability_manager_object_type"); - mgrList.availManagers(listItem).type = - static_cast(getEnumValue(managerTypeNamesUC, Util::makeUPPER(availManagerObjType))); + mgrList.availManagers(listItem).type = static_cast(getEnumValue(managerTypeNamesUC, availManagerObjType)); if (mgrList.availManagers(listItem).type == ManagerType::HybridVent) { mgrList.availManagers(listItem).type = ManagerType::Invalid; } diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index 111e118df67..3574f975665 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -329,8 +329,8 @@ void InitEnergyReports(EnergyPlusData &state) for (int VarNum = 1; VarNum <= thisZoneEquipList.EquipData(AirDistUnitNum).NumMeteredVars; ++VarNum) { if (thisZoneEquipList.EquipData(AirDistUnitNum).MeteredVar(VarNum).resource == Constant::eResource::EnergyTransfer) { thisZoneEquipList.EquipData(AirDistUnitNum).EnergyTransComp = EnergyTransfer; - const std::string &CompType = thisZoneEquipList.EquipData(AirDistUnitNum).TypeOf; - const std::string &CompName = thisZoneEquipList.EquipData(AirDistUnitNum).Name; + std::string &CompType = thisZoneEquipList.EquipData(AirDistUnitNum).TypeOf; + std::string &CompName = thisZoneEquipList.EquipData(AirDistUnitNum).Name; int Idx = 0; int MatchLoop = 0; int MatchLoopType = 0; @@ -351,8 +351,8 @@ void InitEnergyReports(EnergyPlusData &state) if (thisZoneEquipList.EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).MeteredVar(VarNum).resource == Constant::eResource::EnergyTransfer) { thisZoneEquipList.EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).EnergyTransComp = EnergyTransfer; - const std::string &CompType = thisZoneEquipList.EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).TypeOf; - const std::string &CompName = thisZoneEquipList.EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).Name; + std::string &CompType = thisZoneEquipList.EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).TypeOf; + std::string &CompName = thisZoneEquipList.EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).Name; int Idx = 0; int MatchLoop = 0; int MatchLoopType = 0; @@ -384,9 +384,9 @@ void InitEnergyReports(EnergyPlusData &state) .SubEquipData(SubEquipNum) .SubSubEquipData(SubSubEquipNum) .EnergyTransComp = EnergyTransfer; - const std::string &CompType = + std::string &CompType = thisZoneEquipList.EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).SubSubEquipData(SubSubEquipNum).TypeOf; - const std::string &CompName = + std::string &CompName = thisZoneEquipList.EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).SubSubEquipData(SubSubEquipNum).Name; int Idx = 0; int MatchLoop = 0; @@ -725,8 +725,8 @@ void InitEnergyReports(EnergyPlusData &state) auto &thisVentRepComp = state.dataPlnt->VentRepPlant[static_cast(LoopSideLocation::Supply)](PlantLoopNum) .Branch(BranchNum) .Comp(CompNum); - const std::string &CompType = thisVentRepComp.TypeOf; - const std::string &CompName = thisVentRepComp.Name; + std::string &CompType = thisVentRepComp.TypeOf; + std::string &CompName = thisVentRepComp.Name; int MatchLoop = 0; int MatchLoopType = 0; int MatchBranch = 0; @@ -754,8 +754,8 @@ void InitEnergyReports(EnergyPlusData &state) auto &thisVentRepComp = state.dataPlnt->VentRepCond[static_cast(LoopSideLocation::Supply)](PlantLoopNum) .Branch(BranchNum) .Comp(CompNum); - const std::string &CompType = thisVentRepComp.TypeOf; - const std::string &CompName = thisVentRepComp.Name; + std::string &CompType = thisVentRepComp.TypeOf; + std::string &CompName = thisVentRepComp.Name; int MatchLoop = 0; int MatchLoopType = 0; int MatchBranch = 0; @@ -2247,9 +2247,9 @@ void CreateEnergyReportStructure(EnergyPlusData &state) for (AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { for (BranchNum = 1; BranchNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).NumBranches; ++BranchNum) { for (CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { - DataLoopNode::ConnectionObjectType TypeOfComp = static_cast( - EnergyPlus::getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf)); + DataLoopNode::ConnectionObjectType TypeOfComp = static_cast(EnergyPlus::getEnumValue( + BranchNodeConnections::ConnectionObjectTypeNamesUC, + Util::makeUPPER(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf))); std::string &NameOfComp = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).Name; // Get complete list of components for complex branches if (BranchNodeConnections::IsParentObject(state, TypeOfComp, NameOfComp)) { @@ -2307,7 +2307,8 @@ void CreateEnergyReportStructure(EnergyPlusData &state) for (SubCompNum = 1; SubCompNum <= NumChildren; ++SubCompNum) { DataLoopNode::ConnectionObjectType TypeOfSubComp = static_cast(EnergyPlus::getEnumValue( BranchNodeConnections::ConnectionObjectTypeNamesUC, - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).SubComp(SubCompNum).TypeOf)); + Util::makeUPPER( + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).SubComp(SubCompNum).TypeOf))); std::string &NameOfSubComp = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).SubComp(SubCompNum).Name; if (BranchNodeConnections::IsParentObject(state, TypeOfSubComp, NameOfSubComp)) { @@ -4529,8 +4530,8 @@ void MatchPlantSys(EnergyPlusData &state, for (int VarNum = 1; VarNum <= thisComp.NumMeteredVars; ++VarNum) { if (thisComp.MeteredVar(VarNum).resource == Constant::eResource::EnergyTransfer) { thisComp.EnergyTransComp = EnergyTrans; - const std::string &CompType = thisComp.TypeOf; - const std::string &CompName = thisComp.Name; + std::string &CompType = thisComp.TypeOf; + std::string &CompName = thisComp.Name; bool MatchFound = false; // Set to .TRUE. when a match is found int MatchLoop = 0; // Loop number of the match int MatchBranch = 0; // Branch number of the match @@ -4552,8 +4553,8 @@ void MatchPlantSys(EnergyPlusData &state, for (int VarNum = 1; VarNum <= thisSubComp.NumMeteredVars; ++VarNum) { if (thisSubComp.MeteredVar(VarNum).resource == Constant::eResource::EnergyTransfer) { thisSubComp.EnergyTransComp = EnergyTrans; - const std::string &CompType = thisComp.TypeOf; - const std::string &CompName = thisComp.Name; + std::string &CompType = thisComp.TypeOf; + std::string &CompName = thisComp.Name; bool MatchFound = false; // Set to .TRUE. when a match is found int MatchLoop = 0; // Loop number of the match int MatchBranch = 0; // Branch number of the match @@ -4576,8 +4577,8 @@ void MatchPlantSys(EnergyPlusData &state, for (int VarNum = 1; VarNum <= thisSubSubComp.NumMeteredVars; ++VarNum) { if (thisSubSubComp.MeteredVar(VarNum).resource == Constant::eResource::EnergyTransfer) { thisSubSubComp.EnergyTransComp = EnergyTrans; - const std::string &CompType = thisComp.TypeOf; - const std::string &CompName = thisComp.Name; + std::string &CompType = thisComp.TypeOf; + std::string &CompName = thisComp.Name; bool MatchFound = false; // Set to .TRUE. when a match is found int MatchLoop = 0; // Loop number of the match int MatchBranch = 0; // Branch number of the match @@ -4611,13 +4612,13 @@ void MatchPlantSys(EnergyPlusData &state, } void FindDemandSideMatch(EnergyPlusData &state, - std::string const &CompType, // Inlet node of the component to find the match of - std::string_view CompName, // Outlet node of the component to find the match of - bool &MatchFound, // Set to .TRUE. when a match is found - int &MatchLoopType, // Loop number of the match - int &MatchLoop, // Loop number of the match - int &MatchBranch, // Branch number of the match - int &MatchComp // Component number of the match + std::string &CompType, // Inlet node of the component to find the match of + std::string &CompName, // Outlet node of the component to find the match of + bool &MatchFound, // Set to .TRUE. when a match is found + int &MatchLoopType, // Loop number of the match + int &MatchLoop, // Loop number of the match + int &MatchBranch, // Branch number of the match + int &MatchComp // Component number of the match ) { diff --git a/src/EnergyPlus/SystemReports.hh b/src/EnergyPlus/SystemReports.hh index 5b7555b0808..f0660a725a6 100644 --- a/src/EnergyPlus/SystemReports.hh +++ b/src/EnergyPlus/SystemReports.hh @@ -328,13 +328,13 @@ namespace SystemReports { ); void FindDemandSideMatch(EnergyPlusData &state, - std::string const &CompType, // Inlet node of the component to find the match of - std::string_view CompName, // Outlet node of the component to find the match of - bool &MatchFound, // Set to .TRUE. when a match is found - int &MatchLoopType, // Loop number of the match - int &MatchLoop, // Loop number of the match - int &MatchBranch, // Branch number of the match - int &MatchComp // Component number of the match + std::string &CompType, // Inlet node of the component to find the match of + std::string &CompName, // Outlet node of the component to find the match of + bool &MatchFound, // Set to .TRUE. when a match is found + int &MatchLoopType, // Loop number of the match + int &MatchLoop, // Loop number of the match + int &MatchBranch, // Branch number of the match + int &MatchComp // Component number of the match ); void ReportAirLoopConnections(EnergyPlusData &state); diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 762747f685a..ceb7d5aff8c 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -103,6 +103,7 @@ namespace UnitHeater { // only when there is actually a heating load. This fan control works together // with the unit operation schedule to determine what the unit heater actually // does at a given point in time. + std::string coilHeatingWater = "Coil:Heating:Water"; // REFERENCES: // ASHRAE Systems and Equipment Handbook (SI), 1996. pp. 31.3-31.8 @@ -117,7 +118,6 @@ namespace UnitHeater { Real64 &LatOutputProvided, // Latent add/removal supplied by window AC (kg/s), dehumid = negative int &CompIndex) { - // SUBROUTINE INFORMATION: // AUTHOR Rick Strand // DATE WRITTEN May 2000 @@ -342,7 +342,7 @@ namespace UnitHeater { // Heating coil information: { - unitHeat.Type = static_cast(getEnumValue(HCoilTypeNamesUC, Util::makeUPPER(Alphas(7)))); + unitHeat.Type = static_cast(getEnumValue(HCoilTypeNamesUC, Alphas(7))); switch (unitHeat.Type) { case HCoilType::WaterHeatingCoil: unitHeat.HeatingCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; @@ -376,7 +376,7 @@ namespace UnitHeater { // mine the hot water or steam node from the coil object errFlag = false; if (unitHeat.Type == HCoilType::WaterHeatingCoil) { - unitHeat.HotControlNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", unitHeat.HCoilName, errFlag); + unitHeat.HotControlNode = WaterCoils::GetCoilWaterInletNode(state, coilHeatingWater, unitHeat.HCoilName, errFlag); } else { // its a steam coil unitHeat.HCoil_Index = SteamCoils::GetSteamCoilIndex(state, "COIL:HEATING:STEAM", unitHeat.HCoilName, errFlag); unitHeat.HotControlNode = SteamCoils::GetCoilSteamInletNode(state, unitHeat.HCoil_Index, unitHeat.HCoilName, errFlag); @@ -934,11 +934,10 @@ namespace UnitHeater { } } else { CheckZoneSizing(state, "ZoneHVAC:UnitHeater", state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name); - int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode( - state, "Coil:Heating:Water", state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, ErrorsFound); + state, coilHeatingWater, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, ErrorsFound); int CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode( - state, "Coil:Heating:Water", state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, ErrorsFound); + state, coilHeatingWater, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, ErrorsFound); if (IsAutoSize) { bool DoWaterCoilSizing = false; // if TRUE do water coil sizing calculation PltSizHeatNum = PlantUtilities::MyPlantSizingIndex(state, @@ -1082,11 +1081,11 @@ namespace UnitHeater { } else { auto &ZoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); CheckZoneSizing(state, "ZoneHVAC:UnitHeater", state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name); - + std::string coilHeatingString = "Coil:Heating:Steam"; int CoilSteamInletNode = SteamCoils::GetCoilSteamInletNode( - state, "Coil:Heating:Steam", state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, ErrorsFound); + state, coilHeatingString, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, ErrorsFound); int CoilSteamOutletNode = SteamCoils::GetCoilSteamInletNode( - state, "Coil:Heating:Steam", state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, ErrorsFound); + state, coilHeatingString, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, ErrorsFound); if (IsAutoSize) { PltSizHeatNum = PlantUtilities::MyPlantSizingIndex(state, "Coil:Heating:Steam", diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index 78b18a0be38..6cd61b1ff73 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -115,6 +115,12 @@ namespace UnitVentilator { // ASHRAE Systems and Equipment Handbook (SI), 1996. pp. 31.1-31.3 // Fred Buhl's fan coil module (FanCoilUnits.cc) + std::string coilsystemCoolingWaterHeatexchangerassisted = "CoilSystem:Cooling:Water:HeatExchangerAssisted"; + std::string coilHeatingWater = "Coil:Heating:Water"; + std::string coilHeatingSteam = "Coil:Heating:Steam"; + std::string coilHeatingElectric = "Coil:Heating:Electric"; + std::string coilHeatingFuel = "Coil:Heating:Fuel"; + static constexpr std::array(CoilsUsed::Num)> CoilsUsedNamesUC = { "NONE", "HEATINGANDCOOLING", "HEATING", "COOLING"}; static constexpr std::array(OAControl::Num)> OAControlNamesUC = { @@ -655,7 +661,7 @@ namespace UnitVentilator { unitVent.ColdControlNode = HVACHXAssistedCoolingCoil::GetCoilWaterInletNode(state, unitVent.CCoilTypeCh, unitVent.CCoilName, errFlag); unitVent.MaxVolColdWaterFlow = HVACHXAssistedCoolingCoil::GetCoilMaxWaterFlowRate( - state, "CoilSystem:Cooling:Water:HeatExchangerAssisted", unitVent.CCoilName, errFlag); + state, coilsystemCoolingWaterHeatexchangerassisted, unitVent.CCoilName, errFlag); } // Other error checks should trap before it gets to this point in the code, but including just in case. if (errFlag) { @@ -1766,7 +1772,7 @@ namespace UnitVentilator { } else { CheckZoneSizing(state, state.dataUnitVentilators->cMO_UnitVentilator, unitVent.Name); - CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, "Coil:Heating:Water", unitVent.HCoilName, ErrorsFound); + CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, coilHeatingWater, unitVent.HCoilName, ErrorsFound); if (IsAutoSize) { PltSizHeatNum = PlantUtilities::MyPlantSizingIndex( state, "COIL:HEATING:WATER", unitVent.HCoilName, unitVent.HotControlNode, CoilWaterOutletNode, ErrorsFound); @@ -1912,7 +1918,7 @@ namespace UnitVentilator { } else { CheckZoneSizing(state, state.dataUnitVentilators->cMO_UnitVentilator, unitVent.Name); - int CoilSteamOutletNode = SteamCoils::GetCoilSteamOutletNode(state, "Coil:Heating:Steam", unitVent.HCoilName, ErrorsFound); + int CoilSteamOutletNode = SteamCoils::GetCoilSteamOutletNode(state, coilHeatingSteam, unitVent.HCoilName, ErrorsFound); if (IsAutoSize) { PltSizHeatNum = PlantUtilities::MyPlantSizingIndex( state, "Coil:Heating:Steam", unitVent.HCoilName, unitVent.HotControlNode, CoilSteamOutletNode, ErrorsFound); @@ -2282,11 +2288,10 @@ namespace UnitVentilator { } break; case HeatCoilType::Electric: { HeatingCoils::CheckHeatingCoilSchedule( - state, "Coil:Heating:Electric", unitVent.HCoilName, unitVent.HCoilSchedValue, unitVent.HCoil_Index); + state, coilHeatingElectric, unitVent.HCoilName, unitVent.HCoilSchedValue, unitVent.HCoil_Index); } break; case HeatCoilType::Gas: { - HeatingCoils::CheckHeatingCoilSchedule( - state, "Coil:Heating:Fuel", unitVent.HCoilName, unitVent.HCoilSchedValue, unitVent.HCoil_Index); + HeatingCoils::CheckHeatingCoilSchedule(state, coilHeatingFuel, unitVent.HCoilName, unitVent.HCoilSchedValue, unitVent.HCoil_Index); } break; default: { } break; diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 4141ec1e095..2a3f647c681 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -111,8 +111,11 @@ namespace UnitarySystems { int constexpr HeatingCoil = 1; int constexpr SuppHeatCoil = 2; - static constexpr std::string_view blankString; - static const std::string blankStdString; + std::string coilHeatingWater = "Coil:Heating:Water"; + std::string coilHeatingSteam = "Coil:Heating:Steam"; + + static constexpr std::string_view blankString(""); + static const std::string blankStdString(""); void UnitarySys::simulate(EnergyPlusData &state, std::string_view Name, @@ -296,13 +299,13 @@ namespace UnitarySystems { if (speedNum < (maxSpeeds + 1)) { auto &cobj = flowRatio.at("cooling_speed_supply_air_flow_ratio"); thisDesignSpec.coolingVolFlowRatio[speedNum] = - (cobj.type() == nlohmann::detail::value_t::string && Util::SameString(cobj.get(), "Autosize")) + (cobj.type() == nlohmann::detail::value_t::string && equali(cobj.get(), "Autosize")) ? DataSizing::AutoSize : cobj.get(); auto &hobj = flowRatio.at("heating_speed_supply_air_flow_ratio"); thisDesignSpec.heatingVolFlowRatio[speedNum] = - (hobj.type() == nlohmann::detail::value_t::string && Util::SameString(hobj.get(), "Autosize")) + (hobj.type() == nlohmann::detail::value_t::string && equali(hobj.get(), "Autosize")) ? DataSizing::AutoSize : hobj.get(); } @@ -352,7 +355,7 @@ namespace UnitarySystems { int index = -1; for (std::size_t loop = 0; loop < state.dataUnitarySystems->designSpecMSHP.size(); ++loop) { DesignSpecMSHP *thisDesignSpecMSHPObjec = &state.dataUnitarySystems->designSpecMSHP[loop]; - if (Util::SameString(objectName, thisDesignSpecMSHPObjec->name)) { + if (Util::SameString(thisDesignSpecMSHPObjec->name, objectName)) { index = loop; return index; } @@ -369,7 +372,7 @@ namespace UnitarySystems { int index = -1; for (std::size_t loop = 0; loop < state.dataUnitarySystems->unitarySys.size(); ++loop) { UnitarySys *thisUnitarySysObjec = &state.dataUnitarySystems->unitarySys[loop]; - if (Util::SameString(objectName, thisUnitarySysObjec->Name)) { + if (Util::SameString(thisUnitarySysObjec->Name, objectName)) { index = loop; break; } @@ -696,19 +699,19 @@ namespace UnitarySystems { this->m_SuppHeatCoilName, this->m_MaxHeatAirVolFlow, state.dataUnitarySystems->initUnitarySystemsErrorsFound); - + std::string coilHeatingWater = "Coil:Heating:Water"; if (state.dataUnitarySystems->initUnitarySystemsErrFlag) { ShowFatalError(state, "InitUnitarySystems: Program terminated for previous conditions."); } this->m_MaxSuppCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate( - state, "Coil:Heating:Water", this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); + state, coilHeatingWater, this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); if (this->m_MaxSuppCoilFluidFlow > 0.0) { Real64 rho = state.dataPlnt->PlantLoop(this->m_SuppCoilPlantLoc.loopNum).glycol->getDensity(state, Constant::CWInitConvTemp, routineName); this->m_MaxSuppCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate( - state, "Coil:Heating:Water", this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound) * + state, coilHeatingWater, this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound) * rho; } // fill outlet node for coil @@ -810,7 +813,7 @@ namespace UnitarySystems { if (this->m_HeatingCoilType_Num == HVAC::Coil_HeatingWater) { WaterCoils::SimulateWaterCoilComponents(state, this->m_HeatingCoilName, FirstHVACIteration, this->m_HeatingCoilIndex); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate( - state, "Coil:Heating:Water", this->m_HeatingCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); + state, coilHeatingWater, this->m_HeatingCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 rho = state.dataPlnt->PlantLoop(this->HeatCoilPlantLoc.loopNum) .glycol->getDensity(state, Constant::CWInitConvTemp, routineName); @@ -845,7 +848,7 @@ namespace UnitarySystems { // If water coil max water flow rate is DataSizing::AutoSized, simulate once in order to mine max flow rate WaterCoils::SimulateWaterCoilComponents(state, this->m_SuppHeatCoilName, FirstHVACIteration, this->m_SuppHeatCoilIndex); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate( - state, "Coil:Heating:Water", this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); + state, coilHeatingWater, this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 rho = state.dataPlnt->PlantLoop(this->m_SuppCoilPlantLoc.loopNum) .glycol->getDensity(state, Constant::CWInitConvTemp, routineName); @@ -992,8 +995,8 @@ namespace UnitarySystems { 1.0, state.dataUnitarySystems->initUnitarySystemsQActual); // QCoilReq, simulate any load > 0 to get max capacity of steam coil this->m_DesignHeatingCapacity = SteamCoils::GetCoilCapacity(state, - HVAC::cAllCoilTypes(this->m_HeatingCoilType_Num), this->m_HeatingCoilName, + HVAC::cAllCoilTypes(this->m_HeatingCoilType_Num), state.dataUnitarySystems->initUnitarySystemsErrorsFound); } // from IF(UnitarySystem(UnitarySysNum)%HeatingCoilType_Num == Coil_HeatingSteam) THEN @@ -1033,7 +1036,7 @@ namespace UnitarySystems { 1.0, state.dataUnitarySystems->initUnitarySystemsQActual); // QCoilReq, simulate any load > 0 to get max capacity of steam coil this->m_DesignSuppHeatingCapacity = SteamCoils::GetCoilCapacity( - state, "Coil:Heating:Steam", this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); + state, coilHeatingSteam, this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); } // from IF(UnitarySystem(UnitarySysNum)%SuppHeatCoilType_Num == Coil_HeatingSteam) THEN } // from IF( FirstHVACIteration ) THEN @@ -2682,8 +2685,8 @@ namespace UnitarySystems { state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex).VarSpeedCoilType, state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex).Name)); } - state.dataSize->DXCoolCap = VariableSpeedCoils::GetCoilCapacityVariableSpeed( - state, HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num), this->m_CoolingCoilName, ErrFound); + std::string tempCoilType = HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num); + state.dataSize->DXCoolCap = VariableSpeedCoils::GetCoilCapacityVariableSpeed(state, tempCoilType, this->m_CoolingCoilName, ErrFound); EqSizing.DesCoolingLoad = state.dataSize->DXCoolCap; if (this->m_DXHeatingCoil) { EqSizing.DesHeatingLoad = state.dataSize->DXCoolCap; @@ -3301,8 +3304,9 @@ namespace UnitarySystems { HVAC::CompressorOp::Off, 0.0, FirstHVACIteration); - state.dataSize->DataConstantUsedForSizing = WaterToAirHeatPumpSimple::GetCoilCapacity( - state, HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num), this->m_CoolingCoilName, ErrFound); + std::string tempCoilType = HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num); + state.dataSize->DataConstantUsedForSizing = + WaterToAirHeatPumpSimple::GetCoilCapacity(state, tempCoilType, this->m_CoolingCoilName, ErrFound); EqSizing.DesCoolingLoad = state.dataSize->DataConstantUsedForSizing; state.dataSize->DataFractionUsedForSizing = 1.0; SizingMethod = HVAC::AutoCalculateSizing; @@ -3311,8 +3315,7 @@ namespace UnitarySystems { EqSizing.DesHeatingLoad = state.dataSize->DataConstantUsedForSizing; } // airflow sizing with multispeed fan - Real64 AirFlowRate = WaterToAirHeatPumpSimple::GetCoilAirFlowRate( - state, HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num), this->m_CoolingCoilName, ErrFound); + Real64 AirFlowRate = WaterToAirHeatPumpSimple::GetCoilAirFlowRate(state, tempCoilType, this->m_CoolingCoilName, ErrFound); if (this->m_NumOfSpeedCooling > 1) { int FanIndex = this->m_FanIndex; for (int i = 1; i <= this->m_NumOfSpeedCooling; ++i) { @@ -3343,8 +3346,9 @@ namespace UnitarySystems { 0.0, HVAC::CompressorOp::Off, 0.0); + std::string tempCoilType = HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num); state.dataSize->DataConstantUsedForSizing = - WaterToAirHeatPump::GetCoilCapacity(state, HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num), this->m_CoolingCoilName, ErrFound); + WaterToAirHeatPump::GetCoilCapacity(state, tempCoilType, this->m_CoolingCoilName, ErrFound); EqSizing.DesCoolingLoad = state.dataSize->DataConstantUsedForSizing; state.dataSize->DataFractionUsedForSizing = 1.0; SizingMethod = HVAC::AutoCalculateSizing; @@ -3398,8 +3402,9 @@ namespace UnitarySystems { HVAC::CompressorOp::Off, 0.0, FirstHVACIteration); - state.dataSize->DataConstantUsedForSizing = WaterToAirHeatPumpSimple::GetCoilCapacity( - state, HVAC::cAllCoilTypes(this->m_HeatingCoilType_Num), this->m_HeatingCoilName, ErrFound); + std::string tempCoilType = HVAC::cAllCoilTypes(this->m_HeatingCoilType_Num); + state.dataSize->DataConstantUsedForSizing = + WaterToAirHeatPumpSimple::GetCoilCapacity(state, tempCoilType, this->m_HeatingCoilName, ErrFound); EqSizing.DesHeatingLoad = state.dataSize->DataConstantUsedForSizing; state.dataSize->DataFractionUsedForSizing = 1.0; SizingMethod = HVAC::AutoCalculateSizing; @@ -3415,15 +3420,16 @@ namespace UnitarySystems { HVAC::CompressorOp::Off, 0.0, FirstHVACIteration); - state.dataSize->DataConstantUsedForSizing = WaterToAirHeatPumpSimple::GetCoilCapacity( - state, HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num), this->m_CoolingCoilName, ErrFound); + std::string tempCoilType = HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num); + state.dataSize->DataConstantUsedForSizing = + WaterToAirHeatPumpSimple::GetCoilCapacity(state, tempCoilType, this->m_CoolingCoilName, ErrFound); EqSizing.DesCoolingLoad = state.dataSize->DataConstantUsedForSizing; } state.dataSize->DataFractionUsedForSizing = 1.0; this->m_DesignCoolingCapacity = DataSizing::AutoSize; // airflow sizing with multispeed fan - Real64 AirFlowRate = WaterToAirHeatPumpSimple::GetCoilAirFlowRate( - state, HVAC::cAllCoilTypes(this->m_HeatingCoilType_Num), this->m_HeatingCoilName, ErrFound); + tempCoilType = HVAC::cAllCoilTypes(this->m_HeatingCoilType_Num); + Real64 AirFlowRate = WaterToAirHeatPumpSimple::GetCoilAirFlowRate(state, tempCoilType, this->m_HeatingCoilName, ErrFound); if (this->m_NumOfSpeedHeating > 1) { int FanIndex = this->m_FanIndex; for (int i = 1; i <= this->m_NumOfSpeedHeating; ++i) { @@ -3695,12 +3701,8 @@ namespace UnitarySystems { // UnitarySystemNumericFields.deallocate(); // remove temporary array for field names at end of sizing } // namespace UnitarySystems - void UnitarySys::processInputSpec(EnergyPlusData &state, - const UnitarySysInputSpec &input_data, - int sysNum, - bool &errorsFound, - bool const ZoneEquipment, - int const ZoneOAUnitNum) + void UnitarySys::processInputSpec( + EnergyPlusData &state, UnitarySysInputSpec &input_data, int sysNum, bool &errorsFound, bool const ZoneEquipment, int const ZoneOAUnitNum) { static constexpr std::string_view routineName = "UnitarySys::processInputSpec"; @@ -3709,8 +3711,8 @@ namespace UnitarySystems { static constexpr std::string_view unitarySysHeatPumpPerformanceObjectType("UnitarySystemPerformance:Multispeed"); std::string const &cCurrentModuleObject = input_data.system_type; - DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(input_data.system_type))); + DataLoopNode::ConnectionObjectType objType = + static_cast(getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, input_data.system_type)); std::string const &thisObjectName = input_data.name; ErrorObjectHeader eoh{routineName, cCurrentModuleObject, thisObjectName}; @@ -3913,7 +3915,7 @@ namespace UnitarySystems { constexpr static std::array(UnitarySysCtrlType::Num)> UnitarySysCtrlTypeNamesUC = { "NONE", "LOAD", "SETPOINT", "SINGLEZONEVAV"}; - this->m_ControlType = static_cast(getEnumValue(UnitarySysCtrlTypeNamesUC, Util::makeUPPER(input_data.control_type))); + this->m_ControlType = static_cast(getEnumValue(UnitarySysCtrlTypeNamesUC, input_data.control_type)); if (this->m_ControlType == UnitarySysCtrlType::CCMASHRAE) { this->m_ValidASHRAECoolCoil = true; this->m_ValidASHRAEHeatCoil = true; @@ -4353,7 +4355,7 @@ namespace UnitarySystems { std::string const &loc_m_FanName = input_data.supply_fan_name; if (!loc_m_FanName.empty() && !loc_fanType.empty()) { - this->m_FanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(loc_fanType))); + this->m_FanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, loc_fanType)); this->m_FanIndex = Fans::GetFanIndex(state, loc_m_FanName); if (this->m_FanIndex == 0) { @@ -4392,7 +4394,7 @@ namespace UnitarySystems { this->m_FanCompNotSetYet = false; } - this->m_FanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, Util::makeUPPER(input_data.fan_placement))); + this->m_FanPlace = static_cast(getEnumValue(HVAC::fanPlaceNamesUC, input_data.fan_placement)); if (this->m_FanPlace == HVAC::FanPlace::Invalid && this->m_FanExists) { ShowSevereError(state, format("{} = {}", cCurrentModuleObject, thisObjectName)); ShowContinueError(state, format("Illegal Fan Placement = {}", input_data.fan_placement)); @@ -5121,14 +5123,11 @@ namespace UnitarySystems { errFlag = false; errorsFound = true; } - - this->m_coolingCoilAvailSched = - WaterCoils::GetWaterCoilAvailSched(state, HVAC::cAllCoilTypes(ActualCoolCoilType), HXCoilName, errFlag); - this->MaxCoolCoilFluidFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, HVAC::cAllCoilTypes(ActualCoolCoilType), HXCoilName, errFlag); + std::string tempCoilType = HVAC::cAllCoilTypes(ActualCoolCoilType); + this->m_coolingCoilAvailSched = WaterCoils::GetWaterCoilAvailSched(state, tempCoilType, HXCoilName, errFlag); + this->MaxCoolCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, tempCoilType, HXCoilName, errFlag); // Get the Cooling Coil water Inlet Node number - this->CoolCoilFluidInletNode = - WaterCoils::GetCoilWaterInletNode(state, HVAC::cAllCoilTypes(ActualCoolCoilType), HXCoilName, errFlag); + this->CoolCoilFluidInletNode = WaterCoils::GetCoilWaterInletNode(state, tempCoilType, HXCoilName, errFlag); if (errFlag) { ShowContinueError(state, format("Occurs in {} = {}", cCurrentModuleObject, thisObjectName)); errFlag = false; @@ -5471,7 +5470,7 @@ namespace UnitarySystems { this->m_CoolingCoilType_Num == HVAC::Coil_CoolingWaterToAirHPSimple) { if (!input_data.heat_pump_coil_water_flow_mode.empty()) { this->m_WaterCyclingMode = - static_cast(getEnumValue(HVAC::waterFlowNamesUC, Util::makeUPPER(input_data.heat_pump_coil_water_flow_mode))); + static_cast(getEnumValue(HVAC::waterFlowNamesUC, input_data.heat_pump_coil_water_flow_mode)); } else { this->m_WaterCyclingMode = HVAC::WaterFlow::Cycling; } @@ -5517,7 +5516,7 @@ namespace UnitarySystems { ShowContinueError(state, "Variable DX Cooling Coil resets Use DOAS DX Cooling Coil = No and the simulation continues."); this->m_ISHundredPercentDOASDXCoil = false; } - } else if (Util::SameString(input_data.use_doas_dx_cooling_coil, "")) { + } else if (input_data.use_doas_dx_cooling_coil == "") { this->m_ISHundredPercentDOASDXCoil = false; } else if (Util::SameString(input_data.use_doas_dx_cooling_coil, "No")) { this->m_ISHundredPercentDOASDXCoil = false; @@ -7291,7 +7290,7 @@ namespace UnitarySystems { std::string const &thisObjectName = Util::makeUPPER(instance.key()); // only get the current data once all data has been read in and vector unitarySys has been initialized // when UnitarySystems::getInputOnceFlag is true read all unitary systems, otherwise read just the current object - if (!Util::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) { + if (!equali(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) { continue; } @@ -7419,7 +7418,7 @@ namespace UnitarySystems { std::string const &thisObjectName = Util::makeUPPER(instance.key()); // only get the current data once all data has been read in and vector unitarySys has been initialized // when UnitarySystems::getInputOnceFlag is true read all unitary systems, otherwise read just the current object - if (!Util::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) { + if (!equali(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) { continue; } @@ -7594,7 +7593,7 @@ namespace UnitarySystems { auto const &fields = instance.value(); std::string const &thisObjectName = Util::makeUPPER(instance.key()); - if (!Util::SameString(CoilSysName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) { + if (!equali(CoilSysName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) { continue; } @@ -7623,7 +7622,7 @@ namespace UnitarySystems { // why is this cooling coil does not have a field for Design Air Vol Flow Rate // set it "SupplyAirFlowRate" to avoid blank, which lead to fatal out during get input static constexpr std::string_view loc_cooling_coil_object_type("COIL:COOLING:WATER:DETAILEDGEOMETRY"); - if (Util::SameString(loc_cooling_coil_object_type, thisSys.input_specs.cooling_coil_object_type)) { + if (equali(loc_cooling_coil_object_type, thisSys.input_specs.cooling_coil_object_type)) { thisSys.input_specs.cooling_supply_air_flow_rate_method = Util::makeUPPER("SupplyAirFlowRate"); thisSys.input_specs.cooling_supply_air_flow_rate = DataSizing::AutoSize; } @@ -7640,11 +7639,11 @@ namespace UnitarySystems { bool runOnSensibleLoad = true; if (auto it = fields.find("run_on_sensible_load"); it != fields.end()) { - runOnSensibleLoad = Util::SameString(it.value().get(), "YES"); + runOnSensibleLoad = equali(it.value().get(), "YES"); } bool runOnLatentLoad = false; if (auto it = fields.find("run_on_latent_load"); it != fields.end()) { - runOnLatentLoad = Util::SameString(it.value().get(), "YES"); + runOnLatentLoad = equali(it.value().get(), "YES"); } if (runOnSensibleLoad && !runOnLatentLoad) { @@ -7672,7 +7671,7 @@ namespace UnitarySystems { thisSys.m_minWaterLoopTempForHR = it.value().get(); } if (auto it = fields.find("economizer_lockout"); it != fields.end()) { // duplicate above as default - bool econoFlag = Util::SameString(it.value().get(), "YES"); + bool econoFlag = equali(it.value().get(), "YES"); if (econoFlag) { thisSys.m_waterSideEconomizerFlag = true; } @@ -7685,7 +7684,7 @@ namespace UnitarySystems { thisSys.m_WaterHRPlantLoopModel = true; } if (thisSys.m_WaterHRPlantLoopModel) { - std::string const HRcoolingCoilType("COIL:COOLING:WATER"); + std::string HRcoolingCoilType("COIL:COOLING:WATER"); bool errFound = false; thisSys.m_HRcoolCoilAirInNode = WaterCoils::GetCoilInletNode(state, HRcoolingCoilType, HRWaterCoolingCoilName, errFound); thisSys.m_HRcoolCoilFluidInletNode = @@ -7746,7 +7745,7 @@ namespace UnitarySystems { std::string const &thisObjectName = Util::makeUPPER(instance.key()); // only get the current data once all data has been read in and vector unitarySys has been initialized // when UnitarySystems::getInputOnceFlag is true read all unitary systems, otherwise read just the current object - if (!Util::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) { + if (!equali(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) { continue; } @@ -7819,7 +7818,7 @@ namespace UnitarySystems { if (auto it = fields.find("minimum_supply_air_temperature"); it != fields.end()) { // not required field, has default (2C), and autosizable thisSys.input_specs.minimum_supply_air_temperature = - (it.value().type() == nlohmann::detail::value_t::string && Util::SameString(it.value().get(), "Autosize")) + (it.value().type() == nlohmann::detail::value_t::string && equali(it.value().get(), "Autosize")) ? DataSizing::AutoSize : it.value().get(); } @@ -7839,7 +7838,7 @@ namespace UnitarySystems { } if (auto it = fields.find("cooling_supply_air_flow_rate"); it != fields.end()) { // not required field, autosizable thisSys.input_specs.cooling_supply_air_flow_rate = - (it.value().type() == nlohmann::detail::value_t::string && Util::SameString(it.value().get(), "Autosize")) + (it.value().type() == nlohmann::detail::value_t::string && equali(it.value().get(), "Autosize")) ? DataSizing::AutoSize : it.value().get(); } @@ -7857,7 +7856,7 @@ namespace UnitarySystems { } if (auto it = fields.find("heating_supply_air_flow_rate"); it != fields.end()) { // not required field thisSys.input_specs.heating_supply_air_flow_rate = - (it.value().type() == nlohmann::detail::value_t::string && Util::SameString(it.value().get(), "Autosize")) + (it.value().type() == nlohmann::detail::value_t::string && equali(it.value().get(), "Autosize")) ? DataSizing::AutoSize : it.value().get(); } @@ -7875,7 +7874,7 @@ namespace UnitarySystems { } if (auto it = fields.find("no_load_supply_air_flow_rate"); it != fields.end()) { // not required field thisSys.input_specs.no_load_supply_air_flow_rate = - (it.value().type() == nlohmann::detail::value_t::string && Util::SameString(it.value().get(), "Autosize")) + (it.value().type() == nlohmann::detail::value_t::string && equali(it.value().get(), "Autosize")) ? DataSizing::AutoSize : it.value().get(); } @@ -7901,9 +7900,8 @@ namespace UnitarySystems { if (fields.find("maximum_supply_air_temperature") != fields.end()) { // not required field, has default of 80 C auto const &obj = fields.at("maximum_supply_air_temperature"); thisSys.input_specs.maximum_supply_air_temperature = - (obj.type() == nlohmann::detail::value_t::string && Util::SameString(obj.get(), "Autosize")) - ? DataSizing::AutoSize - : obj.get(); + (obj.type() == nlohmann::detail::value_t::string && equali(obj.get(), "Autosize")) ? DataSizing::AutoSize + : obj.get(); } if (auto it = fields.find("maximum_outdoor_dry_bulb_temperature_for_supplemental_heater_operation"); it != fields.end()) { // not required field, has default @@ -10469,7 +10467,7 @@ namespace UnitarySystems { if (this->m_HeatingCoilType_Num == HVAC::Coil_HeatingWater) { WaterCoils::SimulateWaterCoilComponents(state, this->m_HeatingCoilName, FirstHVACIteration, this->m_HeatingCoilIndex); Real64 CoilMaxVolFlowRate = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_HeatingCoilName, errorsFound); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, this->m_HeatingCoilName, errorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 rho = state.dataPlnt->PlantLoop(this->HeatCoilPlantLoc.loopNum) .glycol->getDensity(state, Constant::CWInitConvTemp, routineName); @@ -10502,7 +10500,7 @@ namespace UnitarySystems { // IF water coil max water flow rate is DataSizing::AutoSized, simulate once in order to mine max flow rate WaterCoils::SimulateWaterCoilComponents(state, this->m_SuppHeatCoilName, FirstHVACIteration, this->m_SuppHeatCoilIndex); Real64 CoilMaxVolFlowRate = - WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_SuppHeatCoilName, errorsFound); + WaterCoils::GetCoilMaxWaterFlowRate(state, coilHeatingWater, this->m_SuppHeatCoilName, errorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 rho = state.dataPlnt->PlantLoop(this->m_SuppCoilPlantLoc.loopNum) .glycol->getDensity(state, Constant::CWInitConvTemp, routineName); @@ -17019,7 +17017,7 @@ namespace UnitarySystems { if (state.dataUnitarySystems->numUnitarySystems > 0) { bool UnitarySysFound = false; for (int UnitarySysNum = 0; UnitarySysNum < state.dataUnitarySystems->numUnitarySystems; ++UnitarySysNum) { - if (Util::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { + if (Util::SameString(state.dataUnitarySystems->unitarySys[UnitarySysNum].Name, UnitarySysName)) { if (state.dataUnitarySystems->unitarySys[UnitarySysNum].m_ThisSysInputShouldBeGotten) { getUnitarySystemInput(state, UnitarySysName, false, ZoneOAUnitNum); } @@ -17063,7 +17061,7 @@ namespace UnitarySystems { } for (int UnitarySysNum = 0; UnitarySysNum < state.dataUnitarySystems->numUnitarySystems; ++UnitarySysNum) { - if (Util::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { + if (Util::SameString(state.dataUnitarySystems->unitarySys[UnitarySysNum].Name, UnitarySysName)) { if (state.dataUnitarySystems->unitarySys[UnitarySysNum].m_ThisSysInputShouldBeGotten) { getUnitarySystemInput(state, UnitarySysName, false, ZoneOAUnitNum); } @@ -17088,7 +17086,7 @@ namespace UnitarySystems { } int airNode = 0; for (int UnitarySysNum = 0; UnitarySysNum < state.dataUnitarySystems->numUnitarySystems; ++UnitarySysNum) { - if (Util::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { + if (Util::SameString(state.dataUnitarySystems->unitarySys[UnitarySysNum].Name, UnitarySysName)) { airNode = this->AirInNode; break; } @@ -17108,7 +17106,7 @@ namespace UnitarySystems { } for (int UnitarySysNum = 0; UnitarySysNum < state.dataUnitarySystems->numUnitarySystems; ++UnitarySysNum) { - if (Util::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { + if (Util::SameString(state.dataUnitarySystems->unitarySys[UnitarySysNum].Name, UnitarySysName)) { if (zoneEquipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner || zoneEquipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump || zoneEquipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir || @@ -17128,7 +17126,7 @@ namespace UnitarySystems { } int airNode = 0; for (int UnitarySysNum = 0; UnitarySysNum < state.dataUnitarySystems->numUnitarySystems; ++UnitarySysNum) { - if (Util::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { + if (Util::SameString(state.dataUnitarySystems->unitarySys[UnitarySysNum].Name, UnitarySysName)) { airNode = this->AirOutNode; break; } diff --git a/src/EnergyPlus/UnitarySystem.hh b/src/EnergyPlus/UnitarySystem.hh index 42cce2205f1..26e31583844 100644 --- a/src/EnergyPlus/UnitarySystem.hh +++ b/src/EnergyPlus/UnitarySystem.hh @@ -593,12 +593,8 @@ namespace UnitarySystems { static void getUnitarySystemInput(EnergyPlusData &state, std::string_view Name, bool const ZoneEquipment, int const ZoneOAUnitNum); - void processInputSpec(EnergyPlusData &state, - const UnitarySysInputSpec &input_data, - int sysNum, - bool &errorsFound, - bool const ZoneEquipment, - int const ZoneOAUnitNum); + void processInputSpec( + EnergyPlusData &state, UnitarySysInputSpec &input_data, int sysNum, bool &errorsFound, bool const ZoneEquipment, int const ZoneOAUnitNum); void setSystemParams(EnergyPlusData &state, Real64 &TotalFloorAreaOnAirLoop, const std::string &thisObjectName); diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index 643ef22a22d..acb2d253b7e 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -666,8 +666,7 @@ namespace UserDefinedComponents { { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed = - static_cast( - getEnumValue(DataPlant::HowMetTypeNamesUC, Util::makeUPPER(cAlphaArgs(aArgCount + 2)))); + static_cast(getEnumValue(DataPlant::HowMetTypeNamesUC, cAlphaArgs(aArgCount + 2))); if (state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed == DataPlant::HowMet::ByNominalCapLowOutLimit) { // actuator for low out limit @@ -693,8 +692,7 @@ namespace UserDefinedComponents { { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).FlowPriority = - static_cast( - getEnumValue(DataPlant::LoopFlowStatusTypeNamesUC, Util::makeUPPER(cAlphaArgs(aArgCount + 3)))); + static_cast(getEnumValue(DataPlant::LoopFlowStatusTypeNamesUC, cAlphaArgs(aArgCount + 3))); } // find program manager for initial setup, begin environment and sizing of this plant connection diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index 4f12d539f62..4f9d5ea89f2 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -438,11 +438,27 @@ namespace Util { template ::value>::type> // Container needs and operator[i] and elements need Name - inline int FindItemInList(std::string_view const String, Container const &ListOfItems, int const NumItems) + inline int FindItemInList(std::string_view const String, Container const &ListOfItems, int const NumItems, bool CaseInsensitive = false) { for (typename Container::size_type i = 0, e = NumItems; i < e; ++i) { if (String == ListOfItems[i].Name) { return int(i + 1); // 1-based return index + } else if (CaseInsensitive && equali(String, ListOfItems[i].Name)) { + return int(i + 1); // 1-based return index + } + } + return 0; // Not found + } + + template ::value>::type> + // Container needs and operator[i] and elements need Name + inline int FindItemInListCaseInsensitive(std::string_view const String, Container const &ListOfItems, int const NumItems) + { + for (typename Container::size_type i = 0, e = NumItems; i < e; ++i) { + if (String == ListOfItems[i].Name) { + return int(i + 1); // 1-based return index + } else if (equali(String, ListOfItems[i].Name)) { + return int(i + 1); // 1-based return index } } return 0; // Not found @@ -455,6 +471,12 @@ namespace Util { return Util::FindItemInList(String, ListOfItems, ListOfItems.isize()); } + template ::value>::type> + inline int FindItemInListCaseInsensitive(std::string_view const String, Container const &ListOfItems) + { + return Util::FindItemInListCaseInsensitive(String, ListOfItems, ListOfItems.isize()); + } + template ::value>::type> // Container needs operator[i] and value_type inline int @@ -665,10 +687,39 @@ namespace Util { return ResultString; } - constexpr bool SameString(std::string_view const s, std::string_view const t) - { - // case insensitive comparison - return equali(s, t); + /// + /// Case insensitive search + /// + /// First string + /// Second String + /// If they match, but have different cases, then replace the first string with the second so later checks are + /// faster true if they are equal each other, false if they are not + inline bool SameString(std::string &s, std::string_view const t, bool replaceString = true) + { + // different sizes, can't be the same string + if (s.length() != t.length()) { + // Strings are different lengths so they can't be equal + return false; + } else if (s.length() == 0) { + // Two empy strings, so they're equal + return true; + } else if (s[s.length() / 2] == t[t.length() / 2] && s[s.length() / 3] == t[t.length() / 3] && s == t) { + // the strings are similar enough to do more intensive checks + // case sensitive comparison (fastest) + return true; + } else if (std::tolower(s[s.length() / 2]) != std::tolower(t[t.length() / 2])) { + // fairly common scenario, middle character is different so check just that for a quick exit + return false; + } else if (equali(s, t)) { + // case insensitive comparison, at this point we know they don't match each other's casing + if (replaceString) { + // changing to uppercase + s = Util::makeUPPER(s); + } + return true; + } else { + return false; + } } template @@ -831,7 +882,7 @@ namespace Util { constexpr int getEnumValue(const gsl::span sList, const std::string_view s) { for (unsigned int i = 0; i < sList.size(); ++i) { - if (sList[i] == s) { + if (equali(sList[i], s)) { return i; } } diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index ab8b30c8edf..99c5251b71d 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -802,7 +802,7 @@ namespace VariableSpeedCoils { } cFieldName = "Condenser Type"; // cAlphaFields(6) - std::string const condenserType = s_ip->getAlphaFieldValue(fields, schemaProps, "condenser_type"); + std::string condenserType = s_ip->getAlphaFieldValue(fields, schemaProps, "condenser_type"); if ((Util::SameString(condenserType, "AirCooled")) || cFieldName.empty()) { varSpeedCoil.CondenserType = DataHeatBalance::RefrigCondenserType::Air; } else if (Util::SameString(condenserType, "EvaporativelyCooled")) { @@ -818,10 +818,10 @@ namespace VariableSpeedCoils { cFieldName = "Evaporative Condenser Pump Rated Power Consumption"; // NumArray(10) if (fields.find("evaporative_condenser_pump_rated_power_consumption") != fields.end()) { // not required field, has default value auto &evapCondPumpPower = fields.at("evaporative_condenser_pump_rated_power_consumption"); - varSpeedCoil.EvapCondPumpElecNomPower = (evapCondPumpPower.type() == nlohmann::detail::value_t::string && - Util::SameString(evapCondPumpPower.get(), "Autosize")) - ? DataSizing::AutoSize - : evapCondPumpPower.get(); + varSpeedCoil.EvapCondPumpElecNomPower = + (evapCondPumpPower.type() == nlohmann::detail::value_t::string && equali(evapCondPumpPower.get(), "Autosize")) + ? DataSizing::AutoSize + : evapCondPumpPower.get(); } if (varSpeedCoil.EvapCondPumpElecNomPower != DataSizing::AutoSize) { if (varSpeedCoil.EvapCondPumpElecNomPower < 0.0) { @@ -1666,7 +1666,7 @@ namespace VariableSpeedCoils { cFieldName = "Defrost Strategy"; // cAlphaFields(7) std::string defrostStrategy = s_ip->getAlphaFieldValue(fields, schemaProps, "defrost_strategy"); varSpeedCoil.DefrostStrategy = - static_cast(getEnumValue(StandardRatings::DefrostStratUC, Util::makeUPPER(defrostStrategy))); + static_cast(getEnumValue(StandardRatings::DefrostStratUC, defrostStrategy)); if (varSpeedCoil.DefrostStrategy == StandardRatings::DefrostStrat::ReverseCycle) { if (varSpeedCoil.DefrostEIRFT == 0) { if (defrostEIRFTCurveName.empty()) { @@ -1697,8 +1697,8 @@ namespace VariableSpeedCoils { //"defrost_control", cFieldName = "Defrost Control"; // cAlphaFields(8) std::string defrostControl = s_ip->getAlphaFieldValue(fields, schemaProps, "defrost_control"); - varSpeedCoil.DefrostControl = static_cast( - getEnumValue(StandardRatings::HPdefrostControlUC, Util::makeUPPER(defrostControl))); + varSpeedCoil.DefrostControl = + static_cast(getEnumValue(StandardRatings::HPdefrostControlUC, defrostControl)); if (varSpeedCoil.DefrostControl == StandardRatings::HPdefrostControl::Invalid) { ShowSevereInvalidKey(state, eoh, cFieldName, defrostControl, "...valid values for this field are Timed or OnDemand."); ErrorsFound = true; @@ -1737,10 +1737,9 @@ namespace VariableSpeedCoils { cFieldName = "Resistive Defrost Heater Capacity"; // cNumericFields(11) if (fields.find("resistive_defrost_heater_capacity") != fields.end()) { auto &dCap = fields.at("resistive_defrost_heater_capacity"); - varSpeedCoil.DefrostCapacity = - (dCap.type() == nlohmann::detail::value_t::string && Util::SameString(dCap.get(), "Autosize")) - ? DataSizing::AutoSize - : dCap.get(); + varSpeedCoil.DefrostCapacity = (dCap.type() == nlohmann::detail::value_t::string && equali(dCap.get(), "Autosize")) + ? DataSizing::AutoSize + : dCap.get(); } if (varSpeedCoil.DefrostCapacity == 0.0 && varSpeedCoil.DefrostStrategy == StandardRatings::DefrostStrat::Resistive) { ShowWarningError(state, format("{}{}=\"{}\", ", RoutineName, CurrentModuleObject, varSpeedCoil.Name)); @@ -2162,7 +2161,7 @@ namespace VariableSpeedCoils { cFieldName = "Evaporator Air Temperature Type for Curve Objects"; fieldValue = s_ip->getAlphaFieldValue(fields, schemaProps, "evaporator_air_temperature_type_for_curve_objects"); - varSpeedCoil.InletAirTemperatureType = static_cast(getEnumValue(HVAC::oatTypeNamesUC, Util::makeUPPER(fieldValue))); + varSpeedCoil.InletAirTemperatureType = static_cast(getEnumValue(HVAC::oatTypeNamesUC, fieldValue)); if (varSpeedCoil.InletAirTemperatureType == HVAC::OATType::Invalid) { // wrong temperature type selection ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, varSpeedCoil.Name)); @@ -6814,7 +6813,7 @@ namespace VariableSpeedCoils { } Real64 GetCoilCapacityVariableSpeed(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -6904,7 +6903,7 @@ namespace VariableSpeedCoils { } Real64 GetCoilAirFlowRateVariableSpeed(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) diff --git a/src/EnergyPlus/VariableSpeedCoils.hh b/src/EnergyPlus/VariableSpeedCoils.hh index e63dcb98bd9..817dcc71ac6 100644 --- a/src/EnergyPlus/VariableSpeedCoils.hh +++ b/src/EnergyPlus/VariableSpeedCoils.hh @@ -410,7 +410,7 @@ namespace VariableSpeedCoils { ); Real64 GetCoilCapacityVariableSpeed(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -422,7 +422,7 @@ namespace VariableSpeedCoils { ); Real64 GetCoilAirFlowRateVariableSpeed(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index d00f5deffdf..1b97b94d594 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -117,6 +117,13 @@ namespace VentilatedSlab { // Fred Buhl's fan coil module (FanCoilUnits.cc) std::string const cMO_VentilatedSlab = "ZoneHVAC:VentilatedSlab"; + std::string coilHeatingWater = "Coil:Heating:Water"; + std::string coilHeatingSteam = "Coil:Heating:Steam"; + std::string coilCoolingWater = "Coil:Cooling:Water"; + std::string coilCoolingWaterDetailedgeometry = "Coil:Cooling:Water:DetailedGeometry"; + std::string coilsystemCoolingWaterHeatExchangerAssisted = "CoilSystem:Cooling:Water:HeatExchangerAssisted"; + std::string coilHeatingElectric = "Coil:Heating:Electric"; + std::string coilHeatingFuel = "Coil:Heating:Fuel"; // int constexpr NotOperating = 0; // Parameter for use with OperatingMode variable, set for no heating/cooling int constexpr HeatingMode = 1; // Parameter for use with OperatingMode variable, set for heating @@ -468,7 +475,7 @@ namespace VentilatedSlab { ventSlab.OutAirVolFlow = state.dataIPShortCut->rNumericArgs(3); ventSlab.outsideAirControlType = - static_cast(getEnumValue(OutsideAirControlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + static_cast(getEnumValue(OutsideAirControlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(5))); switch (ventSlab.outsideAirControlType) { @@ -564,7 +571,7 @@ namespace VentilatedSlab { } // Process the temperature control type - ventSlab.controlType = static_cast(getEnumValue(ControlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); + ventSlab.controlType = static_cast(getEnumValue(ControlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(9))); if (ventSlab.controlType == ControlType::Invalid) { ShowSevereError( @@ -922,7 +929,7 @@ namespace VentilatedSlab { // Coil options assign - ventSlab.coilOption = static_cast(getEnumValue(CoilTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(26)))); + ventSlab.coilOption = static_cast(getEnumValue(CoilTypeNamesUC, state.dataIPShortCut->cAlphaArgs(26))); if (ventSlab.coilOption == CoilType::Invalid) { ShowSevereError( @@ -950,8 +957,7 @@ namespace VentilatedSlab { ventSlab.heatingCoilTypeCh = state.dataIPShortCut->cAlphaArgs(27); errFlag = false; - ventSlab.hCoilType = - static_cast(getEnumValue(HeatingCoilTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(27)))); + ventSlab.hCoilType = static_cast(getEnumValue(HeatingCoilTypeNamesUC, state.dataIPShortCut->cAlphaArgs(27))); switch (ventSlab.hCoilType) { @@ -1037,11 +1043,11 @@ namespace VentilatedSlab { ventSlab.HotControlOffset = 0.001; if (ventSlab.hCoilType == HeatingCoilType::Water) { - ventSlab.MaxVolHotWaterFlow = GetWaterCoilMaxFlowRate(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); - ventSlab.MaxVolHotSteamFlow = GetWaterCoilMaxFlowRate(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); + ventSlab.MaxVolHotWaterFlow = GetWaterCoilMaxFlowRate(state, coilHeatingWater, ventSlab.heatingCoilName, ErrorsFound); + ventSlab.MaxVolHotSteamFlow = GetWaterCoilMaxFlowRate(state, coilHeatingWater, ventSlab.heatingCoilName, ErrorsFound); } else if (ventSlab.hCoilType == HeatingCoilType::Steam) { - ventSlab.MaxVolHotWaterFlow = GetSteamCoilMaxFlowRate(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); - ventSlab.MaxVolHotSteamFlow = GetSteamCoilMaxFlowRate(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); + ventSlab.MaxVolHotWaterFlow = GetSteamCoilMaxFlowRate(state, coilHeatingSteam, ventSlab.heatingCoilName, ErrorsFound); + ventSlab.MaxVolHotSteamFlow = GetSteamCoilMaxFlowRate(state, coilHeatingSteam, ventSlab.heatingCoilName, ErrorsFound); } } else { // no heating coil @@ -1068,8 +1074,7 @@ namespace VentilatedSlab { ventSlab.coolingCoilTypeCh = state.dataIPShortCut->cAlphaArgs(30); errFlag = false; - ventSlab.cCoilType = - static_cast(getEnumValue(CoolingCoilTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(30)))); + ventSlab.cCoilType = static_cast(getEnumValue(CoolingCoilTypeNamesUC, state.dataIPShortCut->cAlphaArgs(30))); switch (ventSlab.cCoilType) { case CoolingCoilType::WaterCooling: { ventSlab.coolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; @@ -1152,13 +1157,13 @@ namespace VentilatedSlab { ventSlab.ColdControlOffset = 0.001; if (ventSlab.cCoilType == CoolingCoilType::WaterCooling) { - ventSlab.MaxVolColdWaterFlow = GetWaterCoilMaxFlowRate(state, "Coil:Cooling:Water", ventSlab.coolingCoilName, ErrorsFound); + ventSlab.MaxVolColdWaterFlow = GetWaterCoilMaxFlowRate(state, coilCoolingWater, ventSlab.coolingCoilName, ErrorsFound); } else if (ventSlab.cCoilType == CoolingCoilType::DetailedCooling) { ventSlab.MaxVolColdWaterFlow = - GetWaterCoilMaxFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", ventSlab.coolingCoilName, ErrorsFound); + GetWaterCoilMaxFlowRate(state, coilCoolingWaterDetailedgeometry, ventSlab.coolingCoilName, ErrorsFound); } else if (ventSlab.cCoilType == CoolingCoilType::HXAssisted) { ventSlab.MaxVolColdWaterFlow = - GetHXAssistedCoilFlowRate(state, "CoilSystem:Cooling:Water:HeatExchangerAssisted", ventSlab.coolingCoilName, ErrorsFound); + GetHXAssistedCoilFlowRate(state, coilsystemCoolingWaterHeatExchangerAssisted, ventSlab.coolingCoilName, ErrorsFound); } } else { // No Cooling Coil @@ -1983,9 +1988,8 @@ namespace VentilatedSlab { } } else { // Autosize or hard-size with sizing run CheckZoneSizing(state, cMO_VentilatedSlab, ventSlab.Name); - - int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); - int CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); + int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, coilHeatingWater, ventSlab.heatingCoilName, ErrorsFound); + int CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, coilHeatingWater, ventSlab.heatingCoilName, ErrorsFound); if (IsAutoSize) { int PltSizHeatNum = PlantUtilities::MyPlantSizingIndex( state, "Coil:Heating:Water", ventSlab.heatingCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); @@ -2112,8 +2116,8 @@ namespace VentilatedSlab { } else { // Autosize or hard-size with sizing run CheckZoneSizing(state, "ZoneHVAC:VentilatedSlab", ventSlab.Name); - int CoilSteamInletNode = SteamCoils::GetCoilSteamInletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); - int CoilSteamOutletNode = SteamCoils::GetCoilSteamOutletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); + int CoilSteamInletNode = SteamCoils::GetCoilSteamInletNode(state, coilHeatingSteam, ventSlab.heatingCoilName, ErrorsFound); + int CoilSteamOutletNode = SteamCoils::GetCoilSteamOutletNode(state, coilHeatingSteam, ventSlab.heatingCoilName, ErrorsFound); if (IsAutoSize) { int PltSizHeatNum = PlantUtilities::MyPlantSizingIndex( state, "Coil:Heating:Steam", ventSlab.heatingCoilName, CoilSteamInletNode, CoilSteamOutletNode, ErrorsFound); @@ -2479,12 +2483,12 @@ namespace VentilatedSlab { } case HeatingCoilType::Electric: { HeatingCoils::CheckHeatingCoilSchedule( - state, "Coil:Heating:Electric", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); + state, coilHeatingElectric, ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } case HeatingCoilType::Gas: { HeatingCoils::CheckHeatingCoilSchedule( - state, "Coil:Heating:Fuel", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); + state, coilHeatingFuel, ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } default: @@ -2524,12 +2528,12 @@ namespace VentilatedSlab { } case HeatingCoilType::Electric: { HeatingCoils::CheckHeatingCoilSchedule( - state, "Coil:Heating:Electric", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); + state, coilHeatingElectric, ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } case HeatingCoilType::Gas: { HeatingCoils::CheckHeatingCoilSchedule( - state, "Coil:Heating:Fuel", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); + state, coilHeatingFuel, ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } default: diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index 3bba40c81cb..db0bfc25b26 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -5405,7 +5405,7 @@ void CheckWaterCoilSchedule(EnergyPlusData &state, std::string_view CompName, Re } Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -5454,7 +5454,7 @@ Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, } int GetCoilInletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -5496,8 +5496,50 @@ int GetCoilInletNode(EnergyPlusData &state, return NodeNumber; } +int GetCoilInletNodeConstCoil(EnergyPlusData &state, + std::string_view CoilType, // must match coil types in this module + std::string const &CoilName, // must match coil names for the coil type + bool &ErrorsFound // set to true if problem +) +{ + + // FUNCTION INFORMATION: + // AUTHOR R. Raustad + // DATE WRITTEN March 2007 + + // PURPOSE OF THIS FUNCTION: + // This function looks up the given coil and returns the inlet node number. If + // incorrect coil type or name is given, ErrorsFound is returned as true and node number is returned + // as zero. + + // Obtains and Allocates DXCoils + if (state.dataWaterCoils->GetWaterCoilsInputFlag) { + GetWaterCoilInput(state); + state.dataWaterCoils->GetWaterCoilsInputFlag = false; + } + + int NodeNumber = 0; + int WhichCoil = 0; + if (equali(CoilType, "Coil:Heating:Water") || equali(CoilType, "Coil:Cooling:Water:DetailedGeometry") || equali(CoilType, "Coil:Cooling:Water")) { + WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); + if (WhichCoil != 0) { + NodeNumber = state.dataWaterCoils->WaterCoil(WhichCoil).AirInletNodeNum; + } + } else { + WhichCoil = 0; + } + + if (WhichCoil == 0) { + ShowSevereError(state, format("GetCoilInletNode: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); + ErrorsFound = true; + NodeNumber = 0; + } + + return NodeNumber; +} + int GetCoilOutletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -5542,7 +5584,7 @@ int GetCoilOutletNode(EnergyPlusData &state, } int GetCoilWaterInletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -5585,7 +5627,7 @@ int GetCoilWaterInletNode(EnergyPlusData &state, } int GetCoilWaterOutletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -5649,8 +5691,7 @@ void SetCoilDesFlow(EnergyPlusData &state, state.dataWaterCoils->GetWaterCoilsInputFlag = false; } - if (Util::SameString(CoilType, "Coil:Heating:Water") || Util::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || - Util::SameString(CoilType, "Coil:Cooling:Water")) { + if (equali(CoilType, "Coil:Heating:Water") || equali(CoilType, "Coil:Cooling:Water:DetailedGeometry") || equali(CoilType, "Coil:Cooling:Water")) { int WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); if (WhichCoil != 0) { if (state.dataWaterCoils->WaterCoil(WhichCoil).DesAirVolFlowRate <= 0.0) { @@ -5666,7 +5707,7 @@ void SetCoilDesFlow(EnergyPlusData &state, } Real64 GetWaterCoilDesAirFlow(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -5990,18 +6031,22 @@ int GetWaterCoilIndex(EnergyPlusData &state, } IndexNum = 0; - if (CoilType == "COIL:HEATING:WATER") { - IndexNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); - } else if (CoilType == "COIL:COOLING:WATER") { - IndexNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); - } else if (CoilType == "COIL:COOLING:WATER:DETAILEDGEOMETRY") { - IndexNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); + if (equali(CoilType, "COIL:HEATING:WATER")) { + IndexNum = Util::FindItemInListCaseInsensitive(CoilName, state.dataWaterCoils->WaterCoil); + } else if (equali(CoilType, "COIL:COOLING:WATER")) { + IndexNum = Util::FindItemInListCaseInsensitive(CoilName, state.dataWaterCoils->WaterCoil); + } else if (equali(CoilType, "COIL:COOLING:WATER:DETAILEDGEOMETRY")) { + IndexNum = Util::FindItemInListCaseInsensitive(CoilName, state.dataWaterCoils->WaterCoil); } else { IndexNum = 0; } if (IndexNum == 0) { ShowSevereError(state, format("GetWaterCoilIndex: Could not find CoilType=\"{}\" with Name=\"{}\"", CoilType, CoilName)); + ShowSevereError(state, format("++++++++++++++GetWaterCoilIndex: Coil Count {}", state.dataWaterCoils->WaterCoil.isize())); + for (int i = 0; i < state.dataWaterCoils->WaterCoil.isize(); i++) { + ShowSevereError(state, format("-----------GetWaterCoilIndex: Available Name = \"{}\"", state.dataWaterCoils->WaterCoil[i].Name)); + } ErrorsFound = true; } @@ -6017,11 +6062,15 @@ int GetCompIndex(EnergyPlusData &state, CoilModel compType, std::string_view con state.dataWaterCoils->GetWaterCoilsInputFlag = false; } - int index = Util::FindItemInList(coilName, state.dataWaterCoils->WaterCoil); + int index = Util::FindItemInListCaseInsensitive(coilName, state.dataWaterCoils->WaterCoil); if (index == 0) { // may not find coil name ShowSevereError(state, - format("GetWaterCoilIndex: Could not find CoilType = \"{}\" with Name = \"{}\"", CoilModelNamesUC[(int)compType], coilName)); + format("GetCompIndex: Could not find CoilType = \"{}\" with Name = \"{}\"", CoilModelNamesUC[(int)compType], coilName)); + ShowSevereError(state, format("++++++++++++++GetCompIndex: Coil Count {}", state.dataWaterCoils->WaterCoil.isize())); + for (int i = 0; i < state.dataWaterCoils->WaterCoil.isize(); i++) { + ShowSevereError(state, format("-----------GetCompIndex: Available Name = \"{}\"", state.dataWaterCoils->WaterCoil[i].Name)); + } } return index; } @@ -6176,7 +6225,7 @@ void UpdateWaterToAirCoilPlantConnection(EnergyPlusData &state, } Sched::Schedule *GetWaterCoilAvailSched(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) diff --git a/src/EnergyPlus/WaterCoils.hh b/src/EnergyPlus/WaterCoils.hh index 2fd95b9e164..5a72df9a7e8 100644 --- a/src/EnergyPlus/WaterCoils.hh +++ b/src/EnergyPlus/WaterCoils.hh @@ -416,35 +416,41 @@ namespace WaterCoils { void CheckWaterCoilSchedule(EnergyPlusData &state, std::string_view CompName, Real64 &Value, int &CompIndex); Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); int GetCoilInletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); int GetCoilOutletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); int GetCoilWaterInletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); int GetCoilWaterOutletNode(EnergyPlusData &state, - std::string_view CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); + int GetCoilInletNodeConstCoil(EnergyPlusData &state, + std::string_view CoilType, // must match coil types in this module + std::string const &CoilName, // must match coil names for the coil type + bool &ErrorsFound // set to true if problem + ); + void SetCoilDesFlow(EnergyPlusData &state, std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type @@ -453,7 +459,7 @@ namespace WaterCoils { ); Real64 GetWaterCoilDesAirFlow(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -503,7 +509,7 @@ namespace WaterCoils { ); Sched::Schedule *GetWaterCoilAvailSched(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index bb2770a45ea..c3ce527dfab 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -815,7 +815,7 @@ bool getDesuperHtrInput(EnergyPlusData &state) // Set up comp set for water side nodes (reverse inlet/outlet for water heater) BranchNodeConnections::SetUpCompSets(state, DesupHtr.Type, DesupHtr.Name, DesupHtr.TankType, DesupHtr.TankName, cAlphaArgs(6), cAlphaArgs(5)); - std::string const heatSourceObjType = cAlphaArgs(9); + std::string &heatSourceObjType = cAlphaArgs(9); if ((Util::SameString(heatSourceObjType, "Refrigeration:Condenser:AirCooled")) || (Util::SameString(heatSourceObjType, "Refrigeration:Condenser:EvaporativeCooled")) || @@ -1343,7 +1343,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) } // Inlet Air Configuration - HPWH.InletAirConfiguration = static_cast(getEnumValue(HPWHAmbientTempNamesUC, Util::makeUPPER(hpwhAlpha[6 + nAlphaOffset]))); + HPWH.InletAirConfiguration = static_cast(getEnumValue(HPWHAmbientTempNamesUC, hpwhAlpha[6 + nAlphaOffset])); switch (HPWH.InletAirConfiguration) { case WTTAmbientTemp::Schedule: { @@ -1557,7 +1557,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) // Compressor Location HPWH.CrankcaseTempIndicator = - static_cast(getEnumValue(CrankcaseHeaterControlTempNamesUC, Util::makeUPPER(hpwhAlpha[20 + nAlphaOffset]))); + static_cast(getEnumValue(CrankcaseHeaterControlTempNamesUC, hpwhAlpha[20 + nAlphaOffset])); switch (HPWH.CrankcaseTempIndicator) { case CrankcaseHeaterControlTemp::Schedule: { @@ -2352,8 +2352,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) } // Validate Heater Control Type - Tank.ControlType = - static_cast(getEnumValue(HeaterControlModeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + Tank.ControlType = static_cast(getEnumValue(HeaterControlModeNamesUC, state.dataIPShortCut->cAlphaArgs(3))); switch (Tank.ControlType) { case HeaterControlMode::Cycle: { Tank.MinCapacity = Tank.MaxCapacity; @@ -2500,8 +2499,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) Tank.OnCycParaFracToTank = state.dataIPShortCut->rNumericArgs(12); - Tank.AmbientTempIndicator = - static_cast(getEnumValue(TankAmbientTempNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + Tank.AmbientTempIndicator = static_cast(getEnumValue(TankAmbientTempNamesUC, state.dataIPShortCut->cAlphaArgs(8))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -2715,8 +2713,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) } if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - Tank.SourceSideControlMode = - static_cast(getEnumValue(SourceSideControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(18)))); + Tank.SourceSideControlMode = static_cast(getEnumValue(SourceSideControlNamesUC, state.dataIPShortCut->cAlphaArgs(18))); if (Tank.SourceSideControlMode == SourceSideControl::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Control Mode entered={}", @@ -2807,7 +2804,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.HeightWasAutoSized = true; } - Tank.Shape = static_cast(getEnumValue(TankShapeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + Tank.Shape = static_cast(getEnumValue(TankShapeNamesUC, state.dataIPShortCut->cAlphaArgs(3))); switch (Tank.Shape) { case TankShape::HorizCylinder: case TankShape::VertCylinder: { @@ -2846,8 +2843,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) } // Validate Heater Priority Control - Tank.StratifiedControlMode = - static_cast(getEnumValue(PriorityControlModeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + Tank.StratifiedControlMode = static_cast(getEnumValue(PriorityControlModeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); if (Tank.StratifiedControlMode == PriorityControlMode::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Heater Priority Control entered={}", @@ -3011,8 +3007,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.OnCycParaFracToTank = state.dataIPShortCut->rNumericArgs(16); Tank.OnCycParaHeight = state.dataIPShortCut->rNumericArgs(17); - Tank.AmbientTempIndicator = - static_cast(getEnumValue(TankAmbientTempNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); + Tank.AmbientTempIndicator = static_cast(getEnumValue(TankAmbientTempNamesUC, state.dataIPShortCut->cAlphaArgs(10))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -3292,8 +3287,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) } // Validate inlet mode - Tank.InletMode = - static_cast(getEnumValue(InletPositionModeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(20)))); + Tank.InletMode = static_cast(getEnumValue(InletPositionModeNamesUC, state.dataIPShortCut->cAlphaArgs(20))); Tank.Nodes = state.dataIPShortCut->rNumericArgs(32); int specifiedNodes = 0; @@ -3327,8 +3321,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.SetupStratifiedNodes(state); if (!state.dataIPShortCut->lAlphaFieldBlanks(21)) { - Tank.SourceSideControlMode = - static_cast(getEnumValue(SourceSideControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(21)))); + Tank.SourceSideControlMode = static_cast(getEnumValue(SourceSideControlNamesUC, state.dataIPShortCut->cAlphaArgs(21))); if (Tank.SourceSideControlMode == SourceSideControl::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Control Mode entered={}", @@ -3453,8 +3446,7 @@ bool getWaterTankMixedInput(EnergyPlusData &state) Tank.OnCycParaFuelType = Constant::eFuel::Electricity; Tank.OnCycParaFracToTank = 0.0; - Tank.AmbientTempIndicator = - static_cast(getEnumValue(TankAmbientTempNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + Tank.AmbientTempIndicator = static_cast(getEnumValue(TankAmbientTempNamesUC, state.dataIPShortCut->cAlphaArgs(3))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -3708,8 +3700,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state, std::string objectType) Tank.HeightWasAutoSized = true; } - Tank.Shape = - static_cast(getEnumValue(TankShapeNamesUC, Util::makeUPPER(Util::makeUPPER(fields.at("tank_shape").get())))); + Tank.Shape = static_cast(getEnumValue(TankShapeNamesUC, Util::makeUPPER(fields.at("tank_shape").get()))); switch (Tank.Shape) { case TankShape::HorizCylinder: case TankShape::VertCylinder: { @@ -3844,8 +3835,8 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state, std::string objectType) Tank.OnCycParaFracToTank = 0.0; Tank.OnCycParaHeight = 0.0; - Tank.AmbientTempIndicator = static_cast( - getEnumValue(TankAmbientTempNamesUC, Util::makeUPPER(fields.at("ambient_temperature_indicator").get()))); + Tank.AmbientTempIndicator = + static_cast(getEnumValue(TankAmbientTempNamesUC, fields.at("ambient_temperature_indicator").get())); auto const ambientTempSched = fields.find("ambient_temperature_schedule_name"); std::string fieldName; switch (Tank.AmbientTempIndicator) { @@ -4076,8 +4067,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state, std::string objectType) } // Validate inlet mode - Tank.InletMode = - static_cast(getEnumValue(InletPositionModeNamesUC, Util::makeUPPER(fields.at("inlet_mode").get()))); + Tank.InletMode = static_cast(getEnumValue(InletPositionModeNamesUC, fields.at("inlet_mode").get())); Tank.Nodes = state.dataInputProcessing->inputProcessor->getRealFieldValue(fields, schemaProps, "number_of_nodes"); Tank.AdditionalCond = @@ -4400,7 +4390,7 @@ void GetWaterThermalTankInput(EnergyPlusData &state) } else { DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(Tank.Type))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Tank.Type)); Tank.SourceInletNode = NodeInputManager::GetOnlySingleNode(state, HPWH.OutletNodeName1, @@ -4524,7 +4514,7 @@ void GetWaterThermalTankInput(EnergyPlusData &state) // check that tank has lower priority than all other non-HPWH objects in Zone // Equipment List for (int EquipmentTypeNum = 1; EquipmentTypeNum <= zoneEquipList.NumOfEquipTypes; ++EquipmentTypeNum) { - if (Util::SameString(zoneEquipList.EquipTypeName(EquipmentTypeNum), state.dataIPShortCut->cCurrentModuleObject)) { + if (Util::SameString(state.dataIPShortCut->cCurrentModuleObject, zoneEquipList.EquipTypeName(EquipmentTypeNum))) { continue; } if (TankCoolingPriority > zoneEquipList.CoolingPriority(EquipmentTypeNum) || diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index c1d0ed61609..bc0d386c8a8 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -321,7 +321,7 @@ namespace WaterToAirHeatPump { heatPump.LossFactor = s_ip->getRealFieldValue(fields, schemaProps, "compressor_efficiency"); std::string const compType = s_ip->getAlphaFieldValue(fields, schemaProps, "compressor_type"); - heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, Util::makeUPPER(compType))); + heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, compType)); switch (heatPump.compressorType) { case CompressorType::Reciprocating: { heatPump.CompPistonDisp = s_ip->getRealFieldValue(fields, schemaProps, "compressor_piston_displacement"); @@ -558,7 +558,7 @@ namespace WaterToAirHeatPump { heatPump.LossFactor = s_ip->getRealFieldValue(fields, schemaProps, "compressor_efficiency"); std::string const compType = s_ip->getAlphaFieldValue(fields, schemaProps, "compressor_type"); - heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, Util::makeUPPER(compType))); + heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, compType)); switch (heatPump.compressorType) { case CompressorType::Reciprocating: { heatPump.CompPistonDisp = s_ip->getRealFieldValue(fields, schemaProps, "compressor_piston_displacement"); @@ -2251,7 +2251,7 @@ namespace WaterToAirHeatPump { } Real64 GetCoilCapacity(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) diff --git a/src/EnergyPlus/WaterToAirHeatPump.hh b/src/EnergyPlus/WaterToAirHeatPump.hh index fda1204a99a..2bd12b66089 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.hh +++ b/src/EnergyPlus/WaterToAirHeatPump.hh @@ -233,7 +233,7 @@ namespace WaterToAirHeatPump { ); Real64 GetCoilCapacity(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index a91b06cb197..ddde2106d97 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -3797,7 +3797,7 @@ namespace WaterToAirHeatPumpSimple { } Real64 GetCoilCapacity(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -3860,7 +3860,7 @@ namespace WaterToAirHeatPumpSimple { } Real64 GetCoilAirFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh index b44e24815f8..f7c227b78cb 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh @@ -237,13 +237,13 @@ namespace WaterToAirHeatPumpSimple { ); Real64 GetCoilCapacity(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); Real64 GetCoilAirFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string &CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); diff --git a/src/EnergyPlus/WaterUse.cc b/src/EnergyPlus/WaterUse.cc index 43e443ab5a9..f2644fcf873 100644 --- a/src/EnergyPlus/WaterUse.cc +++ b/src/EnergyPlus/WaterUse.cc @@ -469,7 +469,7 @@ namespace WaterUse { if ((!state.dataIPShortCut->lAlphaFieldBlanks(8)) && (state.dataIPShortCut->cAlphaArgs(8) != "NONE")) { waterConnection.HeatRecovery = true; waterConnection.HeatRecoveryHX = - static_cast(getEnumValue(HeatRecoverHXNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + static_cast(getEnumValue(HeatRecoverHXNamesUC, state.dataIPShortCut->cAlphaArgs(8))); if (waterConnection.HeatRecoveryHX == HeatRecovHX::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(8), state.dataIPShortCut->cAlphaArgs(8))); @@ -478,7 +478,7 @@ namespace WaterUse { } waterConnection.HeatRecoveryConfig = - static_cast(getEnumValue(HeatRecoveryConfigNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); + static_cast(getEnumValue(HeatRecoveryConfigNamesUC, state.dataIPShortCut->cAlphaArgs(9))); if (waterConnection.HeatRecoveryConfig == HeatRecovConfig::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(9), state.dataIPShortCut->cAlphaArgs(9))); diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index 4397077ad4b..4c0c578f8ba 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -6101,7 +6101,7 @@ namespace Weather { if (ipsc->lAlphaFieldBlanks(3)) { desDayInput.dryBulbRangeType = DesDayDryBulbRangeType::Default; } else if ((desDayInput.dryBulbRangeType = static_cast( - getEnumValue(DesDayDryBulbRangeTypeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(3))))) != DesDayDryBulbRangeType::Invalid) { + getEnumValue(DesDayDryBulbRangeTypeNamesUC, ipsc->cAlphaArgs(3)))) != DesDayDryBulbRangeType::Invalid) { } else { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; @@ -6221,7 +6221,7 @@ namespace Weather { } // A5, \field Humidity Condition Type - desDayInput.HumIndType = static_cast(getEnumValue(DesDayHumIndTypeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(5)))); + desDayInput.HumIndType = static_cast(getEnumValue(DesDayHumIndTypeNamesUC, ipsc->cAlphaArgs(5))); switch (desDayInput.HumIndType) { case DesDayHumIndType::WetBulb: { @@ -6441,8 +6441,8 @@ namespace Weather { // A10, \field Solar Model Indicator if (ipsc->lAlphaFieldBlanks(10)) { desDayInput.solarModel = DesDaySolarModel::ASHRAE_ClearSky; - } else if ((desDayInput.solarModel = static_cast( - getEnumValue(DesDaySolarModelNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(10))))) != DesDaySolarModel::Invalid) { + } else if ((desDayInput.solarModel = static_cast(getEnumValue(DesDaySolarModelNamesUC, ipsc->cAlphaArgs(10)))) != + DesDaySolarModel::Invalid) { } else { ShowWarningInvalidKey(state, eoh, ipsc->cAlphaFieldNames(10), ipsc->cAlphaArgs(10), "ASHRAE ClearSky"); desDayInput.solarModel = DesDaySolarModel::ASHRAE_ClearSky; diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc index 520bb8665f1..f872e980754 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -265,8 +265,7 @@ namespace WindTurbine { ErrorsFound = true; } // Select rotor type - windTurbine.rotorType = - static_cast(getEnumValue(WindTurbine::RotorNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + windTurbine.rotorType = static_cast(getEnumValue(WindTurbine::RotorNamesUC, state.dataIPShortCut->cAlphaArgs(3))); if (windTurbine.rotorType == RotorType::Invalid) { if (state.dataIPShortCut->cAlphaArgs(3).empty()) { windTurbine.rotorType = RotorType::HorizontalAxis; @@ -282,8 +281,7 @@ namespace WindTurbine { } // Select control type - windTurbine.controlType = - static_cast(getEnumValue(WindTurbine::ControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + windTurbine.controlType = static_cast(getEnumValue(WindTurbine::ControlNamesUC, state.dataIPShortCut->cAlphaArgs(4))); if (windTurbine.controlType == ControlType::Invalid) { if (state.dataIPShortCut->cAlphaArgs(4).empty()) { windTurbine.controlType = ControlType::VariableSpeedVariablePitch; diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index ad06915628a..70edd234e01 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -600,7 +600,7 @@ int getEMSGlobalVariableHandle(EnergyPlusState state, const char *name) index++; // only respond if we are outside of the built-in EMS var range if (index < thisState->dataRuntimeLang->emsVarBuiltInStart || index > thisState->dataRuntimeLang->emsVarBuiltInEnd) { - if (EnergyPlus::Util::SameString(name, erlVar.Name)) { + if (equali(name, erlVar.Name)) { return index; } } diff --git a/third_party/ObjexxFCL/src/ObjexxFCL/string.functions.hh b/third_party/ObjexxFCL/src/ObjexxFCL/string.functions.hh index 98890117cf0..47da8880202 100644 --- a/third_party/ObjexxFCL/src/ObjexxFCL/string.functions.hh +++ b/third_party/ObjexxFCL/src/ObjexxFCL/string.functions.hh @@ -29,968 +29,1024 @@ namespace ObjexxFCL { -// Predicate ///// - -// string is Empty? -constexpr -bool -empty( std::string_view const s ) -{ - return s.empty(); -} - -// string is Blank? -constexpr -bool -is_blank( std::string_view const s ) -{ - return ( s.empty() ? true : s.find_first_not_of( ' ' ) == std::string::npos ); -} - -// string is Not Blank? -constexpr -bool -not_blank( std::string_view const s ) -{ - return ! is_blank( s ); -} - -// string is Whitespace? -constexpr -bool -is_whitespace( std::string_view const s ) -{ - return ( s.empty() ? true : s.find_last_not_of( " \t\000" ) == std::string::npos ); -} - -// string is Digits? -inline -bool -is_digit( std::string_view const s ) -{ - if ( s.empty() ) { - return false; - } else { - for ( char const c : s ) { - if ( std::isdigit( c ) == 0 ) return false; + // Predicate ///// + + // string is Empty? + constexpr + bool + empty(std::string_view const s) + { + return s.empty(); + } + + // string is Blank? + constexpr + bool + is_blank(std::string_view const s) + { + return (s.empty() ? true : s.find_first_not_of(' ') == std::string::npos); + } + + // string is Not Blank? + constexpr + bool + not_blank(std::string_view const s) + { + return !is_blank(s); + } + + // string is Whitespace? + constexpr + bool + is_whitespace(std::string_view const s) + { + return (s.empty() ? true : s.find_last_not_of(" \t\000") == std::string::npos); + } + + // string is Digits? + inline + bool + is_digit(std::string_view const s) + { + if (s.empty()) { + return false; + } + else { + for (char const c : s) { + if (std::isdigit(c) == 0) return false; + } + return true; } - return true; } -} -// string is Lowercase Alphabetic? -inline -bool -is_lower( std::string_view const s ) -{ - if ( s.empty() ) { - return false; - } else { - for ( char const c : s ) { - if ( std::islower( c ) == 0 ) return false; + // string is Lowercase Alphabetic? + inline + bool + is_lower(std::string_view const s) + { + if (s.empty()) { + return false; + } + else { + for (char const c : s) { + if (std::islower(c) == 0) return false; + } + return true; } - return true; } -} -// string is Uppercase Alphabetic? -inline -bool -is_upper( std::string_view const s ) -{ - if ( s.empty() ) { - return false; - } else { - for ( char const c : s ) { - if ( std::isupper( c ) == 0 ) return false; + // string is Uppercase Alphabetic? + inline + bool + is_upper(std::string_view const s) + { + if (s.empty()) { + return false; + } + else { + for (char const c : s) { + if (std::isupper(c) == 0) return false; + } + return true; } - return true; } -} - -// string has a Lowercase Character? -inline -bool -has_lower( std::string_view const s ) -{ - for ( char const c : s ) { - if ( std::islower( c ) != 0 ) return true; - } - return false; -} - -// string has an Uppercase Character? -inline -bool -has_upper( std::string_view const s ) -{ - for ( char const c : s ) { - if ( std::isupper( c ) != 0 ) return true; - } - return false; -} - -// string has a string? -constexpr -bool -has( std::string_view const s, std::string_view const t ) -{ - return ( s.find( t ) != std::string::npos ); -} - -// string has a Character? -inline -bool -has( std::string_view const s, char const c ) -{ - return ( s.find( c ) != std::string::npos ); -} - -// string has a String/Character Case-Insensitively? -template< typename T > -bool -hasi( std::string_view const s, T const & t ); // Implementation below - -// string has any Character of a string_view? -constexpr -bool -has_any_of( std::string_view const s, std::string_view const t ) -{ - return ( s.find_first_of( t ) != std::string::npos ); -} - - -// Has a Prefix Case-Optionally? -constexpr -bool -has_prefix( std::string_view const s, std::string_view const pre, bool const exact_case = true ) -{ - std::string::size_type const pre_len( pre.length() ); - if ( pre_len == 0 ) { + + // string has a Lowercase Character? + inline + bool + has_lower(std::string_view const s) + { + for (char const c : s) { + if (std::islower(c) != 0) return true; + } return false; - } else if ( s.length() < pre_len ) { + } + + // string has an Uppercase Character? + inline + bool + has_upper(std::string_view const s) + { + for (char const c : s) { + if (std::isupper(c) != 0) return true; + } return false; - } else if ( exact_case ) { - for ( std::string::size_type i = 0; i < pre_len; ++i ) { - if ( s[ i ] != pre[ i ] ) return false; + } + + // string has a string? + constexpr + bool + has(std::string_view const s, std::string_view const t) + { + return (s.find(t) != std::string::npos); + } + + // string has a Character? + inline + bool + has(std::string_view const s, char const c) + { + return (s.find(c) != std::string::npos); + } + + // string has a String/Character Case-Insensitively? + template< typename T > + bool + hasi(std::string_view const s, T const& t); // Implementation below + + // string has any Character of a string_view? + constexpr + bool + has_any_of(std::string_view const s, std::string_view const t) + { + return (s.find_first_of(t) != std::string::npos); + } + + + // Has a Prefix Case-Optionally? + constexpr + bool + has_prefix(std::string_view const s, std::string_view const pre, bool const exact_case = true) + { + std::string::size_type const pre_len(pre.length()); + if (pre_len == 0) { + return false; } - return true; - } else { - for ( std::string::size_type i = 0; i < pre_len; ++i ) { - if ( ! equali( s[ i ], pre[ i ] ) ) return false; + else if (s.length() < pre_len) { + return false; + } + else if (exact_case) { + for (std::string::size_type i = 0; i < pre_len; ++i) { + if (s[i] != pre[i]) return false; + } + return true; + } + else { + for (std::string::size_type i = 0; i < pre_len; ++i) { + if (!equali(s[i], pre[i])) return false; + } + return true; } - return true; } -} -// Has a Prefix Case-Optionally? -constexpr -bool -has_prefix( std::string_view const s, char const pre, bool const exact_case = true ) -{ - if ( s.length() == 0 ) { - return false; - } else if ( exact_case ) { - return ( s[ 0 ] == pre ); - } else { - return equali( s[ 0 ], pre ); - } -} - - -// Has a Prefix Case-Insensitively? -template< typename S > -constexpr -bool -has_prefixi( std::string_view const s, S const & pre ) -{ - return has_prefix( s, pre, false ); -} - -// Trailing Whitespace Trimmed Copy of a string -std::string -trimmed_whitespace( std::string_view const s ); // Declaration copy for use below - -// string is Readable as a Type Supporting Stream Input? -template< typename T > -inline -bool -is_type( std::string const & s ) -{ - if ( is_whitespace( s ) ) { // Don't accept empty or whitespace string - return false; - } else { // Try to read the string as a T - std::istringstream t_stream( trimmed_whitespace( s ) ); - T t; - t_stream >> t; - return ( t_stream && t_stream.eof() ); - } -} - -// string is Readable as a Type Supporting Stream Input? -template< typename T > -inline -bool -is_type( char const * const s ) -{ - return is_type< T >( std::string( s ) ); -} - -// string is Readable as a bool? -template<> -inline -bool -is_type< bool >( std::string const & s ) -{ - std::string const t( trimmed_whitespace( s ) ); - if ( t.empty() ) { // Don't accept empty or whitespace string + // Has a Prefix Case-Optionally? + constexpr + bool + has_prefix(std::string_view const s, char const pre, bool const exact_case = true) + { + if (s.length() == 0) { + return false; + } + else if (exact_case) { + return (s[0] == pre); + } + else { + return equali(s[0], pre); + } + } + + + // Has a Prefix Case-Insensitively? + template< typename S > + constexpr + bool + has_prefixi(std::string_view const s, S const& pre) + { + return has_prefix(s, pre, false); + } + + // Trailing Whitespace Trimmed Copy of a string + std::string + trimmed_whitespace(std::string_view const s); // Declaration copy for use below + + // string is Readable as a Type Supporting Stream Input? + template< typename T > + inline + bool + is_type(std::string const& s) + { + if (is_whitespace(s)) { // Don't accept empty or whitespace string + return false; + } + else { // Try to read the string as a T + std::istringstream t_stream(trimmed_whitespace(s)); + T t; + t_stream >> t; + return (t_stream && t_stream.eof()); + } + } + + // string is Readable as a Type Supporting Stream Input? + template< typename T > + inline + bool + is_type(char const* const s) + { + return is_type< T >(std::string(s)); + } + + // string is Readable as a bool? + template<> + inline + bool + is_type< bool >(std::string const& s) + { + std::string const t(trimmed_whitespace(s)); + if (t.empty()) { // Don't accept empty or whitespace string + return false; + } + else if ((t == "T") || (t == "t") || (t == "true")) { // Accept for true + return true; + } + else if ((t == "F") || (t == "f") || (t == "false")) { // Accept for false + return true; + } + else { // Try to read the string as 0/1 bool + std::istringstream b_stream(t); + bool b; + b_stream >> b; + return (b_stream && b_stream.eof()); + } + } + + // Is char Pointer Pointing to String Whitespace Tail + inline + bool + is_tail(char* end) + { + if (end == nullptr) return false; + while (std::isspace(*end)) ++end; + return (*end == '\0'); + } + + // string is Readable as a short int? + template<> + inline + bool + is_type< short int >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + long int const i(std::strtol(str, &end, 10)); + return ((end != str) && is_tail(end) && (std::numeric_limits< short int >::min() <= i) && (i <= std::numeric_limits< short int >::max())); + } + + // string is Readable as an int? + template<> + inline + bool + is_type< int >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + long int const i(std::strtol(str, &end, 10)); + return ((end != str) && is_tail(end) && (std::numeric_limits< int >::min() <= i) && (i <= std::numeric_limits< int >::max())); + } + + // string is Readable as a long int? + template<> + inline + bool + is_type< long int >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + static_cast(std::strtol(str, &end, 10)); + return ((end != str) && is_tail(end)); + } + + // string is Readable as a long long int? + template<> + inline + bool + is_type< long long int >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + static_cast(std::strtoll(str, &end, 10)); + return ((end != str) && is_tail(end)); + } + + // string is Readable as an unsigned short int? + template<> + inline + bool + is_type< unsigned short int >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + unsigned long int const i(std::strtoul(str, &end, 10)); + return ((end != str) && is_tail(end) && (i <= std::numeric_limits< unsigned short int >::max())); + } + + // string is Readable as an unsigned int? + template<> + inline + bool + is_type< unsigned int >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + unsigned long int const i(std::strtoul(str, &end, 10)); + return ((end != str) && is_tail(end) && (i <= std::numeric_limits< unsigned int >::max())); + } + + // string is Readable as an unsigned long int? + template<> + inline + bool + is_type< unsigned long int >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + static_cast(std::strtoul(str, &end, 10)); + return ((end != str) && is_tail(end)); + } + + // string is Readable as an unsigned long long int? + template<> + inline + bool + is_type< unsigned long long int >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + static_cast(std::strtoull(str, &end, 10)); + return ((end != str) && is_tail(end)); + } + + // string is Readable as a float? + template<> + inline + bool + is_type< float >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + static_cast(std::strtof(str, &end)); + return ((end != str) && is_tail(end)); + } + + // string is Readable as a double? + template<> + inline + bool + is_type< double >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + static_cast(std::strtod(str, &end)); + return ((end != str) && is_tail(end)); + } + + // string is Readable as a long double? + template<> + inline + bool + is_type< long double >(std::string const& s) + { + char const* str(s.c_str()); + char* end; + static_cast(std::strtold(str, &end)); + return ((end != str) && is_tail(end)); + } + + // string is Readable as a char? + template<> + inline + bool + is_type< char >(std::string const& s) + { + return (s.length() == 1); + } + + // string is Readable as a bool? + inline + bool + is_bool(std::string const& s) + { + return is_type< bool >(s); + } + + // string is Readable as a short int? + inline + bool + is_short(std::string const& s) + { + return is_type< short int >(s); + } + + // string is Readable as an int? + inline + bool + is_int(std::string const& s) + { + return is_type< int >(s); + } + + // string is Readable as a long long int? + inline + bool + is_longlong(std::string const& s) + { + return is_type< long long int >(s); + } + + // string is Readable as an unsigned short int? + inline + bool + is_ushort(std::string const& s) + { + return is_type< unsigned short int >(s); + } + + // string is Readable as a float? + inline + bool + is_float(std::string const& s) + { + return is_type< float >(s); + } + + // string is Readable as a double? + inline + bool + is_double(std::string const& s) + { + return is_type< double >(s); + } + + // string is Readable as a char? + inline + bool + is_char(std::string const& s) + { + return is_type< char >(s); + } + + // string is Readable as a Decimal Integer? + inline + bool + is_decimal(std::string const& s, bool const allow_sign = true) + { + char const* str(s.c_str()); + char* end; + long int const i(std::strtol(str, &end, 10)); + return ((end != str) && is_tail(end) && (allow_sign || (i >= 0))); + } + + // string is Readable as a Binary Integer? + inline + bool + is_binary(std::string const& s, bool const allow_sign = true) + { + char const* str(s.c_str()); + char* end; + long int const i(std::strtol(str, &end, 2)); + return ((end != str) && is_tail(end) && (allow_sign || (i >= 0))); + } + + // string is Readable as a bool? + inline + bool + is_bool(char const* const s) + { + return is_type< bool >(s); + } + + // string is Readable as a short int? + inline + bool + is_short(char const* const s) + { + return is_type< short int >(s); + } + + // string is Readable as an int? + inline + bool + is_int(char const* const s) + { + return is_type< int >(s); + } + + // string is Readable as a long long int? + inline + bool + is_longlong(char const* const s) + { + return is_type< long long int >(s); + } + + // string is Readable as an unsigned short int? + inline + bool + is_ushort(char const* const s) + { + return is_type< unsigned short int >(s); + } + + // string is Readable as a float? + inline + bool + is_float(char const* const s) + { + return is_type< float >(s); + } + + // string is Readable as a double? + inline + bool + is_double(char const* const s) + { + return is_type< double >(s); + } + + // string is Readable as a char? + inline + bool + is_char(char const* const s) + { + return is_type< char >(s); + } + + // string is Readable as a Decimal Integer? + inline + bool + is_decimal(char const* const s, bool const allow_sign = true) + { + char* end; + long int const i(std::strtol(s, &end, 10)); + return ((end != s) && is_tail(end) && (allow_sign || (i >= 0))); + } + + // string is Readable as a Binary Integer? + inline + bool + is_binary(char const* const s, bool const allow_sign = true) + { + char* end; + long int const i(std::strtol(s, &end, 2)); + return ((end != s) && is_tail(end) && (allow_sign || (i >= 0))); + } + + // Comparison ///// + + // char == char Case-Insensitively? + constexpr + bool + equali_char(char const c, char const d) + { + if (c == d) { + //Same character + return true; + } + //Without passing or changing the character, check if it's the same, ignoring case + else if (c >= 'A' && c <= 'Z') { + if (c == (d - 32)) { + return true; + } + else { + return false; + } + } + else if (c >= 'a' && c <= 'z') { + if (c == (d + 32)) { + return true; + } + else { + return false; + } + } return false; - } else if ( ( t == "T" ) || ( t == "t" ) || ( t == "true" ) ) { // Accept for true - return true; - } else if ( ( t == "F" ) || ( t == "f" ) || ( t == "false" ) ) { // Accept for false - return true; - } else { // Try to read the string as 0/1 bool - std::istringstream b_stream( t ); - bool b; - b_stream >> b; - return ( b_stream && b_stream.eof() ); - } -} - -// Is char Pointer Pointing to String Whitespace Tail -inline -bool -is_tail( char * end ) -{ - if ( end == nullptr ) return false; - while ( std::isspace( *end ) ) ++end; - return ( *end == '\0' ); -} - -// string is Readable as a short int? -template<> -inline -bool -is_type< short int >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - long int const i( std::strtol( str, &end, 10 ) ); - return ( ( end != str ) && is_tail( end ) && ( std::numeric_limits< short int >::min() <= i ) && ( i <= std::numeric_limits< short int >::max() ) ); -} - -// string is Readable as an int? -template<> -inline -bool -is_type< int >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - long int const i( std::strtol( str, &end, 10 ) ); - return ( ( end != str ) && is_tail( end ) && ( std::numeric_limits< int >::min() <= i ) && ( i <= std::numeric_limits< int >::max() ) ); -} - -// string is Readable as a long int? -template<> -inline -bool -is_type< long int >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - static_cast< void >( std::strtol( str, &end, 10 ) ); - return ( ( end != str ) && is_tail( end ) ); -} - -// string is Readable as a long long int? -template<> -inline -bool -is_type< long long int >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - static_cast< void >( std::strtoll( str, &end, 10 ) ); - return ( ( end != str ) && is_tail( end ) ); -} - -// string is Readable as an unsigned short int? -template<> -inline -bool -is_type< unsigned short int >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - unsigned long int const i( std::strtoul( str, &end, 10 ) ); - return ( ( end != str ) && is_tail( end ) && ( i <= std::numeric_limits< unsigned short int >::max() ) ); -} - -// string is Readable as an unsigned int? -template<> -inline -bool -is_type< unsigned int >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - unsigned long int const i( std::strtoul( str, &end, 10 ) ); - return ( ( end != str ) && is_tail( end ) && ( i <= std::numeric_limits< unsigned int >::max() ) ); -} - -// string is Readable as an unsigned long int? -template<> -inline -bool -is_type< unsigned long int >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - static_cast< void >( std::strtoul( str, &end, 10 ) ); - return ( ( end != str ) && is_tail( end ) ); -} - -// string is Readable as an unsigned long long int? -template<> -inline -bool -is_type< unsigned long long int >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - static_cast< void >( std::strtoull( str, &end, 10 ) ); - return ( ( end != str ) && is_tail( end ) ); -} - -// string is Readable as a float? -template<> -inline -bool -is_type< float >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - static_cast< void >( std::strtof( str, &end ) ); - return ( ( end != str ) && is_tail( end ) ); -} - -// string is Readable as a double? -template<> -inline -bool -is_type< double >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - static_cast< void >( std::strtod( str, &end ) ); - return ( ( end != str ) && is_tail( end ) ); -} - -// string is Readable as a long double? -template<> -inline -bool -is_type< long double >( std::string const & s ) -{ - char const * str( s.c_str() ); - char * end; - static_cast< void >( std::strtold( str, &end ) ); - return ( ( end != str ) && is_tail( end ) ); -} - -// string is Readable as a char? -template<> -inline -bool -is_type< char >( std::string const & s ) -{ - return ( s.length() == 1 ); -} - -// string is Readable as a bool? -inline -bool -is_bool( std::string const & s ) -{ - return is_type< bool >( s ); -} - -// string is Readable as a short int? -inline -bool -is_short( std::string const & s ) -{ - return is_type< short int >( s ); -} - -// string is Readable as an int? -inline -bool -is_int( std::string const & s ) -{ - return is_type< int >( s ); -} - -// string is Readable as a long long int? -inline -bool -is_longlong( std::string const & s ) -{ - return is_type< long long int >( s ); -} - -// string is Readable as an unsigned short int? -inline -bool -is_ushort( std::string const & s ) -{ - return is_type< unsigned short int >( s ); -} - -// string is Readable as a float? -inline -bool -is_float( std::string const & s ) -{ - return is_type< float >( s ); -} - -// string is Readable as a double? -inline -bool -is_double( std::string const & s ) -{ - return is_type< double >( s ); -} - -// string is Readable as a char? -inline -bool -is_char( std::string const & s ) -{ - return is_type< char >( s ); -} - -// string is Readable as a Decimal Integer? -inline -bool -is_decimal( std::string const & s, bool const allow_sign = true ) -{ - char const * str( s.c_str() ); - char * end; - long int const i( std::strtol( str, &end, 10 ) ); - return ( ( end != str ) && is_tail( end ) && ( allow_sign || ( i >= 0 ) ) ); -} - -// string is Readable as a Binary Integer? -inline -bool -is_binary( std::string const & s, bool const allow_sign = true ) -{ - char const * str( s.c_str() ); - char * end; - long int const i( std::strtol( str, &end, 2 ) ); - return ( ( end != str ) && is_tail( end ) && ( allow_sign || ( i >= 0 ) ) ); -} - -// string is Readable as a bool? -inline -bool -is_bool( char const * const s ) -{ - return is_type< bool >( s ); -} - -// string is Readable as a short int? -inline -bool -is_short( char const * const s ) -{ - return is_type< short int >( s ); -} - -// string is Readable as an int? -inline -bool -is_int( char const * const s ) -{ - return is_type< int >( s ); -} - -// string is Readable as a long long int? -inline -bool -is_longlong( char const * const s ) -{ - return is_type< long long int >( s ); -} - -// string is Readable as an unsigned short int? -inline -bool -is_ushort( char const * const s ) -{ - return is_type< unsigned short int >( s ); -} - -// string is Readable as a float? -inline -bool -is_float( char const * const s ) -{ - return is_type< float >( s ); -} - -// string is Readable as a double? -inline -bool -is_double( char const * const s ) -{ - return is_type< double >( s ); -} - -// string is Readable as a char? -inline -bool -is_char( char const * const s ) -{ - return is_type< char >( s ); -} - -// string is Readable as a Decimal Integer? -inline -bool -is_decimal( char const * const s, bool const allow_sign = true ) -{ - char * end; - long int const i( std::strtol( s, &end, 10 ) ); - return ( ( end != s ) && is_tail( end ) && ( allow_sign || ( i >= 0 ) ) ); -} - -// string is Readable as a Binary Integer? -inline -bool -is_binary( char const * const s, bool const allow_sign = true ) -{ - char * end; - long int const i( std::strtol( s, &end, 2 ) ); - return ( ( end != s ) && is_tail( end ) && ( allow_sign || ( i >= 0 ) ) ); -} - -// Comparison ///// - -// char == char Case-Insensitively? -constexpr -bool -equali_char( char const c, char const d ) -{ - return ( to_lower( c ) == to_lower( d ) ); -} - -// string == string Case-Insensitively? -constexpr -bool -equali( std::string_view const s, std::string_view const t ) -{ + } + + // string == string Case-Insensitively? + constexpr + bool + equali(std::string_view const s, std::string_view const t) + { #if defined(__linux__) || defined(__INTEL_COMPILER) // This is faster - std::string::size_type const s_len( s.length() ); - if ( s_len != t.length() ) return false; - for ( std::string::size_type i = 0; i < s_len; ++i ) { - if ( to_lower( s[ i ] ) != to_lower( t[ i ] ) ) return false; - if ( ++i == s_len ) break; // Unroll - if ( to_lower( s[ i ] ) != to_lower( t[ i ] ) ) return false; - if ( ++i == s_len ) break; // Unroll - if ( to_lower( s[ i ] ) != to_lower( t[ i ] ) ) return false; - } - return true; + std::string::size_type const s_len(s.length()); + if (s_len != t.length()) return false; + if (s_len == 0) { + //Both are empty strings, return true + return true; + } + else if (to_lower(s[(int)s.length() / 2]) != to_lower(t[(int)t.length() / 2])) { + //Check the middle character for a quick false + return false; + } + for (std::string::size_type i = 0; i < s_len; ++i) { + if (to_lower(s[i]) != to_lower(t[i])) return false; + if (++i == s_len) break; // Unroll + if (to_lower(s[i]) != to_lower(t[i])) return false; + if (++i == s_len) break; // Unroll + if (to_lower(s[i]) != to_lower(t[i])) return false; + } + return true; #else - return ( s.length() == t.length() ? std::equal( s.begin(), s.end(), t.begin(), equali_char ) : false ); + if (s.length() == t.length()) { + if (s.length() == 0) { + //Both are empty strings, return true + return true; + } + else if (!equali_char(s[(int)s.length() / 2], t[(int)t.length() / 2])) { + //Check the middle character for a quick false + return false; + } + //Do case insensitive compare + return std::equal(s.begin(), s.end(), t.begin(), equali_char); + } + return false; #endif -} - - -// string == string Case-Optionally? -inline -bool -equal( std::string_view const s, std::string_view const t, bool const exact_case = true ) -{ - return ( exact_case ? s == t : equali( s, t ) ); -} - - -// char < char Case-Sensitively? -inline -bool -lessthan_char( char const c, char const d ) -{ - return c < d; -} - -// char < char Case-Insensitively? -inline -bool -lessthani_char( char const c, char const d ) -{ - return ( to_lower( c ) < to_lower( d ) ); -} - -// string < string Case-Insensitively? -inline -bool -lessthan( std::string_view const s, std::string_view const t, bool const exact_case = true ) -{ - if ( exact_case ) { - return std::lexicographical_compare( s.begin(), s.end(), t.begin(), t.end(), lessthan_char ); - } else { - return std::lexicographical_compare( s.begin(), s.end(), t.begin(), t.end(), lessthani_char ); - } -} - -// string < string Case-Insensitively? -inline -bool -lessthani( std::string_view const s, std::string_view const t ) -{ - return std::lexicographical_compare( s.begin(), s.end(), t.begin(), t.end(), lessthani_char ); -} - -// ASCII Lexical < Comparison -inline -bool -llt( std::string_view const s, std::string_view const t ) -{ - return ( s < t ); -} - -// ASCII Lexical <= Comparison -inline -bool -lle( std::string_view const s, std::string_view const t ) -{ - return ( s <= t ); -} - -// ASCII Lexical >= Comparison -inline -bool -lge( std::string_view const s, std::string_view const t ) -{ - return ( s >= t ); -} - -// ASCII Lexical < Comparison -inline -bool -lgt( std::string_view const s, std::string_view const t ) -{ - return ( s > t ); -} - -// Inspector ///// - -// Length -constexpr -std::string::size_type -len( std::string_view const s ) -{ - return s.length(); -} - - -// Length Space-Trimmed -constexpr -std::string::size_type -len_trim( std::string_view const s ) -{ - return s.find_last_not_of( ' ' ) + 1; // Works if npos returned: npos + 1 == 0 -} - -// Index of a Substring -template< typename T > -constexpr -std::string::size_type -index( std::string_view const s, T const & t, bool const last = false ) -{ - return ( last ? s.rfind( t ) : s.find( t ) ); -} - -// Last Index of a Substring -template< typename T > -constexpr -std::string::size_type -rindex( std::string_view const s, T const & t ) -{ - return s.rfind( t ); -} - -// Index of a Substring Case-Insensitively -inline -std::string::size_type -indexi( std::string_view const s, std::string_view const t, bool const last = false ) -{ - if ( last ) { - auto const i( std::find_end( s.begin(), s.end(), t.begin(), t.end(), equali_char ) ); - return ( i == s.end() ? std::string::npos : static_cast< std::string::size_type >( i - s.begin() ) ); - } else { - auto const i( std::search( s.begin(), s.end(), t.begin(), t.end(), equali_char ) ); - return ( i == s.end() ? std::string::npos : static_cast< std::string::size_type >( i - s.begin() ) ); - } -} - -// Index of a Character Case-Insensitively -constexpr -std::string::size_type -indexi( std::string_view const s, char const c, bool const last = false ) -{ - if ( last ) { - for ( std::string::size_type i = s.length() - 1, e = 0; i >= e; --i ) { - if ( equali_char( s[ i ], c ) ) return i; - } - } else { - for ( std::string::size_type i = 0, e = s.length(); i < e; ++i ) { - if ( equali_char( s[ i ], c ) ) return i; - } - } - return std::string::npos; -} - -// Last Index of a Substring Case-Insensitively -template< typename T > -inline -std::string::size_type -rindexi( std::string_view const s, T const & t ) -{ - return indexi( s, t, true ); -} - -// string has a String/Character Case-Insensitively? -template< typename T > -inline -bool -hasi( std::string_view const s, T const & t ) // Declaration above -{ - return ( indexi( s, t ) != std::string::npos ); -} - -// Find any Characters of Another String -template< typename T > -inline -std::string::size_type -scan( std::string_view const s, T const & t, bool const last = false ) -{ - return ( last ? s.find_last_of( t ) : s.find_first_of( t ) ); -} - -// Find any Characters not of Another String -template< typename T > -inline -std::string::size_type -verify( std::string_view const s, T const & t, bool const last = false ) -{ - return ( last ? s.find_last_not_of( t ) : s.find_first_not_of( t ) ); -} - -// Conversion ///// - -// Integer Value of a string -inline -int -ichar( std::string_view const s ) -{ - return ( ! s.empty() ? static_cast< int >( s[ 0 ] ) : 0 ); -} - -// Conversion to Numeric Types ///// - -// Modifier ///// - -// Uppercase a string -std::string & -uppercase( std::string & s ); - -// Trim Trailing Space from a string -std::string & -trim( std::string & s ); - -// Strip Specified Characters from a string's Tails -std::string & -strip( std::string & s, std::string const & chars ); - -// Strip Specified Characters from a string's Right Tail -std::string & -rstrip( std::string & s, std::string const & chars ); - -// Strip Space from a string's Tails -std::string & -strip( std::string & s ); - -// Strip Space from a string's Right Tail -std::string & -rstrip( std::string & s ); - -// Pad a string to a Specified Length -inline -std::string & -pad( std::string & s, std::string::size_type const len ) -{ - std::string::size_type const s_len( s.length() ); - if ( s_len < len ) s.append( len - s_len, ' ' ); // Pad - return s; -} - -// Pare a string to a Specified Length -inline -std::string & -pare( std::string & s, std::string::size_type const len ) -{ - if ( s.length() > len ) s.erase( len ); // Pare - return s; -} - -// Size a string to a Specified Length -std::string & -size( std::string & s, std::string::size_type const len ); - -// Center a string wrt its Whitespace -std::string & -center( std::string & s ); - -// Center a string with a Specified Length -std::string & -center( std::string & s, std::string::size_type const len ); - -// Remove Repeat Characters from a Possibly Unsorted string Preserving Order -std::string & -unique( std::string & s ); - -// Substring Replaced in a string -std::string & -replace( std::string & s, std::string_view const a, std::string_view const b ); - -// Wrap in Double Quotes -inline -std::string & -quote( std::string & s ) -{ - s = '"' + s + '"'; - return s; -} - -// Overlay a string with Another string, Expanding Size as Needed -std::string & -overlay( std::string & s, std::string_view const t, std::string::size_type const pos = 0 ); - -// Generator ///// - -// Blank string of Specified Length -inline -std::string -blank( std::string::size_type const len ) -{ - return std::string( len, ' ' ); -} - -// Uppercased Copy of a string -std::string -uppercased( std::string_view const s ); - -// Left-Justified Copy of a string -std::string -ljustified( std::string_view const s ); - -// Right-Justified Copy of a string -std::string -rjustified( std::string_view const s ); - -// Trailing Space Trimmed Copy of a string -std::string -trimmed( std::string_view const s ); - -// Trailing Whitespace Trimmed Copy of a string -std::string -trimmed_whitespace( std::string_view const s ); - -// Specified Characters Stripped from a string's Tails Copy of a string -std::string -stripped( std::string_view const s, std::string_view const chars ); - -// Space Stripped from a string's Tails Copy of a string -std::string -stripped( std::string_view const s ); - -// Whitespace Stripped from a string's Tails Copy of a string -std::string -stripped_whitespace( std::string_view const s ); - -// Sized to a Specified Length Copy of a string -std::string -sized( std::string_view const s, std::string::size_type const len ); - -// Centered in a string of Specified Length Copy of a string -std::string -centered( std::string_view const s, std::string::size_type const len ); - -// Centered wrt Whitespace Copy of a string -inline -std::string -centered( std::string_view const s ) -{ - return centered( stripped_whitespace( s ), s.length() ); -} - -// Substring Replaced Copy of a string -inline -std::string -replaced( std::string_view const s, std::string_view const a, std::string_view const b ) -{ - std::string r( s ); - replace( r, a, b ); - return r; -} - -// Overlayed string with Another string, Expanding Size as Needed -std::string -overlayed( std::string_view const s, std::string_view const t, std::string::size_type const pos = 0 ); - -// Repeated Copies -std::string -repeated( std::string_view const s, int const n ); - -// Repeated Copies -std::string -repeat( std::string_view const s, int const n ); - -// Space-Free Head Copy of a string -std::string -head( std::string_view const s ); - -// Concatenation: Non-template to Support Conversions -inline -std::string -operator +( std::string const & s, std::string const & t ) -{ - return std::string( s ) += t; -} - -// Concatenation: Non-template to Support Conversions -inline -std::string -operator +( char const * const s, std::string const & t ) -{ - return std::string( s ) += t; -} - -// Concatenation: Non-template to Support Conversions -inline -std::string -operator +( std::string const & s, char const * const t ) -{ - return s + std::string( t ); -} - -// Conversion To std::string + } + + + // string == string Case-Optionally? + inline + bool + equal(std::string_view const s, std::string_view const t, bool const exact_case = true) + { + return (exact_case ? s == t : equali(s, t)); + } + + + // char < char Case-Sensitively? + inline + bool + lessthan_char(char const c, char const d) + { + return c < d; + } + + // char < char Case-Insensitively? + inline + bool + lessthani_char(char const c, char const d) + { + return (to_lower(c) < to_lower(d)); + } + + // string < string Case-Insensitively? + inline + bool + lessthan(std::string_view const s, std::string_view const t, bool const exact_case = true) + { + if (exact_case) { + return std::lexicographical_compare(s.begin(), s.end(), t.begin(), t.end(), lessthan_char); + } + else { + return std::lexicographical_compare(s.begin(), s.end(), t.begin(), t.end(), lessthani_char); + } + } + + // string < string Case-Insensitively? + inline + bool + lessthani(std::string_view const s, std::string_view const t) + { + return std::lexicographical_compare(s.begin(), s.end(), t.begin(), t.end(), lessthani_char); + } + + // ASCII Lexical < Comparison + inline + bool + llt(std::string_view const s, std::string_view const t) + { + return (s < t); + } + + // ASCII Lexical <= Comparison + inline + bool + lle(std::string_view const s, std::string_view const t) + { + return (s <= t); + } + + // ASCII Lexical >= Comparison + inline + bool + lge(std::string_view const s, std::string_view const t) + { + return (s >= t); + } + + // ASCII Lexical < Comparison + inline + bool + lgt(std::string_view const s, std::string_view const t) + { + return (s > t); + } + + // Inspector ///// + + // Length + constexpr + std::string::size_type + len(std::string_view const s) + { + return s.length(); + } + + + // Length Space-Trimmed + constexpr + std::string::size_type + len_trim(std::string_view const s) + { + return s.find_last_not_of(' ') + 1; // Works if npos returned: npos + 1 == 0 + } + + // Index of a Substring + template< typename T > + constexpr + std::string::size_type + index(std::string_view const s, T const& t, bool const last = false) + { + return (last ? s.rfind(t) : s.find(t)); + } + + // Last Index of a Substring + template< typename T > + constexpr + std::string::size_type + rindex(std::string_view const s, T const& t) + { + return s.rfind(t); + } + + // Index of a Substring Case-Insensitively + inline + std::string::size_type + indexi(std::string_view const s, std::string_view const t, bool const last = false) + { + if (last) { + auto const i(std::find_end(s.begin(), s.end(), t.begin(), t.end(), equali_char)); + return (i == s.end() ? std::string::npos : static_cast(i - s.begin())); + } + else { + auto const i(std::search(s.begin(), s.end(), t.begin(), t.end(), equali_char)); + return (i == s.end() ? std::string::npos : static_cast(i - s.begin())); + } + } + + // Index of a Character Case-Insensitively + constexpr + std::string::size_type + indexi(std::string_view const s, char const c, bool const last = false) + { + if (last) { + for (std::string::size_type i = s.length() - 1, e = 0; i >= e; --i) { + if (equali_char(s[i], c)) return i; + } + } + else { + for (std::string::size_type i = 0, e = s.length(); i < e; ++i) { + if (equali_char(s[i], c)) return i; + } + } + return std::string::npos; + } + + // Last Index of a Substring Case-Insensitively + template< typename T > + inline + std::string::size_type + rindexi(std::string_view const s, T const& t) + { + return indexi(s, t, true); + } + + // string has a String/Character Case-Insensitively? + template< typename T > + inline + bool + hasi(std::string_view const s, T const& t) // Declaration above + { + return (indexi(s, t) != std::string::npos); + } + + // Find any Characters of Another String + template< typename T > + inline + std::string::size_type + scan(std::string_view const s, T const& t, bool const last = false) + { + return (last ? s.find_last_of(t) : s.find_first_of(t)); + } + + // Find any Characters not of Another String + template< typename T > + inline + std::string::size_type + verify(std::string_view const s, T const& t, bool const last = false) + { + return (last ? s.find_last_not_of(t) : s.find_first_not_of(t)); + } + + // Conversion ///// + + // Integer Value of a string + inline + int + ichar(std::string_view const s) + { + return (!s.empty() ? static_cast(s[0]) : 0); + } + + // Conversion to Numeric Types ///// + + // Modifier ///// + + // Uppercase a string + std::string& + uppercase(std::string& s); + + // Trim Trailing Space from a string + std::string& + trim(std::string& s); + + // Strip Specified Characters from a string's Tails + std::string& + strip(std::string& s, std::string const& chars); + + // Strip Specified Characters from a string's Right Tail + std::string& + rstrip(std::string& s, std::string const& chars); + + // Strip Space from a string's Tails + std::string& + strip(std::string& s); + + // Strip Space from a string's Right Tail + std::string& + rstrip(std::string& s); + + // Pad a string to a Specified Length + inline + std::string& + pad(std::string& s, std::string::size_type const len) + { + std::string::size_type const s_len(s.length()); + if (s_len < len) s.append(len - s_len, ' '); // Pad + return s; + } + + // Pare a string to a Specified Length + inline + std::string& + pare(std::string& s, std::string::size_type const len) + { + if (s.length() > len) s.erase(len); // Pare + return s; + } + + // Size a string to a Specified Length + std::string& + size(std::string& s, std::string::size_type const len); + + // Center a string wrt its Whitespace + std::string& + center(std::string& s); + + // Center a string with a Specified Length + std::string& + center(std::string& s, std::string::size_type const len); + + // Remove Repeat Characters from a Possibly Unsorted string Preserving Order + std::string& + unique(std::string& s); + + // Substring Replaced in a string + std::string& + replace(std::string& s, std::string_view const a, std::string_view const b); + + // Wrap in Double Quotes + inline + std::string& + quote(std::string& s) + { + s = '"' + s + '"'; + return s; + } + + // Overlay a string with Another string, Expanding Size as Needed + std::string& + overlay(std::string& s, std::string_view const t, std::string::size_type const pos = 0); + + // Generator ///// + + // Blank string of Specified Length + inline + std::string + blank(std::string::size_type const len) + { + return std::string(len, ' '); + } + + // Uppercased Copy of a string + std::string + uppercased(std::string_view const s); + + // Left-Justified Copy of a string + std::string + ljustified(std::string_view const s); + + // Right-Justified Copy of a string + std::string + rjustified(std::string_view const s); + + // Trailing Space Trimmed Copy of a string + std::string + trimmed(std::string_view const s); + + // Trailing Whitespace Trimmed Copy of a string + std::string + trimmed_whitespace(std::string_view const s); + + // Specified Characters Stripped from a string's Tails Copy of a string + std::string + stripped(std::string_view const s, std::string_view const chars); + + // Space Stripped from a string's Tails Copy of a string + std::string + stripped(std::string_view const s); + + // Whitespace Stripped from a string's Tails Copy of a string + std::string + stripped_whitespace(std::string_view const s); + + // Sized to a Specified Length Copy of a string + std::string + sized(std::string_view const s, std::string::size_type const len); + + // Centered in a string of Specified Length Copy of a string + std::string + centered(std::string_view const s, std::string::size_type const len); + + // Centered wrt Whitespace Copy of a string + inline + std::string + centered(std::string_view const s) + { + return centered(stripped_whitespace(s), s.length()); + } + + // Substring Replaced Copy of a string + inline + std::string + replaced(std::string_view const s, std::string_view const a, std::string_view const b) + { + std::string r(s); + replace(r, a, b); + return r; + } + + // Overlayed string with Another string, Expanding Size as Needed + std::string + overlayed(std::string_view const s, std::string_view const t, std::string::size_type const pos = 0); + + // Repeated Copies + std::string + repeated(std::string_view const s, int const n); + + // Repeated Copies + std::string + repeat(std::string_view const s, int const n); + + // Space-Free Head Copy of a string + std::string + head(std::string_view const s); + + // Concatenation: Non-template to Support Conversions + inline + std::string + operator +(std::string const& s, std::string const& t) + { + return std::string(s) += t; + } + + // Concatenation: Non-template to Support Conversions + inline + std::string + operator +(char const* const s, std::string const& t) + { + return std::string(s) += t; + } + + // Concatenation: Non-template to Support Conversions + inline + std::string + operator +(std::string const& s, char const* const t) + { + return s + std::string(t); + } + + // Conversion To std::string } // ObjexxFCL diff --git a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc index 2e16dc0b15b..c9ce3109add 100644 --- a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc +++ b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc @@ -8529,7 +8529,7 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOAS_ReportVariableResetTest) thisAirLoopDOASObjec.SimAirLoopHVACDOAS(*state, true, index); // verify doas air flow rate and heating rate HeatingCoilEquipConditions &mainHtgCoil = state->dataHeatingCoils->HeatingCoil(doasMainHCIndex); - EXPECT_EQ("OA HEATING COIL", mainHtgCoil.Name); + EXPECT_EQ("OA HEATING COIL", Util::makeUPPER(mainHtgCoil.Name)); EXPECT_EQ(0.5, thisAirLoopDOASObjec.SumMassFlowRate); EXPECT_NEAR(2130.0, mainHtgCoil.HeatingCoilRate, 1.0); // reset doas air flow rate to zero and verify the diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc index d1e47958c89..39c5c2e573d 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc @@ -406,10 +406,11 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVHeatCool_GetInputTest) GetZoneAirLoopEquipment(*state); GetSysInput(*state); - EXPECT_EQ("AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", state->dataSingleDuct->sd_airterminal(1).sysType); // AT SD VAV HeatCool Reheat Type - EXPECT_EQ("ZONE 1 VAV SYSTEM", state->dataSingleDuct->sd_airterminal(1).SysName); // AT SD VAV HeatCool Reheat Name - EXPECT_EQ("COIL:HEATING:ELECTRIC", state->dataSingleDuct->sd_airterminal(1).ReheatComp); // Reheat Coil Type - EXPECT_EQ("REHEAT COIL ZONE 1", state->dataSingleDuct->sd_airterminal(1).ReheatName); // Reheat Coil Name + EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:REHEAT", + Util::makeUPPER(state->dataSingleDuct->sd_airterminal(1).sysType)); // AT SD VAV HeatCool Reheat Type + EXPECT_EQ("ZONE 1 VAV SYSTEM", Util::makeUPPER(state->dataSingleDuct->sd_airterminal(1).SysName)); // AT SD VAV HeatCool Reheat Name + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(state->dataSingleDuct->sd_airterminal(1).ReheatComp)); // Reheat Coil Type + EXPECT_EQ("REHEAT COIL ZONE 1", Util::makeUPPER(state->dataSingleDuct->sd_airterminal(1).ReheatName)); // Reheat Coil Name } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheatVarSpeedFan_GetInputTest) @@ -530,10 +531,10 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheatVarSpeedFan_GetInputTest GetSysInput(*state); EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", - state->dataSingleDuct->sd_airterminal(1).sysType); // AT SD VAV HeatCool Reheat Type - EXPECT_EQ("SPACE1-1 VAV REHEAT", state->dataSingleDuct->sd_airterminal(1).SysName); // AT SD VAV HeatCool Reheat Name - EXPECT_EQ("COIL:HEATING:WATER", state->dataSingleDuct->sd_airterminal(1).ReheatComp); // Reheat Coil Type - EXPECT_EQ("SPACE1-1 ZONE COIL", state->dataSingleDuct->sd_airterminal(1).ReheatName); // Reheat Coil Name + state->dataSingleDuct->sd_airterminal(1).sysType); // AT SD VAV HeatCool Reheat Type + EXPECT_EQ("SPACE1-1 VAV REHEAT", Util::makeUPPER(state->dataSingleDuct->sd_airterminal(1).SysName)); // AT SD VAV HeatCool Reheat Name + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(state->dataSingleDuct->sd_airterminal(1).ReheatComp)); // Reheat Coil Type + EXPECT_EQ("SPACE1-1 ZONE COIL", Util::makeUPPER(state->dataSingleDuct->sd_airterminal(1).ReheatName)); // Reheat Coil Name } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheat_NormalActionTest) @@ -647,7 +648,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheat_NormalActionTest) Real64 MassFlowRateMaxAvail = state->dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate * state->dataEnvrn->StdRhoAir; EXPECT_EQ(1.0, state->dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate); EXPECT_EQ(1.0, MassFlowRateMaxAvail); - EXPECT_EQ("COIL:HEATING:ELECTRIC", state->dataSingleDuct->sd_airterminal(SysNum).ReheatComp); + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(state->dataSingleDuct->sd_airterminal(SysNum).ReheatComp)); EXPECT_ENUM_EQ(Action::Normal, state->dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction); EXPECT_EQ(0.2, state->dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); @@ -1628,7 +1629,7 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVReheatVSFan_DamperPositionTest) int InletNodeNum = Util::FindItemInList("ZONE 1 ATU IN NODE", state->dataLoopNodes->NodeID); EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", thisAirTerminal.sysType); EXPECT_EQ("VAV RHT VS FAN AIRTERM", thisAirTerminal.SysName); - EXPECT_EQ("COIL:HEATING:ELECTRIC", thisAirTerminal.ReheatComp); + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(thisAirTerminal.ReheatComp)); EXPECT_EQ("ZONE 1 REHEAT COIL", thisAirTerminal.ReheatName); EXPECT_EQ((int)HVAC::FanType::SystemModel, (int)thisAirTerminal.fanType); EXPECT_EQ("ZONE 1 VS FAN", thisAirTerminal.FanName); diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc index 0d2ad5f1a8a..6240df6dbff 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc @@ -7729,10 +7729,10 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) EXPECT_EQ((int)HVAC::MixerType::InletSide, (int)thisATMixer.type); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", state->dataDefineEquipment->AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ((int)HVAC::FanType::VAV, (int)thisFanCoil.fanType); - EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); - EXPECT_EQ("FCU COOLING COIL", thisFanCoil.CCoilName); - EXPECT_EQ("COIL:HEATING:WATER", thisFanCoil.HCoilType); - EXPECT_EQ("FCU HEATING COIL", thisFanCoil.HCoilName); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(thisFanCoil.CCoilType)); + EXPECT_EQ("FCU COOLING COIL", Util::makeUPPER(thisFanCoil.CCoilName)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(thisFanCoil.HCoilType)); + EXPECT_EQ("FCU HEATING COIL", Util::makeUPPER(thisFanCoil.HCoilName)); state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -8147,10 +8147,10 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) EXPECT_EQ((int)HVAC::MixerType::InletSide, (int)thisATMixer.type); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", state->dataDefineEquipment->AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ((int)HVAC::FanType::VAV, (int)thisFanCoil.fanType); - EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); - EXPECT_EQ("FCU COOLING COIL", thisFanCoil.CCoilName); - EXPECT_EQ("COIL:HEATING:WATER", thisFanCoil.HCoilType); - EXPECT_EQ("FCU HEATING COIL", thisFanCoil.HCoilName); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(thisFanCoil.CCoilType)); + EXPECT_EQ("FCU COOLING COIL", Util::makeUPPER(thisFanCoil.CCoilName)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(thisFanCoil.HCoilType)); + EXPECT_EQ("FCU HEATING COIL", Util::makeUPPER(thisFanCoil.HCoilName)); EXPECT_EQ("NIGHTCYCLE AVAILMGR", thisAvaiManager.Name); EXPECT_EQ((int)Avail::ManagerType::NightCycle, (int)thisAvaiManager.type); diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc index 35c3e561d91..0caa8e4181a 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc @@ -187,7 +187,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctSeriesPIUReheat_GetInputtest) GetPIUs(*state); ASSERT_EQ(1, state->dataPowerInductionUnits->NumSeriesPIUs); - EXPECT_EQ("SPACE1-1 ZONE COIL", state->dataPowerInductionUnits->PIU(1).HCoil); // heating coil name + EXPECT_EQ("SPACE1-1 ZONE COIL", Util::makeUPPER(state->dataPowerInductionUnits->PIU(1).HCoil)); // heating coil name EXPECT_EQ("COIL:HEATING:WATER", HCoilNamesUC[static_cast(state->dataPowerInductionUnits->PIU(1).HCoilType)]); // hot water heating coil EXPECT_GT(state->dataPowerInductionUnits->PIU(1).HotControlNode, 0); // none zero integer node index is expected diff --git a/tst/EnergyPlus/unit/AirflowNetworkConditions.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkConditions.unit.cc index 9a66b243352..9814ae17564 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkConditions.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkConditions.unit.cc @@ -168,10 +168,10 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestDefaultBehaviourOfSimulationControl EXPECT_EQ(state->afn->simulation_control.name, "AFNDefaultControl"); EXPECT_ENUM_EQ(AirflowNetwork::ControlType::MultizoneWithoutDistribution, state->afn->simulation_control.type); - EXPECT_EQ(state->afn->simulation_control.WPCCntr, "SURFACEAVERAGECALCULATION"); - EXPECT_EQ(state->afn->simulation_control.HeightOption, "OPENINGHEIGHT"); - EXPECT_EQ(state->afn->simulation_control.BldgType, "LOWRISE"); - EXPECT_EQ(state->afn->simulation_control.InitType, "ZERONODEPRESSURES"); + EXPECT_EQ(Util::makeUPPER(state->afn->simulation_control.WPCCntr), "SURFACEAVERAGECALCULATION"); + EXPECT_EQ(Util::makeUPPER(state->afn->simulation_control.HeightOption), "OPENINGHEIGHT"); + EXPECT_EQ(Util::makeUPPER(state->afn->simulation_control.BldgType), "LOWRISE"); + EXPECT_EQ(Util::makeUPPER(state->afn->simulation_control.InitType), "ZERONODEPRESSURES"); EXPECT_FALSE(state->afn->simulation_control.temperature_height_dependence); EXPECT_ENUM_EQ(AirflowNetwork::SimulationControl::Solver::SkylineLU, state->afn->simulation_control.solver); //// Use default values for numerical fields diff --git a/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitOperatingMode.unit.cc b/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitOperatingMode.unit.cc index 5ef8c3b0cd2..03ce716fd8b 100644 --- a/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitOperatingMode.unit.cc +++ b/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitOperatingMode.unit.cc @@ -68,8 +68,8 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitModeInput) EXPECT_TRUE(process_idf(idf_objects, false)); state->init_state(*state); CoilCoolingDXCurveFitOperatingMode thisMode(*state, "mode1"); - EXPECT_EQ("MODE1", thisMode.name); - EXPECT_EQ("MODE1SPEED1", thisMode.speeds[0].name); + EXPECT_EQ("MODE1", Util::makeUPPER(thisMode.name)); + EXPECT_EQ("MODE1SPEED1", Util::makeUPPER(thisMode.speeds[0].name)); } TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitOperatingMode_Sizing) @@ -168,7 +168,7 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitOperatingMode_Sizing) // Now check output tables to ensure that we also get the right units etc const std::string compType = "Coil:Cooling:DX:CurveFit:OperatingMode"; const std::string compName = thisMode.name; - EXPECT_EQ(compName, "COIL COOLING DX CURVE FIT OPERATING MODE 1"); + EXPECT_EQ(Util::makeUPPER(compName), "COIL COOLING DX CURVE FIT OPERATING MODE 1"); struct TestQuery { @@ -271,8 +271,8 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitCrankcaseHeaterCurve) int coilIndex = CoilCoolingDX::factory(*state, "Coil Cooling DX 1"); auto &thisCoil(state->dataCoilCoolingDX->coilCoolingDXs[coilIndex]); - EXPECT_EQ("COIL COOLING DX 1", thisCoil.name); - EXPECT_EQ("COIL COOLING DX CURVE FIT PERFORMANCE 1", thisCoil.performance->name); + EXPECT_EQ("COIL COOLING DX 1", Util::makeUPPER(thisCoil.name)); + EXPECT_EQ("COIL COOLING DX CURVE FIT PERFORMANCE 1", Util::makeUPPER(thisCoil.performance->name)); HVAC::CoilMode coilMode = HVAC::CoilMode::Normal; int speedNum = 1; diff --git a/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitPerformance.unit.cc b/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitPerformance.unit.cc index 7e32c6855a8..0b57b747469 100644 --- a/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitPerformance.unit.cc +++ b/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitPerformance.unit.cc @@ -61,8 +61,8 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitPerformanceInput) EXPECT_TRUE(process_idf(idf_objects, false)); state->init_state(*state); CoilCoolingDXCurveFitPerformance thisPerf(*state, "coilPerformance"); - EXPECT_EQ("COILPERFORMANCE", thisPerf.name); - EXPECT_EQ("BASEOPERATINGMODE", thisPerf.normalMode.name); + EXPECT_EQ("COILPERFORMANCE", Util::makeUPPER(thisPerf.name)); + EXPECT_EQ("BASEOPERATINGMODE", Util::makeUPPER(thisPerf.normalMode.name)); EXPECT_EQ((int)thisPerf.maxAvailCoilMode, (int)HVAC::CoilMode::Normal); } @@ -72,7 +72,7 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitPerformanceInputAlternateMode) EXPECT_TRUE(process_idf(idf_objects, false)); state->init_state(*state); CoilCoolingDXCurveFitPerformance thisPerf(*state, "coilPerformance"); - EXPECT_EQ("COILPERFORMANCE", thisPerf.name); - EXPECT_EQ("BASEOPERATINGMODE", thisPerf.normalMode.name); + EXPECT_EQ("COILPERFORMANCE", Util::makeUPPER(thisPerf.name)); + EXPECT_EQ("BASEOPERATINGMODE", Util::makeUPPER(thisPerf.normalMode.name)); EXPECT_EQ((int)thisPerf.maxAvailCoilMode, (int)HVAC::CoilMode::Enhanced); } diff --git a/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitSpeed.unit.cc b/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitSpeed.unit.cc index eda75e0566f..4afdd237d32 100644 --- a/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitSpeed.unit.cc +++ b/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitSpeed.unit.cc @@ -64,7 +64,7 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitSpeedInput) state->init_state(*state); CoilCoolingDXCurveFitSpeed thisSpeed(*state, "speed1"); - EXPECT_EQ("SPEED1", thisSpeed.name); + EXPECT_EQ("SPEED1", Util::makeUPPER(thisSpeed.name)); } TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitSpeedTest) @@ -74,7 +74,7 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitSpeedTest) state->init_state(*state); CoilCoolingDXCurveFitSpeed thisSpeed(*state, "speed1"); - EXPECT_EQ("SPEED1", thisSpeed.name); + EXPECT_EQ("SPEED1", Util::makeUPPER(thisSpeed.name)); CoilCoolingDXCurveFitOperatingMode thisMode; thisMode.ratedGrossTotalCap = 12000; diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index af15b4fad8b..0b12b35f288 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -5502,9 +5502,9 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_RegenAirHeaterHWCoilSizingTest) GetDesiccantDehumidifierInput(*state); EXPECT_EQ(1, state->dataDesiccantDehumidifiers->NumDesicDehums); EXPECT_EQ(1, state->dataDesiccantDehumidifiers->NumGenericDesicDehums); - EXPECT_EQ("DESICCANT 1", state->dataDesiccantDehumidifiers->DesicDehum(DesicDehumNum).Name); - EXPECT_EQ("DESICCANT REGEN COIL", state->dataDesiccantDehumidifiers->DesicDehum(DesicDehumNum).RegenCoilName); - EXPECT_EQ("COIL:HEATING:WATER", state->dataDesiccantDehumidifiers->DesicDehum(DesicDehumNum).RegenCoilType); + EXPECT_EQ("DESICCANT 1", Util::makeUPPER(state->dataDesiccantDehumidifiers->DesicDehum(DesicDehumNum).Name)); + EXPECT_EQ("DESICCANT REGEN COIL", Util::makeUPPER(state->dataDesiccantDehumidifiers->DesicDehum(DesicDehumNum).RegenCoilName)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(state->dataDesiccantDehumidifiers->DesicDehum(DesicDehumNum).RegenCoilType)); CompName = state->dataDesiccantDehumidifiers->DesicDehum(DesicDehumNum).Name; CompIndex = state->dataDesiccantDehumidifiers->NumGenericDesicDehums; diff --git a/tst/EnergyPlus/unit/EMSManager.unit.cc b/tst/EnergyPlus/unit/EMSManager.unit.cc index b7d3af3fb49..b2e2632174b 100644 --- a/tst/EnergyPlus/unit/EMSManager.unit.cc +++ b/tst/EnergyPlus/unit/EMSManager.unit.cc @@ -2778,9 +2778,9 @@ TEST_F(EnergyPlusFixture, EMSManager_Sensor_On_ScheduleConstant) EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::SetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(anyEMSRan); // this stays the same - EXPECT_EQ("SCHEDULECONSTANT_SENSOR", sensor.Name); - EXPECT_EQ("SCHEDULECONSTANT", sensor.UniqueKeyName); - EXPECT_EQ("SCHEDULE VALUE", sensor.OutputVarName); + EXPECT_EQ("SCHEDULECONSTANT_SENSOR", Util::makeUPPER(sensor.Name)); + EXPECT_EQ("SCHEDULECONSTANT", Util::makeUPPER(sensor.UniqueKeyName)); + EXPECT_EQ("SCHEDULE VALUE", Util::makeUPPER(sensor.OutputVarName)); EXPECT_EQ(0, sensor.Index); EXPECT_EQ(1, sensor.VariableNum); // CheckedOkay and sched are ok now diff --git a/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc b/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc index 62328be9c98..afb0b017344 100644 --- a/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc +++ b/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc @@ -487,19 +487,19 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ComputeEscalatedEnergyCosts) TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_GetMonthNumber) { - EXPECT_EQ(0, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("January"))); - EXPECT_EQ(1, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("February"))); - EXPECT_EQ(2, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("March"))); - EXPECT_EQ(3, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("April"))); - EXPECT_EQ(4, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("May"))); - EXPECT_EQ(5, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("June"))); - EXPECT_EQ(6, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("July"))); - EXPECT_EQ(7, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("August"))); - EXPECT_EQ(8, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("September"))); - EXPECT_EQ(9, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("October"))); - EXPECT_EQ(10, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("November"))); - EXPECT_EQ(11, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("December"))); - EXPECT_EQ(-1, getEnumValue(Util::MonthNamesUC, Util::makeUPPER("Hexember"))); + EXPECT_EQ(0, getEnumValue(Util::MonthNamesUC, "January")); + EXPECT_EQ(1, getEnumValue(Util::MonthNamesUC, "February")); + EXPECT_EQ(2, getEnumValue(Util::MonthNamesUC, "March")); + EXPECT_EQ(3, getEnumValue(Util::MonthNamesUC, "April")); + EXPECT_EQ(4, getEnumValue(Util::MonthNamesUC, "May")); + EXPECT_EQ(5, getEnumValue(Util::MonthNamesUC, "June")); + EXPECT_EQ(6, getEnumValue(Util::MonthNamesUC, "July")); + EXPECT_EQ(7, getEnumValue(Util::MonthNamesUC, "August")); + EXPECT_EQ(8, getEnumValue(Util::MonthNamesUC, "September")); + EXPECT_EQ(9, getEnumValue(Util::MonthNamesUC, "October")); + EXPECT_EQ(10, getEnumValue(Util::MonthNamesUC, "November")); + EXPECT_EQ(11, getEnumValue(Util::MonthNamesUC, "December")); + EXPECT_EQ(-1, getEnumValue(Util::MonthNamesUC, "Hexember")); } TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ExpressAsCashFlows) diff --git a/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc b/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc index 3789e4c4ceb..8813df35546 100644 --- a/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc +++ b/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc @@ -1023,7 +1023,7 @@ TEST_F(EnergyPlusFixture, Battery_LiIonNmc_Constructor) ASSERT_TRUE(process_idf(idf_objects)); state->init_state(*state); ElectricStorage battery1{*state, "Battery1"}; - ASSERT_TRUE(Util::SameString(battery1.name(), "Battery1")); + ASSERT_TRUE(equali(battery1.name(), "Battery1")); ASSERT_THROW(ElectricStorage battery2(*state, "Battery2"), EnergyPlus::FatalError); std::string const error_string = delimited_string( diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index 0600ade9561..5314daae864 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -257,10 +257,10 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilHeatingTest) GetFanCoilUnits(*state); EXPECT_ENUM_EQ(CCM::MultiSpeedFan, state->dataFanCoilUnits->FanCoil(1).CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", state->dataFanCoilUnits->FanCoil(1).OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)state->dataFanCoilUnits->FanCoil(1).fanType); - EXPECT_EQ("COIL:COOLING:WATER", state->dataFanCoilUnits->FanCoil(1).CCoilType); - EXPECT_EQ("COIL:HEATING:WATER", state->dataFanCoilUnits->FanCoil(1).HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).CCoilType)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).HCoilType)); state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -577,10 +577,10 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilCoolingTest) GetFanCoilUnits(*state); EXPECT_ENUM_EQ(CCM::MultiSpeedFan, state->dataFanCoilUnits->FanCoil(1).CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", state->dataFanCoilUnits->FanCoil(1).OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)state->dataFanCoilUnits->FanCoil(1).fanType); - EXPECT_EQ("COIL:COOLING:WATER", state->dataFanCoilUnits->FanCoil(1).CCoilType); - EXPECT_EQ("COIL:HEATING:WATER", state->dataFanCoilUnits->FanCoil(1).HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).CCoilType)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).HCoilType)); state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -894,10 +894,10 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilHeatingTest) GetFanCoilUnits(*state); EXPECT_ENUM_EQ(CCM::ConsFanVarFlow, state->dataFanCoilUnits->FanCoil(1).CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", state->dataFanCoilUnits->FanCoil(1).OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)state->dataFanCoilUnits->FanCoil(1).fanType); - EXPECT_EQ("COIL:COOLING:WATER", state->dataFanCoilUnits->FanCoil(1).CCoilType); - EXPECT_EQ("COIL:HEATING:WATER", state->dataFanCoilUnits->FanCoil(1).HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).CCoilType)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).HCoilType)); state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -1292,10 +1292,10 @@ TEST_F(EnergyPlusFixture, ElectricCoilFanCoilHeatingTest) GetFanCoilUnits(*state); EXPECT_ENUM_EQ(CCM::ConsFanVarFlow, state->dataFanCoilUnits->FanCoil(1).CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", state->dataFanCoilUnits->FanCoil(1).OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)state->dataFanCoilUnits->FanCoil(1).fanType); - EXPECT_EQ("COIL:COOLING:WATER", state->dataFanCoilUnits->FanCoil(1).CCoilType); - EXPECT_EQ("COIL:HEATING:ELECTRIC", state->dataFanCoilUnits->FanCoil(1).HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).CCoilType)); + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).HCoilType)); state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -1620,10 +1620,10 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilCoolingTest) GetFanCoilUnits(*state); EXPECT_ENUM_EQ(CCM::ConsFanVarFlow, state->dataFanCoilUnits->FanCoil(1).CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", state->dataFanCoilUnits->FanCoil(1).OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)state->dataFanCoilUnits->FanCoil(1).fanType); - EXPECT_EQ("COIL:COOLING:WATER", state->dataFanCoilUnits->FanCoil(1).CCoilType); - EXPECT_EQ("COIL:HEATING:WATER", state->dataFanCoilUnits->FanCoil(1).HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).CCoilType)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).HCoilType)); state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -1992,10 +1992,10 @@ TEST_F(EnergyPlusFixture, FanCoil_ASHRAE90VariableFan) GetFanCoilUnits(*state); EXPECT_ENUM_EQ(CCM::ASHRAE, state->dataFanCoilUnits->FanCoil(1).CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", state->dataFanCoilUnits->FanCoil(1).OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)state->dataFanCoilUnits->FanCoil(1).fanType); - EXPECT_EQ("COIL:COOLING:WATER", state->dataFanCoilUnits->FanCoil(1).CCoilType); - EXPECT_EQ("COIL:HEATING:WATER", state->dataFanCoilUnits->FanCoil(1).HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).CCoilType)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).HCoilType)); state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -2715,10 +2715,10 @@ TEST_F(EnergyPlusFixture, FanCoil_CyclingFanMode) GetFanCoilUnits(*state); EXPECT_ENUM_EQ(CCM::CycFan, state->dataFanCoilUnits->FanCoil(1).CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", state->dataFanCoilUnits->FanCoil(1).OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)state->dataFanCoilUnits->FanCoil(1).fanType); - EXPECT_EQ("COIL:COOLING:WATER", state->dataFanCoilUnits->FanCoil(1).CCoilType); - EXPECT_EQ("COIL:HEATING:WATER", state->dataFanCoilUnits->FanCoil(1).HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).CCoilType)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).HCoilType)); state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -3157,10 +3157,10 @@ TEST_F(EnergyPlusFixture, FanCoil_FanSystemModelCyclingFanMode) auto &thisFanCoil(state->dataFanCoilUnits->FanCoil(1)); EXPECT_ENUM_EQ(CCM::CycFan, thisFanCoil.CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", thisFanCoil.OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(thisFanCoil.OAMixType)); EXPECT_EQ((int)HVAC::FanType::SystemModel, (int)thisFanCoil.fanType); - EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); - EXPECT_EQ("COIL:HEATING:WATER", thisFanCoil.HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(thisFanCoil.CCoilType)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(thisFanCoil.HCoilType)); state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -3555,9 +3555,9 @@ TEST_F(EnergyPlusFixture, FanCoil_ElecHeatCoilMultiSpeedFanCyclingFanMode) GetFanCoilUnits(*state); auto &thisFanCoil(state->dataFanCoilUnits->FanCoil(1)); EXPECT_ENUM_EQ(CCM::MultiSpeedFan, thisFanCoil.CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", thisFanCoil.OAMixType); - EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); - EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(thisFanCoil.OAMixType)); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(thisFanCoil.CCoilType)); + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(thisFanCoil.HCoilType)); EXPECT_EQ((int)HVAC::FanType::SystemModel, (int)thisFanCoil.fanType); state->dataPlnt->TotNumLoops = 1; @@ -3921,9 +3921,9 @@ TEST_F(EnergyPlusFixture, FanCoil_ElecHeatCoilMultiSpeedFanContFanMode) GetFanCoilUnits(*state); auto &thisFanCoil(state->dataFanCoilUnits->FanCoil(1)); EXPECT_ENUM_EQ(CCM::MultiSpeedFan, thisFanCoil.CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", thisFanCoil.OAMixType); - EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); - EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(thisFanCoil.OAMixType)); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(thisFanCoil.CCoilType)); + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(thisFanCoil.HCoilType)); EXPECT_EQ((int)HVAC::FanType::SystemModel, (int)thisFanCoil.fanType); state->dataPlnt->TotNumLoops = 1; @@ -4286,9 +4286,9 @@ TEST_F(EnergyPlusFixture, FanCoil_CalcFanCoilElecHeatCoilPLRResidual) GetFanCoilUnits(*state); auto &thisFanCoil(state->dataFanCoilUnits->FanCoil(1)); EXPECT_ENUM_EQ(CCM::MultiSpeedFan, thisFanCoil.CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", thisFanCoil.OAMixType); - EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); - EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(thisFanCoil.OAMixType)); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(thisFanCoil.CCoilType)); + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(thisFanCoil.HCoilType)); EXPECT_EQ((int)HVAC::FanType::SystemModel, (int)thisFanCoil.fanType); state->dataPlnt->TotNumLoops = 1; @@ -4601,10 +4601,10 @@ TEST_F(EnergyPlusFixture, FanCoil_ElectricHeatingCoilASHRAE90VariableFan) GetFanCoilUnits(*state); auto &thisFanCoil(state->dataFanCoilUnits->FanCoil(1)); EXPECT_ENUM_EQ(CCM::ASHRAE, thisFanCoil.CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", thisFanCoil.OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(thisFanCoil.OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)thisFanCoil.fanType); - EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); - EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(thisFanCoil.CCoilType)); + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(thisFanCoil.HCoilType)); state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); diff --git a/tst/EnergyPlus/unit/FaultsManager.unit.cc b/tst/EnergyPlus/unit/FaultsManager.unit.cc index 85f41ed1936..cdf81bd87d2 100644 --- a/tst/EnergyPlus/unit/FaultsManager.unit.cc +++ b/tst/EnergyPlus/unit/FaultsManager.unit.cc @@ -427,7 +427,7 @@ TEST_F(EnergyPlusFixture, FaultsManager_TemperatureSensorOffset_CoilSAT) // Check EXPECT_EQ(2.0, state->dataFaultsMgr->FaultsCoilSATSensor(1).Offset); - EXPECT_EQ("COIL:COOLING:WATER", state->dataFaultsMgr->FaultsCoilSATSensor(1).CoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(state->dataFaultsMgr->FaultsCoilSATSensor(1).CoilType)); EXPECT_TRUE(state->dataHVACControllers->ControllerProps(1).FaultyCoilSATFlag); EXPECT_EQ(1, state->dataHVACControllers->ControllerProps(1).FaultyCoilSATIndex); } diff --git a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc index 5ca7f0d39b3..02c0410794f 100644 --- a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc +++ b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc @@ -172,8 +172,8 @@ std::vector EnergyPlusFixture::read_lines_in_file(fs::path const &f bool EnergyPlusFixture::compare_eso_stream(std::string const &expected_string, bool reset_stream) { auto const stream_str = state->files.eso.get_output(); - EXPECT_EQ(expected_string, stream_str); - bool are_equal = (expected_string == stream_str); + EXPECT_EQ(Util::makeUPPER(expected_string), Util::makeUPPER(stream_str)); + bool are_equal = equali(expected_string, stream_str); if (reset_stream) { state->files.eso.open_as_stringstream(); } @@ -183,8 +183,8 @@ bool EnergyPlusFixture::compare_eso_stream(std::string const &expected_string, b bool EnergyPlusFixture::compare_eio_stream(std::string const &expected_string, bool reset_stream) { auto const stream_str = state->files.eio.get_output(); - EXPECT_EQ(expected_string, stream_str); - bool are_equal = (expected_string == stream_str); + EXPECT_EQ(Util::makeUPPER(expected_string), Util::makeUPPER(stream_str)); + bool are_equal = equali(expected_string, stream_str); if (reset_stream) { state->files.eio.open_as_stringstream(); } @@ -193,8 +193,8 @@ bool EnergyPlusFixture::compare_eio_stream(std::string const &expected_string, b bool EnergyPlusFixture::compare_eio_stream_substring(std::string const &search_string, bool reset_stream) { - auto const stream_str = state->files.eio.get_output(); - bool const found = stream_str.find(search_string) != std::string::npos; + auto const stream_str = Util::makeUPPER(state->files.eio.get_output()); + bool const found = stream_str.find(Util::makeUPPER(search_string)) != std::string::npos; EXPECT_TRUE(found); if (reset_stream) { state->files.eio.open_as_stringstream(); @@ -205,8 +205,8 @@ bool EnergyPlusFixture::compare_eio_stream_substring(std::string const &search_s bool EnergyPlusFixture::compare_mtr_stream(std::string const &expected_string, bool reset_stream) { auto const stream_str = state->files.mtr.get_output(); - EXPECT_EQ(expected_string, stream_str); - bool are_equal = (expected_string == stream_str); + EXPECT_EQ(Util::makeUPPER(expected_string), Util::makeUPPER(stream_str)); + bool are_equal = equali(expected_string, stream_str); if (reset_stream) { state->files.mtr.open_as_stringstream(); } @@ -216,8 +216,8 @@ bool EnergyPlusFixture::compare_mtr_stream(std::string const &expected_string, b bool EnergyPlusFixture::compare_err_stream(std::string const &expected_string, bool reset_stream) { auto const stream_str = this->err_stream->str(); - EXPECT_EQ(expected_string, stream_str); - bool are_equal = (expected_string == stream_str); + EXPECT_EQ(Util::makeUPPER(expected_string), Util::makeUPPER(stream_str)); + bool are_equal = equali(expected_string, stream_str); if (reset_stream) { this->err_stream->str(std::string()); } diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 0e442e01ec8..b2fe1294d83 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -8177,33 +8177,33 @@ TEST_F(EnergyPlusFixture, VRFTU_SupplementalHeatingCoilGetInput) auto &VRFTU_1(state->dataHVACVarRefFlow->VRFTU(1)); // Check the results - EXPECT_EQ(VRFTU_1.Name, "TU1"); - EXPECT_EQ(VRFTU_1.SuppHeatCoilType, "COIL:HEATING:ELECTRIC"); - EXPECT_EQ(VRFTU_1.SuppHeatCoilName, "TU1 SUPP HEATING COIL"); + EXPECT_EQ(Util::makeUPPER(VRFTU_1.Name), "TU1"); + EXPECT_EQ(Util::makeUPPER(VRFTU_1.SuppHeatCoilType), "COIL:HEATING:ELECTRIC"); + EXPECT_EQ(Util::makeUPPER(VRFTU_1.SuppHeatCoilName), "TU1 SUPP HEATING COIL"); auto &VRFTU_2(state->dataHVACVarRefFlow->VRFTU(2)); // Check the results - EXPECT_EQ(VRFTU_2.Name, "TU2"); - EXPECT_EQ(VRFTU_2.SuppHeatCoilType, "COIL:HEATING:FUEL"); - EXPECT_EQ(VRFTU_2.SuppHeatCoilName, "TU2 SUPP HEATING COIL"); + EXPECT_EQ(Util::makeUPPER(VRFTU_2.Name), "TU2"); + EXPECT_EQ(Util::makeUPPER(VRFTU_2.SuppHeatCoilType), "COIL:HEATING:FUEL"); + EXPECT_EQ(Util::makeUPPER(VRFTU_2.SuppHeatCoilName), "TU2 SUPP HEATING COIL"); auto &VRFTU_3(state->dataHVACVarRefFlow->VRFTU(3)); // Check the results - EXPECT_EQ(VRFTU_3.Name, "TU3"); - EXPECT_EQ(VRFTU_3.SuppHeatCoilType, "COIL:HEATING:WATER"); - EXPECT_EQ(VRFTU_3.SuppHeatCoilName, "TU3 SUPP HEATING COIL"); + EXPECT_EQ(Util::makeUPPER(VRFTU_3.Name), "TU3"); + EXPECT_EQ(Util::makeUPPER(VRFTU_3.SuppHeatCoilType), "COIL:HEATING:WATER"); + EXPECT_EQ(Util::makeUPPER(VRFTU_3.SuppHeatCoilName), "TU3 SUPP HEATING COIL"); auto &VRFTU_4(state->dataHVACVarRefFlow->VRFTU(4)); // Check the results - EXPECT_EQ(VRFTU_4.Name, "TU4"); - EXPECT_EQ(VRFTU_4.SuppHeatCoilType, "COIL:HEATING:FUEL"); - EXPECT_EQ(VRFTU_4.SuppHeatCoilName, "TU4 SUPP HEATING COIL"); + EXPECT_EQ(Util::makeUPPER(VRFTU_4.Name), "TU4"); + EXPECT_EQ(Util::makeUPPER(VRFTU_4.SuppHeatCoilType), "COIL:HEATING:FUEL"); + EXPECT_EQ(Util::makeUPPER(VRFTU_4.SuppHeatCoilName), "TU4 SUPP HEATING COIL"); auto &VRFTU_5(state->dataHVACVarRefFlow->VRFTU(5)); // Check the results - EXPECT_EQ(VRFTU_5.Name, "TU5"); - EXPECT_EQ(VRFTU_5.SuppHeatCoilType, "COIL:HEATING:STEAM"); - EXPECT_EQ(VRFTU_5.SuppHeatCoilName, "TU5 SUPP HEATING COIL"); + EXPECT_EQ(Util::makeUPPER(VRFTU_5.Name), "TU5"); + EXPECT_EQ(Util::makeUPPER(VRFTU_5.SuppHeatCoilType), "COIL:HEATING:STEAM"); + EXPECT_EQ(Util::makeUPPER(VRFTU_5.SuppHeatCoilName), "TU5 SUPP HEATING COIL"); } TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilElectric) diff --git a/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc index c2fcbb7833b..a3a27488068 100644 --- a/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc @@ -528,9 +528,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceAirManager_GetInfiltrationAndVentilation) for (int itemNum = 0; itemNum <= numInstances - 1; ++itemNum) { auto &thisInfiltration = state->dataHeatBal->Infiltration[itemNum]; auto &thisVentilation = state->dataHeatBal->Ventilation[itemNum]; - EXPECT_TRUE(Util::SameString(infilNames[itemNum], thisInfiltration.Name)); + EXPECT_TRUE(equali(infilNames[itemNum], thisInfiltration.Name)); EXPECT_EQ(thisInfiltration.DesignLevel, flows[itemNum]); - EXPECT_TRUE(Util::SameString(ventNames[itemNum], thisVentilation.Name)); + EXPECT_TRUE(equali(ventNames[itemNum], thisVentilation.Name)); EXPECT_EQ(thisVentilation.DesignLevel, flows[itemNum]); EXPECT_EQ(thisInfiltration.ZonePtr, zoneNums[itemNum]); EXPECT_EQ(thisVentilation.ZonePtr, zoneNums[itemNum]); @@ -962,9 +962,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceAirManager_GetMixingAndCrossMixing) for (int itemNum = 0; itemNum <= numInstances - 1; ++itemNum) { auto &thisMixing = state->dataHeatBal->Mixing[itemNum]; auto &thisCrossMixing = state->dataHeatBal->CrossMixing[itemNum]; - EXPECT_TRUE(Util::SameString(mixNames[itemNum], thisMixing.Name)); + EXPECT_TRUE(equali(mixNames[itemNum], thisMixing.Name)); EXPECT_EQ(thisMixing.DesignLevel, flows[itemNum]); - EXPECT_TRUE(Util::SameString(crossMixNames[itemNum], thisCrossMixing.Name)); + EXPECT_TRUE(equali(crossMixNames[itemNum], thisCrossMixing.Name)); EXPECT_EQ(thisCrossMixing.DesignLevel, flows[itemNum]); EXPECT_EQ(thisMixing.ZonePtr, zoneNums[itemNum]); EXPECT_EQ(thisCrossMixing.ZonePtr, zoneNums[itemNum]); diff --git a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc index daea37443e1..77b6b20a71e 100644 --- a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc @@ -574,9 +574,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest) "radiant or solar enclosure name."}); EXPECT_TRUE(compare_err_stream(error_string, true)); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(1).Name, "Enclosure 1"); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(2).Name, "Enclosure 2"); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(3).Name, "Space 3"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(1).Name), "ENCLOSURE 1"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(2).Name), "ENCLOSURE 2"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(3).Name), "SPACE 3"); } TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest2) @@ -673,9 +673,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest2) "6\" did not find a matching radiant or solar enclosure name."}); EXPECT_TRUE(compare_err_stream(error_string, true)); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(1).Name, "PERIMETER ZONES"); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(2).Name, "Enclosure 2"); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(3).Name, "Space 3"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(1).Name), "PERIMETER ZONES"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(2).Name), "ENCLOSURE 2"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(3).Name), "SPACE 3"); } TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest3) @@ -775,9 +775,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest3) "radiant or solar enclosure name."}); EXPECT_TRUE(compare_err_stream(error_string, true)); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(1).Name, "Enclosure 1"); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(2).Name, "Enclosure 2"); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(3).Name, "Space 3"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(1).Name), "ENCLOSURE 1"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(2).Name), "ENCLOSURE 2"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(3).Name), "SPACE 3"); } TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest4) @@ -874,9 +874,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest4) "6\" did not find a matching radiant or solar enclosure name."}); EXPECT_TRUE(compare_err_stream(error_string, true)); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(1).Name, "PERIMETER ZONES"); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(2).Name, "Enclosure 2"); - EXPECT_EQ(state->dataViewFactor->EnclRadInfo(3).Name, "Space 3"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(1).Name), "PERIMETER ZONES"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(2).Name), "ENCLOSURE 2"); + EXPECT_EQ(Util::makeUPPER(state->dataViewFactor->EnclRadInfo(3).Name), "SPACE 3"); } TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_ViewFactorAngleLimitTest) diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index c41dd9370d0..81ac31e5903 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -2561,7 +2561,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_SurfaceCOnstructionIndexTest AllocateSurfaceHeatBalArrays(*state); // allocates a host of variables related to CTF calculations OutputProcessor::GetReportVariableInput(*state); - EXPECT_EQ(state->dataOutputProcessor->reqVars[1]->name, "SURFACE CONSTRUCTION INDEX"); + EXPECT_EQ(Util::makeUPPER(state->dataOutputProcessor->reqVars[1]->name), "SURFACE CONSTRUCTION INDEX"); } TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceAddSourceTerm) diff --git a/tst/EnergyPlus/unit/InputProcessor.unit.cc b/tst/EnergyPlus/unit/InputProcessor.unit.cc index 3e15705a63b..57f1879481f 100644 --- a/tst/EnergyPlus/unit/InputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/InputProcessor.unit.cc @@ -4764,8 +4764,8 @@ TEST_F(InputProcessorFixture, epJSONgetFieldValue_extensiblesFromIDF) } EXPECT_TRUE(Util::SameString(equipmentNames[0], "Baseboard Heat")); EXPECT_TRUE(Util::SameString(equipmentTypes[0], "ZoneHVAC:Baseboard:RadiantConvective:Electric")); - EXPECT_TRUE(Util::SameString(coolFracSchedNames[0], "")); - EXPECT_TRUE(Util::SameString(heatFracSchedNames[0], "")); + EXPECT_TRUE(coolFracSchedNames[0] == ""); + EXPECT_TRUE(heatFracSchedNames[0] == ""); EXPECT_EQ(coolSeqNums[0], 0); EXPECT_EQ(heatSeqNums[0], 3); @@ -4779,8 +4779,8 @@ TEST_F(InputProcessorFixture, epJSONgetFieldValue_extensiblesFromIDF) EXPECT_TRUE(Util::SameString(equipmentNames[2], "Exhaust Fan")); EXPECT_TRUE(Util::SameString(equipmentTypes[2], "Fan:ZoneExhaust")); - EXPECT_TRUE(Util::SameString(coolFracSchedNames[2], "")); - EXPECT_TRUE(Util::SameString(heatFracSchedNames[2], "")); + EXPECT_TRUE(coolFracSchedNames[2] == ""); + EXPECT_TRUE(heatFracSchedNames[2] == ""); EXPECT_EQ(coolSeqNums[2], 1); EXPECT_EQ(heatSeqNums[2], 1); } diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 96d906e67f0..1b787680a41 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -2430,37 +2430,37 @@ namespace OutputProcessor { EXPECT_EQ(6, op->reqVars.size()); EXPECT_EQ("", op->reqVars[0]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[0]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[0]->name)); EXPECT_EQ((int)ReportFreq::TimeStep, (int)op->reqVars[0]->freq); EXPECT_EQ(nullptr, op->reqVars[0]->sched); EXPECT_TRUE(op->reqVars[0]->Used); EXPECT_EQ("", op->reqVars[1]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[1]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[1]->name)); EXPECT_EQ((int)ReportFreq::Hour, (int)op->reqVars[1]->freq); EXPECT_EQ(nullptr, op->reqVars[1]->sched); EXPECT_TRUE(op->reqVars[1]->Used); EXPECT_EQ("", op->reqVars[2]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[2]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[2]->name)); EXPECT_EQ((int)ReportFreq::Day, (int)op->reqVars[2]->freq); EXPECT_EQ(nullptr, op->reqVars[2]->sched); EXPECT_TRUE(op->reqVars[2]->Used); EXPECT_EQ("", op->reqVars[3]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[3]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[3]->name)); EXPECT_EQ((int)ReportFreq::Month, (int)op->reqVars[3]->freq); EXPECT_EQ(nullptr, op->reqVars[3]->sched); EXPECT_TRUE(op->reqVars[3]->Used); EXPECT_EQ("", op->reqVars[4]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[4]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[4]->name)); EXPECT_EQ((int)ReportFreq::Simulation, (int)op->reqVars[4]->freq); EXPECT_EQ(nullptr, op->reqVars[4]->sched); EXPECT_TRUE(op->reqVars[4]->Used); EXPECT_EQ("", op->reqVars[4]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[4]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[4]->name)); EXPECT_EQ((int)ReportFreq::Simulation, (int)op->reqVars[4]->freq); EXPECT_EQ(nullptr, op->reqVars[4]->sched); EXPECT_TRUE(op->reqVars[4]->Used); @@ -2699,31 +2699,31 @@ namespace OutputProcessor { EXPECT_EQ(5, op->reqVars.size()); EXPECT_EQ("", op->reqVars[0]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[0]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[0]->name)); EXPECT_EQ((int)ReportFreq::TimeStep, (int)op->reqVars[0]->freq); EXPECT_EQ(nullptr, op->reqVars[0]->sched); EXPECT_TRUE(op->reqVars[0]->Used); EXPECT_EQ("", op->reqVars[1]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[1]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[1]->name)); EXPECT_EQ((int)ReportFreq::Hour, (int)op->reqVars[1]->freq); EXPECT_EQ(nullptr, op->reqVars[1]->sched); EXPECT_TRUE(op->reqVars[1]->Used); EXPECT_EQ("", op->reqVars[2]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[2]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[2]->name)); EXPECT_EQ((int)ReportFreq::Day, (int)op->reqVars[2]->freq); EXPECT_EQ(nullptr, op->reqVars[2]->sched); EXPECT_TRUE(op->reqVars[2]->Used); EXPECT_EQ("", op->reqVars[3]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[3]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[3]->name)); EXPECT_EQ((int)ReportFreq::Month, (int)op->reqVars[3]->freq); EXPECT_EQ(nullptr, op->reqVars[3]->sched); EXPECT_TRUE(op->reqVars[3]->Used); EXPECT_EQ("", op->reqVars[4]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[4]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[4]->name)); EXPECT_EQ((int)ReportFreq::Simulation, (int)op->reqVars[4]->freq); EXPECT_EQ(nullptr, op->reqVars[4]->sched); EXPECT_TRUE(op->reqVars[4]->Used); @@ -2777,7 +2777,7 @@ namespace OutputProcessor { EXPECT_EQ((int)VariableType::Real, (int)op->ddOutVars[0]->variableType); EXPECT_EQ(-1, op->ddOutVars[0]->Next); EXPECT_FALSE(op->ddOutVars[0]->ReportedOnDDFile); - EXPECT_EQ("Site Outdoor Air Drybulb Temperature", op->ddOutVars[0]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->ddOutVars[0]->name)); EXPECT_EQ((int)Constant::Units::C, (int)op->ddOutVars[0]->units); EXPECT_EQ((int)TimeStepType::Zone, (int)op->ddOutVars[1]->timeStepType); @@ -2785,7 +2785,7 @@ namespace OutputProcessor { EXPECT_EQ((int)VariableType::Real, (int)op->ddOutVars[1]->variableType); EXPECT_EQ(-1, op->ddOutVars[1]->Next); EXPECT_FALSE(op->ddOutVars[1]->ReportedOnDDFile); - EXPECT_EQ("Site Outdoor Air Wetbulb Temperature", op->ddOutVars[1]->name); + EXPECT_EQ("SITE OUTDOOR AIR WETBULB TEMPERATURE", Util::makeUPPER(op->ddOutVars[1]->name)); EXPECT_EQ((int)Constant::Units::C, (int)op->ddOutVars[1]->units); EXPECT_EQ((int)TimeStepType::Zone, (int)op->ddOutVars[2]->timeStepType); @@ -2793,7 +2793,7 @@ namespace OutputProcessor { EXPECT_EQ((int)VariableType::Real, (int)op->ddOutVars[2]->variableType); EXPECT_EQ(-1, op->ddOutVars[2]->Next); EXPECT_FALSE(op->ddOutVars[2]->ReportedOnDDFile); - EXPECT_EQ("Site Outdoor Air Humidity Ratio", op->ddOutVars[2]->name); + EXPECT_EQ("SITE OUTDOOR AIR HUMIDITY RATIO", Util::makeUPPER(op->ddOutVars[2]->name)); EXPECT_EQ((int)Constant::Units::kgWater_kgDryAir, (int)op->ddOutVars[2]->units); EXPECT_EQ((int)TimeStepType::Zone, (int)op->ddOutVars[3]->timeStepType); @@ -2801,7 +2801,7 @@ namespace OutputProcessor { EXPECT_EQ((int)VariableType::Real, (int)op->ddOutVars[3]->variableType); EXPECT_EQ(-1, op->ddOutVars[3]->Next); EXPECT_FALSE(op->ddOutVars[3]->ReportedOnDDFile); - EXPECT_EQ("Site Outdoor Air Relative Humidity", op->ddOutVars[3]->name); + EXPECT_EQ("SITE OUTDOOR AIR RELATIVE HUMIDITY", Util::makeUPPER(op->ddOutVars[3]->name)); EXPECT_EQ((int)Constant::Units::Perc, (int)op->ddOutVars[3]->units); } @@ -2832,7 +2832,7 @@ namespace OutputProcessor { // EXPECT_EQ(1, op->NumExtraVars); EXPECT_EQ("", op->reqVars[0]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[0]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[0]->name)); EXPECT_EQ((int)ReportFreq::Simulation, (int)op->reqVars[0]->freq); EXPECT_EQ(nullptr, op->reqVars[0]->sched); EXPECT_EQ(true, op->reqVars[0]->Used); @@ -2842,7 +2842,7 @@ namespace OutputProcessor { EXPECT_EQ((int)VariableType::Real, (int)op->ddOutVars[0]->variableType); EXPECT_EQ(-1, op->ddOutVars[0]->Next); EXPECT_FALSE(op->ddOutVars[0]->ReportedOnDDFile); - EXPECT_EQ("Site Outdoor Air Drybulb Temperature", op->ddOutVars[0]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->ddOutVars[0]->name)); } TEST_F(EnergyPlusFixture, OutputProcessor_setupOutputVariable_endUseSubKey) @@ -2902,7 +2902,7 @@ namespace OutputProcessor { // Cooling // testing an ABUPS end use with no sub end use specified EXPECT_EQ(1, op->EndUseCategory(2).NumSubcategories); - EXPECT_EQ("General", op->EndUseCategory(2).SubcategoryName(1)); + EXPECT_EQ("GENERAL", Util::makeUPPER(op->EndUseCategory(2).SubcategoryName(1))); auto found = op->meterMap.find(Util::makeUPPER("Cooling:Electricity")); EXPECT_NE(found, op->meterMap.end()); @@ -2914,12 +2914,12 @@ namespace OutputProcessor { EXPECT_NE(found, op->meterMap.end()); EXPECT_EQ((int)Constant::eResource::Electricity, (int)op->meters[found->second]->resource); EXPECT_EQ((int)EndUseCat::Cooling, (int)op->meters[found->second]->endUseCat); - EXPECT_EQ("General", op->meters[found->second]->EndUseSub); + EXPECT_EQ("GENERAL", Util::makeUPPER(op->meters[found->second]->EndUseSub)); // lighting // testing an ABUPS end use with a sub end use specified EXPECT_EQ(1, op->EndUseCategory(3).NumSubcategories); // lighting end use - EXPECT_EQ("RailroadCrossing", op->EndUseCategory(3).SubcategoryName(1)); + EXPECT_EQ("RAILROADCROSSING", Util::makeUPPER(op->EndUseCategory(3).SubcategoryName(1))); found = op->meterMap.find(Util::makeUPPER("InteriorLights:Electricity")); EXPECT_NE(found, op->meterMap.end()); @@ -2934,7 +2934,7 @@ namespace OutputProcessor { EXPECT_NE(found, op->meterMap.end()); EXPECT_EQ((int)Constant::eResource::Electricity, (int)op->meters[found->second]->resource); EXPECT_EQ((int)EndUseCat::InteriorLights, (int)op->meters[found->second]->endUseCat); - EXPECT_EQ("RailroadCrossing", op->meters[found->second]->EndUseSub); + EXPECT_EQ("RAILROADCROSSING", Util::makeUPPER(op->meters[found->second]->EndUseSub)); // fuel oil CO2 emissions // testing a non-ABUPS end use with no sub end use specified @@ -3218,31 +3218,31 @@ namespace OutputProcessor { EXPECT_EQ(5, op->reqVars.size()); EXPECT_EQ("", op->reqVars[0]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[0]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[0]->name)); EXPECT_EQ((int)ReportFreq::TimeStep, (int)op->reqVars[0]->freq); EXPECT_EQ(nullptr, op->reqVars[0]->sched); EXPECT_EQ(true, op->reqVars[0]->Used); EXPECT_EQ("", op->reqVars[1]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[1]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[1]->name)); EXPECT_EQ((int)ReportFreq::Hour, (int)op->reqVars[1]->freq); EXPECT_EQ(nullptr, op->reqVars[1]->sched); EXPECT_EQ(true, op->reqVars[1]->Used); EXPECT_EQ("", op->reqVars[2]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[2]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[2]->name)); EXPECT_EQ((int)ReportFreq::Day, (int)op->reqVars[2]->freq); EXPECT_EQ(nullptr, op->reqVars[2]->sched); EXPECT_EQ(true, op->reqVars[2]->Used); EXPECT_EQ("", op->reqVars[3]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[3]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[3]->name)); EXPECT_EQ((int)ReportFreq::Month, (int)op->reqVars[3]->freq); EXPECT_EQ(nullptr, op->reqVars[3]->sched); EXPECT_EQ(true, op->reqVars[3]->Used); EXPECT_EQ("", op->reqVars[4]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[4]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[4]->name)); EXPECT_EQ((int)ReportFreq::Simulation, (int)op->reqVars[4]->freq); EXPECT_EQ(nullptr, op->reqVars[4]->sched); EXPECT_EQ(true, op->reqVars[4]->Used); @@ -5076,12 +5076,12 @@ namespace OutputProcessor { { EXPECT_EQ((int)Constant::Units::J, (int)getEnumValue(Constant::unitNamesUC, "J")); - EXPECT_EQ((int)Constant::Units::J, (int)getEnumValue(Constant::unitNamesUC, Util::makeUPPER("j"))); + EXPECT_EQ((int)Constant::Units::J, (int)getEnumValue(Constant::unitNamesUC, "j")); - EXPECT_EQ((int)Constant::Units::kgWater_kgDryAir, (int)getEnumValue(Constant::unitNamesUC, Util::makeUPPER("kgWater/kgDryAir"))); - EXPECT_EQ((int)Constant::Units::kgWater_s, (int)getEnumValue(Constant::unitNamesUC, Util::makeUPPER("kgWater/s"))); + EXPECT_EQ((int)Constant::Units::kgWater_kgDryAir, (int)getEnumValue(Constant::unitNamesUC, "kgWater/kgDryAir")); + EXPECT_EQ((int)Constant::Units::kgWater_s, (int)getEnumValue(Constant::unitNamesUC, "kgWater/s")); - EXPECT_EQ((int)Constant::Units::Invalid, (int)getEnumValue(Constant::unitNamesUC, Util::makeUPPER("junk"))); + EXPECT_EQ((int)Constant::Units::Invalid, (int)getEnumValue(Constant::unitNamesUC, "junk")); } TEST_F(EnergyPlusFixture, OutputProcessor_unitEnumToString) @@ -5297,7 +5297,7 @@ namespace OutputProcessor { // EXPECT_EQ(1, op->NumExtraVars); EXPECT_EQ("", op->reqVars[0]->key); - EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", op->reqVars[0]->name); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", Util::makeUPPER(op->reqVars[0]->name)); EXPECT_EQ((int)ReportFreq::Simulation, (int)op->reqVars[0]->freq); EXPECT_EQ(nullptr, op->reqVars[0]->sched); EXPECT_EQ(true, op->reqVars[0]->Used); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index b1ee2363d1d..11a10cf8692 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -7395,7 +7395,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthlyPredefined_FindNeededOutputV OutputReportTabular::InitializeTabularMonthly(*state); // We check that the Predefined Table is actually set to show - EXPECT_EQ("SetpointsNotMetWithTemperaturesMonthly", state->dataOutRptTab->namedMonthly(31).title); + EXPECT_EQ("SETPOINTSNOTMETWITHTEMPERATURESMONTHLY", Util::makeUPPER(state->dataOutRptTab->namedMonthly(31).title)); EXPECT_TRUE(state->dataOutRptTab->namedMonthly(31).show); // Check that it's the only one that's shown @@ -7442,7 +7442,7 @@ TEST_F(SQLiteFixture, OutputReportTabularTest_PredefinedTableDXConversion) EXPECT_EQ("10000.0", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilNetCapSIA, CompName)); // We enable the report we care about, making sure it's the right one - EXPECT_EQ("EquipmentSummary", state->dataOutRptPredefined->reportName(5).name); + EXPECT_EQ("EQUIPMENTSUMMARY", Util::makeUPPER(state->dataOutRptPredefined->reportName(5).name)); state->dataOutRptPredefined->reportName(5).show = true; WritePredefinedTables(*state); @@ -7492,9 +7492,9 @@ TEST_F(SQLiteFixture, OutputReportTabularTest_PredefinedTableCoilHumRat) PreDefTableEntry(*state, state->dataOutRptPredefined->pdchCoilLvgHumRatIdealPeak, CompName, 0.006, 8); // We enable the reports we care about, making sure we have the right ones - EXPECT_EQ("HVACSizingSummary", state->dataOutRptPredefined->reportName(7).name); + EXPECT_EQ("HVACSIZINGSUMMARY", Util::makeUPPER(state->dataOutRptPredefined->reportName(7).name)); state->dataOutRptPredefined->reportName(7).show = true; - EXPECT_EQ("CoilSizingDetails", state->dataOutRptPredefined->reportName(8).name); + EXPECT_EQ("COILSIZINGDETAILS", Util::makeUPPER(state->dataOutRptPredefined->reportName(8).name)); state->dataOutRptPredefined->reportName(8).show = true; WritePredefinedTables(*state); @@ -10400,8 +10400,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_PredefinedTable_Standard62_1_N SetPredefinedTables(*state); EXPECT_GT(state->dataOutRptPredefined->numReportName, 0); auto &reportNameArray = state->dataOutRptPredefined->reportName; - auto it = - std::find_if(reportNameArray.begin(), reportNameArray.end(), [](const auto &rN) { return Util::SameString("Standard62.1Summary", rN.name); }); + auto it = std::find_if(reportNameArray.begin(), reportNameArray.end(), [](const auto &rN) { return equali("Standard62.1Summary", rN.name); }); EXPECT_FALSE(it != reportNameArray.end()); // Not found GetInputOutputTableSummaryReports(*state); @@ -10434,8 +10433,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_PredefinedTable_Standard62_1_W SetPredefinedTables(*state); EXPECT_GT(state->dataOutRptPredefined->numReportName, 0); auto &reportNameArray = state->dataOutRptPredefined->reportName; - auto it = - std::find_if(reportNameArray.begin(), reportNameArray.end(), [](const auto &rN) { return Util::SameString("Standard62.1Summary", rN.name); }); + auto it = std::find_if(reportNameArray.begin(), reportNameArray.end(), [](const auto &rN) { return equali("Standard62.1Summary", rN.name); }); EXPECT_TRUE(it != reportNameArray.end()); // EXPECT_TRUE(Util::FindItem("Standard62.1Summary", state->dataOutRptPredefined->reportName)); diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index a6ba356144e..a07c99c642b 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -857,7 +857,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTAC_HeatingCoilTest) //// get input test for terminal air single duct mixer on inlet side of PTAC ASSERT_EQ(1, state->dataUnitarySystems->numUnitarySystems); EXPECT_EQ("ZoneHVAC:PackagedTerminalAirConditioner", thisSys.UnitType); // zoneHVAC equipment type - EXPECT_EQ("COIL:HEATING:FUEL", thisSys.m_HeatingCoilTypeName); // PTAC heating coil type + EXPECT_EQ("COIL:HEATING:FUEL", Util::makeUPPER(thisSys.m_HeatingCoilTypeName)); // PTAC heating coil type EXPECT_EQ(state->dataHeatingCoils->HeatingCoil(1).HCoilType_Num, HVAC::Coil_HeatingGasOrOtherFuel); // gas heating coil type state->dataGlobal->BeginEnvrnFlag = false; @@ -4914,7 +4914,7 @@ TEST_F(EnergyPlusFixture, PTAC_AvailabilityManagerTest) // get input test for terminal air single duct mixer on inlet side of PTAC ASSERT_EQ(1, state->dataUnitarySystems->numUnitarySystems); EXPECT_EQ("ZoneHVAC:PackagedTerminalAirConditioner", thisSys.UnitType); - EXPECT_EQ("COIL:HEATING:FUEL", thisSys.m_HeatingCoilTypeName); + EXPECT_EQ("COIL:HEATING:FUEL", Util::makeUPPER(thisSys.m_HeatingCoilTypeName)); EXPECT_EQ(state->dataHeatingCoils->HeatingCoil(1).HCoilType_Num, HVAC::Coil_HeatingGasOrOtherFuel); EXPECT_FALSE(thisSys.m_useNoLoadLowSpeedAirFlow); // set input variables diff --git a/tst/EnergyPlus/unit/PlantManager.unit.cc b/tst/EnergyPlus/unit/PlantManager.unit.cc index 3fe4217f5a2..3532702e7cd 100644 --- a/tst/EnergyPlus/unit/PlantManager.unit.cc +++ b/tst/EnergyPlus/unit/PlantManager.unit.cc @@ -375,35 +375,35 @@ namespace UserDefinedComponents { EXPECT_ENUM_EQ(DataLoopNode::ConnectionObjectType::OutdoorAirNode, state->dataBranchNodeConnections->NodeConnections(1).ObjectType); EXPECT_EQ("OutdoorAir:Node", state->dataBranchNodeConnections->NodeConnections(1).ObjectName); EXPECT_ENUM_EQ(DataLoopNode::ConnectionType::OutsideAir, state->dataBranchNodeConnections->NodeConnections(1).ConnectionType); - EXPECT_EQ("TEST_OA_NODE", state->dataBranchNodeConnections->NodeConnections(1).NodeName); + EXPECT_EQ("TEST_OA_NODE", Util::makeUPPER(state->dataBranchNodeConnections->NodeConnections(1).NodeName)); // Coil Air Primiary Inlet EXPECT_ENUM_EQ(NodeInputManager::CompFluidStream::Primary, state->dataBranchNodeConnections->NodeConnections(2).FluidStream); EXPECT_ENUM_EQ(DataLoopNode::ConnectionObjectType::CoilUserDefined, state->dataBranchNodeConnections->NodeConnections(2).ObjectType); - EXPECT_EQ("COILUSERDEF_1", state->dataBranchNodeConnections->NodeConnections(2).ObjectName); + EXPECT_EQ("COILUSERDEF_1", Util::makeUPPER(state->dataBranchNodeConnections->NodeConnections(2).ObjectName)); EXPECT_ENUM_EQ(DataLoopNode::ConnectionType::Inlet, state->dataBranchNodeConnections->NodeConnections(2).ConnectionType); - EXPECT_EQ("PRIMARY_INLET_NODE", state->dataBranchNodeConnections->NodeConnections(2).NodeName); + EXPECT_EQ("PRIMARY_INLET_NODE", Util::makeUPPER(state->dataBranchNodeConnections->NodeConnections(2).NodeName)); // Coil Air Primiary Outlet EXPECT_ENUM_EQ(NodeInputManager::CompFluidStream::Primary, state->dataBranchNodeConnections->NodeConnections(3).FluidStream); EXPECT_ENUM_EQ(DataLoopNode::ConnectionObjectType::CoilUserDefined, state->dataBranchNodeConnections->NodeConnections(3).ObjectType); - EXPECT_EQ("COILUSERDEF_1", state->dataBranchNodeConnections->NodeConnections(3).ObjectName); + EXPECT_EQ("COILUSERDEF_1", Util::makeUPPER(state->dataBranchNodeConnections->NodeConnections(3).ObjectName)); EXPECT_ENUM_EQ(DataLoopNode::ConnectionType::Outlet, state->dataBranchNodeConnections->NodeConnections(3).ConnectionType); - EXPECT_EQ("PRIMARY_OUTLET_NODE", state->dataBranchNodeConnections->NodeConnections(3).NodeName); + EXPECT_EQ("PRIMARY_OUTLET_NODE", Util::makeUPPER(state->dataBranchNodeConnections->NodeConnections(3).NodeName)); // Coil Air Secondary Inlet EXPECT_ENUM_EQ(NodeInputManager::CompFluidStream::Secondary, state->dataBranchNodeConnections->NodeConnections(4).FluidStream); EXPECT_ENUM_EQ(DataLoopNode::ConnectionObjectType::CoilUserDefined, state->dataBranchNodeConnections->NodeConnections(4).ObjectType); - EXPECT_EQ("COILUSERDEF_1", state->dataBranchNodeConnections->NodeConnections(4).ObjectName); + EXPECT_EQ("COILUSERDEF_1", Util::makeUPPER(state->dataBranchNodeConnections->NodeConnections(4).ObjectName)); EXPECT_ENUM_EQ(DataLoopNode::ConnectionType::Inlet, state->dataBranchNodeConnections->NodeConnections(4).ConnectionType); - EXPECT_EQ("SECONDARY_INLET_NODE", state->dataBranchNodeConnections->NodeConnections(4).NodeName); + EXPECT_EQ("SECONDARY_INLET_NODE", Util::makeUPPER(state->dataBranchNodeConnections->NodeConnections(4).NodeName)); // Coil Air Secondary Outlet EXPECT_ENUM_EQ(NodeInputManager::CompFluidStream::Secondary, state->dataBranchNodeConnections->NodeConnections(5).FluidStream); EXPECT_ENUM_EQ(DataLoopNode::ConnectionObjectType::CoilUserDefined, state->dataBranchNodeConnections->NodeConnections(5).ObjectType); - EXPECT_EQ("COILUSERDEF_1", state->dataBranchNodeConnections->NodeConnections(5).ObjectName); + EXPECT_EQ("COILUSERDEF_1", Util::makeUPPER(state->dataBranchNodeConnections->NodeConnections(5).ObjectName)); EXPECT_ENUM_EQ(DataLoopNode::ConnectionType::Outlet, state->dataBranchNodeConnections->NodeConnections(5).ConnectionType); - EXPECT_EQ("SECONDARY_OUTLET_NODE", state->dataBranchNodeConnections->NodeConnections(5).NodeName); + EXPECT_EQ("SECONDARY_OUTLET_NODE", Util::makeUPPER(state->dataBranchNodeConnections->NodeConnections(5).NodeName)); } } // namespace UserDefinedComponents diff --git a/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc b/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc index 87ebdd535be..4931449d126 100644 --- a/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc +++ b/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc @@ -3107,7 +3107,7 @@ TEST_F(EnergyPlusFixture, PIU_reportTerminalUnit) EXPECT_EQ("n/a", RetrievePreDefTableEntry(*state, orp.pdchAirTermMinFlowSch, "ADU a")); EXPECT_EQ("n/a", RetrievePreDefTableEntry(*state, orp.pdchAirTermMaxFlowReh, "ADU a")); EXPECT_EQ("n/a", RetrievePreDefTableEntry(*state, orp.pdchAirTermMinOAflowSch, "ADU a")); - EXPECT_EQ("COIL:HEATING:ELECTRIC", RetrievePreDefTableEntry(*state, orp.pdchAirTermHeatCoilType, "ADU a")); + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(RetrievePreDefTableEntry(*state, orp.pdchAirTermHeatCoilType, "ADU a"))); EXPECT_EQ("n/a", RetrievePreDefTableEntry(*state, orp.pdchAirTermCoolCoilType, "ADU a")); EXPECT_EQ("Fan:ConstantVolume", RetrievePreDefTableEntry(*state, orp.pdchAirTermFanType, "ADU a")); EXPECT_EQ("FanA", RetrievePreDefTableEntry(*state, orp.pdchAirTermFanName, "ADU a")); diff --git a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc index 8fb206fe297..055f30b6119 100644 --- a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc +++ b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc @@ -1008,8 +1008,8 @@ TEST_F(EnergyPlusFixture, Test_finishCoilSummaryReportTable) zoneEquipList.EquipType.allocate(2); zoneEquipList.EquipIndex.allocate(2); - EXPECT_TRUE(Util::SameString(zoneEquipList.EquipName(1), "")); // equipment list data is cleared - EXPECT_TRUE(Util::SameString(zoneEquipList.EquipName(2), "")); + EXPECT_TRUE(zoneEquipList.EquipName(1) == ""); // equipment list data is cleared + EXPECT_TRUE(zoneEquipList.EquipName(2) == ""); // test that 2 equipment in the equipment list will fill coil selection data std::string coil2Name = "ElecHeatCoil 2"; // user-defined name of the coil diff --git a/tst/EnergyPlus/unit/SZVAVModel.unit.cc b/tst/EnergyPlus/unit/SZVAVModel.unit.cc index aa453cc700b..84f579f669f 100644 --- a/tst/EnergyPlus/unit/SZVAVModel.unit.cc +++ b/tst/EnergyPlus/unit/SZVAVModel.unit.cc @@ -652,15 +652,15 @@ TEST_F(EnergyPlusFixture, SZVAV_FanCoilUnit_Testing) state->dataGlobal->TimeStep = 1; state->dataSize->CurZoneEqNum = 1; GetZoneData(*state, ErrorsFound); - EXPECT_EQ("WEST ZONE", state->dataHeatBal->Zone(1).Name); + EXPECT_EQ("WEST ZONE", Util::makeUPPER(state->dataHeatBal->Zone(1).Name)); GetZoneEquipmentData(*state); GetFanCoilUnits(*state); auto &thisFanCoil(state->dataFanCoilUnits->FanCoil(1)); EXPECT_ENUM_EQ(CCM::ASHRAE, thisFanCoil.CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", thisFanCoil.OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(thisFanCoil.OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)thisFanCoil.fanType); - EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); - EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(thisFanCoil.CCoilType)); + EXPECT_EQ("COIL:HEATING:ELECTRIC", Util::makeUPPER(thisFanCoil.HCoilType)); state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 2f2c1a0984c..0d8a810b593 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -5078,7 +5078,7 @@ TEST_F(EnergyPlusFixture, WorldCoord_with_RelativeRectSurfCoord_test3) " ** ~~~ ** Coordinate System=\"WORLD\"; while ", " ** ~~~ ** Rectangular Surface Coordinate System=\"RELATIVE\".", }); - EXPECT_TRUE(compare_err_stream(error_string, true)); + EXPECT_TRUE(compare_err_stream(error_string, false)); } TEST_F(EnergyPlusFixture, WorldCoord_with_RelativeRectSurfCoord_test4) diff --git a/tst/EnergyPlus/unit/UnitHeater.unit.cc b/tst/EnergyPlus/unit/UnitHeater.unit.cc index 7acfeca1db1..acfde587e6b 100644 --- a/tst/EnergyPlus/unit/UnitHeater.unit.cc +++ b/tst/EnergyPlus/unit/UnitHeater.unit.cc @@ -2451,13 +2451,13 @@ TEST_F(EnergyPlusFixture, UnitHeater_SecondPriorityZoneEquipment) EXPECT_EQ(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes, 2); // first priority zone equipment is zone ADU - EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(1).EquipTypeName, "ZONEHVAC:AIRDISTRIBUTIONUNIT"); - EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(1).EquipName, "MAIN ZONE ATU"); - EXPECT_EQ(state->dataHeatingCoils->HeatingCoil(1).Name, "MAIN ZONE REHEAT COIL"); + EXPECT_EQ(Util::makeUPPER(state->dataZoneEquipmentManager->PrioritySimOrder(1).EquipTypeName), "ZONEHVAC:AIRDISTRIBUTIONUNIT"); + EXPECT_EQ(Util::makeUPPER(state->dataZoneEquipmentManager->PrioritySimOrder(1).EquipName), "MAIN ZONE ATU"); + EXPECT_EQ(Util::makeUPPER(state->dataHeatingCoils->HeatingCoil(1).Name), "MAIN ZONE REHEAT COIL"); // second priority zone equipment is unit heater - EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(2).EquipTypeName, "ZONEHVAC:UNITHEATER"); - EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(2).EquipName, "UNITHEATER"); - EXPECT_EQ(state->dataHeatingCoils->HeatingCoil(2).Name, "UNITHEATER_ELECTRICHEATER"); + EXPECT_EQ(Util::makeUPPER(state->dataZoneEquipmentManager->PrioritySimOrder(2).EquipTypeName), "ZONEHVAC:UNITHEATER"); + EXPECT_EQ(Util::makeUPPER(state->dataZoneEquipmentManager->PrioritySimOrder(2).EquipName), "UNITHEATER"); + EXPECT_EQ(Util::makeUPPER(state->dataHeatingCoils->HeatingCoil(2).Name), "UNITHEATER_ELECTRICHEATER"); // check the reheat coil output EXPECT_NEAR(state->dataHeatingCoils->HeatingCoil(1).HeatingCoilRate, 7028.9, 1.0); // check the unit heater heating coil output diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 12ce7ad97e1..5f48f4cb40f 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -17107,7 +17107,7 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_getUnitarySystemInputDataTest) thisSys->getUnitarySystemInputData(*state, compName, zoneEquipment, 0, ErrorsFound); // get UnitarySystem input from object above EXPECT_FALSE(ErrorsFound); // expect no errors // check each input fields of unitary system - EXPECT_EQ("UNITARY SYSTEM MODEL", thisSys->Name); // checks object name + EXPECT_EQ("UNITARY SYSTEM MODEL", Util::makeUPPER(thisSys->Name)); // checks object name EXPECT_ENUM_EQ(UnitarySys::UnitarySysCtrlType::Load, thisSys->m_ControlType); // checks control type EXPECT_ENUM_EQ(UnitarySys::DehumCtrlType::None, thisSys->m_DehumidControlType_Num); // checks Dehumidification Control type EXPECT_EQ(Util::FindItemInList("EAST ZONE", state->dataHeatBal->Zone), thisSys->ControlZoneNum); // checks zone ID @@ -17115,19 +17115,19 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_getUnitarySystemInputDataTest) EXPECT_EQ("NODE 29", state->dataLoopNodes->NodeID(thisSys->AirInNode)); // checks air inlet node name EXPECT_EQ("NODE 30", state->dataLoopNodes->NodeID(thisSys->AirOutNode)); // checks air outlet node name EXPECT_EQ((int)HVAC::FanType::OnOff, (int)thisSys->m_FanType); // checks fan object type "FAN:ONOFF" - EXPECT_EQ("SUPPLY FAN", thisSys->m_FanName); // checks fan object name + EXPECT_EQ("SUPPLY FAN", Util::makeUPPER(thisSys->m_FanName)); // checks fan object name EXPECT_EQ((int)HVAC::FanPlace::DrawThru, (int)thisSys->m_FanPlace); // checks fan placement, "DrawThrough" - EXPECT_EQ(nullptr, thisSys->m_fanOpModeSched); // checks Supply Air Fan Operating Mode Schedule Name - EXPECT_EQ("COIL:HEATING:WATER", thisSys->m_HeatingCoilTypeName); // checks heating coil object type - EXPECT_EQ("WATER HEATING COIL", thisSys->m_HeatingCoilName); // checks heating coil object type - EXPECT_EQ(1, thisSys->m_HeatingSizingRatio); // checks dx heating coil sizing ratio - EXPECT_EQ(HVAC::Coil_CoolingWater, thisSys->m_CoolingCoilType_Num); // checks cooling coil object type - EXPECT_EQ("WATER COOLING COIL", thisSys->m_CoolingCoilName); // checks cooling coil name - EXPECT_FALSE(thisSys->m_ISHundredPercentDOASDXCoil); // checks DX Coil is for DOAS use - EXPECT_EQ(7.0, thisSys->DesignMinOutletTemp); // checks minimum supply air temperature - EXPECT_TRUE(thisSys->m_RunOnSensibleLoad); // checks for "SENSIBLEONLYLOADCONTROL" - EXPECT_EQ("COIL:HEATING:FUEL", thisSys->m_SuppHeatCoilTypeName); // checks supplemental heating coil object type - EXPECT_EQ("SUPPLEMENTAL HEATING COIL", thisSys->m_SuppHeatCoilName); // checks supplemental heating coil name + EXPECT_EQ(nullptr, thisSys->m_fanOpModeSched); // checks Supply Air Fan Operating Mode Schedule Name + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(thisSys->m_HeatingCoilTypeName)); // checks heating coil object type + EXPECT_EQ("WATER HEATING COIL", Util::makeUPPER(thisSys->m_HeatingCoilName)); // checks heating coil object type + EXPECT_EQ(1, thisSys->m_HeatingSizingRatio); // checks dx heating coil sizing ratio + EXPECT_EQ(HVAC::Coil_CoolingWater, thisSys->m_CoolingCoilType_Num); // checks cooling coil object type + EXPECT_EQ("WATER COOLING COIL", Util::makeUPPER(thisSys->m_CoolingCoilName)); // checks cooling coil name + EXPECT_FALSE(thisSys->m_ISHundredPercentDOASDXCoil); // checks DX Coil is for DOAS use + EXPECT_EQ(7.0, thisSys->DesignMinOutletTemp); // checks minimum supply air temperature + EXPECT_TRUE(thisSys->m_RunOnSensibleLoad); // checks for "SENSIBLEONLYLOADCONTROL" + EXPECT_EQ("COIL:HEATING:FUEL", Util::makeUPPER(thisSys->m_SuppHeatCoilTypeName)); // checks supplemental heating coil object type + EXPECT_EQ("SUPPLEMENTAL HEATING COIL", Util::makeUPPER(thisSys->m_SuppHeatCoilName)); // checks supplemental heating coil name EXPECT_EQ(4, thisSys->m_CoolingSAFMethod); // checks cooling supply air flow rate sizing method, FractionOfAutosizedCoolingAirflow EXPECT_EQ(0.5, thisSys->m_MaxCoolAirVolFlow); // checks Cooling Fraction of Autosized Cooling Supply Air Flow Rate value EXPECT_EQ(5, thisSys->m_HeatingSAFMethod); // checks cooling supply air flow rate sizing method, FractionOfAutosizedHeatingAirflow @@ -17136,18 +17136,20 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_getUnitarySystemInputDataTest) EXPECT_EQ(0.0000462180155978106, thisSys->m_MaxNoCoolHeatAirVolFlow); // checks Heating Fraction of Autosized Heating Supply Air Flow Rate value EXPECT_EQ(30.0, thisSys->DesignMaxOutletTemp); // checks Maximum Supply Air Temperature value EXPECT_EQ(20.0, thisSys->m_MaxOATSuppHeat); // checks Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation value - EXPECT_EQ("SYSTEM OUTDOOR AIR NODE", state->dataLoopNodes->NodeID(thisSys->m_CondenserNodeNum)); // checks condenser air inlet node name - EXPECT_EQ(40.0, thisSys->m_AncillaryOnPower); // checks Ancillary On-Cycle Electric Power value - EXPECT_EQ(10.0, thisSys->m_AncillaryOffPower); // checks Ancillary Off-Cycle Electric Power value - EXPECT_EQ(0.005, thisSys->m_DesignHRWaterVolumeFlow); // checks Design Heat Recovery Water Flow Rate value - EXPECT_EQ(75.0, thisSys->m_MaxHROutletWaterTemp); // checks Maximum Temperature for Heat Recovery value + EXPECT_EQ("SYSTEM OUTDOOR AIR NODE", + Util::makeUPPER(state->dataLoopNodes->NodeID(thisSys->m_CondenserNodeNum))); // checks condenser air inlet node name + EXPECT_EQ(40.0, thisSys->m_AncillaryOnPower); // checks Ancillary On-Cycle Electric Power value + EXPECT_EQ(10.0, thisSys->m_AncillaryOffPower); // checks Ancillary Off-Cycle Electric Power value + EXPECT_EQ(0.005, thisSys->m_DesignHRWaterVolumeFlow); // checks Design Heat Recovery Water Flow Rate value + EXPECT_EQ(75.0, thisSys->m_MaxHROutletWaterTemp); // checks Maximum Temperature for Heat Recovery value EXPECT_EQ("WATER INLET NODE NAME", - state->dataLoopNodes->NodeID(thisSys->m_HeatRecoveryInletNodeNum)); // checks Heat Recovery Water Inlet Node Name ID + Util::makeUPPER(state->dataLoopNodes->NodeID(thisSys->m_HeatRecoveryInletNodeNum))); // checks Heat Recovery Water Inlet Node Name ID EXPECT_EQ("WATER OUTLET NODE NAME", - state->dataLoopNodes->NodeID(thisSys->m_HeatRecoveryOutletNodeNum)); // checks Heat Recovery Water Outlet Node Name ID + Util::makeUPPER(state->dataLoopNodes->NodeID(thisSys->m_HeatRecoveryOutletNodeNum))); // checks Heat Recovery Water Outlet Node Name ID EXPECT_EQ("UNITARYSYSTEMPERFORMANCE:MULTISPEED", - thisSys->m_DesignSpecMultispeedHPType); // checks design_specification_multispeed_object_type value - EXPECT_EQ("MULTISPEED PERFORMANCE", thisSys->m_DesignSpecMultispeedHPName); // checks design_specification_multispeed_object_name value + Util::makeUPPER(thisSys->m_DesignSpecMultispeedHPType)); // checks design_specification_multispeed_object_type value + EXPECT_EQ("MULTISPEED PERFORMANCE", + Util::makeUPPER(thisSys->m_DesignSpecMultispeedHPName)); // checks design_specification_multispeed_object_name value } TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInputwithTradeOff) { @@ -19223,10 +19225,11 @@ Dimensionless; !- Output Unit Type EnergyPlus::HVACSystemData *compPointer2 = outsideAirSys.compPointer[OASys2Index]; UnitarySys *unitarySys2 = dynamic_cast(compPointer2); assert(unitarySys2 != nullptr); - EXPECT_EQ("OA SYS COOLING COIL 1", OASys1->Name); // UnitarySystems::UnitarySys *OASys1 = &state->dataUnitarySystems->unitarySys[0] - EXPECT_EQ("OA SYS COOLING COIL 1", unitarySys1->Name); // see above, data from the OA system, these match - EXPECT_EQ("OA SYS COOLING COIL 2", OASys2->Name); - EXPECT_EQ("OA SYS COOLING COIL 2", unitarySys2->Name); + EXPECT_EQ("OA SYS COOLING COIL 1", + Util::makeUPPER(OASys1->Name)); // UnitarySystems::UnitarySys *OASys1 = &state->dataUnitarySystems->unitarySys[0] + EXPECT_EQ("OA SYS COOLING COIL 1", Util::makeUPPER(unitarySys1->Name)); // see above, data from the OA system, these match + EXPECT_EQ("OA SYS COOLING COIL 2", Util::makeUPPER(OASys2->Name)); + EXPECT_EQ("OA SYS COOLING COIL 2", Util::makeUPPER(unitarySys2->Name)); // Now call the OA system to make sure the above data is not corrupted // The test here is if the index has changed diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index d8acb4800a1..812e2f37f12 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -1574,10 +1574,10 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) GetFanCoilUnits(*state); EXPECT_ENUM_EQ(CCM::ConsFanVarFlow, state->dataFanCoilUnits->FanCoil(1).CapCtrlMeth_Num); - EXPECT_EQ("OUTDOORAIR:MIXER", state->dataFanCoilUnits->FanCoil(1).OAMixType); + EXPECT_EQ("OUTDOORAIR:MIXER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).OAMixType)); EXPECT_EQ((int)HVAC::FanType::OnOff, (int)state->dataFanCoilUnits->FanCoil(1).fanType); - EXPECT_EQ("COIL:COOLING:WATER", state->dataFanCoilUnits->FanCoil(1).CCoilType); - EXPECT_EQ("COIL:HEATING:WATER", state->dataFanCoilUnits->FanCoil(1).HCoilType); + EXPECT_EQ("COIL:COOLING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).CCoilType)); + EXPECT_EQ("COIL:HEATING:WATER", Util::makeUPPER(state->dataFanCoilUnits->FanCoil(1).HCoilType)); state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); diff --git a/tst/EnergyPlus/unit/WeatherManager.unit.cc b/tst/EnergyPlus/unit/WeatherManager.unit.cc index 3f379103977..926ca4248ff 100644 --- a/tst/EnergyPlus/unit/WeatherManager.unit.cc +++ b/tst/EnergyPlus/unit/WeatherManager.unit.cc @@ -1985,14 +1985,14 @@ TEST_F(EnergyPlusFixture, epwHeaderTest) EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(1).EndDay, 22); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(2).Title, "No Dry Season - Week Near Annual Max"); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(2).ShortTitle, "NoDrySeasonMax"); - EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(2).TEType, "Extreme"); + EXPECT_EQ(Util::makeUPPER(state->dataWeather->TypicalExtremePeriods(2).TEType), "EXTREME"); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(2).StartMonth, 2); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(2).StartDay, 5); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(2).EndMonth, 2); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(2).EndDay, 11); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(3).Title, "No Dry Season - Week Near Annual Min"); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(3).ShortTitle, "NoDrySeasonMin"); - EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(3).TEType, "Extreme"); + EXPECT_EQ(Util::makeUPPER(state->dataWeather->TypicalExtremePeriods(3).TEType), "EXTREME"); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(3).StartMonth, 7); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(3).StartDay, 16); EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(3).EndMonth, 7);